]> git.saurik.com Git - bison.git/blame - ChangeLog
tests/output.at: Update copyright date.
[bison.git] / ChangeLog
CommitLineData
096c9f9d
JD
12008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
4 2.61. Reported by Juan Manuel Guerrero at
5 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
6 * tests/output.at ("Output file name: ("): Comment out test case for
7 now.
8 ("Output file name: )"): Likewise.
9
0f664b89
JD
102008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
11
12 * GNUmakefile: Update git-version-gen invocation so make dist
13 succeeds.
14
1cfe6375
JD
152008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
16
17 Update to the current gnulib CVS repository, and fix trigraph handling
18 in Bison.
19 * bootstrap: Update gnulib CVS repository URL.
20 (symlink_to_dir): Encapsulate the code that guarantees the destination
21 directory exists into...
22 (check_dst_dir): ... this new function, and...
23 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
24 fail when copying files into lib/uniwidth/.
25 * src/output.c (prepare_symbols): When writing yytname muscles, where
26 symbol names will be encoded in C-string literals, tell quotearg to
27 escape trigraphs. This used to be the default in gnulib.
28 * tests/regression.at (Token definitions): Because of the change in
29 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
30 escapes trigraphs in symbol names. Thus, yytname no longer has
31 trigraphs unnecessarily doubly escaped. Update test case output.
32 Extend test case to be sure Bison's own error messages will no longer
33 have trigraphs in symbol names unnecessarily escaped once.
34
74c52fc8
JD
352008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
36
37 Fix make dist infinite loop reported by Juan Manuel Guerrero at
38 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
39 * .cvsignore: Add .version.
40 * .version.in: New.
41 * bootstrap.conf (gnulib_modules): Add git-version-gen.
42 * configure.ac (AC_CONFIG_FILES): Add .version.
43 * build-aux/.cvsignore: Add git-version-gen.
44
8e55b3aa
JD
452008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
46
47 * NEWS (2.3a+): Mention that -g now takes an argument.
48 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
49 consistency. Update the -g and -x entries now that they take
50 arguments. Use brackets to indicate optional arguments.
51 * src/getargs.c (usage): Explain the relationship between arguments of
52 long and short options more completely. Document --defines and -d
53 separately since the former takes an argument but, for POSIX Yacc, the
54 latter does not.
55 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 56 (getargs): Sort cases.
8e55b3aa 57
59c5ac72
AD
582008-02-28 Akim Demaille <demaille@gostai.com>
59
60 * doc/bison.texinfo: Fix a few typos.
61
118d4978
AD
622008-02-28 Akim Demaille <akim@epita.fr>
63
64 * doc/bison.texinfo (Bison Options): Document -W.
65 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
66
7020f1e9
AD
672008-02-28 Akim Demaille <akim@epita.fr>
68
69 * src/getargs.c (short_options): Split and sort for readability.
70 -g and -x take optional arguments, just like their long options.
71 * build-aux/cross-options.pl: Use /x to make the regexp easier to
72 understand.
73 Fix the handling of $opt which resulted in all the argument to be
74 considered as optional.
75
59da312b
JD
762008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
77
78 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
79 say its interface is experimental.
80 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
81 Java.
82 (Bison Options): In the -L and --language entry, mention Java.
83 (Java Bison Interface): Say the interface is experimental.
84 * src/getargs.c (usage): Mention -L and --language.
85
86 * NEWS (2.3a+): Say the push parsing interface is experimental.
87 * doc/bison.texinfo (Push Decl): Likewise.
88 (Decl Summary): Likewise in the "%define api.push_pull" entry.
89 (Push Parser Function): Likewise.
90 (Pull Parser Function): Likewise.
91 (Parser Create Function): Likewise.
92 (Parser Delete Function): Likewise.
93 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
94 yypull_parse, and yypush_parse entries.
95
96 * NEWS (2.3a+): Mention XML support, and say the schema is
97 experimental.
98 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
99 * src/getargs.c (usage): Say the XML schema is experimental.
100
101 * NEWS (2.3a+): Say option instead of flag.
102
2bb3ebec
WP
1032008-02-21 Wojciech Polak <polak@gnu.org>
104
105 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
106 text.
107
333e670c
JD
1082008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
109
110 Fix impure push parser compile error reported by Bob Rossi at
111 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
112 * data/yacc.c: Clean up whitespace in the output a little.
113 (yypstate_allocated): Define for impure push parsers regardless of
114 whether the pull interface is also requested.
115 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
116 check impure push parsers without the pull interface.
117
118 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
119 yyerror takes arguments specified by %parse-param while yypstate_new
120 does not.
121 * doc/bison.texinfo (Parser Create Function): Document that
122 yypstate_new returns 0 for multiple impure parser instances.
123 * tests/push.at (Push Parsing: Multiple impure instances): Update
124 expected stderr output.
125
798096e1
JD
1262008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
127
128 * runtime-po/POTFILES.in (push.c): Remove.
129
9ca7f077
JD
1302008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
131
132 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
133 * data/push.c: Rename to...
134 * data/yacc.c: ... this, overwriting it.
135 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
136 `%push-pull-parser' -> `%define api.push_pull "both"'.
137 Remove old yacc.c tests, and update push.c tests to yacc.c.
138
42ee26bb
JD
1392008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
140
141 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
142 `"%code top" blocks' instead of `%code "top" blocks'.
143 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
144 Clean up whitespace in the output a little.
145
b1cc23c4
JD
1462008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
147
148 Fix documentation problems reported by Tim Josling at
149 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
150 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
151 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
152 integers. Explain the effect of literal string aliases on error
153 messages. Copy token 0 documentation from the C++ skeleton
154 documentation.
155
ab7f29f8
JD
1562008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
157
158 Accept a token number in a %left, %right, or %nonassoc for POSIX
159 conformance. Reported by Tim Josling at
160 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
161 * NEWS (2.3a+): Mention.
162 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
163 and code numbers are treated by precedence declarations.
164 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
165 of symbols.1.
166 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
167 of symbol.
168 (symbol.prec): New, just like symbol but allows INT.
169 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
170 longer holds.
171 * tests/regression.at (Token number in precedence declaration): New
172 test case.
173
a924ef36
JMG
1742008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
175
176 DJGPP specific issues.
177 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
178 be changed. Copyright timestamp adjusted.
179 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
180 be changed. Copyright timestamp adjusted.
181 * djgpp/config.site: Copyright timestamp adjusted.
182 * djgpp/config_h.sed: Copyright timestamp adjusted.
183 * djgpp/djunpack.bat: Copyright timestamp adjusted.
184 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
185 filename translation list.
186 * djgpp/subpipe.c (init_subpipe): Check the environment variables
187 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
188 files shall be created. Before trying to use the temp dir where the
189 environment variable points to check that the dir really exists. If
190 not default to the cwd as temp dir. Copyright timestamp adjusted.
191 * djgpp/subpipe.h: Copyright timestamp adjusted.
192 * djgpp/testsuite.sed: Copyright timestamp adjusted.
193
389c8cfd
PE
1942008-01-30 Paul Eggert <eggert@cs.ucla.edu>
195
196 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
197
5d1cfef4
PE
1982008-01-09 Paul Eggert <eggert@cs.ucla.edu>
199
200 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
201 Problem reported by Claudio Saavedra in
202 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
203
e2dcf996
WP
2042008-01-05 Wojciech Polak <polak@gnu.org>
205
206 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
207 document's title with the input grammar file name.
208
da730230
JD
2092007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
210
211 Automate regression testing of the XML/XSLT implementation. Discussed
212 starting at
213 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
214 * configure.ac (XSLTPROC): New substitution.
215 * Makefile.am (maintainer-xml-check): New phony target invoking...
216 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
217 invoking make maintainer-check with BISON_TEST_XML=1.
218 * tests/atlocal.in (XSLTPROC): New.
219 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
220 not to report reachable memory when Bison is expected to have a
221 non-zero exit status and (2) to compare XML/XSLT output with --graph
222 and --report=all output for every working grammar when
223 BISON_TEST_XML=1.
224 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
225 (AT_BISON_CHECK_XML): New.
226 (AT_QUELL_VALGRIND): New.
227 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
228 (AT_CHECK): ... don't redefine this since this was the old way to
229 quell Valgrind.
230 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
231 AT_BISON_CHECK invocations.
232 * tests/c++.at: Likewise.
233 * tests/calc.at: Likewise.
234 * tests/conflicts.at: Likewise.
235 * tests/cxx-type.at: Likewise.
236 * tests/existing.at: Likewise.
237 * tests/glr-regression.at: Likewise.
238 * tests/headers.at: Likewise.
239 * tests/input.at: Likewise.
240 * tests/java.at: Likewise.
241 * tests/output.at: Likewise.
242 * tests/push.at: Likewise.
243 * tests/reduce.at: Likewise.
244 * tests/regression.at: Likewise.
245 * tests/sets.at: Likewise.
246 * tests/skeletons.at: Likewise.
247 * tests/synclines.at: Likewise.
248 * tests/torture.at: Likewise.
249 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
250 tends to hang xsltproc.
251 (Big horizontal): Likewise.
252
408476bc
JD
2532007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
254
255 In XML output, remove redundant class attribute on symbol element.
256 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
257 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
258 look up a symbol to determine whether it's a nonterminal or terminal.
259 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
260 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
261
262 Add prec/assoc information to XML output.
263 * src/gram.c (grammar_rules_print_xml): For each rule that has a
264 %prec, add a percent_prec attribute.
265 * src/print-xml.c (print_grammar): For each terminal that has a
266 precedence or associativity, add a prec or assoc attribute.
267 (xml_indent): New.
268 (xml_puts): Use xml_indent.
269 (xml_printf): Use xml_indent.
270 * src/print-xml.h (xml_indent): Prototype.
271
272 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
273 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
274
d4a26c48
JD
2752007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
276
277 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
278 (bison:ruleByNumber): ... this for clarity.
279 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
280 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
281 (xsl:template match="reduction"): Update.
282 (xsl:template match="item"): Update.
283 (xsl:template match="reduction"): Update.
284
285 In the XML output, don't print the list of rules where symbols appear.
286 Compute it in XSLT instead. Discussed at
287 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
288 * data/xslt/bison.xsl (bison:ruleByLhs): New.
289 (bison:ruleByRhs): New.
290 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
291 bison:ruleByRhs.
292 (xsl:template match="terminal/rule"): Remove.
293 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
294 bison:ruleByRhs.
295 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
296 Remove.
297 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
298 bison:ruleByRhs and mode="number-link" for rule template.
299 (xsl:template match="terminal/rule"): Remove.
300 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
301 bison:ruleByRhs and mode="number-link" for rule template.
302 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
303 Rewrite as...
304 (xsl:template match="rule" mode="number-link"): ... this.
305 * src/print-xml.c (print_grammar): Don't print the list of rules.
306
ef1b4273
JD
3072007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
308
309 Don't let --report affect XML output; always print all information.
310 Discussed at
311 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
312 * src/conflicts.c (log_resolution): Implement.
313 * src/print-xml.c (print_core): Implement.
314 (print_state): Implement.
315 (print_xml): Implement.
316
317 * NEWS (2.3a+): Fix quotes.
318 * src/parse-gram.y (prologue_declaration): For consistency with -v,
319 don't let %verbose clear the list specified by --report.
320
0f6cd9e3
AD
3212007-11-26 Akim Demaille <akim@epita.fr>
322
323 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
324
d80fb37a
JD
3252007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
326
327 In the XML output, list useless and unused symbols and rules with the
328 useful ones and add a "usefulness" attribute. Discussed starting at
329 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
330 * src/gram.c (grammar_rules_partial_print_xml): Remove.
331 (grammar_rules_print_xml): Print all rules instead of just those
332 useful in the grammar, and add a "usefulness" attribute.
333 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
334 * src/print-xml.c (print_rules_useless_in_parser): Remove.
335 (print_grammar): Print all nonterminals instead of just useful ones,
336 and add a "usefulness" attribute to nonterminals and terminals.
337 (print_xml): Don't print a separate "reductions" or
338 "rules-useless-in-parser" element.
339 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
340 (reduce_xml): Remove.
341 (reduce_token_unused_in_grammar): New.
342 (reduce_nonterminal_useless_in_grammar): New.
343 * src/reduce.h (reduce_xml): Remove prototype.
344 (reduce_token_unused_in_grammar): Add prototype.
345 (reduce_nonterminal_useless_in_grammar): Add prototype.
346 * data/xslt/xml2text.xsl: Update for XML changes.
347 * data/xslt/xml2xhtml.xsl: Update for XML changes.
348 * tests/reduce.at (Useless Terminals): Update output.
349 (Useless Rules): Update output.
350 (Reduced Automaton): Update output.
351
352 Say "Terminals unused in grammar" instead of "Unused terminals".
353 * NEWS (2.3a+): Update.
354 * doc/bison.texinfo (Understanding): Update example output.
355 * src/reduce.c (reduce_output): Implement.
356 * data/xslt/xml2text.xsl: Implement.
357 * data/xslt/xml2xhtml.xsl: Implement.
358
1bb2bd75
JD
3592007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
360
361 Accept --report-file=FILE to override the default `.output' filename.
362 * NEWS (2.3a+): Mention.
363 * doc/bison.texinfo (Bison Options): Add an entry.
364 * src/files.c (compute_output_file_names): Don't override
365 spec_verbose_file if already set.
366 * src/getargs.c (usage): Document --report-file.
367 (REPORT_FILE_OPTION): New anonymous enum member.
368 (long_options): Add entry for it.
369 (getargs): Add case for it setting spec_verbose_file.
370
371 * build-aux/cross-options.pl: Don't record a short option just because
372 there's an arg.
373 * doc/.cvsignore: Add yacc.1.
374
a005a9c4
AD
3752007-11-14 Akim Demaille <akim@epita.fr>
376
377 * doc/yacc.1.in: New.
378 * configure.ac, doc/Makefile.am: Adjust.
379 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
380 config.h symbol.
381 Use AC_SUBST for assignments too.
382 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
383
cff03fb2
JD
3842007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
385
386 * src/gram.c: Remove comments that duplicate comments in gram.h.
387
388 When reporting useless rules and nonterminals, say "useless in grammar"
389 instead of "useless", and say "useless in parser" instead of "never
390 reduced". Discussed starting at
391 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
392 * NEWS (2.3a+): Mention this change.
393 * data/xslt/xml2text.xsl: Update output text and expected input XML
394 element names to match changes below.
395 * data/xslt/xml2xhtml.xsl: Likewise.
396 (xsl:template match="bison-xml-report"): Add missing entry in Table of
397 Contents: "Rules useless in parser due to conflicts".
398 * doc/bison.texinfo (Decl Summary): Reword a little.
399 (Understanding): Update example output for changes below.
400 * src/gram.c: (rule_useful_p): Rename to...
401 (rule_useful_in_grammar_p): ... this.
402 (rule_useless_p): Rename to...
403 (rule_useless_in_grammar_p): ... this.
404 (rule_never_reduced_p): Rename to...
405 (rule_useless_in_parser_p): ... this.
406 (grammar_rules_print): Update for renames.
407 (grammar_rules_print_xml): Update for renames.
408 (grammar_rules_never_reduced_report): Rename to...
409 (grammar_rules_useless_report): ... this since it is used for either
410 kind of useless rule.
411 * src/gram.h: Reword comments and update function names in prototypes.
412 * src/main.c (main): Say "rule useless in parser due to conflicts".
413 * src/print-xml.c (print_rules_never_reduced): Rename to...
414 (print_rules_useless_in_parser): ... this, and rename output XML
415 element "rules-never-reduced" to "rules-useless-in-parser".
416 (print_xml): Update for rename.
417 * src/print.c (print_results): Say "Rules useless in parser due to
418 conflicts".
419 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
420 (nonterminals_reduce): Say "nonterminal useless in grammar".
421 (reduce_output): Say "Nonterminals useless in grammar".
422 Say "Rules useless in grammar".
423 (reduce_xml): Rename output XML element "useless" to
424 "useless-in-grammar".
425 (reduce_print): Don't report the count of grammatically useless rules
426 as "rules never reduced" just because %yacc is specified.
427 In the correct report of this count, say nonterminal(s) and rule(s)
428 "useless in grammar".
429 * tests/conflicts.at (S/R in initial): Update expected output.
430 (Defaulted Conflicted Reduction): Likewise.
431 (Unreachable States After Conflict Resolution): Likewise.
432 * tests/existing.at (GNU pic Grammar): Likewise.
433 * tests/reduce.at (Useless Nonterminals): Likewise.
434 (Useless Rules): Likewise.
435 (Reduced Automaton): Likewise.
436 (Underivable Rules): Likewise.
437 (Empty Language): Likewise.
438
66f0441d
JD
4392007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
440
441 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
442 here document and before the EOF so that BSD's implementation of Bourne
443 shell doesn't parse the delimiter as part of the here document.
444 * doc/.cvsignore: Add cross-options.texi.
445 * src/getargs.c (usage): Add a blank line after the warning categories.
446
d0ee4105
PB
4472007-11-08 Paolo Bonzini <bonzini@gnu.org>
448
449 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
450
e8b1fb9b
AD
4512007-11-05 Akim Demaille <akim@epita.fr>
452
453 Remove Id: from bison.1.
454 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
455 (perl -0777 -pi -e 's/\.PP\nId): New.
456 (.x.1): Use it to ignore the version control revision.
457
2f7a96b5
AD
4582007-11-05 Akim Demaille <demaille@gostai.com>
459
460 * build-aux/Makefile.am: Ship cross-options.pl.
461 * doc/Makefile.am: Always refer to cross-options.texi with
462 $(srcdir).
463 (MAINTAINERCLEANFILES): Add it.
464
f4101aa6
AD
4652007-11-04 Akim Demaille <demaille@gostai.com>
466
467 Generate the long/short option cross-table.
468 * build-aux/cross-options.pl: New.
469 * doc/Makefile.am (cross-options.texi): New.
470 * doc/bison.texinfo: Use it.
471
727a1401
AD
4722007-11-04 Akim Demaille <demaille@gostai.com>
473
474 Generate bison.1 using help2man.
475 * doc/common.x, doc/bison.x: New.
476 * doc/Makefile.am (bison.1, .x.1): New.
477 The code is taken from autoconf-2.61/man/Makefile.am.
478 * configure.ac: Look for help2man.
479
6aeb9c57
AD
4802007-11-04 Akim Demaille <demaille@gostai.com>
481
482 Complete --help.
483 * src/getargs.c (usage): Document -W, make it clear that -d,
484 -g and -x have optional arguments.
485
d7be4085
AD
4862007-11-04 Akim Demaille <demaille@gostai.com>
487
488 Find sha1sum when named gsha1sum.
489 * bootstrap (find_tool): New.
490 ($SHA1SUM): New.
491
d9df47b6
JD
4922007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
493
494 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
495 at
496 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
497 * NEWS (2.3a+): Mention.
498 * data/bison.m4 (b4_pure_if): Don't define it here.
499 * data/c.m4 (b4_identification): Depend on individual skeletons to
500 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
501 values of the %define variables api.pure or api.push_pull. Define
502 YYPURE, YYPUSH, and YYPULL accordingly.
503 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
504 glr.cc has already defined b4_pure_flag.
505 * data/push.c: Define b4_pure_if based on `%define api.pure'.
506 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 507 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
508 * doc/bison.texinfo (Pure Decl): Update.
509 (Push Decl): Update.
510 (Decl Summary): Add api.pure to %define entry.
511 In %pure-parser entry, say it's deprecated and reference %define.
512 (Pure Calling): Update.
513 (Error Reporting): Update.
514 (C++ Scanner Interface): Update.
515 (How Can I Reset the Parser): Update.
516 (Table of Symbols): In %pure-parser entry, say it's deprecated and
517 reference %define.
518 * src/getargs.c (pure_parser): Remove global variable.
519 * src/getargs.h (pure_parser): Remove extern.
520 * src/output.c (prepare): Don't define pure_flag muscle.
521 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
522 wrapper around `%define api.pure'.
523 * tests/calc.at (Simple LALR Calculator): Update.
524 (Simple GLR Calculator): Update.
525 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
526 Update.
527 (GLR: Resolve ambiguity, pure, locations): Update.
528 (GLR: Merge conflicting parses, pure, no locations): Update.
529 (GLR: Merge conflicting parses, pure, locations): Update.
530 * tests/glr-regression.at (Uninitialized location when reporting
531 ambiguity): Update
532 * tests/input.at (Unused %define api.pure): New test case.
533 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
534 AT_PURE_IF and AT_PURE_AND_LOC_IF.
535 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
536
c373bf8b
JD
5372007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
538
539 %define push_pull -> %define api.push_pull. Discussed starting at
540 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
541 * data/push.c: Expect the new name.
542 * data/yacc.c: Likewise.
543 * doc/bison.texinfo (Push Decl): Update.
544 (Decl Summary): Update %define entry.
545 (Push Parser Function): Update.
546 (Pull Parser Function): Update.
547 (Parser Create Function): Update.
548 (Parser Delete Function): Update.
549 * tests/calc.at (Simple LALR Calculator): Update.
550 * tests/input.at (%define enum variables): Update.
551 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
552 (Push Parsing: Multiple impure instances): Update.
553 (Push Parsing: Unsupported Skeletons): Update.
554 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
555 (Exploding the Stack Size with Malloc): Update.
556
557 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
558 other entries some.
559
32f19b6b
JD
5602007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
561
562 For the XML output's terminal element, rename @number to @token-number,
563 and add @symbol-number. In the nonterminal element, rename @number to
564 @symbol-number. Discussed starting at
565 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
566 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
567 renames.
568 (xsl:template match="nonterminal"): Likewise.
569 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
570 (xsl:template match="nonterminal"): Likewise.
571 * src/print-xml.c (print_grammar): Implement.
572
255a6b90
JD
5732007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
574
575 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
576 2007-10-11 change, the child elements here are items not rules.
408476bc 577 (xsl:template match="item"): New.
255a6b90
JD
578 (xsl:template match="rule"): Update for new reduced itemset.
579 (xsl:template match="point"): Remove.
580 (xsl:template match="empty"): For consistency with --graph, don't
581 output "/* empty */".
582 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
583 line-wrap, don't pass a negative value as first-line-length since this
584 won't work with the following changes.
585 (xsl:template name="line-wrap"): Simplify slightly.
586 (xsl:template name="ws-search"): Eliminate recursion.
587 * src/print_graph.c (print_core): Don't print a reduction's lookahead
588 set next to an item whose dot is not at the end of the RHS even if it
589 happens to be associated with the same rule.
590
88c78747
JD
5912007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
592
31984206
JD
593 Add %define lr.keep_unreachable_states.
594 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
595 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
596 * src/main.c (main): Implement it.
597 * tests/conflicts.at (Unreachable States After Conflict Resolution):
598 Extend to test it, and fix a typo.
599
6002007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
601
602 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
603 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
604 the example .output text.
605 * tests/regression.at (Extra lookahead sets in report): Improve wording
606 of comments.
607
b7a70162
WP
6082007-10-17 Wojciech Polak <polak@gnu.org>
609
610 * src/print-xml.c (print_grammar): Renamed
611 <terminal> and <nonterminal> attributes:
612 "type" to "number" and "symbol" to "name".
613 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
614 Use new attribute names.
615 (xsl:template match="nonterminal"): Likewise.
616 * data/xslt/xml2xhtml.xsl: Likewise.
617
a0de5091
JD
6182007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
619
620 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
621 (Option Cross Key): Likewise.
622
623 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
624 next to an item whose dot is not at the end of the RHS even if it
625 happens to be associated with the same rule.
626 * src/print.c (print_core): Likewise.
627 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
628 (Resolved SR Conflicts): Update output.
629 * tests/regression.at (Extra lookahead sets in report): New test case.
630
4c20d18d
WP
6312007-10-11 Wojciech Polak <polak@gnu.org>
632
633 * src/print-xml.c (print_core): Remove item set
634 redundancy.
635 * data/xslt/bison.xsl (bison:ruleNumber): New key.
636 Improve processing time. Suggested by Joel E. Denny.
637 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
638 Write xsl:param "required" attribute as comment.
639 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
640 (xsl:template match="rule"): Support new reduced itemset.
641 (xsl:template match="point"): Remove.
642 * data/xslt/xml2xhtml.xsl: Likewise.
643
f506ad1c
JD
6442007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
645
646 * src/getargs.c (version): Update copyright year.
647
21f1b063
JD
6482007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
649
650 Make xml2dot.xsl and --graph produce the same output.
651 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
652 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
653 escaped later.
654 (xsl:template name="output-node"): Use the new escape template instead
655 of the string-replace template directly.
656 (xsl:template name="output-edge"): Likewise.
657 (xsl:template name="escape"): New, escapes backslashes and newlines in
658 addition to quotation marks.
659 * src/graphviz.c (start_graph, output_node, output_edge): Add
660 whitespace to output for legibility.
661
662 Make xml2text.xsl and --report produce the same output, and remove the
663 XML "conflicts" element since a conflict summary is easily extracted
664 from the automaton.
665 * data/xslt/bison.xsl: New.
666 (xsl:template match="state" mode="bison:count-conflicts): New.
667 * data/xslt/xml2text.xsl: Import bison.xsl.
668 (xsl:template match="bison-xml-report"): Instead of styling the
669 "conflicts" element, style the "automaton" element with mode
670 "conflicts". Unlike the former, the latter lists S/R and R/R
671 conflicts for a state on the same line.
672 (xsl:template match="conflicts"): Remove.
673 (xsl:template match="conflict"): Remove.
674 (xsl:template match="terminal"): Line-wrap the list of rules in which
675 the terminal is used.
676 (xsl:template match="nonterminal"): Likewise for nonterminals.
677 (xsl:template match="automaton" mode="conflicts"): New.
678 (xsl:template match="state" mode="conflicts"): New.
679 (xsl:template name="line-wrap"): New.
680 (xsl:template name="ws-search"): New.
681 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
682 (xsl:template match="bison-xml-report"): Instead of styling the
683 "conflicts" element, style the "automaton" element with mode
684 "conflicts."
685 (xsl:template match="conflicts"): Remove.
686 (xsl:template match="conflict"): Remove.
687 (xsl:template match="automaton" mode="conflicts"): New.
688 (xsl:template match="state" mode="conflicts): New.
689 * src/conflicts.c (conflicts_output_xml): Remove.
690 * src/conflicts.h (conflicts_output_xml): Remove prototype.
691 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
692 * src/print.c (print_grammar): Consistently wrap at the 66th column so
693 the corresponding XSLT is easier. Also, never wrap between a word and
694 the comma that follows it.
695
793fbca5
JD
6962007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
697
698 Improve C++ namespace support. Discussed starting at
699 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
700 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
701 b4_namespace_close): New macros that interpret the %define variable
702 "namespace" so its value can contain "::" to indicate nested
703 namespaces.
704 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
705 the above macros.
706 * data/lalr1.cc (b4_namespace): Likewise.
707 * data/location.cc (b4_namespace): Likewise.
708 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
709 inside a new table in the general %define entry. Document `%define
710 namespace' there as well. Point the %name-prefix entry to it since it
711 explains it more completely in the case of C++.
712 (C++ Bison Interface): Mention `%define namespace' instead of
713 %name-prefix.
714 (Table of Symbols): Remove the `%define push_pull' entry. The %define
715 entry suffices.
716 * tests/c++.at (Relative namespace references): New test case.
717 (Absolute namespace references): New test case.
718 (Syntactically invalid namespace references): New test case.
719 * tests/input.at (C++ namespace reference errors): New test case.
720
35b8730d
JD
7212007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
722
723 Add syncline support and location accessor to internal %define
724 interfaces.
725 * data/bison.m4 (b4_percent_define_get_loc): New.
726 (b4_percent_define_get_syncline): New.
727 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
728 (b4_percent_define_default): Record defining location as line 1 rather
729 than 0 for the sake of synchronizing #line's, and define
730 b4_percent_define_syncline(VARIABLE).
731 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
732 * src/muscle_tab.c (muscle_syncline_grow): New.
733 (muscle_code_grow): Use muscle_syncline_grow.
734 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
735 define b4_percent_define_syncline(VARIABLE).
736 (muscle_percent_define_get_loc): New.
737 (muscle_percent_define_get_syncline): New.
738 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
739 remove some unused variables.
740 (muscle_percent_define_default): Record defining location as line 1
741 rather than 0 for the sake of synchronizing #line's, and define
742 b4_percent_define_syncline(VARIABLE).
743 (muscle_percent_define_check_values): Use
744 muscle_percent_define_get_loc.
745 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
746 (muscle_percent_define_get_syncline): Prototype.
747 * tests/skeletons.at (%define Boolean variables: invalid skeleton
748 defaults): Update output for location change.
749 (Complaining during macro argument expansion): Extend to test
750 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
751
7dc4a694
JD
7522007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
753
754 Fix some error-reporting macro bugs.
755 * data/bison.m4 (b4_cat): New.
756 (b4_error, b4_error_at): Use b4_cat to send error directives directly
757 to stdout so they don't become arguments to other macros. Update
758 comments and add examples.
759 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
760 add examples.
761 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
762 after printing the error directive so that M4 doesn't report subsequent
763 problems that are induced by this problem.
764 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
765 instead of just in them. Recognize @\n in both places. Both expand to
766 the empty string. Needed by b4_cat.
767 * tests/skeletons.at (Complaining during macro argument expansion):
768 New test case.
769 (Fatal errors make M4 exit immediately): New test case.
770
d4bd2295
JD
7712007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
772
773 Implement --print-datadir.
774 * src/getargs.c (usage): Mention.
775 (PRINT_DATADIR_OPTION): New anonymous enum member.
776 (long_options): Add entry for it.
777 (getargs): Add case for it calling compute_pkgdatadir.
778 * src/output.c (output_skeleton): Encapsulate data directory
779 computation from here...
780 (prepare): ... and from here...
781 (compute_pkgdatadir): ... into this new function.
782 * src/output.h (compute_pkgdatadir): Prototype.
783
34cdeddf
JD
7842007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
785
786 * src/print-xml.c (escape_bufs): New static global variable
787 replacing...
788 (xml_escape_n): ... the static local variable buf here.
789 (print_xml): Free memory for escape_bufs.
790 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
791
d782395d
JD
7922007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
793
794 Replace `%push-parser' and `%push-pull-parser' with
795 `%define push_pull "push"' and `%define push_pull "both"'.
796 `%define push_pull "pull"' is the default.
797 * doc/bison.texinfo (Push Decl, Push Parser Function,
798 Pull Parser Function, Parser Create Function, Parser Delete Function):
799 Update declarations.
800 (Decl Summary, Table of Symbols): Replace %push-parser and
801 %push-pull-parser entries with a %define push_pull entry.
802 * data/bison.m4 (b4_percent_define_check_values): New macro.
803 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
804 definitions...
805 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
806 definitions...
807 * data/push.c: ... to here and compute them from the value of the
808 %define variable push_pull.
809 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
810 parsing requests here...
811 * data/yacc.c: ... hack this to switch to push.c any time
812 b4_use_push_pull_flag or the %define variable push_pull is set. This
813 will go away when we mv push.c yacc.c.
814 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
815 push parsing is not supported since unused %define variables are
816 reported anyway.
817 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
818 * src/muscle_tab.h (muscle_percent_define_check_values): Update
819 comments for consistency with b4_percent_define_check_values.
820 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
821 muscles.
822 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
823 Remove.
824 (prologue_declaration): Remove %push-parser and %push-pull-parser
825 rules.
826 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
827 * tests/calc.at: Update declarations.
828 * tests/input.at (%define enum variables): New test case.
829 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
830 declaration.
831 (Push Parsing: Multiple impure instances): Update declaration.
832 (Push Parsing: Unsupported Skeletons): New test case.
833 * tests/torture.at (Exploding the Stack Size with Alloca): Update
834 declaration.
835 (Exploding the Stack Size with Malloc): Update declaration.
836
3f999f78
WP
8372007-09-24 Wojciech Polak <polak@gnu.org>
838
839 Add XSLT transformations.
840
841 * data/xslt/xml2dot.xsl: Transform XML into DOT.
842 * data/xslt/xml2text.xsl: Transform XML into plain text.
843 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
844 * data/Makefile.am (xsltdir): New variable.
845 (dist_xslt_DATA): Add xslt/*.xsl files.
846
a4f75309
PE
8472007-09-23 Paul Eggert <eggert@cs.ucla.edu>
848
849 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
850 Problem reported by Wojciech Polak.
851 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
852 (xml_printf): Undo change I made on 21 September; that is,
853 indent 2 spaces, not 1.
854
ad5feac4
JD
8552007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
856
857 Pacify ./configure --enable-gcc-warnings.
858 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
859 `char const *' instead of `char *'.
860 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
861 local variable `sep'.
862
41d7a5f2
PE
8632007-09-21 Paul Eggert <eggert@cs.ucla.edu>
864
865 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
866 elsewhere.
867 * src/print-xml.c: Prefer "const" after types; that's more consistent.
868 (xml_printf): Indent just 1 space for level.
869 (e_char, xlate_char): Remove.
870 (xml_escape_string): Rewrite to avoid undefined behavior (used
871 storage that was freed from the stack).
872 (xml_escape_n): Don't bother checking for subscript error.
873
3f999f78
WP
8742007-09-21 Wojciech Polak <polak@gnu.org>
875
876 Add Bison XML Automaton Report.
41d7a5f2
PE
877
878 Add support for an -x option to generate an XML report.
879 It is not documented yet.
880 * src/print-xml.c: New file.
881 * src/print-xml.h: Likewise.
882 * lib/timevar.def (TV_XML): New var.
883 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
884 * src/conflicts.c: Include print-xml.h.
885 (solved_conflicts_xml_obstack): New var.
886 (log_resolution, conflicts_solve, conflicts_free):
887 Add support for XML report.
888 (conflicts_output_val): New function.
889 * src/conflicts.h (conflicts_output_val): New decl.
890 * src/files.c (spec_xml_file): New var.
891 (compute_output_file_names, output_file_names_free): Add XML support.
892 * src/files.h (spec_xml_file): New decl.
893 * src/getargs.c (xml_flag): New var.
894 (usage, short_options, long_options, getargs): Add XML support.
895 * src/getargs.h (xml_flag): New decl.
896 * src/gram.c: Include print-xml.h.
897 (rule_lhs_print_xml, rule_rhs_print_xml):
898 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
899 New functions.
900 * src/gram.h: Declare external ones.
901 * src/main.c: Include print-xml.h.
902 (main): Add XML support.
903 * src/reduce.c: Include print-xml.h.
904 (reduce_xml): New function.
905 * src/reduce.h: Declare it.
906 * src/state.c: Include print-xml.h.
907 (state_new): Add XML support.
908 (state_rule_lookahead_tokens_print_xml): New function.
909 * src/state.h: Declare it.
910 (struct state): New member solved_conflicts_xml.
911 * src/symtab.c (symbol_class_get_string): New function.
912 * src/symtab.h: Declare it.
913
6d8e724d
PE
9142007-09-21 Paul Eggert <eggert@cs.ucla.edu>
915
916 * GNUmakefile: Switch to coreutils's version.
917 * bootstrap: Likewise.
918 * Makefile.cfg: Adjust to new GNUmakefile.
919 * README-hacking: Likewise.
920
921 Import from gnulib:
922
923 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
924 Bruno Haible <bruno@clisp.org>
925
926 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
927 and is a script that invokes bison. Tighten the code. Add comments.
928
922bdd7f
JD
9292007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
930
931 Spell "boolean" as "Boolean". Reported by Akim Demaille.
932 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
933 * doc/bison.texinfo (Decl Summary): Fix.
934 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
935 * tests/input.at (Boolean %define variables): Update output.
936 * tests/skeletons.at (%define boolean variables: invalid skeleton
937 defaults): Rename to...
938 (%define Boolean variables: invalid skeleton defaults): ... this and
939 update output.
940
1b17b01d
JD
9412007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
942
943 In impure push mode, don't allow more than one yypstate to be allocated
944 since multiple impure parsers would corrupt yynerrs.
945 * data/push.c (yypstate_allocated): New static global variable
946 initialized to 0.
947 (yypull_parse): If yypstate_new returns 0, don't report it as memory
948 exhaustion if yypstate_allocated is 1, but still return 2.
949 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
950 already 1. Otherwise, set it to 1.
951 (yypstate_delete): Set it to 0.
952 * tests/push.at (Push Parsing: Multiple impure instances): New test
953 case.
954
9987d1b3
JD
9552007-08-17 Bob Rossi <bob@brasko.net>
956
957 * doc/bison.texinfo (Push Decl): Document the push parser.
958 (Table of Symbols): Ditto.
959 (Pure Decl): Ditto.
960 (Decl Summary): Ditto.
961 (Multiple Parsers, Push Parser Function, Pull Parser Function,
962 Parser Create Function, Parser Delete Function):
963 Add new push parser symbols.
964 (Table of Symbols): Document push-parser, push-pull-parser,
965 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
966
f16b0819
PE
9672007-08-15 Paul Eggert <eggert@cs.ucla.edu>
968
969 Update to GPLv3.
970 * doc/gpl-3.0.texi: New file.
971 * doc/gpl.texi: Remove.
972 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
973 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
974 * README-hacking, TODO, bootstrap, bootstrap.conf:
975 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
976 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
977 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
978 * data/lalr1.cc, data/lalr1.java, data/location.cc:
979 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
980 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
981 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
982 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
983 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
984 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
985 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
986 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
987 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
988 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
989 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
990 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
991 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
992 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
993 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
994 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
995 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
996 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
997 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
998 * src/complain.c, src/complain.h, src/conflicts.c:
999 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
1000 * src/files.h, src/flex-scanner.h, src/getargs.c:
1001 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
1002 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
1003 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
1004 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
1005 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
1006 * src/print.c, src/print.h, src/print_graph.c:
1007 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
1008 * src/reduce.h, src/relation.c, src/relation.h:
1009 * src/revision.h, src/scan-code.h, src/scan-code.l:
1010 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
1011 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
1012 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
1013 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
1014 * tests/Makefile.am, tests/actions.at, tests/c++.at:
1015 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
1016 * tests/existing.at, tests/glr-regression.at:
1017 * tests/headers.at, tests/input.at, tests/java.at:
1018 * tests/local.at, tests/output.at, tests/push.at:
1019 * tests/reduce.at, tests/regression.at, tests/sets.at:
1020 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
1021 * tests/torture.at:
1022 Update to GPLv3.
1023
728c4be2
JD
10242007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1025
1026 Get rid of broken %no-parser, -n, and --no-parser implementation and
1027 documentation.
1028 * TODO: Don't mention them.
1029 * doc/bison.1: Likewise.
1030 * doc/bison.texinfo (Decl Summary): Likewise.
1031 (Bison Options): Likewise.
1032 (Option Cross Key): Likewise.
1033 * src/getargs.c (no_parser_flag): Remove global variable.
1034 (usage): Don't print description of -n and --no-parser.
1035 (long_options): Remove --no-parser entry here.
1036 (getargs): Remove -n case in the switch here.
1037 * src/getargs.h (no_parser_flag): Remove extern.
1038 * tests/regression.at (Web2c Actions): Remove comment that mentions
1039 --no-parser.
1040
5d31a216
JD
10412007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1042
1043 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
1044 name user variables starting with `yy'. Just pass NULL instead of a
1045 dummy local &yylval to yypush_parse.
1046 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
1047 starting with `yy'.
1048
a2ea208d
JD
10492007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
1050
1051 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
1052 true since it's then always used regardless of whether yyoverflow is
1053 defined. Reported by Christian Burger at
1054 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
1055 * THANKS: Add Christian Burger.
1056
91661ebb
JD
1057 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1058 node names: say "Decl Summary" not "Bison Declaration Summary".
1059
cbd50549
JD
10602007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
1061
1062 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
1063 determine whether this function has already complained about an invalid
1064 value for a %define boolean variable, don't check whether Bison has
1065 ever examined the value. As written, the check was a tautology.
1066 Instead, record and check for this complaint using a separate muscle.
1067
eb1b0740
JD
10682007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1069
1070 Fix push parsing memory leak reported by Brandon Lucia at
1071 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
1072 * THANKS: Add Brandon Lucia.
1073 * data/push.c (yypstate_delete): Free the stack if it was reallocated
1074 but the parse never completed and thus freed it.
1075 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
1076 * tests/testsuite.at: Include push.at.
1077 * test/push.at: New.
1078 (Push Parsing: Memory Leak for Early Deletion): New test case.
1079
9d774aff
JD
10802007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
1081
1082 Improve handling of multiple S/R conflicts in the same state and of S/R
1083 conflicts involving multiple reductions.
1084 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
1085 set for a state here or Bison will abort if it is reassigned on a
1086 later conflicted reduction in the same state.
1087 Similarly, don't finalize and assign the solved conflicts report here
1088 or it will be lost if it is reassigned on a later conflicted reduction
1089 in the same state.
1090 (set_conflicts): Instead, assign them both here after all S/R conflicts
1091 in the state have been fully examined.
1092 * src/print.c (shift_set): Rename to...
1093 (no_reduce_set): ... this.
1094 (print_reductions): Update for rename, and add %nonassoc error action
1095 tokens to no_reduce_set so that, when printing the first remaining
1096 reduction on an error action token, the reduction is enclosed in
1097 brackets.
1098 (print_results): Update for rename.
1099 * tests/conflicts.at (Solved conflicts report for multiple reductions
1100 in a state): New test case.
1101 (%nonassoc error actions for multiple reductions in a state): New test
1102 case.
1103
1104 * src/main.c (main): Don't depend on C99 features.
1105
10159d2a
JD
11062007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1107
1108 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
1109 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
1110 uniwidth.
10159d2a 1111
953b3935
JD
11122007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
1113
1114 * bootstrap (slurp): Create target directories that don't exist.
1115 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
1116
6ce2d93a
JD
11172007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1118
1119 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
1120 than item number.
1121 * closure.c (closure): Likewise.
1122 * state.h (reductions): Comment sorting of rules.
1123 (state): Comment sorting of items.
1124
ce3448d5
JD
11252007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
1126
1127 Fix C++ test cases after recent Gnulib changes. Discussed starting at
1128 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
1129 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
1130 definition in order to avoid Gnulib headers since we don't use config.h
1131 here.
1132 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
1133 rather than AT_DATA so that config.h is included.
1134
8a86eef0
JD
11352007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
1136
1137 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
1138 instead of fprintf. Guard these functions with #if YYDEBUG instead of
1139 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
1140 and so that YYFPRINTF is guaranteed to be defined here.
1141
b1a81613
JD
11422007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1143
1144 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
1145 with...
1146 (muscle_percent_define_check_values): ... this more helpful function.
1147 Again, it's not used yet, but it will be.
1148 * src/muscle_tab.h: Likewise.
1149
71b61d4d
JD
1150 Improve some comments in parser table construction.
1151 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
1152 (generate_states): Don't mention ruleset, which is internal to closure.
1153 * src/closure.c (closure): Explain sorting of core and itemset, which
1154 is required for this function to behave correctly.
1155 * src/closure.h (closure): Mention sorting.
1156
2a6b783d
JD
11572007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
1158
1159 * src/lalr.c (state_lookahead_tokens_count): For code readability,
1160 move the check for disabled transitions to an aver since conflict
1161 resolution hasn't happened yet.
1162
1163 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
1164 labels a state as inconsistent just because it has error transitions.
1165 The original form of this check appeared in revision 1.1 of lalr.c,
1166 which was committed on 1991-12-21. Now (at least), changing the
1167 consistency label on such a state appears to have no useful effect in
1168 any of the places it is examined, which I enumerate below. The key
1169 point to understanding each item in this enumeration is that a state
1170 with an error transition is labelled consistent in the first place only
1171 if it has no rules, so the check cannot matter for states that have
1172 rules. (1) Labelling a state as inconsistent will cause set_conflicts
1173 to try to identify its conflicts, and a state must have *rules* to have
1174 conflicts. (2) Labelling a state as inconsistent will affect how
1175 action_row sets the default *rule* for the state. (3) Labelling a
1176 state as inconsistent will cause build_relations to add lookback edges
1177 to *rules* in that state.
1178 * src/state.h (struct state): Word the comment for member consistent
1179 more carefully.
1180
14462c2b
JD
11812007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1182
1183 Don't depend on C99 features.
1184 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
1185 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
1186 * src/reader.c (check_and_convert_grammar): Fix for-loop.
1187 * src/state.c (state_mark_reachable_states): Fix for-loop.
1188 (state_remove_unreachable_states): Fix for-loop.
1189
1190 Don't widen struct state with member reachable just to temporarily
1191 record reachability. Instead, use a local bitset.
1192 * src/state.h (struct state): Remove member.
1193 * src/state.c (state_new): Don't initialize it.
1194 (state_mark_reachable_states): Rename to...
1195 (state_record_reachable_states): ... this, and use bitset.
1196 (state_remove_unreachable_states): Use bitset.
1197
5a43d418
JD
11982007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
1199
1200 * src/Makefile.am (yacc): Quote target action commands properly so
1201 that the yacc script isn't corrupt. Reported by Hans Aberg at
1202 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
1203
0c650a20
JD
1204 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
1205 the case of pure parsers. Reported by Frans Englich at
1206 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
1207 * THANKS: Add Frans Englich.
1208
61fee93e
JD
1209 * NEWS (2.3a+): In the %code entry, reference section `Bison
1210 Declaration Summary' from the manual now since the %code summary has
1211 moved there.
1212 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
1213 in the rules section must be terminated by semicolons.
1214
f124d423
JD
12152007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1216
1217 Extend the front-end API for %define variables to more completely
1218 mirror the back-end. This will be useful in the future.
1219 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
1220 Update comments to mention the new front-end counterparts of these
1221 macros.
1222 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
1223 for muscle_string_decode and muscle_location_decode.
1224 (muscle_string_decode): New static function.
1225 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
1226 (muscle_percent_define_get, muscle_percent_define_ifdef): New
1227 functions.
1228 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
1229 muscle_percent_define_get to mimic the b4_percent_define_flag_if
1230 implementation more closely.
1231 (muscle_percent_define_invalid_value): New function.
1232 * src/muscle_tab.h (muscle_percent_define_get,
1233 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
1234 Prototype.
1235
75ad86ee
JD
12362007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1237
1238 * NEWS (2.3a+): Mention yesterday's state-removal change.
1239 (2.3a): Remove the %language entry, which was added after 2.3a.
1240 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
1241 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
1242 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
1243 tests/existing.at: Update copyright date.
1244
5967f0cf
JD
12452007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1246
1247 If conflict resolution makes states unreachable, remove those states,
1248 report rules that are then unused, and don't report conflicts in those
1249 states.
1250 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
1251 New global function.
1252 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
1253 function.
1254 * src/main.c (main): After conflict resolution, remove the unreachable
1255 states and update all data structures that reference states by number.
1256 * src/state.c (state_new): Initialize each state's reachable member to
1257 false.
1258 (state_mark_reachable_states): New static function.
1259 (state_remove_unreachable_states): New global function.
1260 * src/state.h (struct state): Add member bool reachable.
1261 (state_remove_unreachable_states): Prototype.
1262 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1263 New test case.
1264 * tests/existing.at (GNU pic Grammar): Update test case output now that
1265 an unused rule is discovered.
1266
b09f4f48
JD
12672007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1268
1269 Minor code cleanup in parser table construction.
1270 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
1271 (new_itemsets, save_reductions): Update for rename to nitemset.
1272 * src/closure.c (nritemset): Rename to...
1273 (nitemset): ... this since the "r" appears to meaningless and isn't
1274 used in the comments.
1275 (closure): Update for rename.
1276 * src/closure.h (nritemset): Update extern to...
1277 (nitemset): ... this.
1278 * src/lalr.c (LA): Fix a typo in comments.
1279 * src/print.c (print_core): Update for rename to nitemset.
1280 * src/print_graph.c (print_graph): Likewise.
1281 * src/state.h: Fix some typos in header comments.
1282
bbb44d83
PE
12832007-04-04 Paul Eggert <eggert@cs.ucla.edu>
1284
9b33de72
PE
1285 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
1286 still sticks to ASCII. Sorry!
1287
bbb44d83
PE
1288 * README-hacking: New file, taken mostly from coreutils, with changes
1289 for Bison. Contains much of the contents of:
1290 * README-cvs: Remove.
1291 * bootstrap: Sync from gnulib.
1292 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
1293 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
1294
29553547
JD
12952007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
1296
1297 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
1298 Setzer.
1299 (Java Differences): Fix some typos.
1300 * THANKS: Add Sebastian Setzer.
1301
01b477c6
PB
13022007-03-07 Paolo Bonzini <bonzini@gnu.org>
1303
730739e4
AD
1304 * data/java.m4 (b4_single_class_if): Remove.
1305 (b4_abstract_if): Look at "%define abstract".
1306 (b4_lexer_if): New.
1307 (b4_union_name): Rename...
1308 (b4_yystype): ... to this. Map to "%define stype".
1309 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
1310 b4_maybe_throws): Fix quoting.
1311 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
1312 * data/lalr1.java (Lexer interface): Always define.
1313 (Lexer interface within parser class): Remove.
1314 (YYLexer class): New, used when "%code lexer" is present.
1315 (constructor): When "%code lexer" is used, pass %lex-param
1316 to the lexer constructor.
1317 (yylex, yyparse): Remove %lex-param from method invocations
1318 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
1319
1320 * doc/bison.texinfo (Java Bison Interface): Mention "%define
1321 abstract". Rename "%define union_name" to "%define stype".
1322 Rename method names according to previous patch.
1323 (Java Scanner Interface): Describe "%code lexer" instead of
1324 "%pure-parser" and "%define single_class".
1325 (Java Differences): Mention "%code lexer".
1326
1327 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
1328 Include scanner here, using macros from tests/local.at.
1329 (AT_DATA_CALC_Y): Remove final argument.
1330 (_AT_CHECK_JAVA_CALC): Likewise.
1331 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
1332 of %locations and %error-verbose.
1333 (main): Test with and without %lex-param.
1334 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
1335 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 1336
122bea3a
JMG
13372007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1338
1339 DJGPP spefic issue. Inhibit the use of disallowed characters for
1340 file name genertion on Win98, WinXP, etc. These are |<>":?*\
1341 and concern testsuite case 46.
1342 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
1343 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
1344 * djgpp/config.bat: Inhibit the use of disallowed characters.
1345
9611cfa2
JD
13462007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1347
1348 Miscellaneous %define and %code cleanup.
1349 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
1350 values are interpreted.
1351 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
1352 documentation a little more.
1353 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
1354 muscle_percent_define_insert, muscle_percent_code_grow): New
1355 functions/macros.
1356 * src/muscle_tab.h (muscle_percent_define_insert,
1357 muscle_percent_code_grow): Prototype.
1358 * src/parse-gram.y (prologue_declaration): Use
1359 muscle_percent_define_insert and muscle_percent_code_grow when parsing
1360 %define and %code directives.
1361
1362 Make it easy to share %define boolean variables between the front-end
1363 and back-end. Though not used yet, this will be useful in the future.
1364 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
1365 Bison uses of names rather than just skeleton uses of names.
1366 (b4_percent_define_get, b4_percent_define_ifdef): Rename
1367 b4_percent_define_skeleton_variables(VARIABLE) to
1368 b4_percent_define_bison_variables(VARIABLE).
1369 (b4_percent_code_get, b4_percent_code_ifdef): Rename
1370 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
1371 b4_percent_code_bison_qualifiers(QUALIFIER).
1372 (b4_check_user_names_wrap): Update for renames.
1373 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
1374 muscle_percent_define_default): New functions mimicking
1375 b4_percent_define_flag_if and b4_percent_define_default.
1376
1377 For %define variables, report locations for invalid values and
bbb44d83 1378 redefinitions.
9611cfa2
JD
1379 * data/bison.m4 (b4_percent_define_flag_if): Read
1380 b4_percent_define_loc(VARIABLE) to report the location of an invalid
1381 value for VARIABLE.
1382 (b4_percent_define_default): Save a special location in
1383 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
1384 must later be reported as invalid.
1385 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
1386 functions.
1387 (muscle_percent_define_insert): Record the location of VARIABLE in
1388 muscle percent_define_loc(VARIABLE), and use it to report the previous
1389 location for a redefinition.
1390 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
1391 (muscle_percent_define_default): Update like b4_percent_define_default.
1392 (muscle_grow_user_name_list): Rename to...
1393 (muscle_user_name_list_grow): ... this for consistency and use
1394 muscle_location_grow.
1395 * src/muscle_tab.h (muscle_location_grow): Prototype.
1396 * tests/input.at (%define errors): Update expected output.
1397 * tests/skeletons.at (%define boolean variables: invalid skeleton
1398 defaults): New test case.
1399
0bf92491
JD
14002007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
1401
1402 * src/print.c (lookahead_set, state_default_rule): Remove.
1403 (print_reductions): Replace state_default_rule invocation with
1404 equivalent use of yydefact, which was computed in token_actions in
1405 tables.c.
1406 (print_results): Don't allocate lookahead_set.
1407
d3b12988
PB
14082007-02-27 Paolo Bonzini <bonzini@gnu.org>
1409
1410 * data/lalr1.java: Prefix all private members with yy.
1411
f57a7536
JD
14122007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
1413
1414 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 1415 Sebastien Fricker at
f57a7536 1416 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 1417 * THANKS: Add Sebastien Fricker.
f57a7536
JD
1418 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
1419 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
1420 accept a variable number of arguments.
1421
6404a5bf
JD
14222007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1423
1424 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
1425
e4e09639
JMG
14262007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1427
1428 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
1429 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
1430 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
1431
d7e0a1a7
PE
14322007-02-11 Paul Eggert <eggert@cs.ucla.edu>
1433
1434 Undo my 2007-02-07 change, switching back to the c-strcase module
1435 introduced in the 2007-02-03 change. Bruno Haible reported that
1436 the 2007-02-07 change would be dangerous in Turkish if we add a
1437 language whose name contains "i", since "i" is not lowercase "I"
1438 in Turkish.
1439 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
1440 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
1441 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
1442 * m4/.cvsignore: Remove strcase.m4.
1443 * src/getargs.c: Revert 2007-02-07 change, as follows.
1444 Include c-strcase.h.
1445 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
1446
deee93a1
JD
14472007-02-11 Bruno Haible <bruno@clisp.org>
1448
1449 Enable the Java related testsuite tests when the only Java compiler
1450 found is a gcj < 4.3. Discussed at
1451 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
1452 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
1453
574add85
JD
14542007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
1455
1456 * data/Makefile.am: Update copyright date.
1457 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
1458 yypstate_new returns NULL.
1459 (yypstate_new): Return NULL if malloc does.
1460 * src/reader.c (packgram): Move translation of rule actions from the
1461 beginning of packgram to...
1462 (check_and_convert_grammar): ... here right before packgram is invoked
1463 so it's easier to write more complete comments, and remove redundant
1464 code.
1465
e785ccf7
JD
14662007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
1467
1468 As in semantic actions, make @$ in %initial-action, %destructor, and
1469 %printer imply %locations.
1470 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
1471 scanning @$.
1472 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
1473 (@$ in %initial-action implies %locations,
1474 @$ in %destructor implies %locations,
1475 @$ in %printer implies %locations): ... these new test cases.
1476
1cfe1ed7
PE
14772007-02-07 Paul Eggert <eggert@cs.ucla.edu>
1478
1479 Undo most of the 2007-02-03 change, switching to the strcase module
1480 now that gnulib strcase has been fixed.
1481 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
1482 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
1483 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
1484 * m4/.cvsignore: Add strcase.m4.
1485 * src/getargs.c: Revert 2007-02-03 change, as follows.
1486 Don't include c-strcase.h.
1487 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
1488 strcasecmp has "unspecified behavior" outside the POSIX locale,
1489 but it works fine in practice if at least one argument is ASCII,
1490 as is the case in Bison.
1491
0049ec86
PB
14922007-02-07 Paolo Bonzini <bonzini@gnu.org>
1493
1494 * tests/java.at: Skip tests if only one of javac/java is present.
1495 Reported by Joel E. Denny.
1496 * tests/atlocal.in: Adjust copyright years.
1497
14982007-02-05 Paolo Bonzini <bonzini@gnu.org>
1499
1500 * data/lalr1.java (Stack): Work around old verifiers that disallow
1501 access to the private fields of an inner class, from the outer class.
1502 We can make Stack's fields public because user code doesn't have access
1503 to the instance of Stack used by parse(). Reported by Paul Eggert.
1504
2c2b7220
PE
15052007-02-03 Paul Eggert <eggert@cs.ucla.edu>
1506
1507 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
1508 the right spot for these files?
1509 * bootstrap.conf (gnulib_modules): Add c-strcase.
1510 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
1511 c-strncasecmp.c.
1512 * src/getargs.c: Include c-strcase.h.
1513 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
1514 to avoid unspecified behavior.
1515
b2b81dae
JD
15162007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
1517
1518 * doc/bison.texinfo (Decl Summary): Correct typo.
1519
c1d19e10
PB
15202007-01-30 Paolo Bonzini <bonzini@gnu.org>
1521
1522 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
1523 Complain if the value does not match empty, "true" or "false".
1524 * data/c++.m4: Adjust default definitions of %define variables.
1525 * data/java.m4: Adjust default definitions of %define variables.
1526 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
1527 to above behavior.
1528 * tests/input.at (Boolean %define variables): Test new behavior.
1529
8405b70c
PB
15302007-01-29 Paolo Bonzini <bonzini@gnu.org>
1531
1532 * NEWS: Mention java.
1533 * TODO: Remove things that are done.
1534 * bootstrap.conf: Add javacomp-script and javaexec-script.
1535 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
1536
1537 * data/Makefile.am: Add new files.
1538 * data/java-skel.m4: New.
1539 * data/java.m4: New.
1540 * data/lalr1.java: New.
1541
1542 * doc/bison.texinfo: Put "A Complete C++ Example" under
1543 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
1544 under Other Languages.
1545
1546 * src/getargs.c (valid_languages): Add Java.
1547 * src/getargs.h (struct bison_language): Update size of string fields.
1548
1549 * tests/Makefile.am: Add java.at.
1550 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
1551 * tests/java.at: New.
1552 * tests/testsuite.at: Include it.
1553
3eb82471
JD
15542007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
1555
1556 Clean up.
1557 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
1558 at_directive_argv arguments so these no longer have to be global
1559 variables. Also, update the implementation for the following changes.
1560 (fail_for_at_directive_too_many_args,
1561 fail_for_at_directive_too_few_args): Add at_directive_name argument.
1562 (at_directive_name): Remove as at_directive_argv[0] will be used for
1563 this now.
1564 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
1565 for the directive name.
1566 (at_directive_argc, at_directive_argv): Make these local within
1567 skel_lex instead of global.
1568 (INITIAL): Update directive start action for above changes.
1569 (SC_AT_DIRECTIVE_ARG): Rename to...
1570 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
1571 (SC_AT_DIRECTIVE_SKIP_WS): Update.
1572 (scan_skel): Move yylex_destroy to...
1573 (skel_scanner_free): ... here.
1574 * tests/skeletons.at (installed skeleton file name): Rename to...
1575 (installed skeleton file names): ... this.
1576
148d66d8
JD
15772007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
1578
1579 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1580 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
1581 Summary" not "Directives".
1582 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
1583 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
1584 since the former is now the more complete one.
1585 (Prologue Alternatives): Likewise and do the same for %defines.
1586 (Table of Symbols): Add summary of %code, add summary of %define, and
1587 move full %code documentation to...
1588 (Decl Summary): ... here for consistency with other entries in these
1589 sections.
1590 Move %define entry in order to keep this list alphabetized.
1591 Reword %define entry a little to put less emphasis on the skeleton
1592 concept, which most users shouldn't have to think about.
1593
665f0c24
PE
15942007-01-26 Paul Eggert <eggert@cs.ucla.edu>
1595
1596 Adjust to recent gnulib changes.
1597 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
1598 Add string.h, string_.h, unistd_.h, wchar_.h.
1599 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
1600 * src/system.h: Don't include <stpcpy.h>; this is now done by
1601 <string.h>.
1602
592d0b1e
PB
16032007-01-23 Paolo Bonzini <bonzini@gnu.org>
1604
1605 Simplify implementation of unqualified %code, implement macros for
1606 uniform treatment of boolean %define flags. Document %define.
1607 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
1608 b4_percent_code_ifdef): New.
1609 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
1610 * data/c++.m4: Define default value for global_tokens_and_yystype.
1611 * data/glr.cc: Likewise.
1612 * data/location.cc: Use b4_percent_define_flag_if.
1613
148d66d8 1614 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
1615
1616 * src/parse-gram.y (Unqualified %code): Change muscle name to
1617 b4_percent_code().
1618 (content.opt): Default to empty.
1619
a7867f53
JD
16202007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1621
1622 Implement support for relative and absolute skeleton file names.
1623 Discussed starting at
1624 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
1625 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
1626 (Bison Options): Document in --skeleton entry.
1627 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
1628 full_skeleton can't necessarily hold all of pkgdatadir.
1629 If the specified skeleton file name contains a `/', don't prepend
1630 pkgdatadir.
1631 * src/parse-gram.y (prologue_declaration): If the specified skeleton
1632 file name contains a `/', prepend the grammar file directory.
1633 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
1634 * skeletons.at: New file.
1635 (relative skeleton file names): New test case.
1636 (installed skeleton file names): New test case.
1637 * tests/testsuite.at: Include skeletons.at.
1638
1639 * bootstrap: Update copyright to 2007.
1640
830c9b18
PB
16412007-01-17 Paolo Bonzini <bonzini@gnu.org>
1642
1643 * bootstrap: Remove occurrences of .#bootmp from the files.
1644
a8c2e813
AD
16452007-01-17 Akim Demaille <akim@epita.fr>
1646
1647 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1648 nonterminals.
1649 Use per-type %printer.
1650
279cabb6
JD
16512007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1652
1653 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1654 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1655 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1656 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1657 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1658 tests/glr-regression.at, tests/input.at, tests/local.at,
1659 tests/output.at, tests/torture.at: Update copyright to 2007.
1660
bb32f4f2
AD
16612007-01-16 Akim Demaille <akim@epita.fr>
1662
1663 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1664 error code.
1665 (Calc++ Scanner): Exit with failure if we can't open the input
1666 file.
1667 Accept "-" standing for stdin.
1668 (Calc++ Top Level): Print the result only if the parsing was
1669 successful.
1670
7cff04b5
AD
16712007-01-16 Akim Demaille <akim@epita.fr>
1672
1673 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1674
a4e25e1d
JD
16752007-01-15 Paolo Bonzini <bonzini@gnu.org>
1676 and Joel E. Denny <jdenny@ces.clemson.edu>
1677
1678 Clean up %define and %code implementation in M4 some. Most
1679 importantly, rename all related macros to be in the b4_percent_define
1680 and b4_percent_code namespaces. Also, complete support for `.' in
1681 %define variable names and %code qualifiers.
1682 * data/bison.m4 (b4_check_user_names): Check for special
1683 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1684 m4_foreach loops.
1685 (b4_get_percent_define, b4_get_percent_code): Rename to...
1686 (b4_percent_define_get, b4_percent_code_get): ... these.
1687 Extend documentation with examples.
1688 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1689 b4_percent_define_skeleton_variables and
1690 b4_percent_code_skeleton_qualifiers.
1691 Expect any value for the %define variable `foo' to be stored in the
1692 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1693 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1694 expect any unqualified %code blocks to be stored in a macro named
1695 `b4_percent_code_unqualified'.
1696 Use m4_indir so that %define variable names and %code qualifiers can
1697 contain `.', which is allowed by the grammar parser.
1698 (b4_percent_define_default): New macro to set a default value for a
1699 %define variable.
1700 (m4_wrap): Update wrapped code, and fix some underquoting.
1701 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1702 Expect grammar uses of %define variables and %code qualifiers to be
1703 defined in b4_percent_define_user_variables and
1704 b4_percent_code_user_qualifiers.
1705 * data/c++.m4: Use b4_percent_define_default rather than
1706 m4_define_default. Fix some underquoting. Skeleton usage of %define
1707 variable define_location_comparison now implies skeleton usage of
1708 %define variable filename_type.
1709 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1710 data/push.c, data/yacc.c: Update macro names.
1711 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1712 muscle names.
1713
e37c665c
JMG
17142007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1715
1716 DJGPP specific issues.
1717
1718 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1719 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1720
7d2d521f
JD
17212007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1722
1723 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1724 run parsers in all tests so that Valgrind is invoked during
1725 maintainer-check-valgrind.
1726 (Duplicate representation of merged trees): Free all semantic values.
1727 (Duplicated user destructor for lookahead): Likewise.
1728
e0ac9b4b
JD
17292007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1730
1731 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1732 command-line prefix.
1733 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1734 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1735 miss Valgrind messages.
1736 (Exploding the Stack Size with Malloc): Likewise.
1737
78143faa
JD
17382007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1739
1740 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1741 locals. Reported by Juan Manuel Guerrero at
1742 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1743 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1744 Fix some indentation also.
1745 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1746 explaining this issue.
1747
7ecec4dd
JD
17482007-01-09 Paolo Bonzini <bonzini@gnu.org>
1749 and Joel E. Denny <jdenny@ces.clemson.edu>
1750
1751 Simplify union and prologue handling, and escape union and lex/parse
1752 params with digraphs.
1753 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1754 values to the empty string since these are no longer guaranteed
1755 initialized by the front-end.
1756 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1757 braces around b4_user_stype since this is no longer done by the
1758 front-end.
1759 * src/files.c, src/files.h (pre_prologue_obstack,
1760 post_prologue_obstack): Remove.
1761 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1762 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1763 with digraphs. This fixes lex params and parse params.
1764 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1765 * src/output.c (prepare): Remove muscle insertion of the prologues.
1766 (output): Remove freeing of pre_prologue_obstack and
1767 post_prologue_obstack.
1768 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1769 than prologue_augment for prologue parsing so you don't need prologue
1770 obstacks.
5c80250c
JD
1771 (grammar_declaration): For %union RHS, use `braceless' instead of
1772 "{...}" so that braces are already stripped and code is escaped with
1773 digraphs.
7ecec4dd
JD
1774 * src/reader.c (prologue_augment): Remove.
1775 (reader): Remove initialization of pre_prologue_obstack and
1776 post_prologue_obstack.
1777 * src/reader.h (prologue_augment): Remove.
1778
1779 * data/c.m4: Remove stray parenthesis.
1780
16dc6a9e
JD
17812007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1782
1783 Remove quotes from variables names in %define directives and from
1784 qualifiers in %code directives, and restrict the characters that are
1785 allowed in them to M4-friendly ones. For %define, continue to support
1786 the quoted form as a deprecated feature. Discussed starting at
1787 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1788 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1789 %code.
1790 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
1791 (Decl Summary): In %defines entry, update mention of `%code requires'
1792 and `%code provides'.
16dc6a9e
JD
1793 (C++ Location Values): Update %define uses.
1794 (Calc++ Parser Interface): Likewise.
1795 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 1796 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
1797 * src/parse-gram.y (prologue_declaration): For %define variables, use
1798 `variable' instead of `STRING'.
1799 (grammar_declaration): For %code qualifiers, use `ID' instead of
1800 `STRING'.
1801 (variable): New nonterminal that takes an `ID' or a `STRING'.
1802 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1803 and %define uses.
1804 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1805 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1806 (%define errors): Update %define uses.
1807
e9813cd4
JD
18082007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1809
1810 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1811 instead of muscle_insert for %define values so that M4-special
1812 characters are replaced with digraphs.
1813 * tests/input.at (%define errors): Extend to check weird values.
1814
6afc30cc
JD
18152007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1816
1817 Instead of having skeletons declare all valid %define variables and
1818 %code qualifiers, provide macros that retrieve the associated values
1819 and build these lists automatically. Thus Bison will now warn when a
1820 variable or qualifier is not used by the skeleton in the current
1821 invocation regardless of whether it might sometimes be used by that
1822 skeleton in other invocations. Also, move all %define value macros to
1823 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
1824 form, which is replaced by %code.
1825 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
1826 (b4_check_user_names): ... this, and change the series of valid name
1827 arguments to a single list argument for names used in the skeleton
1828 similar to the existing list argument for names used in the grammar.
1829 Warn instead of complaining.
1830 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
1831 values and %code code, to format %code code properly, and to build
1832 lists of all %define variables and %code qualifiers used in the
1833 skeleton: b4_skeleton_percent_define_variables and
1834 b4_skeleton_percent_code_qualifiers.
1835 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
1836 Remove, and...
1837 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
1838 the skeleton names lists can finish building first. In place of
1839 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
1840 expect the lists b4_user_percent_define_variables and
1841 b4_user_percent_code_qualifiers.
1842 * data/c++.m4: Where setting default values for b4_parser_class_name,
1843 b4_location_type, b4_filename_type, b4_namespace, and
1844 b4_define_location_comparison, update their names to the
1845 b4_percent_define_ namespace.
1846 * data/glr.c: Don't use b4_check_percent_define_variables and
1847 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1848 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
1849 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 1850 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
1851 * data/location.cc: Use b4_get_percent_define.
1852 * data/push.c: Don't use b4_check_percent_define_variables and
1853 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1854 * data/yacc.c: Likewise, and don't call m4_exit in
1855 b4_use_push_for_pull_if or m4_wrap code will never execute.
1856 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
1857 Rename to...
1858 (muscle_grow_user_name_list): ... this for consistency with the
1859 terminology used in bison.m4.
1860 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
1861 %define variable names, and rename muscle used_percent_define_variables
1862 to user_percent_define_variables.
1863 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
1864 user_percent_code_qualifiers.
1865 (content): Remove.
1866 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
1867 {CODE} form is no longer accepted.
1868 * tests/input.at (Reject bad %code qualifiers): Rename to...
1869 (Reject unused %code qualifiers): ... this, and update test output.
1870 (%define error): Update test output.
1871
7eb8a0bc
JD
18722007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
1873
1874 Check for unrecognized %define variables similar to checking for
1875 unrecognized %code qualifiers. Check for redefined %define variables.
1876 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
1877 generalizes...
1878 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
1879 (b4_check_percent_define_variables): New, also wraps it.
1880 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
1881 variables using b4_check_percent_define_variables.
1882 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
1883 all those exercised in the test suite and all those listed in the
1884 `Default values' section of c++.m4. Are there others?
1885 * data/push.c, data/yacc.c: Declare no valid %define variables.
1886 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
1887 similar to muscle_find, but it works even when the muscle stores a
1888 const value.
1889 (muscle_grow_used_name_list): New function for constructing the used
1890 name list muscles that b4_check_for_unrecognized_names requires.
1891 * src/parse-gram.y (prologue_declaration): Warn if a variable is
1892 %define'd more than once. Define the b4_used_percent_define_variables
1893 muscle with muscle_grow_used_name_list.
1894 (grammar_declaration): Abbreviate %code code with
1895 muscle_grow_used_name_list.
1896 * tests/input.at (%define errors): New.
1897
3fc65ead
JD
18982007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1899
1900 Provide warn_at, complain_at, and fatal_at function callbacks to the
1901 skeletons, and use this for %code qualifier complaints.
1902 * data/bison.m4 (b4_error_at): New, invoked by...
1903 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
1904 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
1905 @fatal_at(...@) directives.
1906 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
1907 qualifiers in b4_used_percent_code_qualifiers and to use
1908 b4_complain_at.
1909 * src/location.c, src/location.h (boundary_set_from_string): New global
1910 function.
1911 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
1912 function.
1913 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
1914 to b4_used_percent_code_qualifiers.
1915 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
1916 function.
1917 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
1918 (lineno): Rename to...
1919 (out_lineno): ... this so I don't misunderstand it again.
1920 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
1921 here; these newlines are in the input but not the output file.
1922 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
1923 (at_directive_perform): ... this new static function, and add handling
1924 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
1925 directives.
1926 * tests/input.at (Reject bad %code qualifiers): Update test output with
1927 locations and extend.
1928
1929 * tests/output.at (Output file name: [, Output file name: ]): Remove
1930 bogus comment about these tests failing.
1931
1c7b7e1d
JD
19322007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1933
1934 Clean up b4_check_percent_code_qualifiers a little.
1935 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
1936 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
1937 documentation and add examples.
1938 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
1939 qualifiers here.
1940
08af01c2
JD
19412007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1942
1943 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
1944 unreliable -- especially when they're hidden inside another macro.
1945 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
1946 data/c.m4: Remove m4_divert(-1).
1947 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1948 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
1949 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 1950 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
1951 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
1952 pushed and popped by m4sugar, should be first on the stack.
1953
1954 Provide warn, complain, and fatal function callbacks to the skeletons.
1955 This provides more flexibility than m4_fatal, improves the error
1956 message format, and captures messages for translation. Discussed
1957 starting at
1958 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
1959 * data/bison.m4 (b4_error): New, invoked by...
1960 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
1961 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
1962 directives. Because these M4 macros might be called when the current
1963 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
1964 the previous removal of uses of m4_divert, which caused trouble.
1965 (b4_check_percent_code_qualifiers): Use b4_complain instead of
1966 m4_fatal to report unrecognized %code qualifiers.
1967 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
1968 push parser requests.
1969 * data/glr.c: Use b4_complain instead of m4_fatal to report
1970 non-deterministic push parser requests.
1971 Update @output usage to @output(...@) form.
1972 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
1973 report missing %defines. Update @output usage to @output(...@) form.
1974 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
1975 @output(...@) form.
1976 * src/main.c (main): Invoke skel_scanner_free.
1977 * src/scan-skel.h (skel_scanner_free): Prototype new function.
1978 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
1979 obstack_for_string from flex-scanner.h.
1980 (YY_DECL): Use to declare skel_lex static.
1981 (decode_at_digraphs): Remove; now handled in the new
1982 SC_AT_DIRECTIVE_ARG start condition.
1983 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
1984 functions.
1985 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
1986 at_directive_argv): New static globals.
1987 (INITIAL): Use fail_for_invalid_at.
1988 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
1989 recognize the start of a generalized `@directive(...@)' form and
1990 start...
1991 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
1992 directive args (using the new obstack_for_string), to decode the
1993 contained @ diagraphs, and to perform the directive. It recognizes
1994 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
1995 @output(...@).
1996 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
1997 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
1998 `@,'.
1999 (scan_skel): Initialize obstack_for_string on the first call.
2000 (skel_scanner_free): New function to free obstack_for_string.
2001 * tests/input.at (Reject bad %code qualifiers): Update test output.
2002
8e0a5e9e
JD
20032007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
2004
2005 Consolidate the 4 prologue alternative directives (%code, %requires,
2006 %provides, and %code-top) into a single %code directive with an
2007 optional qualifier field. Discussed at
2008 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
2009 * NEWS (2.3a+): Rewrite the existing entry for the prologue
2010 alternatives.
2011 * doc/bison.texinfo (Prologue Alternatives): Update.
2012 (Decl Summary): Update to %code "requires" and %code "provides".
2013 (Calc++ Parser): Update to %code "requires".
148d66d8 2014 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
2015 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
2016 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
2017 are replaced by b4_percent_code_provides and b4_percent_code_requires,
2018 which are skeleton-specific.
2019 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
2020 declare what %code qualifiers it supports and to complain if any other
2021 qualifiers were used in the grammar.
2022 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
2023 and b4_user_code([b4_percent_code_provides]) in place of
2024 b4_user_requires and b4_user_provides.
2025 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
2026 Add b4_user_code([b4_percent_code_top]) and
2027 b4_user_code([b4_percent_code]).
2028 Invoke b4_check_percent_code_qualifiers.
2029 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2030 PERCENT_REQUIRES): Remove.
2031 (grammar_declaration): Remove RHS's for %code-top, %provides, and
2032 %requires. Rewrite the %code RHS as the unqualified form defining the
2033 muscle b4_percent_code. Add another RHS for the qualified %code form,
2034 which defines muscles of the form b4_percent_code_QUALIFIER and the
2035 b4_used_percent_code_qualifiers muscle.
2036 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2037 PERCENT_REQUIRES): Remove.
2038 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
2039 %code "requires" and %code "provides".
2040 * tests/input.at (Reject bad %code qualifiers): New.
2041
95021767
JD
20422007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2043
2044 Use the new code_props interface for destructors and printers.
2045 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
2046 printer_location members, and change the type of the destructor and
2047 printer members to code_props.
2048 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
2049 symbol_printer_get, semantic_type_destructor_set,
2050 semantic_type_printer_set, default_tagged_destructor_set,
2051 default_tagless_destructor_set, default_tagged_printer_set,
2052 default_tagless_printer_set): Use code_props in arguments and return
2053 types in place of char const * and location.
2054 (symbol_destructor_location_get, symbol_printer_location_get): Remove
2055 since the locations are now contained in the return of
2056 symbol_destructor_get and symbol_printer_get.
2057 * src/output.c (symbol_destructors_output, symbol_printers_output):
2058 Replace with...
2059 (symbol_code_props_output): ... this to eliminate duplicate code.
2060 (output_skeleton): Update to use symbol_code_props_output.
2061 * src/reader.c (symbol_should_be_used): Update use of
2062 symbol_destructor_get.
2063 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2064 Update uses of the various _destructor_set and _printer_set functions.
2065 * src/symtab.c: (default_tagged_destructor_location,
2066 default_tagless_destructor_location, default_tagged_printer_location,
2067 default_tagless_printer_location): Remove since we...
2068 (default_tagged_destructor, default_tagless_destructor,
2069 default_tagged_printer, default_tagless_printer): ... change the type
2070 of these to code_props.
2071 (symbol_new, semantic_type_new, symbol_destructor_set,
2072 semantic_type_destructor_set, symbol_destructor_get,
2073 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
2074 symbol_check_alias_consistency, default_tagged_destructor_set,
2075 default_tagless_destructor_set, default_tagged_printer_set,
2076 default_tagless_printer_set): Update.
2077 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
2078 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
2079 code_props members.
2080 (symbol_print): Use SYMBOL_CODE_PRINT.
2081
f6857bbf
JD
20822007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2083
2084 Use the new code_props interface for rule actions.
2085 * src/symlist.h (symbol_list): Replace action, action_location, and
2086 used members with a code_props action_props member.
2087 * src/reader.c (symbol_should_be_used, grammar_rule_check,
2088 grammar_midrule_action, grammar_current_rule_merge_set,
2089 grammar_current_rule_symbol_append, packgram): Update.
2090 * src/scan-code.h (translate_rule_action): Remove, no longer used.
2091 * src/scan-code.l (handle_action_dollar): Update.
2092 (translate_rule_action): Remove, no longer used.
2093 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
2094
7c0c6181
JD
20952007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2096
2097 Use the new code_props interface in parse-gram.y.
2098 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
2099 Update all uses of translate_* functions to use the new code_props
2100 interface and to use gram_scanner_last_string_free and
2101 code_scanner_last_string_free where possible.
2102 (grammar_declaration): symbol_list_destructor_set and
2103 symbol_list_printer_set now perform the translation, so don't do it
2104 here. Use gram_scanner_last_string_free where possible.
2105 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
2106 translate_code): Remove, no longer used.
2107 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
2108 symbol_list_printer_set): Perform code translation here rather than
2109 depending on the caller to do so.
2110
2111 * src/symlist.h (struct symbol_list): Correct some documentation typos.
2112 * src/scan-gram.h (gram_last_string): Remove declaration.
2113 * src/scan-gram.l (last_string): Declare it static.
2114
28e52c0d
JD
21152007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2116
2117 Encapsulate code properties and related functionality for the various
2118 destructors, printers, and actions into a code_props structure and
2119 interface. This patch merely implements code_props in scan-code.h and
2120 scan-code.l. Future patches will rewrite other modules to use it.
2121 Discussed starting at
2122 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
2123 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
2124 consistently initialize const structs that have an empty location
2125 field.
2126 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
2127 to ensure consistency.
2128 * src/scan-code.h (code_props): New structure.
2129 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
2130 function, macro, and const global variable for initializing a
2131 code_props with no code.
2132 (code_props_plain_init, code_props_symbol_action_init,
2133 code_props_rule_action_init, code_props_translate_code): The rest of
2134 the new code_props functional interface. Among other things, the init
2135 functions set the code_props kind field so that
2136 code_props_translate_code will know whether to behave like
2137 translate_symbol_action, translate_rule_action, or translate_code.
2138 These old translate functions must remain until all other modules are
2139 updated to use the new code_props interface.
2140 (code_scanner_last_string_free): New function similar to
2141 gram_scanner_last_string_free.
2142 (code_scanner_free): Add documentation.
2143 * src/scan-code.l: Implement the new interface.
2144 (code_lex): Make it static, add a code_props* argument, and remove the
2145 rule argument.
2146 (last_string): New static global similar to the one in scan-gram.l.
2147 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
2148 instead of rule.
2149 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
2150 code_props since Bison may one day use this information for destructors
2151 and printers.
2152 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
2153 (handle_action_dollar): Use symbol_list_n_get and set used flag
2154 directly since symbol_list_n_used_set is removed.
2155 (translate_action): Add a code_props* argument and remove the rule,
2156 action, and location arguments. Pass the code_props* on to code_lex.
2157 (translate_rule_action, translate_symbol_action, translate_code):
2158 Rewrite as wrappers around the new code_props interface.
2159 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
2160 it would eventually need to break the encapsulation of code_props.
2161
96034983
JD
21622007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2163
2164 * etc/.cvsignore: New.
2165
945e396c
JD
21662007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2167
2168 Add maintainer-push-check to run maintainer-check using push parsing in
2169 place of pull parsing where available.
2170 * Makefile.am (maintainer-push-check): New.
2171 * data/bison.m4 (b4_use_push_for_pull_if): New.
2172 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
2173 appropriately based on their existing values.
2174 (yypush_parse): Don't print push-parser-specific diagnostics if push
2175 parsing is being used in place of pull parsing.
2176 * data/yacc.c: If push parsing should replace pull parsing, redirect to
2177 push.c.
2178 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
2179 variable, and insert b4_use_push_for_pull_flag into muscles.
2180 * tests/Makefile.am (maintainer-push-check): New.
2181
7d596384
JD
21822006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2183
2184 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
2185 (whether successful or failed) so that yypush_parse can be invoked
2186 again to start a new parse using the same yypstate.
2187 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
2188 check multiple yypull_parse invocations on the same yypstate. For pull
2189 mode, extend to check multiple yyparse invocations.
2190 (Exploding the Stack Size with Alloca): Extend to try with
2191 %push-pull-parser.
2192 (Exploding the Stack Size with Malloc): Likewise.
2193
2194 * tests/calc.at (Simple LALR Calculator): Don't specify
2195 %skeleton "push.c" since %push-pull-parser implies that now.
2196 * tests/headers.at (export YYLTYPE): Don't check for the push
2197 declarations. Otherwise, this test case can't be used to see if push
2198 mode can truly emulate pull mode.
2199 * tests/input.at (Torturing the Scanner): Likewise.
2200 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
2201 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
2202 AT_YACC_IF, which now includes the case of push mode since %skeleton
2203 need not be used for push mode. This will be more intuitive once
2204 push.c is renamed to yacc.c.
2205
7172e23e
JD
22062006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2207
2208 For push mode, convert yyparse from a macro to a function, invoke yylex
2209 instead of passing a yylexp argument to yypull_parse, and don't
2210 generate yypull_parse or yyparse unless %push-pull-parser is declared.
2211 Discussed starting at
2212 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
2213 * data/bison.m4 (b4_pull_if): New.
2214 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
2215 * data/push.c: Improve M4 quoting a little.
2216 (b4_generate_macro_args, b4_parenthesize): Remove.
2217 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
2218 any time a pull parser is requested.
2219 Don't #define this as a wrapper around yypull_parse. Instead, when
2220 both push and pull are requested, make it a function that does that
2221 same thing.
2222 (yypull_parse): If there's a b4_prefix, #define this to
2223 b4_prefix[pull_parse] when both push and pull are requested.
2224 Don't define this as a function unless both push and pull are
2225 requested.
2226 Remove the yylexp argument and hard-code yylex invocation instead.
2227 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
2228 %push-parser.
2229 * src/getargs.c (pull_parser): New global initialized to true.
2230 * getargs.h (pull_parser): extern it.
2231 * src/output.c (prepare): Insert pull_flag muscle.
2232 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
2233 (prologue_declaration): Set both push_parser and pull_parser = true for
2234 %push-pull-parser. Set push_parser = true and pull_parser = false for
2235 %push-parser.
2236 * src/scan-gram.l: Don't accept %push_parser as an alternative to
2237 %push-parser since there's no backward-compatibility concern here.
2238 Scan %push-pull-parser.
2239 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
2240 instead of %push-parser.
2241 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
2242 prototype it in the module that calls yyparse.
2243 * tests/input.at (Torturing the Scanner): Likewise.
2244 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
2245
2e7944cb
JD
22462006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
2247
2248 Update etc/bench.pl. Optimize push mode a little (the yyn change
2249 deserves most of the credit).
2250 * Makefile.am (SUBDIRS): Add etc subdirectory.
2251 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
2252 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
2253 yytoken, yyval, and yyloc declarations to...
2254 (yyparse or yypush_parse): ... here to improve performance. For
2255 yypush_parse invocations after the first, be sure to assign yyn its old
2256 value again.
2257 (yypstate_new): Don't bother initializing the yyresult field since the
2258 initial value isn't used.
2259 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
2260 remove the #define that, in push mode, set it to yyps->NAME.
2261 * etc/Makefile.am: New.
2262 * etc/bench.pl: Remove and build it instead from...
2263 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
2264 "tests/bison" from the build directory by default rather than just
2265 invoking "bison" from $PATH.
2266 (calc_grammar): Update push parser code: don't declare yylval globally,
2267 don't define yyparse_wrapper, and don't #define yyparse.
2268 (bench_grammar): Update to check all working combinations of yacc.c,
2269 push.c, impure, pure, pull, and push.
2270
c3d50342
JD
22712006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2272
2273 For push mode, add pull wrappers around yypush_parse.
2274 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
2275 (yypull_parse): New function wrapping yypush_parse.
2276 (yyparse): New #define wrapping yypull_parse.
2277 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
2278 is declared.
2279 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
2280 prototype yylex in the module that calls yyparse, and don't prototype
2281 yyparse there. Otherwise, the yyparse expansion won't compile.
2282 * tests/input.at (Torturing the Scanner): Likewise.
2283
94ebeba5
JD
22842006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2285
2286 Enable push parsers to operate in impure mode. Thus, %push-parser no
2287 longer implies %pure-parser. The point of this change is to move
2288 towards being able to test the push parser code by running the entire
2289 test suite as if %push-parser had been declared.
2290 * data/push.c (yypush_parse): For impure mode, remove the
2291 yypushed_char, yypushed_val, and yypushed_loc arguments.
2292 Instead, declare these as local variables initialized to the global
2293 yychar, yylval, and yylloc.
2294 For the first yypush_parse invocation only, restore the initial values
2295 of these global variables when it's time to read a token since they
2296 have been overwritten.
2297 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
2298 %push-parser.
2299 * tests/calc.at (Simple LALR(1) Calculator): Always declare
2300 %pure-parser along with %push-parser since this test case was designed
2301 for pure push parsers.
2302 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
2303 (AT_YACC_OR_PUSH_IF): New.
2304 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
2305 add a note that it's still wrong for some cases (as it has been for a
2306 while).
2307 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
2308 %push-parser no longer implies %pure-parser.
2309
a0633178
JD
23102006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2311
2312 Remove some unnecessary differences between the pull parser code and
2313 the push parser code. This patch enables yynerrs in push mode.
2314 * data/push.c: Reformat M4 a little.
2315 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
2316 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
2317 because push mode is on. Instead, if pure mode is on, move yynerrs
2318 to...
2319 (b4_declare_parser_state_variables): ... here.
2320 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
2321 to yyps->NAME so it can be used in yypush_parse.
2322 (yypush_parse): Don't omit uses of yynerrs in push mode.
2323
8646b6a3
JD
23242006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2325
2326 Fix bug such that the first pushed token's value and location are
2327 sometimes overwritten (sometimes by %initial-action) before being used.
2328 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
2329 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
2330 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
2331 more closely mimic the pull parser logic.
2332 Don't copy the pushed token to yychar, yylval, and yylloc until it's
2333 time to read a token, which is after any initialization of yylval and
2334 yylloc.
2335 (gottoken): Rename label to...
2336 (yyread_pushed_token): ... for clarity and to avoid infringing on the
2337 user namespace.
2338
9baf4d74
JD
23392006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2340
2341 Rearrange initialization of the parser state variables so that the
2342 skeleton doesn't have to have a copy for pull mode and another for push
2343 mode. This patch also fixes at least a bug such that yylloc was not
2344 initialized (with b4_location_initial_line and
2345 b4_location_initial_column) upon calling yypush_parse. However, that
2346 initialization now overwrites the first token's location;
2347 %initial-action assigning @$ already did the same thing, and both bugs
2348 will be fixed in a later patch.
2349 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
2350 (b4_declare_parser_state_variables): Remove initialization of yytoken,
2351 yyss, yyvs, yyls, and yystacksize.
2352 (yypstate_new): Remove initialization of some yypstate fields: yystate,
2353 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
2354 yylsp.
2355 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
2356 yyps->NAME so it can be used in yypush_parse.
2357 (yyparse or yypush_parse): For yypush_parse, don't print the
2358 "Starting parse" diagnostic for invocations after the first.
2359 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
2360 yypush_parse, only do it for the first invocation.
2361 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
2362 initialization to occur in yypush_parse but only on the first
2363 invocation.
2364
23522164
JD
23652006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2366
2367 * data/push.c: Add CPP guards around push parser declarations in both
2368 the header and the code file.
2369 In the code file, move the push parser declarations to the same place
2370 they appear in the header file.
2371 Clean up the M4 some, especially the inconsistent underquoting in
2372 some b4_c_function_def and b4_c_function_decl uses.
2373
bb010fe5
JD
23742006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2375
2376 Encapsulate the push parser state variables into an M4 macro so the
2377 push skeleton doesn't have to list them again for pull mode's yyparse.
2378 For push mode, remove yypush_parse's local equivalents of these
2379 variables to eliminate unnecessary copying between the two sets at
2380 run-time. This patch also fixes at least a bug related to multiple
2381 %initial-action invocations in push mode.
2382 * data/push.c (b4_declare_parser_variables): Rename to...
2383 (b4_declare_scanner_communication_variables): ... this for clarity and
2384 update both uses.
2385 (b4_declare_yyparse_variables): Remove and move its contents to the one
2386 spot where it was invoked.
2387 (b4_declare_parser_state_variables): New macro containing the parser
2388 state variables required by push mode.
2389 (struct yypstate): Replace all fields but yynew with
2390 b4_declare_parser_state_variables.
2391 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
2392 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
2393 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
2394 (yyparse or yypush_parse): For yyparse in pull mode, replace local
2395 parser state variable declarations with
2396 b4_declare_parser_state_variables.
2397 Don't initialize parser state variables when calling yypush_parse since
2398 yypstate_new already does that.
2399 Invoke the user's initial action only upon the first yypush_parse
2400 invocation.
2401 Remove all code that copies between the local parser state variables
2402 and the yypstate.
2403
2d212f8c
JD
24042006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2405
2406 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
2407 prevent a name collision in a future patch where these names will
2408 sometimes be #define'd.
2409 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
2410 since it no longer has the same name as the existing argument.
2411 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
2412
e6e704dc
JD
24132006-12-19 Paolo Bonzini <bonzini@gnu.org>
2414 and Joel E. Denny <jdenny@ces.clemson.edu>
2415
2416 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2417 that the argument is case-insensitive, and there's no `=' here.
2418 For the %skeleton entry, mention that %language is better.
2419 (Bison Options): Likewise for --language and --skeleton. Move the
2420 --skeleton entry so that the `Tuning the parser' section is sorted
2421 alphabetically on long options.
2422 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
2423 %language directive in detail here; cross-reference the %language
2424 documentation instead.
2425 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
2426 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 2427 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
2428 * examples/extexi (normalize): Instead of replacing every %require
2429 argument with the current Bison version, just substitute for
2430 `@value{VERSION}'. This guarantees that we're testing what actually
2431 appears in the documentation.
2432 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
2433 rather than `@VERSION@'.
2434
0e021770
PE
24352006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2436
fd575f05
PE
2437 * NEWS: Reword the %language news a bit, and put it earlier.
2438
0e021770
PE
2439 * src/getargs.c (skeleton_arg): Last arg is now location const *.
2440 Rewrite to simplify the logic.
2441 (language_argmatch): Likewise.
fd575f05
PE
2442 (program_name): We now own this var.
2443 * src/getargs.h (struct bison_language): Use char[] rather than
2444 const char *.
0e021770
PE
2445
2446 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
2447 Java is supported.
2448 * src/complain.c (program_name): Remove decl; no longer needed.
2449 * src/main.c (program_name): Remove; now belongs to getargs.
2450
24512006-12-18 Paolo Bonzini <bonzini@gnu.org>
2452
2453 * NEWS: Document %language.
2454
2455 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
2456
2457 * data/c-skel.m4, data/c++-skel.m4: New files.
2458 * data/glr.c: Complain on push parsers.
2459
2460 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
2461 over %skeleton.
148d66d8 2462 (Decl Summary): Document %language and %skeleton.
0e021770
PE
2463 (Command line): Document -L.
2464
2465 * examples/extexi: Rewrite %require directive.
2466 * examples/calc++/Makefile.am: Pass VERSION to extexi.
2467
2468 * src/files.c (compute_exts_from_gc): Look in language structure
2469 for .y extension.
2470 (compute_file_name_parts): Check whether .tab should be added.
2471 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
2472 (language, skeleton_arg, language_argmatch): New.
2473 (long_options): Add --language.
2474 (getargs): Use skeleton_arg, add -L/--language.
2475 * src/getargs.h: Include location.h.
2476 (struct bison_language, language, skeleton_arg, language_argmatch): New.
2477 * src/output.c (prepare): Pick default skeleton from struct language.
2478 Don't dispatch C skeletons here.
2479 * src/parse-gram.y (PERCENT_LANGUAGE): New.
2480 (prologue_declaration): Add "%language" rule, use skeleton_arg.
2481 * src/scan-gram.l ("%language"): New rule.
2482
2483 * tests/calc.at: Test %skeleton and %language.
2484 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
2485 (AT_GLR_IF): Look for %skeleton "glr.cc".
2486 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
2487 (AT_YACC_IF): Reject %language.
2488
5691bf57
PE
24892006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2490
db06f0ce
PE
2491 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
2492 since it wasn't used; only the typedef name 'semantic_type' is needed.
2493 Also, omit trailing white space.
2494
5691bf57
PE
2495 * bootstrap: Sync from coreutils.
2496 (gnulib_extra_files): Add build-aux/announce.gen.
2497 (slurp): Adjust .gitignore files like .cvsignore files.
2498 * build-aux/announce-gen: Remove from CVS, since bootstrap
2499 now creates this.
2500
791934e4
JD
25012006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
2502
2503 Make %push-parser imply %pure-parser. This fixes several bugs; see
2504 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
2505 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
2506 pure_parser = true.
2507 * data/push.c: Don't bother testing b4_push_if when deciding whether
2508 to expand b4_declare_parser_variables globally.
2509 (yypush_parse): Likewise in here.
2510
2511 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
2512 (yy_reduce_print): Reformat M4 for readability.
2513
ee5abb37
JD
25142006-12-15 Bob Rossi <bob@brasko.net>
2515 and Joel Denny <jdenny@ces.clemson.edu>
2516
2517 * data/push.c (yypstate): Add typedef, and update all uses of
2518 struct yypstate to just yypstate.
2519 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
2520
16ca01f9
JD
25212006-12-14 Bob Rossi <bob@brasko.net>
2522
2523 * data/push.c (yypush_parse): Declare prototype regardless of
2524 %locations option.
2525
ab8e7e1a
JD
25262006-12-14 Bob Rossi <bob@brasko.net>
2527
2528 * data/push.c (yyparse): Remove the prototype and the #define when in
2529 push-parser mode.
2530
9bf32be3
JD
25312006-12-13 Bob Rossi <bob@brasko.net>
2532
2533 * data/push.c (yypstate_init): Rename to...
2534 (yypstate_new): ... this and use b4_c_function_def.
2535 (yypstate_delete): New.
2536 (yypush_parse): Change parameters yynval and yynlloc to be const.
2537 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
2538 yypstate_delete functions.
2539
f02e2948
JD
25402006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
2541
2542 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
2543 strange test case titles. Reported by Bob Rossi.
2544
38eb7751
PE
25452006-12-13 Paul Eggert <eggert@cs.ucla.edu>
2546
2547 * TODO: Add pointer to Sylvain Schmitz's work on static detection
2548 of potential ambiguities in GLR grammers.
2549
bd9d212b
JD
25502006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
2551
2552 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
2553 `bison ', use m4_index instead of m4_substr since chopping up a string
2554 containing M4-special characters causes problems here.
2555
2556 Fix a couple of bugs related to special characters in user-specified
2557 file names, and make it easier for skeletons to compute output file
2558 names with the same file name prefix as Bison-computed output file
2559 names.
2560 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
2561 b4_parser_file_name and b4_spec_defines_file instead of
2562 @output_parser_name@ and @output_header_name@, which are now redundant.
2563 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
2564 b4_parser_file_name, b4_spec_defines_file, and the new
2565 @basename(FILENAME@) instead of @output_parser_name@ and
2566 @output_header_name@, which inappropriately escaped the file names as
2567 C string literals.
2568 * src/files.c (all_but_ext): Remove static qualifier.
2569 (compute_output_file_names): Move `free (all_but_ext)' to...
2570 (output_file_names_free): ... here since all_but_ext is needed later.
2571 * src/files.h (all_but_ext): Extern.
2572 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
2573 exactly what MUSCLE_INSERT_STRING used to do.
2574 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
2575 characters are escaped properly.
2576 * src/output.c (prepare): Define muscle file_name_all_but_ext as
2577 all_but_ext.
2578 For pkgdatadir muscle, maintain previous functionality by using
2579 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
2580 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
2581 digraphs would never be expanded. Hopefully no one has M4-special
2582 characters in his Bison installation path.
2583 * src/scan-skel.l: Don't parse @output_header_name@ and
2584 @output_parser_name@ anymore since they're now redundant.
2585 In @output, use decode_at_digraphs.
2586 Parse a new @basename command that invokes last_component.
2587 (decode_at_digraphs): New.
2588 (BASE_QPUTS): Remove unused.
2589 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
2590 (Output file name): New tests.
2591
3f7ca628
JD
25922006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
2593
2594 Warn about output files that are generated by the skeletons and that
2595 conflict with other output files.
2596 * data/glr.c: Don't generate the header file here when glr.cc does.
2597 * src/files.c (file_names, file_names_count): New static globals.
2598 (compute_output_file_names): Invoke output_file_name_check for files
2599 not generated by the skeletons and remove existing checks.
2600 (output_file_name_check): New function that warns about conflicting
2601 output file names.
2602 (output_file_names_free): Free file_names.
2603 * src/files.h (output_file_name_check): Declare.
2604 * src/scan-skel.l: Invoke output_file_name_check for files generated by
2605 the skeletons.
2606 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
2607 (Conflicting output files): New tests.
2608
178e123e
PE
26092006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2610
2611 * doc/bison.texinfo: Fix a couple of typos.
2612
26132006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
2614
2615 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
2616 Rename to...
2617 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
2618 update all uses.
2619 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
2620 (yypush_parse): Rename yypvars argument to yyps and remove redundant
2621 local pv.
2622 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
2623 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
2624
ea17f233
JD
26252006-12-07 Bob Rossi <bob@brasko.net>
2626 and Joel Denny <jdenny@ces.clemson.edu>
2627
2628 * data/push.c (yypvarsinit): Change return type from void* to struct
2629 yypvars*. No longer cast to void* on return.
2630 (struct yypvars): Remove yylen since it need not be remembered between
2631 yypushparse invocations.
2632 (yypushparse): Don't copy between yylen and pv->yylen.
2633
55a30bda
JD
26342006-12-05 Bob Rossi <bob@brasko.net>
2635
2636 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
2637 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
2638 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
2639 (struct yypvars): Remove b4_declare_parser_variables.
2640 (yypvarsinit): Remove init code for removed variables.
2641 (global scope): Do not declare b4_declare_parser_variables if
2642 push or pure mode.
2643 (yypushparse): Add b4_declare_parser_variables.
2644 Init new local variables, and remove init code for removed
2645 yypvars variables.
2646 (yyparse): Delete.
2647 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2648 and yyparse for other modes.
2649 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2650 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2651 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2652 (AT_PURE_LEX_IF): True if pure or push parser.
2653
85894313
JD
26542006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2655
2656 Document Yacc prologue alternatives and default %destructor's and
2657 %printer's as experimental. Don't mention Java yet. Discussed at
2658 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2659 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2660 (2.3a): Annotate this entry to say the old forms of these features were
2661 also experimental.
2662 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 2663 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
2664 of Java (we'll want this back eventually).
2665
02975b9a
JD
26662006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2667
2668 Support a file name argument to %defines. Deprecate `=' in
2669 %file-prefix, %name-prefix, and %output. Discussed at
2670 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2671 * NEWS (2.3a+): Mention.
148d66d8 2672 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
2673 form of %defines, and remove `=' from entries for %file-prefix,
2674 %name-prefix, and %output.
2675 * src/parse-gram.y (prologue_declaration): Implement.
2676 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2677 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2678 all but one occurrence of %name-prefix.
2679 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2680 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2681 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2682 occurrence of each of %file-prefix and %output. Add check for %defines
2683 with argument.
2684 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2685 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2686 Remove the `=' from %output.
2687
287b314e
JD
26882006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2689
2690 Don't escape $ in test case titles since Autoconf 2.61 now does that
2691 correctly.
2692 * tests/actions.at (Default %printer and %destructor are not for error
2693 or $undefined): Here.
2694 (Default %printer and %destructor are not for $accept): Here.
2695 * tests/input.at (Invalid $n and @n): Here.
2696
3ebecc24
JD
26972006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2698
2699 Rename <!> to <>. Discussed starting at
2700 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2701 * NEWS (2.3a+): Update.
148d66d8 2702 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
2703 Update.
2704 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2705 * src/scan-gram.l (INITIAL): Implement.
2706 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2707 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2708 comment.
2709 * tests/actions.at (Default tagless %printer and %destructor,
2710 Default tagged and per-type %printer and %destructor,
2711 Default %printer and %destructor are not for error or $undefined,
2712 Default %printer and %destructor are not for $accept,
2713 Default %printer and %destructor for mid-rule values): Update.
2714 * tests/input.at (Default %printer and %destructor redeclared,
2715 Unused values with default %destructor): Update.
2716
26b8a438
JD
27172006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2718
2719 Don't let %prec take a nonterminal.
2720 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2721 token.
2722 * tests/input.at (%prec takes a token): New test checking that %prec
2723 won't take a nonterminal.
2724
07c39ae9
JD
27252006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2726
405d53b7
JD
2727 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2728 it was double-quoted.
07c39ae9
JD
2729 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2730 grammar is maintained with Bison's highest standards.
2731 * src/getargs.c: Fix some typos in Doxygen comments.
2732
580b8926
JD
27332006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2734
2735 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2736 later. Reported by Paul Eggert in
2737 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2738 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2739 * src/scan-code.l (translate_action): Don't bother invoking
2740 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2741 (code_scanner_free): Instead of invoking
2742 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2743 which frees more.
2744 * src/scan-gram.l (gram_scanner_free): Likewise.
2745 * src/scan-skel.l (scan_skel): Likewise.
2746
4502eadc
JD
27472006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2748
2749 * src/files.c (tr): Change return type to void.
2750 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2751 has been called previously for the same key.
2752 (muscle_find): Return storage instead of value so that
2753 --enable-gcc-warnings doesn't produce warnings that the return discards
2754 const. aver that the value and storage are the same since storage
2755 could potentially be NULL when value is not.
2756 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2757 same as 0.
2758
7746c8f6
PE
27592006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2760
2761 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2762 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2763 us a slightly cleaner distribution, and also works.
2764 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2765 gnulib changes.
2766
eb095650
PE
27672006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2768 and Paul Eggert <eggert@cs.ucla.edu>
2769
2770 Don't let Bison leak memory except when it complains.
2771 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2772 (spec_defines_file, dir_prefix): Now char *, not const char *,
2773 since they are freed.
2774 * src/files.c: Likewise.
2775 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2776 Likewise.
2777 (tr): Now operates in-place. All uses changed.
2778 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2779 values.
2780 (compute_file_name_parts, compute_output_file_names): Don't store
2781 read-only data in variables that will be freed.
2782 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2783 src_extension, and header_extension.
2784 (output_file_names_free): New public function to free
2785 spec_verbose_file, spec_graph_file, spec_defines_file,
2786 parser_file_name, and dir_prefix.
2787 * src/getargs.c (getargs): Don't store read-only data in variables that
2788 will be freed.
2789 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2790 (which previously existed but was unused), and quotearg_free.
2791 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2792 * src/muscle_tab.c: Likewise.
2793 (muscle_entry): Make the value char const *,
2794 and add a new storage member that is char * and can be freed.
2795 (muscle_entry_free): New private function.
2796 (muscle_init): Use it instead of free.
2797 (muscle_insert, muscle_grow): Update and use new storage member.
2798 (muscle_code_grow): Free the string passed to muscle_grow
2799 since it's not needed anymore.
2800 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2801 add a new `char *code' member.
2802 ("{...}"): Declare semantic type as code.
2803 * src/scan-code.h (translate_rule_action):
2804 (translate_symbol_action, translate_code, translate_action): Return
2805 `char const *' rather than `char *' since external code should not free
2806 these strings.
2807 * src/scan-code.l: Likewise.
2808 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2809 which is "{...}" in the parser.
2810 * tests/Makefile.am (maintainer-check-valgrind): Set
2811 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2812 Valgrind.
2813 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2814 complain.
2815 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2816 expecting a non-zero exit status sets --leak-check=summary and
2817 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
2818 this case, and we don't want to hear about it.
2819
ac564be4
PE
28202006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2821
2822 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
2823 instead of from the template, to simplify configuration a bit.
2824 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
2825 and m4/wint_t.m4, as they are needed with the latest gnulib.
2826
17bd8a73
JD
28272006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2828
2829 Disable unset/unused mid-rule value warnings by default, and recognize
2830 --warnings=midrule-values to enable them. Discussed starting at
2831 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
2832 * NEWS (2.3a+): Mention.
2833 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
2834 warnings): Add entry for midrule-values subargument.
2835 * src/reader.c (symbol_should_be_used): Don't return true just because
2836 the value is a set/used mid-rule value unless
2837 --warnings=midrule-values was specified.
2838 * tests/input.at (Unused values, Unused values before symbol
2839 declarations): Run tests with and without --warnings=midrule-values.
2840
2841 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
2842 than LIST_FREE directly.
2843
89eb3c76
JD
28442006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2845
2846 Finish implementing --warnings=error, which should not be implied by
2847 --warnings=all (or by its synonyms -W and --warnings without
2848 subarguments).
2849 * src/complain.c (set_warning_issued): New function to report that
2850 warnings are being treated as errors and to record an error if so.
2851 Invoke...
2852 (warn_at, warn): ... here.
2853 * src/getargs.c (warnings_args, warnings_types): Reorder so that
2854 "error - warnings are errors" does not appear above "all - all of the
2855 above".
2856 (getargs): For -W and --warnings without subarguments, don't let
2857 FLAGS_ARGMATCH set warnings_error in warnings_flag.
2858 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
2859
ba7560e2
JD
28602006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2861
2862 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
2863 empty subargument list. For example: `bison --warnings= parser.y'.
2864
31283fc3
JD
28652006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2866
2867 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
2868 the parser header file so that gcc doesn't warn.
2869
12e35840
JD
28702006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2871
2872 Split the default %destructor/%printer into two kinds: <*> and <!>.
2873 Discussed starting at
2874 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
2875 * NEWS (2.3a+): Mention.
2876 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
2877 previous change today related to mid-rules.
148d66d8 2878 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 2879 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
2880 (TYPE_TAG_ANY): Add as <*>.
2881 (TYPE_TAG_NONE): Add as <!>.
2882 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
2883 for <*> and <!>.
2884 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
2885 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
2886 * src/symlist.c (symbol_list_default_new): Split into tagged and
2887 tagless versions.
2888 (symbol_list_destructor_set, symbol_list_printer_set): Split
2889 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
2890 SYMLIST_DEFAULT_TAGLESS.
2891 * src/symlist.h: Update symbol_list_default*_new prototypes.
2892 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
2893 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
2894 * src/symtab.c (default_destructor, default_destructor_location,
2895 default_printer, default_printer_location): Split each into tagged and
2896 tagless versions.
2897 (symbol_destructor_get, symbol_destructor_location_get,
2898 symbol_printer_get, symbol_printer_location_get): Implement tagged
2899 default and tagless default cases.
2900 (default_destructor_set, default_printer_set): Split each into tagged
2901 and tagless versions.
2902 * src/symtab.h: Update prototypes.
2903 * tests/actions.at (Default %printer and %destructor): Rename to...
2904 (Default tagless %printer and %destructor): ... this, and extend.
2905 (Per-type %printer and %destructor): Rename to...
2906 (Default tagged and per-type %printer and %destructor): ... this, and
2907 extend.
2908 (Default %printer and %destructor for user-defined end token): Extend.
2909 (Default %printer and %destructor are not for error or $undefined):
2910 Update.
2911 (Default %printer and %destructor are not for $accept): Update.
2912 (Default %printer and %destructor for mid-rule values): Extend.
2913 * tests/input.at (Default %printer and %destructor redeclared): Extend.
2914 (Unused values with default %destructor): Extend.
2915
f91b1629
JD
29162006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2917
2918 Don't apply the default %destructor/%printer to an unreferenced midrule
2919 value. Mentioned at
2920 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
2921 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
2922 like $@n instead of just @n so that the default %destructor/%printer
2923 logic doesn't see them as user-defined symbols.
2924 (symbol_is_dummy): Check for both forms of the name.
2925 * src/reader.c (packgram): Remove the `$' from each midrule symbol
2926 name for which the midrule value is referenced in any action.
2927 * tests/actions.at (Default %printer and %destructor for mid-rule
2928 values): New test.
2929 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
2930 for change to dummy symbol names.
2931
519d0004
JD
29322006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2933
2934 Warn about unset midrule $$ if the corresponding $n is used.
2935 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
2936 $n usage.
2937 (packgram): Before invoking grammar_rule_check on any rule, make sure
2938 all actions have already been scanned in order to set `used' flags.
2939 Otherwise, checking that a midrule's $$ is set will not always work
2940 properly because the midrule check must forward-reference the midrule's
2941 parent rule.
2942 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
2943 warning.
2944
a501eca9
JD
29452006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2946
2947 More improvements to the documentation of the prologue alternatives:
2948 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
2949 Bison manual.
2950 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
2951 some text to clarify the relative importance of the new directives and
2952 to show how these directives may be viewed as code labels.
2953
2cbe6b7f
JD
29542006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
2955
2956 Similar to the recently removed %before-header, add %code-top as the
2957 alternative to the pre-prologue. Mentioned at
2958 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
2959 Also, let the prologue alternatives appear in the grammar section.
2960 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
2961 (prologue_declaration): Move the existing prologue alternatives to...
2962 (grammar_declaration): ... here and add %code-top.
2963 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
2964
2965 Clean up and extend documentation for the prologue alternatives.
2966 * NEWS (2.3a+): Describe prologue alternatives.
2967 * doc/bison.texinfo (Prologue): Move discussion of prologue
2968 alternatives to...
2969 (Prologue Alternatives): ... this new section, and extend it to discuss
2970 all 4 directives in detail.
148d66d8
JD
2971 (Table of Symbols): Clean up discussion of prologue alternatives and
2972 add %code-top.
2cbe6b7f 2973
e557d3ea
JMG
29742006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2975
2976 DJGPP specific issues.
2977
2978 * djgpp/config.bat: config.hin has been moved to lib. Adjust
2979 config.bat accordingly.
2980 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
2981 * djgpp/config.site: Likewise.
2982
136a0f76
PB
29832006-10-16 Paolo Bonzini <bonzini@gnu.org>
2984
27bd5d67
PB
2985 Replace %*-header with %provides, %requires, %code. See discussion at
2986 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
2987
136a0f76
PB
2988 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
2989 (b4_user_start_header): Remove.
2990 * data/glr.c: Use new macros instead of b4_*start_header
2991 and b4_*end_header.
2992 * data/glr.cc: Likewise.
2993 * data/lalr1.cc: Likewise.
2994 * data/push.c: Likewise.
2995 * data/yacc.c: Likewise.
2996
2997 * doc/bison.texinfo: Remove %before-header, rename
2998 %{start,end,after}-header to %requires, %provides, %code.
2999
3000 * src/parse-gram.y: Likewise (also rename token names accordingly).
3001 * src/scan-gram.l: Likewise.
3002 * tests/actions.at: Likewise.
3003
10f429ef
PE
30042006-10-14 Paul Eggert <eggert@cs.ucla.edu>
3005
3006 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
3007 Problem reported by Joel E. Denny.
3008
30092006-10-14 Jim Meyering <jim@meyering.net>
3010
3011 (Sync from coreutils.)
3012 Work also when the working directory (with e.g. coreutils sources)
3013 is version controlled with git, rather than CVS.
3014 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
3015 rather than CVS.
3016 In messages and comments, say e.g., "checked-out sources",
3017 rather than "CVS sources".
3018 (version_controlled_file): New function. Work for git as well as
3019 for CVS. Don't use grep's -q option.
3020 (slurp): Call it here, in place of CVS-specific code.
3021
c4bd5bf7
JD
30222006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
3023
3024 Fix testsuite for ./configure --enable-gcc-warnings:
3025 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
3026 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
3027 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
3028 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
3029 * test/regression.at (Diagnostic that expects two alternatives):
3030 Likewise.
3031
46356ea4
PE
30322006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3033
231ed89a
PE
3034 * bootstrap.conf (gnulib_modules): Add config-h.
3035 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
3036 worry about HAVE_CONFIG_H.
3037 * lib/abitset.c: Likewise.
3038 * lib/bitset.c: Likewise.
3039 * lib/bitset_stats.c: Likewise.
3040 * lib/bitsetv-print.c: Likewise.
3041 * lib/bitsetv.c: Likewise.
3042 * lib/ebitset.c: Likewise.
3043 * lib/get-errno.c: Likewise.
3044 * lib/lbitset.c: Likewise.
3045 * lib/subpipe.c: Likewise.
3046 * lib/timevar.c: Likewise.
3047 * lib/vbitset.c: Likewise.
3048 * lib/bitset.c: Include "bitset.h" first, to test interface.
3049 * lib/bitset_stats.c: Include "bitset_stats.h" first.
3050 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
3051 * lib/bitsetv.c: Include "bitsetv.h" first.
3052 * lib/get-errno.c: Include "get-errno.h" first.
3053 * m4/.cvsignore: Add config-h.m4.
3054 * tests/actions.at (Default %printer and %destructor for ...):
3055 Adjust expected line numbers in output to reflect removal of #if
3056 HAVE_CONFIG_H lines.
3057 * tests/glr-regression.at (Missed %merge type warnings when ...):
3058 Likewise.
3059 * tests/regression.at (Braced code in declaration in rules section):
3060 Likewise.
3061 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
3062 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
3063 Include <config.h> unconditionally.
3064
46356ea4
PE
3065 * bootstrap: Sync from coreutils, as follows:
3066
3067 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3068
3069 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
3070 variable was sometimes used without being initialized. This
3071 messed up the installation of the INSTALL file in some cases.
3072
3073 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3074
3075 * bootstrap (usage, main program, symlink_to_gnulib): Add option
3076 --copy. Inspired by a suggestion from Bruno Haible.
3077
3078 2006-10-03 Jim Meyering <jim@meyering.net>
3079
3080 * bootstrap: Undo last change to this file, since now gnulib-tool
3081 sticks with the automake default in generating dependencies.
3082
dd4bf078
PE
30832006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3084
cf2a5f7c
PE
3085 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
3086 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
3087
3088 * doc/bison.1: Add copyright notice.
3089
3090 * data/glr.c: Don't include <stdarg.h>; not used.
3091
35fe0834
PE
3092 * NEWS: The -g and --graph options now output graphs in Graphviz
3093 DOT format, not VCG format.
3094 * doc/bison.1: Likewise.
3095 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
3096 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
3097 of this change in
3098 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
3099 * TODO: Remove Graphviz entry.
3100 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
3101 remove vcg.c, vcg.h, vcg_defaults.h.
3102 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
3103 * src/graphviz.c, src/graphviz.h: New files.
3104 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
3105 * src/files.h: Make comment more generic.
3106 * src/main.c (main): Likewise.
3107 * src/print_graph.h: Likewise.
3108 * src/getargs.c (usage): Make usage description more generic.
3109 * src/print_graph.c: Include graphviz.h rather than vcg.h.
3110 (static_graph, fgraph): Remove. All uses changed to pass
3111 arguments instead of sharing a static var.
3112 (print_core, print_actions, print_state, print_graph):
3113 Output graphviz format rather than VCG format.
3114 * tests/.cvsignore: Remove *.vcg; add *.dot.
3115 * tests/output.at: Expect *.dot files, not *.vcg files.
3116
dd4bf078
PE
3117 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
3118 accommodates the 2006-10-08 change.
3119
efdd7421
PE
31202006-10-11 Bob Rossi <bob@brasko.net>
3121
3122 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
3123 (b4_yyssa, b4_yyerror_range): New macros.
3124 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
3125 (yypvarsinit): Remove init of removed fields.
3126 (yypushparse): Remove use of removed fields; use new macros instead.
3127
96a1981a
PE
31282006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3129
3130 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
3131 in a push parser. Reindent slightly to match yacc.c better.
3132
31332006-10-11 Bob Rossi <bob@brasko.net>
3134
46356ea4
PE
3135 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
3136 yymsg_alloc fields.
3137 (yypvarsinit, yypushparse): Remove init of removed fields.
3138 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 3139
c1630a8b
PE
31402006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3141
3142 * THANKS: Add Paolo Bonzini and Bob Rossi.
3143
90b9908d
PB
31442006-10-08 Paolo Bonzini <bonzini@gnu.org>
3145
3146 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
3147 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
3148 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
3149 b4_define_user_cde and uses): Remove.
3150 (b4_comment, b4_prefix, b4_sync_start): New.
3151 * data/bison.m4: New file, with most of the content removed from c.m4.
3152 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
3153 * src/output.c (output_skeleton): Pass bison.m4.
3154 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
3155 only if specified.
3156
cf806753
PE
31572006-10-05 Paul Eggert <eggert@cs.ucla.edu>
3158
3159 Fix test failure reported by Tom Lane in
3160 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
3161 and try to make such failures easier to catch in the future.
3162 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
3163 that's now the caller's responsibility.
3164 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
3165 Set yychar = YYEOF if it's negative.
3166 * tests/actions.at (yylex): Abort if asked to read past EOF.
3167 * tests/conflicts.at (yylex): Likewise.
3168 * tests/cxx-type.at (yylex): Likewise.
3169 * tests/glr-regression.at (yylex): Likewise.
3170 * tests/input.at (yylex): Likewise.
3171 * tests/regression.at (yylex): Likewise.
3172 * tests/torture.at (yylex): Likewise.
3173
0e2f006a
PE
31742006-10-01 Paul Eggert <eggert@cs.ucla.edu>
3175
3176 Fix problems with translating English-language diagnostics.
3177 * bootstrap: Fix bug introduced in recent bootstrap changes, with
3178 respect to bison-runtime pot generation. The YY_ stuff
3179 wasn't being captured.
3180 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
3181 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
3182 * runtime-po/POTFILES.in: Add data/push.c.
3183
e3ddc1e3
PE
31842006-09-29 Paul Eggert <eggert@cs.ucla.edu>
3185
3186 Merge bootstrap changes from coreutils.
3187
3188 2006-09-28 Jim Meyering <jim@meyering.net>
3189
3190 Automatically generated dependencies are important even
3191 when all of the sources in a directory come from gnulib.
3192 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
3193 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
3194
3195 2006-09-23 Jim Meyering <jim@meyering.net>
3196
3197 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
3198
3199 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3200
3201 * bootstrap: Add support for --force.
3202 (usage): New function. Describe usage less tersely.
3203 (CVS_only_file): New var.
3204
01e972b3
PE
32052006-09-21 Paul Eggert <eggert@cs.ucla.edu>
3206
3207 * data/push.c (YYPUSH_MORE): Make it an enum instead.
3208 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
3209 Adjust white space and comments to match GNU style better.
3210
c63d3e90
PE
32112006-09-20 Bob Rossi <bob@brasko.net>
3212
3213 * data/push.c (yyresult_get): Remove function.
3214 (YYPUSH_MORE): Add #define.
3215 (yypushparse): Modify return value.
3216
e70f46d1
PE
32172006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3218
3219 * stamp-h.in: Remove; no longer needed.
3220 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
3221 Remove config.h, config.hin, intl (no longer created).
3222 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
3223 stamp-h1.
3224
3225 Sync bootstrap from coreutils, as follows:
3226
3227 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
3228
3229 * bootstrap (symlink_to_gnulib): New function.
3230 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
3231 to copies-of-gnulib.
3232 (cp_mark_as_generated, slurp, gnulib_files):
3233 Avoid making a copy if it's the same as the old version.
3234 (gnulib_files): Add support for this variable (used by Bison).
3235
a92be413
PE
32362006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3237
3238 * src/getargs.c (usage): Rework to use conventions similar to
3239 coreutils, to make translation a bit easier and the code a bit
3240 smaller. Problem reported by Tim Van Holder.
3241
4f82b42a
PE
32422006-09-15 Paul Eggert <eggert@cs.ucla.edu>
3243
3b2942e6
PE
3244 Use some of gnulib's new modules, taken from coreutils.
3245
3246 * bootstrap: Sync from coreutils, except add support for gnulib_files.
3247 * bootstrap.conf: New file.
3248 (gnulib_modules): Add configmake, inttypes, unistd.
3249 (XGETTEXT_OPTIONS): Add complain, complain_at,
3250 fatal, fatal_at, warn, warn_at, unexpected_end.
3251 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
3252 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
3253 (gl_EARLY): Add.
3254 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
3255 (gl_INIT): Add
3256 (GNULIB_AUTOCONF_SNIPPET): Remove.
3257 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
3258 the pickiest.
3259 * lib/.cvsignore: Add inttypes_.h.
3260 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
3261 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
3262 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
3263 no-longer-necessary initializations.
3264 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
3265 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
3266 use the unistd module.
3267 * src/system.h: Likewise.
3268 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
3269 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
3270 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
3271 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
3272 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
3273 * src/system.h: Include inttypes.h unconditionally, now that we
3274 use the inttypes module. Don't bother to include stdint.h, since
3275 inttypes.h now does that for us.
3276 (LOCALEDIR): Remove, now that we use the configmake module.
3277 * src/getargs.c: Include configmake.h.
3278 * src/main.c: Likewise.
3279 * src/output.c: Likewise.
3280 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
3281 not from $abs_top_builddir, since config.h moved.
3282
3283
4f82b42a
PE
3284 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
3285 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
3286
3287 * src/parse-gram.y (symbol_declaration): Don't put statements
3288 before declarations; it's not portable to C89.
3289 * src/scan-code.l (handle_action_at): Likewise.
3290
3291 * src/scan-code.l: Always initialize braces_level; the old code
3292 left it uninitialized and therefore had undefined behavior.
3293
3294 Don't attempt to redefine 'assert', since it runs afoul of
3295 systems where standard headers (mistakenly) include <assert.h>.
3296 Instead, define and use our own alternative, called 'aver'.
3297 * src/reader.c: Don't include assert.h, since we no longer
3298 use assert.
3299 * src/scan-code.l: Likewise.
3300 * src/system.h (assert): Remove, replacing with....
3301 (aver): New function, taking a bool arg. All uses changed.
3302 * src/tables.c (pack_vector): Ensure that aver arg is bool,
3303 not merely an integer.
3304
31c10e38
PE
33052006-09-15 Bob Rossi <bob@brasko.net>
3306
3307 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
3308 * data/c.m4 (YYPUSH): New.
3309 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
3310 * src/getargs.c (push_parser): New var.
3311 * src/getargs.h (push_parser): New declaration.
3312 * src/output.c (prepare): Add macro insertion of `push_flag'.
3313 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
3314 (prologue_declaration): Parse %push-parser.
3315 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
3316 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
3317 list of removed lines from the traces observed.
3318 (AT_CHECK_CALC_LALR): Added push parser tests.
3319
fa7b79c0
PE
33202006-09-13 Paul Eggert <eggert@cs.ucla.edu>
3321
21fe08ca
PE
3322 * NEWS: Version 2.3a.
3323 * configure.ac (AC_INIT): Likewise.
3324
e8ec4d9b
PE
3325 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
3326 "#define YYSTYPE int" that caused "make maintainer-check" to fail
3327 due to header ordering dependencies. I don't know why the #define
3328 was there.
3329
fa7b79c0
PE
3330 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
3331 runtime cost when YYDEBUG is not defined, and so that some tests
3332 that used to fail now work. Problem and initial suggestion by
3333 Paolo Bonzini.
3334 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
3335 * data/glr.cc (b4_parser_class_name):
3336 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
3337 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
3338 (yydebug_) [YYDEBUG]: New member.
3339 (yycdebug_): Now defined only if YYDEBUG.
3340 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
3341 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
3342 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
3343 if YYYDEBUG.
3344 (debug_stream, set_debug_stream, debug_level, set_debug_level):
3345 Define only if YYDEBUG.
3346 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
3347 set_debug_level.
3348 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
3349 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
3350 AT_CHECK_CALC_GLR_CC that are working now.
3351
4ec13d60
PE
33522006-09-12 Paul Eggert <eggert@cs.ucla.edu>
3353
3354 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
3355 We don't need them in glr.cc, and glr.c defines them.
3356 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
3357 assumes that defining it to anything is the same as defining
3358 it to 1. Problem reported by Paolo Bonzini.
3359
8e1687ae
PE
33602006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
3361
3362 * data/c.m4 (b4_null, b4_case): Define.
3363 * src/output.c (prepare_symbols): Use b4_null.
3364 (user_actions_output): Use b4_case.
3365
3dc5e96b
PE
33662006-09-11 Paul Eggert <eggert@cs.ucla.edu>
3367
aef3da86
PE
3368 * data/glr.c (b4_shared_declarations): Put start-header first,
3369 before any #includes that we generate, so that feature-test
3370 macros work. Problem reported by Michael Deutschmann in
3371 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
3372 * data/lalr1.cc: Likewise.
3373 * doc/bison.texinfo (Prologue): Document that feature-test macros
3374 should be defined before any Bison declarations.
3375 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
3376 that depend on location.hh after, not before, Bison decls, since
3377 we now include location.hh after the first user prologue.
3378
3dc5e96b
PE
3379 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
3380 Sander Brandenburg in
3381 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
3382 Also, fix minor white space and comment issues.
aef3da86
PE
3383 (Prologue): Mention that it's better to define feature-test macros
3384 before Bison declarations. Problem reported by Michael Deutschmann.
3385
3386 * README-cvs: Fix typo: "&" should be "&&". Problem reported
3387 by Jim Meyering.
3388 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
3389 This adjusts to recent gnulib changes.
3dc5e96b 3390
b2a0b7ca
JD
33912006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3392
3393 Finish implementation of per-type %destructor/%printer. Discussed
3394 starting at
3395 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
3396 and
3397 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
3398 * NEWS (2.3+): Add a description of this feature to the default
3399 %destructor/%printer description.
3400 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
3401 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3402 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
3403 list node contains a semantic type.
3404 * src/symtab.c, src/symtab.h: Extend with a table that associates
3405 semantic types with their %destructor's and %printer's.
3406 (semantic_type_from_uniqstr, semantic_type_get,
3407 semantic_type_destructor_set, semantic_type_printer_set): New functions
3408 composing the public interface of that table.
3409 (symbol_destructor_get, symbol_destructor_location_get,
3410 symbol_printer_get, symbol_printer_location_get): If there's no
3411 per-symbol %destructor/%printer, look up the per-type before trying
3412 the default.
3413 * tests/actions.at (Per-type %printer and %destructor): New test case.
3414 * tests/input.at (Default %printer and %destructor redeclared):
3415 Extend to check that multiple occurrences of %symbol-default in a
3416 single %destructor/%printer declaration is an error.
3417 (Per-type %printer and %destructor redeclared, Unused values with
3418 per-type %destructor): New test cases.
3419
3be03b13
JD
34202006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3421
3422 Require default %destructor/%printer to be declared using
3423 %symbol-default instead of an empty symbol list, and start working on
3424 new per-type %destructor/%printer. Discussed at
3425 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
3426 * NEWS (2.3+): Add %symbol-default to example.
3427 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 3428 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
3429 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
3430 (generic_symlist, generic_symlist_item): New nonterminals for creating
3431 a list in which each item is a symbol, semantic type, or
3432 %symbol-default.
3433 (grammar_declaration): Use generic_symlist in %destructor and %printer
3434 declarations instead of symbols.1 or an empty list.
3435 (symbol_declaration, precedence_declaration, symbols.1): Update actions
3436 for changes to symbol_list.
3437 * src/reader.c: Update for changes to symbol_list.
3438 * src/scan-code.l: Likewise.
3439 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
3440 * src/symlist.c, src/symlist.h: Extend such that a list node may
3441 represent a semantic type or a %symbol-default in addition to just an
3442 ordinary symbol. Add switched functions for setting %destructor's and
3443 %printer's.
3444 * tests/actions.at, tests/input.at: Add %symbol-default to all default
3445 %destructor/%printer declarations.
3446
3508ce36
JD
34472006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
3448
3449 Whether the default %destructor/%printer applies to a particular symbol
3450 isn't a question of whether the user *declares* that symbol (in %token,
3451 for example). It's a question of whether the user by any means
3452 *defines* the symbol at all (by simply using a char token, for
3453 example). $end is defined by Bison whereas any other token with token
3454 number 0 is defined by the user. The error token is always defined by
3455 Bison regardless of whether the user declares it with %token, but we
3456 may one day let the user define error as a nonterminal instead.
3457 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
3458 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
3459 the meaning of "user-defined".
3460 * tests/actions.at (Default %printer and %destructor for user-declared
3461 end token): Rename to...
3462 (Default %printer and %destructor for user-defined end token): ...
3463 this.
3464
3465 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
3466 computation of whether to apply the default, don't maintain a list of
3467 every Bison-defined symbol. Instead, just check for a first character
3468 of '$', which a user symbol cannot have, and check for the error token.
3469
9350499c
JD
34702006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
3471
3472 Don't apply the default %destructor or %printer to the error token,
3473 $undefined, or $accept. This change fits the general rule that the
3474 default %destructor and %printer are only for user-declared symbols,
3475 and it solves several difficulties that are described in the new test
3476 cases listed below.
3477 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
3478 * tests/actions.at (Default %printer and %destructor are not for error
3479 or $undefined, Default %printer and %destructor are not for $accept):
3480 New test cases.
3481
4d7370cb
JD
34822006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
3483
3484 Allow %start after the first rule.
3485 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
3486 when parsing the first rule.
3487 (check_and_convert_grammar): Search for it here after all grammar
3488 declarations have been parsed. Skip midrules, which have dummy LHS
3489 nonterminals.
3490 * src/symtab.c (symbol_is_dummy): New function.
3491 * src/symtab.h (symbol_is_dummy): Declare it.
3492 * tests/input.at (%start after first rule): New test.
3493
6d0ef4ec
JD
34942006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3495
3496 Redo some of the previous commit: add back the ability to use
3497 non-aliased/undeclared string literals since it might be useful to
3498 those declaring %token-table.
3499 * src/reader.c (check_and_convert_grammar): Undo changes in previous
3500 commit: don't worry about complaints from symbols_pack.
3501 * src/symtab.c (symbol_new, symbol_class_set,
3502 symbol_check_alias_consistency): Undo changes in previous commit: count
3503 each string literal as a new symbol and token, assign it a symbol
3504 number, and don't complain about non-aliased string literals.
3505 (symbols_pack): Since symbol_make_alias still does not decrement symbol
3506 and token counts but does still set aliased tokens to the same number,
3507 symbol_pack_processor now leaves empty slots in the symbols array.
3508 Remove those slots.
3509 * tests/regression.at (Undeclared string literal): Remove test case
3510 added in previous commit since non-aliased string literals are allowed
3511 again.
3512 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
3513 remove unnecessary string literal declarations.
3514 * tests/sets.at (Firsts): Likewise.
3515
965537bc
JD
35162006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3517
3518 Don't allow an undeclared string literal, but allow a string literal to
3519 be used before its declaration.
3520 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
3521 symbols_pack complained.
3522 * src/symtab.c (symbol_new): Don't count a string literal as a new
3523 symbol.
3524 (symbol_class_set): Don't count a string literal as a new token, and
3525 don't assign it a symbol number since symbol_make_alias does that.
3526 (symbol_make_alias): It's not necessary to decrement the symbol and
3527 token counts anymore. Don't assume that an alias declaration occurs
3528 before any uses of the identifier or string, and thus don't assert that
3529 one of them has the highest symbol number so far.
3530 (symbol_check_alias_consistency): Complain if there's a string literal
3531 that wasn't declared as an alias.
3532 (symbols_pack): Bail if symbol_check_alias_consistency failed since
3533 symbol_pack asserts that every token has been assigned a symbol number
3534 although undeclared string literals have not.
3535 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 3536 string literal): New test cases.
965537bc
JD
3537 (Characters Escapes, Web2c Actions): Declare string literals as
3538 aliases.
3539 * tests/sets.at (Firsts): Likewise.
3540
47aee066
JD
35412006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
3542
3543 In the grammar scanner, STRING_FINISH unclosed constructs and return
3544 them to the parser in order to improve error messages.
3545 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
3546 SC_BRACED_CODE, SC_PROLOGUE): Implement.
3547 * tests/input.at (Unclosed constructs): New test case.
3548 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
3549 seen.
3550
3551 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
3552 unused global.
3553
1f6b3679
JD
35542006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
3555
3556 Handle string aliases for character tokens correctly.
3557 * src/symtab.c (symbol_user_token_number_set): If the token has an
3558 alias, check and set its alias's user token number instead of its own,
3559 which is set to indicate the alias. Previously, every occurrence of
3560 the character token in the grammar overwrote that alias indicator with
3561 the character code.
3562 * tests/input.at (String aliases for character tokens): New test.
3563
219741d8
JD
35642006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
3565
3566 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
3567
11daa4e7
PE
35682006-08-11 Paul Eggert <eggert@cs.ucla.edu>
3569
3570 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
3571 to prevent failures when building on older platforms.
3572 Check for autopoint failure.
3573 Set XGETTEXT_OPTIONS to values that check for C format strings,
3574 so that translators are warned about them (this also helps
3575 prevent core dumps).
3576
3577 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
3578 function, since it simplifies our code a bit.
3579
3580 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
3581 rather than -W, so we don't get bogus warnings about sign comparisons.
3582 Add -Wpointer-arith, since that warning is useful (it reports code
3583 that does not conform to C89 and that some compilers reject).
3584 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
3585 since it's no longer needed.
3586
f9bfc42a
JD
35872006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
3588
3589 Clean up scanners a bit.
3590 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
3591 definitions so gcc won't warn when obstack_for_string is unused.
3592 * src/scan-code.l: config.h and system.h are already #include'd by
3593 scan-code-c.c, so get rid of them here.
3594 * src/scan-gram.l: Likewise.
3595 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
3596 definitions rather than duplicating the rest of it.
3597 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
3598
06e8700a
JD
35992006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
3600
3601 Suppress signed/unsigned comparison warnings for yycheck.
3602 * data/c.m4 (b4_safest_int_type): New macro.
3603 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
3604 a signed int type, cast it to b4_safest_int_type first.
3605 * data/yacc.c: Likewise.
3606 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
3607 also overwritten.
3608
9c437126
PE
36092006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3610
3611 * doc/bison.texinfo: Fix some typos.
3612
284d8a13
PE
36132006-08-02 Paul Eggert <eggert@cs.ucla.edu>
3614
3615 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
3616 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
3617
3618 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
3619 the latest gnulib does this a different way.
3620 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
3621 translation was patched, so stop omitting it.
3622
ec5479ce
JD
36232006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3624
3625 Enable declaration of default %printer/%destructor. Make the parser
3626 use these for all user-declared grammar symbols for which the user does
3627 not declare a specific %printer/%destructor. Thus, the parser uses it
3628 for token 0 if the user declares it but not if Bison generates it as
3629 $end. Discussed starting at
3630 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
3631 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
3632 and
3633 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
3634 * NEWS (2.3+): Mention.
3635 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
3636 declare a %destructor for a mid-rule's semantic value. It's just
3637 impossible to declare one specific to it.
3638 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
3639 code. Describe default %destructor form.
3640 * src/parse-gram.y (grammar_declaration): Parse default
3641 %printer/%destructor declarations.
3642 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
3643 and symbol_destructor_location_get rather than accessing the destructor
3644 and destructor_location members of struct symbol.
3645 (symbol_printers_output): Likewise but for %printer's.
3646 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3647 again.
3648 * src/symtab.c (default_destructor, default_destructor_location,
3649 default_printer, default_printer_location): New static global
3650 variables to record the default %destructor and %printer.
3651 (symbol_destructor_get, symbol_destructor_location_get,
3652 symbol_printer_get, symbol_printer_location_get): New functions to
3653 compute the appropriate %destructor and %printer for a symbol.
3654 (default_destructor_set, default_printer_set): New functions to set the
3655 default %destructor and %printer.
3656 * src/symtab.h: Prototype all those new functions.
3657 * tests/actions.at (Default %printer and %destructor): New test to
3658 check that the right %printer and %destructor are called, that they're
3659 not called for $end, and that $$ and @$ work correctly.
3660 (Default %printer and %destructor for user-declared end token): New
3661 test to check that the default %printer and %destructor are called for
3662 a user-declared end token.
3663 * tests/input.at (Default %printer and %destructor redeclared, Unused
3664 values with default %destructor): New tests to check related grammar
3665 warnings and errors.
3666
868d2d96
JD
36672006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3668
3669 Clean up handling of %destructor for the end token (token 0).
3670 Discussed starting at
3671 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3672 and
3673 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3674
3675 Make the skeletons consistent in how they pop the end token and invoke
3676 its %destructor.
3677 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3678 state, which has token number 0, since this would invoke the
3679 %destructor for the end token.
3680 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3681 until after shifting the end token, or else it won't be popped.
3682 * data/yacc.c (yyparse): Likewise.
3683
3684 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3685 it's the end token. Upon termination, destroy an unshifted lookahead
3686 even when it's the end token.
3687 * data/lalr1.cc (yy::parser::parse): Likewise.
3688 * data/yacc.c (yyparse): Likewise.
3689
3690 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3691 value warnings for the end token when the user gives the end token a
3692 %destructor.
3693
3694 * tests/actions.at (Printers and Destructors): Test all the above.
3695
62a9592d
PE
36962006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3697
3698 Update to latest gnulib and gettext versions.
3699 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3700 Add fopen-safer.
3701 (gnulib_files): Add m4/warning.m4. Don't worry about files
3702 overwritten by autopoint.
3703 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3704 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3705 rejects them.
3706 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3707 so that we can remove the intl files at a better time.
3708 (intl_files_to_remove): Remove aclocal.m4, since it gets
3709 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3710 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3711 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3712 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3713 Remove datarootdir hack; no longer needed.
3714 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3715 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3716 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3717 strdup.h.
3718 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3719 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3720
10d6970f
PE
37212006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3722
3723 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3724 it with --assume-autoconf='latest-stable'.
3725
50a33993
JD
37262006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3727
3728 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3729 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3730 YYSTYPE' and `{'.
3731 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3732 those from muscle_tab.c since the old ones are misleading.
3733
2ce4ed68
AD
37342006-07-13 Akim Demaille <akim@epita.fr>
3735
3736 Support %define "KEY" {VALUE}.
3737 * src/scan-code.h, src/scan-code.l (translate_action)
3738 (translate_rule_action, translate_symbol_action, translate_code):
3739 Return char *, not const char *.
3740 * src/parse-gram.y (declaration): Rename as...
3741 (prologue_declaration): this.
3742 (string_content): Remove this nonterminal, use STRING.
3743 (braceless, content, content.opt): New nonterminal.
3744 Use them.
3745 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3746 as value.
3747 * src/scan-gram.l (getargs.h): Don't include it.
3748
db7e5eb5
PE
37492006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3750
3751 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3752 rather than a for-loop that declares a local bool variable. This
3753 should work around a compatibility problem with a Cray x1e C++
3754 compiler reported by Hung Nguyen in
3755 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3756 The for-loop was introduced in the 2004-11-17 change but I don't
3757 know why it was needed.
3758
a5d80ba5
AD
37592006-07-12 Akim Demaille <akim@epita.fr>
3760
3761 * data/c.m4: Comment changes.
3762
23eb2a69
AD
37632006-07-10 Akim Demaille <akim@lrde.epita.fr>
3764
3765 * src/complain.c (error_message, ERROR_MESSAGE): New.
3766 To factor...
3767 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3768 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3769
ddc8ede1
PE
37702006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3771
3772 * NEWS: Instead of %union, you can define and use your own union type
3773 YYSTYPE if your grammar contains at least one <type> tag.
3774 Your YYSTYPE need not be a macro; it can be a typedef.
3775 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3776 (Union Decl, Decl Summary): Document this.
3777 * data/glr.c (YYSTYPE): Implement this.
3778 * data/glr.cc (YYSTYPE): Likewise.
3779 * data/lalr1.cc (YYSTYPE): Likewise.
3780 * data/yacc.c (YYSTYPE): Likewise.
3781 * src/output.c (prepare): Output tag_seen_flag.
3782 * src/parse-gram.y (declaration, grammar_declaration):
3783 Use 'union_seen' rather than 'typed' to determine whether
3784 %union has been seen, since grammars can now be typed without
3785 %union.
3786 (symbol_declaration, type.opt, symbol_def):
3787 Keep track of whether a tag has been seen.
3788 * src/reader.c (union_seen, tag_seen): New vars.
3789 (typed): remove.
3790 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3791 * src/scan-code.l (untyped_var_seen): New variable.
3792 (handle_action_dollar): Adjust to above changes.
3793 (handle_action_dollar, handle_action_at):
3794 Improve overflow checking for outlandish numbers.
3795 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3796 avoid new diagnostics generated by above changes.
3797 * tests/regression.at (YYSTYPE typedef): Add test to check
3798 for type tags without %union.
3799
3800 * src/symlist.c (symbol_list_length): Return int, not unsigned
3801 int, since callers expect int. This may need to get revisited
3802 once we have proper integer overflow checking.
3803
3804 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3805 object is now static.
3806
3807 * src/getargs.c (flags_argmatch): Return void, not int,
3808 to pacify ./configure --enable-gcc-warnings.
3809
3810 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3811 since last_string is already defined to FLEX_PREFIX (last_string).
3812
7b42569e
AD
38132006-07-09 Akim Demaille <akim@lrde.epita.fr>
3814
3815 Implement --warnings/-W.
3816 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
3817 replaced by...
3818 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
3819 Adjust callers.
3820 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
3821 (warnings_args, warnings_types): New.
3822 (getargs, short_options, long_options): Accept -W/--warnings.
3823 Sort the options by alphabetical order, upper case letter right
3824 before its lower case.
3825
3b452f4e
JD
38262006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3827
3828 Change %merge result type clash warnings to errors. Discussed at
3829 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
3830 * src/reader.c (record_merge_function_type): Use complain_at.
3831 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3832 declared later): Update test case results.
3833
b8a41559
AD
38342006-07-09 Akim Demaille <akim@lrde.epita.fr>
3835
3836 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
3837 to be in alphabetical order.
3838 (trace_args): Spelling fixes.
3839
cd9e1ba2
PE
38402006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3841
3842 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
3843 so they don't collide with user-defined macros.
3844 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
3845 this was never guaranteed, and now that we're using gnulib stdint,
3846 which defines int_fast16_t to long int, the problem is exposed.
3847
cb48f191
PE
38482006-07-08 Paul Eggert <eggert@cs.ucla.edu>
3849
b8445a15
PE
3850 * data/c.m4 (b4_basename): Simplify a bit, since we don't
3851 need the full POSIX semantics (and weren't implementing them
3852 anyway).
3853
cb48f191
PE
3854 Adjust to Autoconf 2.60 and today's gnulib.
3855 * bootstrap (gnulib_modules): Add stdint.
3856 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
3857 no longer copies it.
3858 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
3859 since stdint needs the former and wcwidth (which is now required
3860 by mbswidth) needs the latter.
3861 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
3862 work around a compatibility glitch between gettext 0.14.6 and
3863 Autoconf 2.60.
3864 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
3865 Do not check for uintptr_t, since new stdint module does the right
3866 thing.
3867 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
3868 Add stdint.h, stdint_.h, wcwidth.h.
3869 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
3870 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
3871 stdint.m4, wchar_t.m4, wcwidth.m4.
3872 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
3873 usual order for ../lib/*.h files.
3874 (file_name_split): Use last_component, not base_name, to adjust
3875 to gnulib changes.
3876 * src/parse-gram.h: Include <strverscmp.h> in the usual order
3877 for ../lib/*.h files.
3878 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
3879 Define unconditionally, since we now assume the stdint module.
3880 * src/scan-skel.l: Include <dirname.h>.
3881 (BASE_QPUTS): Use last_component, not base_name.
3882 * src/system.h: Include <unlocked-io.h> in the usual order
3883 for ../lib/*.h files. Include <stdint.h> unconditionally,
3884 since we now use the stdint module.
3885 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
3886 HAVE_UINTPTR_T, since we now use the stdint module.
3887 (base_name): Remove decl, since files now include <dirname.h>
3888 to get the decl.
3889
cd48d21d
AD
38902006-07-08 Akim Demaille <akim@lrde.epita.fr>
3891
3892 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
3893 New, default to 1.
3894 * data/yacc.c, data/glr.c, data/location.cc: Use them.
3895 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
3896 default.
3897 * tests/calc.at: Adjust.
3898
8ec0a172
AD
38992006-07-08 Akim Demaille <akim@lrde.epita.fr>
3900
b8445a15 3901 * data/c.m4 (b4_basename): New.
8ec0a172
AD
3902 (b4_syncline): Also output the location of its invocation (from
3903 the skeleton).
3904 (b4_user_action, b4_define_user_action, b4_user_actions)
3905 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
3906 (b4_user_stype): New.
3907 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
3908
4a678af8
JD
39092006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3910
3911 In the grammar file, the first column is 1 not 0 on the first line as
3912 on every other line.
3913 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
3914 * tests/input.at (Torturing the Scanner): Update output.
3915
3916 * src/scan-gram.l (scanner_cursor): Declare it static.
3917
dd60572a
JD
39182006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3919
3920 In warnings, say "previous declaration" rather than "first
3921 declaration".
3922 * src/symtab.c (redeclaration): Do that here.
3923 * src/reader.c (record_merge_function_type): In the case of a result
3924 type clash, report the previous declaration rather than the very first
3925 one in the grammar file.
3926 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3927 declared later): Add a third declaration to check this behavior.
3928 * tests/input.at (Incompatible Aliases): Update output.
3929
2073e1b6
AD
39302006-06-27 Akim Demaille <akim@epita.fr>
3931
3932 * doc/Doxyfile.in: New.
3933 * doc/Makefile.am: Use it.
3934 * src/lalr.h, src/symtab.h: Initial doxygenation.
3935
8ee5b538
JD
39362006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3937
3938 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
3939 declared after the %merge. This continues the effort of the previous
3940 patch.
8ee5b538
JD
3941 * src/reader.c (get_merge_function): Don't set the merger type yet.
3942 (record_merge_function_type): New function for setting the merger type
3943 and checking for clashes.
3944 (grammar_current_rule_merge_set): Set the location of the %merge for
3945 the current rule.
3946 (packgram): Invoke record_merge_function_type for each rule now that
3947 all symbol type declarations have been parsed.
3948 * src/reader.h (merger_list.type_declaration_location): New member
3949 storing the location of the first %merge from which the type for this
3950 merging function was derived.
3951 * src/symlist.h (symbol_list.merger_declaration_location): New member
3952 storing the location of a rule's %merge, if any.
3953 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3954 declared later): New test to catch the error fixed by the above patch.
3955
ffa4ba3a
JD
39562006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3957
3958 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
3959 declarations appear after the rules. Discussed at
3960 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
3961 and
3962 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
3963 Don't mistake the type of $$ in a midrule to be that of its parent
3964 rule's $$.
ffa4ba3a
JD
3965 * src/reader.c (grammar_current_rule_end): Don't invoke
3966 grammar_rule_check yet since not all symbol declarations may have been
3967 parsed yet.
3968 (grammar_midrule_action): Likewise.
3969 Don't record whether the midrule's $$ has been used yet since actions
3970 haven't been translated yet.
3971 Record the midrule's parent rule and its RHS index within the parent
3972 rule.
3973 (grammar_current_rule_action_append): Don't translate the action yet
3974 since not all symbol declarations may have been parsed yet and, thus,
3975 warnings about types for $$, $n, @$, and @n can't be reported yet.
3976 (packgram): Translate the action and invoke grammar_rule_check now that
3977 all symbol declarations have been parsed.
3978 * src/scan-code.l (handle_action_dollar): Now that this is invoked
3979 after parsing the entire grammar file, the symbol list here in the case
3980 of a midrule is actually the midrule's empty RHS, so reference its
3981 parent rule's RHS where necessary.
3982 On the other hand, now that you can already know it's a midrule, you
3983 aren't forced to think $$ has the same type as its parent rule's $$.
3984 (handle_action_at): In the case of a midrule, reference the parent rule
3985 where necessary.
3986 * src/symlist.c (symbol_list_new): Initialize new midrule-related
3987 members.
3988 (symbol_list_length): Now that this is invoked after all rules have
3989 been parsed, a NULL symbol (rather than a NULL symbol list node)
3990 terminates a rule. symbol_list_print already does this correctly.
3991 * src/symlist.h (symbol_list.midrule_parent_rule,
3992 symbol_list.midrule_parent_rhs_index): New members so that midrules can
3993 remember their relationships with their parents.
3994 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
3995 fixed by the above patch.
3996 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
3997 implementing...
3998 (Unused values): ... this old test case and...
3999 (Unused values before symbol declarations): ... this new test case.
4000 This one is the same as `Unused values' except that all symbol
4001 declarations appear after the rules in order to catch the rest of the
4002 errors fixed by the above patch.
4003
e256e17f
JD
40042006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4005
300a1930
JD
4006 More cleanup.
4007 * src/reader.c (current_rule): Declare it static since it's no longer
4008 used outside this file.
4009 (grammar_current_rule_action_append): Remove redundant arguments from
4010 translate_rule_action invocation.
4011 * src/reader.h (current_rule): Remove this unused extern.
4012 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
4013 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 4014
381ecb06
JD
40152006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
4016
4017 Clean up yesterday's patch.
4018 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
4019 to...
4020 * src/reader.c (grammar_current_rule_action_append): ... here for
4021 consistency with grammar_current_rule_symbol_append.
4022 * tests/regression.at (Braced code in declaration in rules section):
4023 Make yyerror and yylex static as usual.
4024
4210cd0b
JD
40252006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
4026
4027 Fix bug that mistakes braced code in a declaration in the rules section
4028 to be a rule action. Mentioned at
4029 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
4030 * src/scan-gram.l: Move midrule action detection from the start of the
4031 scanning of any braced code to...
4032 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
4033 action. For readability, use $2 and @2 rather than the equivalent
4034 global variables.
4035 * tests/regression.at (Braced code in declaration in rules section):
4036 New test to catch the error fixed by the above patch.
4037
4038 Work on code readability some.
4039 * src/scan-code.l (current_rule): Get rid of this misleading and
4040 redundant declaration: it's actually extern'ed in reader.h.
4041 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
4042 translate_action): Add a rule argument and use it instead of the global
4043 current_rule.
4044 (translate_rule_action): This already receives current_rule through an
4045 argument, so pass it on to translate_action instead of assigning
4046 current_rule to current_rule.
4047 (translate_symbol_action, translate_code): Pass rule = NULL to
4048 translate_action.
4049
34f98f46
JD
40502006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
4051
4052 Rename %before-definitions to %start-header and %after-definitions to
4053 %end-header. Don't use these declarations to separate pre-prologue
4054 blocks from post-prologue blocks. Add new order-independent
4055 declarations %before-header and %after-header as alternatives to the
4056 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
4057 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
4058 * NEWS (2.3+): Update for these changes.
4059 * data/glr.c (b4_before_definitions): Update to...
4060 (b4_start_header): ... this.
4061 (b4_after_definitions): Update to...
4062 (b4_end_header): ... this.
4063 * data/glr.cc: Likewise.
4064 * data/lalr1.cc: Likewise.
4065 * data/yacc.c: Likewise.
4066 * doc/bison.texinfo (The prologue): Update names, and replace remaining
4067 prologue blocks with %*-header declarations.
4068 (Calc++ Parser): Likewise.
91661ebb 4069 (Decl Summary): Update names.
148d66d8 4070 (Table of Symbols): Update description.
34f98f46
JD
4071 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
4072 (PERCENT_END_HEADER): ... this.
4073 (PERCENT_BEFORE_DEFINITIONS): Update to...
4074 (PERCENT_START_HEADER): ... this.
4075 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4076 (declaration): Update token names and m4 macro names.
4077 When parsing %end-header and %start-header, invoke translate_code
4078 before muscle_code_grow, and no longer set global booleans to remember
4079 whether these declarations have been seen.
4080 Parse new %after-header and %before-header.
4081 * src/reader.c (before_definitions, after_definitions): Remove.
4082 (prologue_augment): Accept a new bool argument to specify whether to
4083 augment the pre-prologue or post-prologue.
4084 * src/reader.h (before_definitions, after_definitions): Remove these
4085 extern's.
4086 (prologue_augment): Add new bool argument.
4087 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
4088 (PERCENT_END_HEADER): ... this.
4089 (PERCENT_BEFORE_DEFINITIONS): Update to...
4090 (PERCENT_START_HEADER): ... this.
4091 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4092 * tests/actions.at (Printers and Destructors): Update names.
4093
31b2b07e
JD
40942006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
4095
4096 Add comparison operators for C++ location classes. Discussed at
4097 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
4098 * data/c++.m4 (b4_define_location_comparison): New boolean %define
4099 declaration indicating whether filename_type has an operator==. If
4100 filename_type is `std::string', it defaults to `1', `0' otherwise.
4101 * data/location.cc: Iff b4_define_location_comparison is `1', add
4102 operator== and operator!= for class position and for class location.
4103
4104 Some minor fixes.
4105 * src/scan-action.l: Remove unused file.
4106 * src/symtab.c (symbol_printer_set): Use printer_location not
4107 destructor_location.
4108 * src/symtab.h (struct symbol): Replace incorrect source comment for
4109 printer members.
4110 * tests/input.at (Incompatible Aliases): Update output with correct
4111 printer location.
4112
9bc0dd67
JD
41132006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
4114
4115 Don't put the pre-prologue in the header file. For the yacc.c code
4116 file and the glr.c header and code files, move the pre-prologue before
4117 the token definitions. Add new %before-definitions and
4118 %after-definitions to declare code that will go in both the header file
4119 and code file. Discussed at
4120 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
4121 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
4122 and
4123 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
4124 * NEWS (2.3+): Describe these changes.
4125 * data/glr.c (b4_pre_prologue): Move from within to before...
4126 (b4_shared_declarations): ... this.
4127 Add new b4_before_definitions before b4_token_enums.
4128 Add new b4_after_definitions at the end.
4129 * data/glr.cc (b4_pre_prologue): Replace with...
4130 (b4_before_definitions): ... this in the header file.
4131 (b4_after_definitions): New near the end of the header file.
4132 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
4133 code file right before including the header file.
4134 (b4_before_definitions): New in the previous position of
4135 b4_pre_prologue in the header file.
4136 (b4_after_definitions): New near the end of the header file.
4137 * data/yacc.c: Clean up some m4 quoting especially in the header file.
4138 (b4_token_enums_defines): In the code file, move to right before
4139 YYSTYPE for consistency with the header file.
4140 (b4_before_definitions): New right before b4_token_enums_defines in
4141 both the header and code file.
4142 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
4143 header and code file.
4144 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
4145 of prologues for %union dependencies.
91661ebb
JD
4146 (Decl Summary): In %defines description, mention the effect of
4147 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
4148 (Calc++ Parser): Forward declare driver in a %before-definitions rather
4149 than in the pre-prologue so that make check succeeds.
148d66d8 4150 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
4151 %after-definitions.
4152 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
4153 %before-definitions.
4154 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
4155 (declaration): Parse those declarations and append to
4156 b4_before_definitions and b4_after_definitions, respectively.
4157 * src/reader.c (before_definitions, after_definitions): New bools to
4158 track whether those declarations have been seen.
4159 (prologue_augment): Add to the post-prologue if %union,
4160 %before-definitions, or %after-definitions has been seen.
4161 * src/reader.h (before_definitions, after_definitions): New extern's.
4162 * src/scan-gram.l: Scan the new declarations.
4163 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
4164 prologue block in a %before-definitions or a %after-definitions based
4165 on whether the %union is declared.
4166 * tests/regression.at (Early token definitions with --yacc, Early token
4167 definitions without --yacc): Move tests for token definitions into the
4168 post-prologue since token names are no longer defined in the
4169 pre-prologue.
4170
203b9274
AD
41712006-06-20 Akim Demaille <akim@epita.fr>
4172
4173 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
4174 (symbol_get): Use it.
4175 * src/parse-gram.y: Use it.
4176
a7ee59cf
JD
41772006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
4178
4179 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
4180 build succeeds when configured with --enable-gcc-warnings.
4181
5a2baae7
PE
41822006-06-19 Paul Eggert <eggert@cs.ucla.edu>
4183
33ad1a9c
PE
4184 * src/parse-gram.y (char_name): New function.
4185 (CHAR, STRING, string_content): For %printer, properly escape.
4186 (ID): Prefer fputs to fprintf.
4187 (id): Reindent to be consistent with other rules.
4188 Properly quote char.
4189
5a2baae7
PE
4190 The Translation Project changed its way of publishing translations
4191 to maintainers. I haven't received any responses to my request
4192 for supporting the old way, or for documenting the new way. I
4193 have modified 'bootstrap' to use screen scraping
4194 (in this case, HTML scraping). This is unreliable and inelegant,
4195 but I don't see any better way. Yuck.
4196 * bootstrap (TP_URL, WGET_COMMAND): New vars.
4197 (get_translations): New function, which uses HTML scraping to
4198 deduce locations of latest translations.
4199 Use this function to grab both bison and bison-runtime .po files.
4200 Don't bother priming the pump for the runtime-po domain any more,
4201 as it's now translated better than bison is.
4202
58d7a1a1
AD
42032006-06-19 Akim Demaille <akim@epita.fr>
4204
4205 * src/scan-gram.l: No longer "parse" things after `%union' until
4206 `{'. Rather, return a single "%union" token.
4207 No longer make symbols: return strings, and leave the conversion
4208 to symbols to the parser.
4209 (SC_PRE_CODE, token_type): Remove.
4210 * src/parse-gram.y (%union): New field `character'.
4211 Sort tokens.
4212 (CHAR): New token.
4213 (ID, ID_COLON): Now that the scanner no longer makes them
4214 identifiers, adjust all uses to invoke symbol_get.
4215 (id_colon): New, wraps the conversion from string to symbol.
4216 (%union): Accept a possible union_name.
4217 (symbol): Now can be a char.
4218 * data/c.m4 (b4_union_name): Leave a default value.
4219 * data/glr.c, data/yacc.c: Use it.
4220
b931235e
JD
42212006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
4222
4223 For associating token numbers with token names for "yacc.c", don't use
4224 #define statements unless `--yacc' is specified; always use enum
4225 yytokentype. Most important discussions start at:
4226 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
4227 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
4228 and
4229 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
4230 * NEWS (2.3+): Mention.
4231 * data/c.m4 (b4_yacc_if): New.
4232 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
4233 token #define's.
4234 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
4235 on token name definitions.
4236 * src/getargs.c (usage): Capitalize `Yacc' in English.
4237 * src/output.c (prepare): Define b4_yacc_flag.
4238 * tests/regression.at (Early token definitions): Test that tokens names
4239 are defined before the pre-prologue not just before the post-prologue.
4240 Remove this test case and copy to...
4241 (Early token definitions with --yacc): ... this to test #define's.
4242 (Early token definitions without --yacc): ... and this to test enums.
4243
9e6e7ed2
PE
42442006-06-11 Paul Eggert <eggert@cs.ucla.edu>
4245
4246 * NEWS: Reword the post-2.3 change to not be so optimistic about
4247 removing the old "look-ahead" spelling.
4248 Update previous look-ahead/lookahead change reports.
4249 * REFERENCES: look-ahead -> lookahead (since that's
4250 what he actually wrote).
4251 * doc/refcard.tex: look ahead -> lookahead,
4252 look-ahead -> lookahead
4253
742e4900
JD
42542006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
4255
4256 For consistency, use `lookahead' instead of `look-ahead' or
4257 `look_ahead'. Discussed starting at
4258 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
4259 and then at
4260 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
4261 * NEWS: For the next release, note the change to `--report'.
4262 * TODO, doc/bison.1: Update English.
4263 * doc/bison.texinfo: Update English.
4264 (Understanding Your Parser, Bison Options): Document as
4265 `--report=lookahead' rather than `--report=look-ahead'.
4266 * src/conflicts.c: Update English in comments.
4267 (lookahead_set): Rename from look_ahead_set.
4268 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
4269 (resolve_sr_conflict): Rename local look_ahead_tokens to
4270 lookahead_tokens, and update other uses.
4271 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
4272 count_rr_conflicts, conflicts_free): Update uses.
4273 * src/getargs.c (report_args): Move "lookahead" before alternate
4274 spellings.
4275 (report_types): Update uses.
4276 (usage): For `--report' usage description, state `lookahead' spelling
4277 rather than `look-ahead'.
4278 * src/getargs.h (report.report_lookahead_tokens): Rename from
4279 report_look_ahead_tokens.
4280 * src/lalr.c: Update English in comments.
4281 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
4282 (state_lookahead_tokens_count): Rename from
4283 state_look_ahead_tokens_count.
4284 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4285 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
4286 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4287 Update other uses.
4288 Update English in output.
4289 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
4290 * src/print.c: Update English in comments.
4291 (lookahead_set): Rename from look_ahead_set.
4292 (print_reduction): Rename argument lookahead_token from
4293 look_ahead_token.
4294 (print_core, state_default_rule, print_reductions, print_results):
4295 Update uses.
4296 * src/print_graph.c: Update English in comments.
4297 (print_core): Update uses.
4298 * src/state.c: Update English in comments.
4299 (reductions_new): Update uses.
4300 (state_rule_lookahead_tokens_print): Rename from
4301 state_rule_look_ahead_tokens_print, and update other uses.
4302 * src/state.h: Update English in comments.
4303 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
4304 (state_rule_lookahead_tokens_print): Rename from
4305 state_rule_look_ahead_tokens_print.
4306 * src/tables.c: Update English in comments.
4307 (conflict_row, action_row): Update uses.
4308 * tests/glr-regression.at
4309 (Incorrect lookahead during deterministic GLR,
4310 Incorrect lookahead during nondeterministic GLR): Rename
4311 print_look_ahead to print_lookahead.
4312 * tests/torture.at: Update English in comments.
4313 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
4314 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
4315 (Many lookahead tokens): Update uses.
4316 * data/glr.c: Update English in comments.
4317 * lalr1.cc: Likewise.
4318 * yacc.c: Likewise.
4319 * src/conflicts.h: Likewise.
4320 * src/lalr.h: Likewise.
4321 * src/main.c: Likewise.
4322 * src/output.c: Likewise.
4323 * src/parse-gram.c: Likewise.
4324 * src/tables.h: Likewise.
4325 * tests/calc.at: Likewise.
4326
3c40d0b5
JD
43272006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
4328
4329 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
4330
5d278082
PE
43312006-06-07 Paul Eggert <eggert@cs.ucla.edu>
4332
4333 * TODO: Add request from Nelson H. F. Beebe to be able to install
4334 Bison without installing the yacc script.
4335
9e668899
JD
43362006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4337
4338 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
4339 and yytext if they're already #define'd.
4340 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
4341 * src/scan-code-c.c: ... here.
4342 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
4343 <config.h>.
4344
0c8e079f
JD
43452006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4346
4347 Get Bison to build again when configured with --enable-gcc-warnings.
4348 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
4349 missing #include's.
4350 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
4351 loc argument as it shadows a global.
4352 * src/scan-gram.l: Remove stray comma that prevents boundary_set
4353 invocation.
4354
4355 * src/.cvsignore: Add scan-code.c.
4356
2346344a
AD
43572006-06-07 Akim Demaille <akim@epita.fr>
4358
4359 * src/scan-gram.l: Move the "add a trailing ; to actions" code
4360 to...
4361 * src/scan-code.l: here.
4362 * tests/input.at (Torturing the Scanner): Fix another location
4363 error.
4364
4862bdfd
AD
43652006-06-07 Akim Demaille <akim@epita.fr>
4366
4367 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
4368
e9071366
AD
43692006-06-06 Akim Demaille <akim@epita.fr>
4370
4371 Extract the parsing of user actions from the grammar scanner.
4372 As a consequence, the relation between the grammar scanner and
4373 parser is much simpler. We can also split "composite tokens" back
4374 into simple tokens.
4375 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
4376 * src/scan-gram.l (add_column_width, adjust_location): Move to and
4377 rename as...
4378 * src/location.h, src/location.c (add_column_width)
4379 (location_compute): these.
4380 Fix the column count: the initial column is 0.
4381 (location_print): Be robust to ending column being 0.
4382 * src/location.h (boundary_set): New.
4383 * src/main.c: Adjust to scanner_free being renamed as
4384 gram_scanner_free.
4385 * src/output.c: Include scan-code.h.
4386 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
4387 Use boundary_set.
4388 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
4389 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
4390 which is now, again, a separate token.
4391 Adjust all dependencies.
4392 Whereever actions with $ and @ are used, use translate_code.
4393 (action): Remove this nonterminal which is now useless.
4394 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
4395 (grammar_current_rule_action_append): Use translate_code.
4396 (packgram): Bound check ruleno, itemno, and rule_length.
4397 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
4398 (last_string, last_braced_code_loc, max_left_semantic_context)
4399 (scanner_initialize, scanner_free, scanner_last_string_free)
4400 (gram_out, gram_lineno, YY_DECL_): Move to...
4401 * src/scan-gram.h: this new file.
4402 (YY_DECL): Rename as...
4403 (GRAM_DECL): this.
4404 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
4405 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4406 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4407 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4408 Move these declarations, and...
4409 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
4410 these to...
4411 * src/flex-scanner.h: this new file.
4412 * src/scan-gram.l (rule_length, rule_length_overflow)
4413 (increment_rule_length): Remove.
4414 (last_braced_code_loc): Rename as...
4415 (gram_last_braced_code_loc): this.
4416 Adjust to the changes of the parser.
4417 Move all the handling of $ and @ into...
4418 * src/scan-code.l: here.
4419 * src/scan-gram.l (handle_dollar, handle_at): Remove.
4420 (handle_action_dollar, handle_action_at): Move to...
4421 * src/scan-code.l: here.
4422 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
4423 scan-code.h, scan-code-c.c, scan-gram.h.
4424 (EXTRA_bison_SOURCES): Add scan-code.l.
4425 (BUILT_SOURCES): Add scan-code.c.
4426 (yacc): Be robust to white spaces.
4427
4428 * tests/conflicts.at, tests/input.at, tests/reduce.at,
4429 * tests/regression.at: Adjust the column numbers.
4430 * tests/regression.at: Adjust the error message.
7891a7c4 4431
184e42f0
JD
44322006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4433
4434 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4435 Use Akim's wording from
4436 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
4437
7891a7c4
JD
44382006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4439
4440 Between Bison releases, manually append `+' to the previous Bison
4441 release number, and use that as a signal to automatically print the
4442 ChangeLog's CVS Id keyword from --version. Discussed starting at
4443 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
4444 * ChangeLog: Add Id header.
4445 * configure.ac (AC_INIT): Append `+' to `2.3'.
4446 * src/.cvsignore: Add revision.c.
4447 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
4448 (BUILT_SOURCES): Add revision.c.
4449 (revision.c): New target rule. This file defines a new global variable
4450 named revision. It initializes it with either the Id from ChangeLog
4451 or, if VERSION doesn't contain `+', with the empty string.
4452 * src/getargs.c (version): Print the value of revision.
4453 * src/revision.h: Extern revision.
4454
4ad3ed84
PE
44552006-06-05 Paul Eggert <eggert@cs.ucla.edu>
4456
4457 * NEWS: Version 2.3.
4458 * configure.ac (AC_INIT): Likewise.
4459
02103984
PE
44602006-05-30 Paul Eggert <eggert@cs.ucla.edu>
4461
4462 * data/glr.c (YYRECOVERING): Define to be a function-like macro
4463 with no arguments, not as an object-like macro. This is for
4464 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
4465 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
4466 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
4467 Document this.
4468
2c08afa5
JD
44692006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
4470
4471 * src/getargs.c (usage): Back out yesterday's modification of the
4472 --help output so that we don't have to wait for translation before
4473 releasing 2.3.
4474
6077da58
PE
44752006-05-29 Paul Eggert <eggert@cs.ucla.edu>
4476
4477 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
4478 Problem reported by Akim Demaille.
4479
2a26b6c2
JD
44802006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4481
4482 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4483
aefef0d6
PE
44842006-05-26 Paul Eggert <eggert@cs.ucla.edu>
4485
4486 * data/yacc.c (yy_reduce_print): Omit trailing white space in
4487 generated source code. Problem reported by Frans Englich in
4488 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
4489
fcd8e201
PE
44902006-05-22 Paul Eggert <eggert@cs.ucla.edu>
4491
4492 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
4493 shell, not within 'make', so that 'make' by an ordinary builder
4494 (using GNU make) does not worry about configuring gzip. This also
4495 works around a bug reported independently by Keith Thompson and by
4496 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
4497 stderr rather than stdout, messing up the build logs.
4498
7b5cdcbd
JD
44992006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4500
4501 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
4502 to make sure that YYID will never be unused. This fixes a 'make
4503 maintainer-check' failure caused by the recent changes to the 'Trivial
4504 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
4505 not used.
4506 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
4507
5ad0a449
JD
45082006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4509
4510 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
4511 state before an empty RHS is always resolved here. Only the location
4512 of that state is guaranteed to be resolved, and that's enough. This
4513 fixes the remaining bug reported by Derek M. Jones in
4514 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4515 * tests/glr-regression.at (Uninitialized location when reporting
4516 ambiguity): Test the above case.
4517 Also, the embedded comments in this test case claim it checks the case
4518 of an empty RHS that has inherited the initial location. However, the
4519 corresponding LHS was already resolved, so yyresolveLocations didn't
4520 actually have reason to modify it. Fix this by forcing
4521 nondeterministic operation at the beginning of the parse.
4522
50cce58e
PE
45232006-05-20 Paul Eggert <eggert@cs.ucla.edu>
4524
4525 * data/c.m4 (b4_yy_symbol_print_generate):
4526 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
4527 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
4528 of the bugs reported today by Derek M Jones in
4529 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4530 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
4531 defined to be a type name without parens or brackets.
4532 (Location Type): Similarly for YYLTYPE.
4533 * tests/regression.at (Trivial grammars): Put in a test for this
4534 bug that will be caught by 'make maintainer-check' (though not,
4535 alas, by 'make check' unless your compiler is picky).
4536
ab8d9dc5
PE
45372006-05-19 Paul Eggert <eggert@cs.ucla.edu>
4538
0d2c8934 4539 * NEWS: Version 2.2.
ab8d9dc5
PE
4540 * configure.ac (AC_INIT): Likewise.
4541
9138c575
JD
45422006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
4543
4544 * data/glr.c (yyreportTree): Make room in yystates for the state
4545 preceding the RHS. This fixes the segmentation fault reported by Derek
4546 M. Jones in
4547 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
4548 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
4549 to the user. Reported for yyreportTree by Derek M. Jones later in the
4550 same thread.
4551 * THANKS: Add Derek M. Jones.
4552 Update my email address.
4553 Fix typo in Steve Murphy's name.
4554
276f48df
PE
45552006-05-14 Paul Eggert <eggert@cs.ucla.edu>
4556
d6645148
PE
4557 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
4558 checking against YYLAST that caused the parser to miss a potential
4559 alternative in its diagnostic.
4560 Problem reported by Maria Jose Moron Fernandez in
4561 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
4562 * data/lalr1.cc (yysyntax_error_): Likewise.
4563 * data/yacc.c (yysyntax_error): Likewise.
4564 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
4565 tokens, in case we run into an older C compiler.
4566 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
4567 Use them to check for the off-by-one error fixed above.
4568
276f48df
PE
4569 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
4570 YYSIZE_T, not size_t.
4571 * tests/regression.at (Trivial grammars): New test, to catch
4572 the error fixed by the above patch.
4573
cd8b5791
AD
45742006-05-14 Akim Demaille <akim@lrde.epita.fr>
4575
4576 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
4577 scheme.
4578 Reported by Steve Murphy.
4579
34376418
AD
45802006-05-14 Akim Demaille <akim@lrde.epita.fr>
4581
4582 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
4583 * data/glr.cc: b4_location_flag is now b4_locations_flag.
4584
327afc7c
AD
45852006-05-14 Akim Demaille <akim@lrde.epita.fr>
4586
4587 Implement --trace=m4.
4588 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
4589 * src/output.c (output_skeleton): When set, pass -dV to m4.
4590
4591 Factor the handling of flags in m4.
4592 * src/output.c (prepare): Rename the muscle names debug, defines,
4593 error_verbose to debug_flag, defines_flag, error_verbose_flag.
4594 * data/c.m4: Adjust.
4595 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
4596 Use b4_define_flag_if to define other b4_FLAG_if macros.
4597 (b4_location_if): As a consequence, rename as...
4598 (b4_locations_if): this, for consistency.
4599 Adjust all the skeletons.
4600
ba9ecd19
AD
46012006-05-14 Akim Demaille <akim@lrde.epita.fr>
4602
4603 * etc/bench.pm: Shorten bench names.
4604
4e83ea15
AD
46052006-05-14 Akim Demaille <akim@lrde.epita.fr>
4606
4607 * src/output.h, src/output.c (error_verbose): Move to...
4608 * src/getargs.h, src/getargs.c: here.
4609 Sort the flags.
4610 Adjust dependencies.
4611
6e93d810
PE
46122006-05-13 Paul Eggert <eggert@cs.ucla.edu>
4613
4614 * data/c.m4 (b4_copyright): Put the special exception for Bison
4615 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
4616 uses changed. Suggested by Akim Demaille. Also, wrap the
4617 copyright notice, in case it is longer than 80 columns. Replace
4618 comma by newline after title.
6e93d810 4619
eaea13f5
PE
46202006-05-11 Paul Eggert <eggert@cs.ucla.edu>
4621
4622 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
4623 incompatibility, not a bug. Mention that it wasn't fixed as of
4624 flex 2.5.33.
4625
3cf084ec
AD
46262006-05-11 Akim Demaille <akim@lrde.epita.fr>
4627
4628 * examples/extexi: Enforce the precedence of concatenation over
4629 >>.
0a9f1c7d 4630 Reported by Tommy Nordgren.
3cf084ec 4631
32c96bd7
AD
46322006-05-11 Akim Demaille <akim@lrde.epita.fr>
4633
4634 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
4635 with the member "token".
f94705b2 4636 Reported by Martin Nylin.
32c96bd7 4637
eaea13f5
PE
46382006-05-08 Paul Eggert <eggert@cs.ucla.edu>
4639
4640 * data/glr.c: Switch to Bison 2.2 special-exception language in
4641 the copyright notice. Use more-regular format for titles and
4642 copyright notices.
4643 * data/glr.cc: Likewise.
4644 * data/location.cc: Likewise.
4645 * data/yacc.cc: Likewise.
4646 * doc/bison.texinfo (Conditions): Document this.
4647 * NEWS: likewise. Upgrade version to 2.2.
4648
6e2d1146
AD
46492006-04-27 Akim Demaille <akim@lrde.epita.fr>
4650
4651 * data/glr.cc: Remove dead code.
4652
47671055
PE
46532006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4654
4655 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4656 that variable and the line breaks the bootstrap. Problem reported
4657 by Juan M. Guerrero.
4658
ed2e6384
AD
46592006-04-24 Akim Demaille <akim@lrde.epita.fr>
4660
4661 * doc/bison.texinfo (Multiple start-symbols): New.
4662
3cedc2dc
AD
46632006-04-24 Akim Demaille <akim@lrde.epita.fr>
4664
4665 * etc/README, etc/bench.pl: New.
4666
b2ddc3f3
AD
46672006-04-03 Akim Demaille <akim@lrde.epita.fr>
4668
4669 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4670 rule.
4671 Reported by Mickael Labau.
4672 * tests/input.at (Torturing the Scanner): Test it.
4673
91e3ac9a
PE
46742006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4675
4676 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4677 Problem reported by Bob Rossi.
4678
46792006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4680
4681 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4682 and didn't really work.
4683 For the index, use @ifnotinfo, not @iftex.
4684 Minor cleanups of spacing and terminology.
4685
5cf61e93
AD
46862006-03-12 Akim Demaille <akim@lrde.epita.fr>
4687
4688 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4689 of AT_NAME_PREFIX when %name-prefix is not used.
4690
aa08666d
AD
46912006-03-12 Akim Demaille <akim@lrde.epita.fr>
4692
4693 Apply --prefix to C++ skeletons too: they change the namespace.
4694 The test suite already exercize these cases.
4695 * data/c++.m4 (b4_namespace): New.
4696 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4697 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4698 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4699 * doc/bison.texinfo: Document it.
4700 (Option Cross Key): Use @multitable in all formats. It looks
4701 nicer, even in TeX outputs.
4702 (Rules): Use the same code whatever the output type is.
4703 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4704 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4705 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 4706
45567173
AD
47072006-03-10 Akim Demaille <akim@lrde.epita.fr>
4708
4709 * TODO: Remove dead items.
4710
e9d8f881 47112006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
4712
4713 * doc/FAQ: Remove, merged into...
4714 * doc/bison.texinfo (FAQ): this.
4715 * doc/Makefile.am (EXTRA_DIST): Adjust.
4716
c095d689
AD
47172006-03-10 Akim Demaille <akim@lrde.epita.fr>
4718
4719 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4720 even if empty.
4721 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4722 * doc/bison.texinfo (Calc++ Scanner): Use it.
4723
6e0f8287
PE
47242006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4725
4726 Fix two nits reported by twlevo, plus one more that I discovered.
4727
4728 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4729 this is the usual Bison style.
4730 * src/location.h (location_print): Likewise.
4731
4732 * src/reader.h (token_name): Likewise.
4733
d6b771c3
PE
47342006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4735
4736 Fix some nits reported by twlevo.
4737 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4738 and "POSIX". Use more-modern syntax for URLs. Mention C++
4739 and ask for Java. Don't hardwire OS version numbers. Add
4740 copyright notice.
4741 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4742 * src/conflicts.c (solved_conflicts_obstack): Now static.
4743
1e137b71
JD
47442006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4745
4746 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4747 page. Say "you can use it" not "you may use it" as on the web page;
4748 we're describing capabilities not granting permission.
4749
73f2e47e
PE
47502006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4751
6d05403d
PE
4752 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4753 shadowing warnings. Use usual patter for iterating through RHS.
4754 * tests/glr-regression.at
4755 (Uninitialized location when reporting ambiguity):
4756 Modify yylex so that it uses its argument, rather than trying
4757 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4758 const char -> char const.
4759
73f2e47e
PE
4760 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4761 Don't use tabs inside commands; it messes up 'ps'.
4762 Problem reported by twlevo.
4763
8710fc41
JD
47642006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4765
4766 * tests/glr-regression.at (Uninitialized location when reporting
4767 ambiguity): New test case.
4768 * data/glr.c (yyresolveLocations): New function, which uses
4769 YYLLOC_DEFAULT.
4770 (yyresolveValue): Invoke yyresolveLocations before reporting an
4771 ambiguity.
4772 * doc/bison.texinfo (Default Action for Locations): Note
4773 YYLLOC_DEFAULT's usage for ambiguity locations.
4774 (GLR Semantic Actions): Cross-reference those notes.
4775
ae952af2
JD
47762006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4777
4778 * tests/glr-regression.at (Leaked semantic values when reporting
4779 ambiguity): Remove unnecessary union and type declarations.
4780 (Leaked lookahead after nondeterministic parse syntax error): New test
4781 case.
4782 * data/glr.c (yyparse): Check for zero stacks remaining before
4783 attempting to shift the lookahead so that you don't lose it.
4784
35ee866a
JD
47852006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4786
4787 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4788 * tests/glr-regression.at (Leaked semantic values when reporting
4789 ambiguity): New test case.
4790 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4791 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4792 now unnecessary yystackp parameter.
4793 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4794 destructors can be called.
4795
4796 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4797 in existing testcases.
4798
520181ab
JD
47992006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4800
4801 Don't leak semantic values for parent RHS when a user action cuts the
4802 parser, and clean up related code a bit.
4803 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
4804 cuts parse): Rename to...
4805 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
4806 for leaked parent RHS values.
4807 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4808 between an unresolved state (non-empty chain of semantic options) and
4809 an incomplete one (signaled by an empty chain).
ae952af2 4810 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
4811 successfully or unsuccessfully resolved yyGLRState to...
4812 (yyresolveValue): ... here so that yyresolveValue always leaves a
4813 yyGLRState with consistent data and thus is easier to understand.
4814 Remove the yyvalp and yylocp parameters since they are always just
4815 taken from the yys parameter. When reporting a discarded merged value
4816 in debugging output, note that it is incompletely merged. Document the
4817 interface.
4818 (yyresolveAction): If resolving any of the RHS states fails, destroy
4819 them all rather than leaking them. Thus, as long as user actions are
4820 written to clean up the RHS correctly, yyresolveAction always cleans up
4821 the RHS of a semantic option. Document the interface.
4822
18d9185c
PE
48232006-02-27 Paul Eggert <eggert@cs.ucla.edu>
4824
4825 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
4826 led to a segmentation fault in GNU Pascal. Problem reported
4827 by Waldek Hebisch.
4828
841a7737
JD
48292006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
4830
4831 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
4832 mid-rule action inside a nonterminal symbol in order to declare a
4833 destructor for its semantic value.
4834
fc3f467f
PE
48352006-02-16 Paul Eggert <eggert@cs.ucla.edu>
4836
4837 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
4838 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
4839 __cplusplus && ! defined _STDLIB_H && !
4840 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
4841 defined free))]: Include <stdlib.h> rather than rolling our own
4842 declarations of malloc and free, to avoid problems with
4843 incompatible declarations (using 'throw') C++'s stdlib.h. This
4844 should fix Debian bug 340012
4845 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
4846 reported by Guillaume Melquiond.
4847
a3af26dd
PE
48482006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4849
4d7bc38c
PE
4850 * NEWS: Clarify symbols versus types in unused-value warnings.
4851
a3af26dd
PE
4852 * configure.ac (AC_INIT): Bump version number.
4853
4e26c69e
PE
48542006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4855
4856 * NEWS: Version 2.1a.
4857 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
4858 since C99 requires this.
4859
498e897c
PE
48602006-02-11 Paul Eggert <eggert@cs.ucla.edu>
4861
4862 * m4/c-working.m4: New file.
4863 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
4864
57bb17ca
PE
48652006-02-10 Paul Eggert <eggert@cs.ucla.edu>
4866
4867 * Makefile.maint: Merge from coreutils.
4868
0be105dc
PE
48692006-02-09 Paul Eggert <eggert@cs.ucla.edu>
4870
4871 More portability fixes for problems summarized by Nelson H. F. Beebe.
4872
4873 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
4874 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
4875 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
4876 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
4877 messes up because C++ code is compiled in 32-bit mode but linked
4878 in 64-bit mode.
4879
6fc0c024
PE
48802006-02-08 Paul Eggert <eggert@cs.ucla.edu>
4881
4882 More portability fixes for problems summarized by Nelson H. F. Beebe.
4883
7870f699
PE
4884 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
4885 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
4886
6fc0c024
PE
4887 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
4888 nodist_PROGRAMS, since we don't need to actually compile the
4889 example if we're just doing a plain 'make'. This avoids bothering
4890 the installer unnecessarily about problems due to weird C++
4891 compilers.
4892
fe6c2fde
PE
48932006-02-06 Paul Eggert <eggert@cs.ucla.edu>
4894
4895 More portability fixes for problems summarized by Nelson H. F. Beebe.
4896
4897 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
4898 than #include "...", and compile with -I'.'. The old method was
4899 not portable, according to Posix and the C standard, and it does
4900 not work with Sun C 5.7, where previous #line directives affect
4901 the working directory used in later #include "..." directives.
4902
927b425b
JMG
49032006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4904
4905 Various DJGGP specific issues in /djgpp
4906
d9735e9e
PE
49072006-02-02 Paul Eggert <eggert@cs.ucla.edu>
4908
4909 More portability fixes for problems summarized by Nelson H. F. Beebe.
4910
4911 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
4912 '#include <map>' works and that you can apply ++ to iterators.
4913
5a6755af
PE
49142006-02-01 Paul Eggert <eggert@cs.ucla.edu>
4915
67a0dc4f
PE
4916 Work around portability problems summarized by Nelson H. F. Beebe in
4917 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
4918
8c86f0ef
PE
4919 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4920 that '#include <string>' works.
4921
de35dd59
PE
4922 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
4923 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
4924 "warning: sorry: semantics of inline function static data `const
4925 unsigned char translate_table[262]' are wrong (you'll wind up with
4926 multiple copies)".
4927
67a0dc4f
PE
4928 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
4929 or, xor to not_, and_, or_, and xor_, respectively. This works
4930 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
4931 random system header somewhere that includes the equivalent of
4932 <iso646.h>.
4933
5a6755af
PE
4934 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
4935 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 4936 Suite Version 2.0.
5a6755af 4937
3f001415
JD
49382006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
4939
4940 During deterministic GLR operation, user actions should be able to
4941 influence the parse by changing yychar. To make this easier to fix and
4942 to make glr.c easier to evolve in general, don't maintain yytoken in
4943 parallel with yychar; just compute yytoken when needed.
4944 * tests/glr-regression.at (Incorrect lookahead during deterministic
4945 GLR): Check that setting yychar in a user action has the intended
4946 effect.
4947 * data/glr.c (yyGLRStack): Remove yytokenp member.
4948 (yyclearin): Don't set *yytokenp.
4949 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
4950 yychar rather than *yytokenp to determine the current lookahead.
4951 Compute yytoken locally when needed.
4952 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
4953 point to.
4954
4955 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
4956 after `--report' documentation.
4957
e2a8c0f5
PE
49582006-01-30 Paul Eggert <eggert@cs.ucla.edu>
4959
4960 * src/parse-gram.y (grammar_declaration): Location of printer
4961 symbol is @1, not list->location. Bug reported by twlevo.
4962 * tests/input.at (Incompatible Aliases): Adjust to above change.
4963
6b702268
PE
49642006-01-29 Paul Eggert <eggert@cs.ucla.edu>
4965
27622431
PE
4966 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
4967 all the test at once. This makes the output easier to read in the
4968 normal case.
4969
6b702268
PE
4970 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
4971 got from <http://bro-ids.org/download.html>. The bug is that
4972 when two actions appeared in succession, the second one was
4973 scanned before the first one was added to the grammar rule
4974 as a midrule action. Bison then output the incorrect warning
4975 "parse.y:905.17-906.36: warning: unused value: $3".
4976 * src/parse-gram.y (BRACED_CODE, action): These are no longer
4977 associated with a value.
4978 (rhs): Don't invoke grammar_current_rule_action_append.
4979 (action): Invoke it here instead.
4980 * src/reader.c (grammar_midrule_action): Now extern.
4981 (grammar_current_rule_action_append): Don't invoke
4982 grammar_midrule_action; that is now the scanner's job.
4983 * src/reader.h (last_string, last_braced_code_loc):
4984 (grammar_midrule_action): New decls.
4985 * src/scan-gram.l (last_string): Now extern, sigh.
4986 (last_braced_code_loc): New extern variable.
4987 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
4988 rule already has an action.
4989 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
4990 * tests/input.at (AT_CHECK_UNUSED_VALUES):
4991 Add some tests to check that the above changes fixed the bug.
4992
d40ba6c2
PE
49932006-01-27 Paul Eggert <eggert@cs.ucla.edu>
4994
4995 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
4996 All used changed. Check whether the symbol has a destructor,
4997 not whether it is typed.
4998 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
4999 that the values are still reported as unused. All line numbers
5000 adjusted.
5001
401aace6
PE
50022006-01-23 Paul Eggert <eggert@cs.ucla.edu>
5003
5004 Work around a bug in bro 0.8, which underparenthesizes its
5005 definition of YYLLOC_DEFAULT.
5006 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
5007 their arguments.
5008 * data/lalr1.cc: Likewise.
5009 * data/yacc.cc: Likewise.
5010
06f01bc4
PE
50112006-01-22 Paul Eggert <eggert@cs.ucla.edu>
5012
401aace6
PE
5013 Work around a bug in Pike 7.0, and give the Pike folks a
5014 better way to override the usual int widths.
5015 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
5016 user can override the types.
5017 (short): #undef, to work around a bug in Pike 7.0.
5018 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
5019 (union yyalloc.yyss): Use yytype_int16 rather than short.
5020 All uses changed.
5021 (yysigned_char): Remove.
5022 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
5023 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
5024 * tests/regression.at (Web2c Actions): Adjust to above changes.
5025
5026 * src/reader.c (check_and_convert_grammar): New function.
5027 (reader): Close the input file even if something went wrong during
5028 parsing. Minor file descriptor leak reported by twlevo.
5029
06f01bc4
PE
5030 * src/assoc.c (assoc_to_string): Use a default: abort (); case
5031 to pacify gcc -Wswitch-default.
5032 * src/scan-gram.l (adjust_location): Use a default: break; case
5033 to pacify gcc -Wswitch-default.
5034 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
5035 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5036 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5037 Move these decls to scan-skel.l, since they don't need to be
5038 visible elsewhere.
5039 * src/scan-skel.l: Accept the above decls.
5040 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
5041 is used.
5042
02650b7f
PE
50432006-01-21 Paul Eggert <eggert@cs.ucla.edu>
5044
5045 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
5046 since we don't want to insist on a version number at the start
5047 of the changelog every time.
5048 * Makefile.maint: Sync from coreutils a bit better.
5049 (sc_trailing_blank): Renamed from sc_trailing_space.
5050 All uses changed.
5051 (sc_no_if_have_config_h, sc_require_config_h):
5052 (sc_prohibit_assert_without_use): New rules.
5053 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
5054 (sc_dd_max_sym_length): Fix leading spaces in rule.
5055 (sc_system_h_headers): Prefix with @.
5056 (sc_useless_cpp_parens, m4-check): Output line numbers.
5057 (changelog-check): Allow version only in head.
5058 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
5059 satisfy new Makefile.maint rule.
5060 * data/glr.c: Likewise.
5061 * data/glr.cc: Likewise.
5062 * data/lalr1.cc: Likewise.
5063 * data/yacc.c: Likewise.
5064 * lib/ebitsetv.c: Likewise.
5065 * lib/lbitset.c: Likewise.
5066 * lib/subpipe.c: Likewise.
5067 * lib/timevar.c: Likewise.
5068 * src/system.h: Likewise.
5069 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
5070 * djgpp/Makefile.maint: Add copyright notice.
5071 * djgpp/README.in: Likewise.
5072 * djgpp/config.bat: Likewise.
5073 * djgpp/config.site: Likewise.
5074 * djgpp/config_h.sed: Likewise.
5075 * djgpp/djunpack.bat: Likewise.
5076 * djgpp/config.sed: Fix copyright notice to match standard format.
5077 * djgpp/subpipe.h: Likewise.
5078 * lib/bitsetv-print.c: Likewise.
5079 * lib/bitsetv.c: Likewise.
5080 * lib/subpipe.h: Likewise.
5081 * lib/timevar.c: Likewise.
5082 * lib/timevar.h: Likewise.
5083 * djgpp/subpipe.c: Use standard recipe for config.h.
5084 * lib/abitset.c: Likewise.
5085 * lib/bitset.c: Likewise.
5086 * lib/bitset_stats.c: Likewise.
5087 * lib/bitsetv-print.c: Likewise.
5088 * lib/bitsetv.c: Likewise.
5089 * lib/ebitsetv.c: Likewise.
5090 * lib/get-errno.c: Likewise.
5091 * lib/lbitset.c: Likewise.
5092 * lib/subpipe.c: Likewise.
5093 * lib/timevar.c: Likewise.
5094 * lib/vbitset.c: Likewise.
5095 * tests/local.at: Likewise.
5096 * src/scan-gram.l: Don't include verify.h, since system.h does
5097 that for us.
5098 * .x-sc_require_config_h: New file.
5099 * .x-sc_unmarked_diagnostics: New file.
5100
287c78f6
PE
51012006-01-20 Paul Eggert <eggert@cs.ucla.edu>
5102
287c78f6
PE
5103 Be a bit more systematic about using 'abort'.
5104 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
5105 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
5106 Put 'default: abort ();' before some other case, to satisfy older
5107 pedantic compilers.
5108 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5109 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
5110 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
5111 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
5112 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
5113 (get_decision_str, get_orientation_str, get_node_alignment_str):
5114 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
5115 (get_linestyle_str, get_arrowstyle_str): Likewise.
5116 * src/conflicts.c (resolve_sr_conflict):
5117 Use a default case rather than one for the one remaining enum
5118 value, to catch invalid enum values as well.
5119 * src/lalr.c (set_goto_map, map_goto):
5120 Prefer "assert (FOO);" to "if (!FOO) abort ();".
5121 * src/nullable.c (nullable_compute, token_definitions_output):
5122 Likewise.
5123 * src/reader.c (packgram, reader): Likewise.
5124 * src/state.c (transitions_to, state_new, state_reduction_find):
5125 Likewise.
5126 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
5127 (symbol_pack): Likewise.
5128 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
5129 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
5130 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
5131 * src/system.h: Don't include <assert.h>.
5132 (assert): New macro.
5133
5134 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
5135 (Destructor Decl, Parser Function, Pure Calling):
5136 Describe rules for braces inside C code more carefully.
287c78f6 5137
c66dfadd
PE
51382006-01-19 Paul Eggert <eggert@cs.ucla.edu>
5139
c21493b8
PE
5140 Fix some porting glitches found by Nelson H. F. Beebe.
5141 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
5142 compilers that don't understand that abort () does not return.
5143 * src/state.c (transitions_to): Likewise.
5144 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5145 that '#include <cstdlib>' works.
5146 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
5147 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
5148 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
5149 for the benefit of some pre-C99 compilers.
5150
b6e3facf
PE
5151 * bootstrap: Undo changes to gnulib files that autoreconf made.
5152
c66dfadd
PE
5153 Minor fixups to get 'make maintainer-check' to work.
5154 * configure.ac: Don't use -Wnested-externs, as it's incompatible
5155 with the new verify.h implementation.
5156 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
5157 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
5158 * data/yacc.c (YYUSE): Likewise.
5159 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
5160 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
5161 * src/parse-gram.y (declaration): Don't pass a string constant
5162 to a function that expects char *, since GCC might complain
5163 about the constant value.
5164 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
5165 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
5166 before #defining them.
5167 * tests/glr-regression.at
5168 (Incorrectly initialized location for empty right-hand side in GLR):
5169 In yyerror, use the msg arg.
5170 (Corrupted semantic options if user action cuts parse):
5171 (Incorrect lookahead during deterministic GLR):
5172 (Incorrect lookahead during nondeterministic GLR):
5173 Don't name a local var 'index'; it shadows string.h's 'index'.
5174
ed94ef2a
AD
51752006-01-19 Akim Demaille <akim@epita.fr>
5176
5177 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
5178 location, not just parts of it.
5179
e9ad4aec
PE
51802006-01-18 Paul Eggert <eggert@cs.ucla.edu>
5181
d6ca7905
PE
5182 * NEWS: Document the fact that multiple %unions are now allowed.
5183 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
5184 * TODO: This feature is now implemented, so remove it from
5185 the wishlist.
d6ca7905 5186
ef1b70e0
PE
5187 * Makefile.maint: Merge with coreutils Makefile.maint.
5188 (CVS_LIST): Use build-aux version if available.
5189 (VERSION_REGEXP): New macro.
5190 (syntax-check-rules): Add sc_no_if_have_config_h,
5191 sc_prohibit_assert_without_use, sc_require_config_h,
5192 sc_useless_cpp_parens.
5193 (sc_obsolete_symbols): Check for O_NDELAY.
5194 (sc_dd_max_sym_length): Track coreutils.
5195 (sc_unmarked_diagnostics): Look in all files, not just *.c.
5196 (sc_useless_cpp_parens): New rule.
5197 (news-date-check): Look for version or today's date.
5198 (changelog-check): Don't require version number near head.
5199 (copyright-check): Use current year instead of hardwiring 2005.
5200 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
5201 (announcement): Add --gpg-key-ID.
5202
5203 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
5204 with "file system".
5205
2073ce56 5206 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
5207 array. Problem reported by twlevo.
5208 * src/reader.c (packgram): Prepend a new sentinel before ritem.
5209 * src/lalr.c (build_relations): Rely on new sentinel.
5210 * src/gram.c (gram_free): Adjust to new sentinel.
5211
b7691f15
JD
52122006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
5213
5214 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
5215 yylookaheadNeeds. All uses updated.
5216 (yysplitStack): Rename local yynewLookaheadStatuses to
5217 yynewLookaheadNeeds.
5218 * data/glr-regression.at (Incorrect lookahead during nondeterministic
5219 GLR): In comments, change `lookahead status' to `lookahead need'.
5220
ddee1b06
PH
52212006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5222
5223 * data/glr.c (yysplitStack): A little stylistic rewrite.
5224
12f4614d
PH
52252006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5226
5227 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
5228
32c29292
JD
52292006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
5230
5231 * doc/bison.texinfo: Fix some typos.
5232 (GLR Semantic Actions): New subsection discussing special
5233 considerations because GLR semantic actions might be deferred.
5234 (Actions): Mention look-ahead usage of yylval.
5235 (Actions and Locations): Mention look-ahead usage of yylloc.
5236 (Special Features for Use in Actions): Add YYEOF entry and mention it
5237 in the yychar entry.
5238 In the yychar entry, remove mention of the local yychar case (pure
5239 parser) since this is irrelevant information when writing semantic
148d66d8 5240 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
5241 yychar is otherwise described as an external variable.
5242 In the yychar entry, don't call it the `current' look-ahead since it
5243 isn't when semantic actions are deferred.
5244 In the yychar and yyclearin entries, add note about deferred semantic
5245 actions.
5246 Add yylloc and yylval entries discussing look-ahead usage.
5247 (Look-Ahead Tokens): When discussing yychar, don't call it the
5248 `current' look-ahead, and do mention yylval and yylloc.
5249 (Error Recovery): Cross-reference `Action Features' when mentioning
5250 yyclearin.
148d66d8 5251 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
5252 look-ahead.
5253 In the yylloc and yylval entries, mention look-ahead usage.
5254
de366a2f 52552006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
5256
5257 * tests/glr-regression.at: Update copyright year to 2006.
5258
bf70fa87
JD
52592006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5260
5261 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
5262 use during nondeterministic operation to track which stacks have
5263 actually needed the current lookahead.
5264 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
5265 Allocate, deallocate, resize, and otherwise shuffle space for
5266 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
5267 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
5268 appropriately during nondeterministic operation.
5269 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
5270 members to store the current lookahead to be used by the deferred
5271 user action.
5272 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
5273 from which the RHS is taken. Set the lookahead members of the new
5274 yySemanticOption according to the lookahead status for stack yyk.
5275 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
5276 yyaddDeferredAction.
5277 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
5278 members of yySemanticOption before invoking yyuserAction, and then set
5279 them back to their current values afterward.
5280 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
5281 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
5282 * tests/glr-regression.at: Remove `.' from the ends of recent test case
5283 titles for consistency.
5284 (Leaked merged semantic value if user action cuts parse): In order to
5285 suppress lint warnings, use arguments in merge function, and assign
5286 char value < 128 in main.
5287 (Incorrect lookahead during deterministic GLR): New test case.
5288 (Incorrect lookahead during nondeterministic GLR): New test case.
5289
05449a2c
JD
52902006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5291
de366a2f 5292 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
5293 !yyvaluep as signal that no semantic value is available to print.
5294 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
5295 to print a semantic value.
5296
4158e0a1 52972006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 5298
4158e0a1
JD
5299 * tests/glr-regression.at: For consistency with my newer test cases,
5300 don't thank myself.
5301
d659304d
JD
53022006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5303
5304 * data/glr.c (yyresolveValue): When merging semantic options, if at
5305 least one user action succeeds but a later one cuts the parse, then
5306 destroy the semantic value before returning rather than leaking it.
5307 (yyresolveStates): If a user action cuts the parse and thus
5308 yyresolveValue fails, ignore the (unset) semantic value rather than
5309 corrupting the yyGLRState, and empty the semantic options list since
5310 the user actions should have called all necessary destructors.
5311 Simplify code with YYCHK.
5312 * tests/glr-regression.at (Corrupted semantic options if user action
5313 cuts parse): New test case.
5314 (Undesirable destructors if user action cuts parse): New test case.
5315 Before applying any of this patch, this test case never actually failed
5316 for me... but only because the corrupted semantic options usually
5317 masked this bug.
5318 (Leaked merged semantic value if user action cuts parse): New test
5319 case.
5320
6ec2c0f2
AD
53212006-01-05 Akim Demaille <akim@epita.fr>
5322
5323 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
5324
1b9c21fb
PE
53252006-01-04 Paul Eggert <eggert@cs.ucla.edu>
5326
5327 * data/c.m4 (b4_c_modern): New macro, with a new provision for
5328 _MSC_VER. Problem reported by Cenzato Marco.
5329 (b4_c_function_def): Use it.
5330 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
5331 b4_c_modern.
5332 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
5333 than rolling our own.
5334
84866159
AD
53352006-01-04 Akim Demaille <akim@epita.fr>
5336
5337 Also warn about non-used mid-rule values.
5338 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
5339 member.
5340 (symbol_list_new): Adjust.
5341 * src/reader.c (symbol_typed_p): New.
5342 (grammar_rule_check): Use it.
5343 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
5344 Check its rule.
5345 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
5346 Use it.
5347 * tests/actions.at (Exotic Dollars): Adjust.
5348
378f4bd8
AD
53492006-01-04 Akim Demaille <akim@epita.fr>
5350
5351 * src/reader.c (grammar_midrule_action): If $$ is set in a
5352 mid-rule, move the `used' bit to its lhs.
5353 * tests/input.at (Unused values): New.
5354 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
5355
e2a21b6f
PE
53562006-01-03 Paul Eggert <eggert@cs.ucla.edu>
5357
54662697
PE
5358 * doc/bison.texinfo (Bison Options): Say more accurately what
5359 --yacc does.
5360 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
5361 about declarations in the grammar when in Yacc mode, as POSIX does
5362 not require a diagnostic when the grammar uses extensions.
5363
5364 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
5365
073f9288
PE
5366 Warn about dubious constructions like "%token T T".
5367 Reported by twlevo.
5368 * src/symtab.h (struct symbol.declared): New member.
5369 * src/symtab.c (symbol_new): Initialize it to false.
5370 (symbol_class_set): New arg DECLARING, specifying whether
5371 this is a declaration that we want to warn about, if there
5372 is more than one of them. All uses changed.
5373
1221b78a
PE
5374 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
5375 Allow multiple %union directives, whose contents concatenate.
5376 * src/parse-gram.y (grammar_declaration): Likewise.
5377 Use muscle_code_grow, so that we don't need stype_line any more.
5378 All uses changed.
5379
5380 * src/muscle_tab.c (muscle_grow): Fix comment.
5381
e2a21b6f
PE
5382 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
5383 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
5384 Update copyright year to 2006.
5385
8f7e3cf9
AD
53862006-01-03 Akim Demaille <akim@epita.fr>
5387
5388 Have glr.cc pass (some of) the calc.at tests.
5389 * data/glr.cc (b4_parse_param_orig): New.
5390 (b4_parse_param): Improve its definition, and bound it more
5391 clearly in the skeleton.
5392 (b4_epilogue): Append, instead of prepending, in order to keep
5393 #line consistency.
5394 Simplify the generation of auxiliary functions: locations and
5395 purity are mandated.
5396 (b4_global_tokens_and_yystype): Honor it.
5397 * data/location.cc (c++.m4): Don't include it.
5398 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
5399 and AT_SKEL_CC_IF.
5400 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
5401 AT_LALR1_CC_IF.
5402 Be sure to initialize the first position's filename.
5403 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
5404 mandated anyway.
5405 (AT_CHECK_CALC_GLR_CC): New.
5406 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
5407
3953ed88
AD
54082006-01-02 Akim Demaille <akim@epita.fr>
5409
5410 * src/output.c (output_skeleton): Don't hard wire the inclusion of
5411 c.m4.
0a96ba81 5412 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
5413 * data/glr.cc: Do not include stack.hh.
5414
9ecafbbf
AD
54152006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5416
5417 * data/glr.c: Reformat whitespace with tabs.
5418 (b4_lpure_formals): Remove this unused m4 macro.
5419 * tests/cxx-type.at: Reformat whitespace with tabs.
5420 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
5421 since it's a member. Rename type to isNterm for clarity.
5422
c4d497a0
AD
54232005-12-29 Akim <akim@sulaco.local>
5424
5425 Let glr.cc catch up with symbol_value_print.
5426 * data/glr.cc (b4_yysymprint_generate): Replace by...
5427 (b4_yy_symbol_print_generate): this.
5428 (yy_symbol_print, yy_symbol_value_print): Declare them.
5429
4517da37
PE
54302005-12-28 Paul Eggert <eggert@cs.ucla.edu>
5431
5432 * src/location.h (boundary): Note that a line or column equal
5433 to INT_MAX indicates an overflow.
5434 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
5435 (rule_length_overflow, increment_rule_length, add_column_width):
5436 New functions.
5437 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
5438 (<SC_BRACED_CODE>"}"):
5439 Use increment_rule_length rather than incrementing it by hand.
5440 (adjust_location, handle_syncline): Diagnose overflow.
5441 (handle_action_dollar, handle_action_at):
5442 Fix bug with monstrosities like $-2147483648.
5443 Remove now-unnecessary checks.
5444 (scan_integer): Verify assumptions and remove now-unnecessary checks.
5445 (convert_ucn_to_byte): Verify assumptions.
5446 (handle_syncline): New arg LOC. All callers changed.
5447 Don't store through a value derived from char const * pointer.
5448
5449 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
5450 GCC warnings.
5451
e3233bf6
PE
54522005-12-27 Paul Eggert <eggert@cs.ucla.edu>
5453
5454 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
5455 Remove unnecessary forward static decls.
5456
8f3596a6
AD
54572005-12-27 Akim Demaille <akim@epita.fr>
5458
5459 * src/reader.c (grammar_current_rule_check): Also check that $$
5460 is used.
5461 Take the rule to check as argument, hence rename as...
5462 (grammar_rule_check): this.
5463 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
5464 Rename as...
5465 (grammar_rule_begin, grammar_rule_end): these, for consistency.
5466 (grammar_midrule_action, grammar_symbol_append): Now static.
5467 * tests/torture.at (input): Don't rely on the default action
5468 being always performed.
5469 * tests/calc.at: "Set" $$ even when the action is "cut" with
5470 YYERROR or other.
5471 * tests/actions.at (Exotic Dollars): Instead of using unused
5472 values, check that the warning is issued.
5473
721be13c
PE
54742005-12-22 Paul Eggert <eggert@cs.ucla.edu>
5475
5476 * NEWS: Improve wording for unused-value warnings.
5477
a0af42fc
AD
54782005-12-22 Akim Demaille <akim@epita.fr>
5479
5480 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
5481 (b4_yysymprint_generate): Rename as...
5482 (b4_yy_symbol_print_generate): this.
5483 Generate yy_symbol_print instead of yysymprint.
5484 Generate also yy_symbol_value_print, and use it.
5485
affac613
AD
54862005-12-22 Akim Demaille <akim@epita.fr>
5487
721be13c 5488 * NEWS: Warn about unused values.
affac613
AD
5489 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
5490 a `used' member.
5491 (symbol_list_n_get, symbol_list_n_used_set): New.
5492 (symbol_list_n_type_name_get): Use symbol_list_n_get.
5493 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
5494 * src/reader.c (grammar_current_rule_check): Check that values are
5495 used.
5496 * src/symtab.c (symbol_print): Accept 0.
5497 * tests/existing.at: Remove the type information.
5498 Empty the actions.
5499 Remove useless actions (beware of mid-rule actions: perl -000
5500 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
5501 * tests/actions.at (Exotic Dollars): Use unused values.
5502 * tests/calc.at: Likewise.
5503 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5504 Likewise.
5505
5506 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
5507 rule_useful_p.
5508
9d9b8b70
PE
55092005-12-21 Paul Eggert <eggert@cs.ucla.edu>
5510
8bb4c753
PE
5511 Undo 2005-12-01 tentative license wording change. The wording is
5512 still being reviewed by the lawyers, and we don't want to wait for
5513 them before publishing a test release. For now, revert to the
5514 previous wording.
5515 * NEWS: Undo 2005-12-01 change.
5516 * data/glr.c: Revert to previous license wording.
5517 * data/glr.cc: Likewise.
5518 * data/lalr1.cc: Likewise.
5519 * data/location.cc: Likewise.
5520 * data/yacc.c: Likewise.
5521
9d9b8b70
PE
5522 * NEWS: Reword %destructor vs YYABORT etc.
5523 * data/glr.c: Use American spacing, for consistency.
5524 * data/glr.cc: Likewise.
5525 * data/lalr1.cc: Likewise.
5526 * data/yacc.c: Likewise.
5527 * data/yacc.c: Reformat comments slightly.
5528 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
5529 for consistency. Fix some spelling errors and reword recently-included
5530 text slightly.
5531 * tests/cxx-type.at: Cast results of malloc, for C++.
5532
2c3b392a
AD
55332005-12-21 Joel E. Denny <address@hidden>
5534
5535 * tests/cxx-type.at: Construct a tree, count the parents of shared
5536 nodes, and free each node once and only once. Previously, the memory
5537 for semantic values was leaked instead.
5538
d6cff4dc
AD
55392005-12-21 Joel E. Denny <address@hidden>
5540
5541 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
5542 (yylval, yylloc): If pure, #define to yystackp->yyval and
5543 yystackp->yyloc similar to yychar and yynerrs.
5544 (yyparse): If pure, remove local yylval and yylloc. Add local
5545 yystackp to accommodate pure definitions of yylval and yylloc.
5546 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
5547 yylvalp and yyllocp to &yylval and &yylloc.
5548 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
5549 namespace. Previously, nerrs and char were missing, but lval and lloc
5550 weren't necessary.
5551 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
5552 yylvalp and yyllocp parameters since, if pure, these are now always
5553 accessible through yystackp. If not pure, they are still accessible
5554 globally.
5555 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
5556 `if (YYID (N))' to pacify lint.
5557
a85284cf
AD
55582005-12-21 Akim Demaille <akim@epita.fr>
5559
5560 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
5561 destroy the RHS symbols of a rule.
5562 * data/yacc.c (yylen): Initialize to 0.
5563 Keep its value to the number of items to possibly shift.
5564 In particular, a regular successful parse that ends on YYFINAL by
5565 a (internal) YYACCEPT must not have yylen != 0.
5566 (yyerrorlab, yyreturn): Pop the RHS.
5567 Reorder a bit to emphasize the `shifting' bits of code.
5568 (YYPOPSTACK): Now accept a number of items to pop.
5569 * data/lalr1.cc: Likewise.
5570 * data/glr.c: Formatting changes.
5571 Use goto instead of fall through.
5572 * doc/bison.texinfo (Destructor Decl): Complete.
5573
d508c281
JMG
55742005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5575
5576 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5577 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
5578 * djgpp/config.bat: Replace every occurence of the file name
5579 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5580 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5581 * djgpp/config.sed: Replace every occurence of the file name
5582 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5583 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5584 * djgpp/djunpack.bat: DJGPP specific file.
5585 * djgpp/fnchange.lst: DJGPP specific file.
5586 * djgpp/README.in: Add new information about how to unpack the bison
5587 source on MSDOS and other systems which have 8.3 file name restrictions
5588 using djunpack.bat and fnchange.lst.
5589
3e7a2cd9
PE
55902005-12-12 Paul Eggert <eggert@cs.ucla.edu>
5591
5592 * bootstrap (build_cvs_prefix): Remove; unused.
5593 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
5594 when getting gnulib.
5595
55962005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
5597
5598 * data/glr.c: Reorder typedef declarations for structs to match order
5599 of struct declarations.
5600 Rename yystack everywhere to yystackp except in yyparse where it's not
5601 a pointer.
5602 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
5603 consistency.
5604 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
5605 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
5606 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
5607 lint.
5608
877519f8
PE
56092005-12-09 Paul Eggert <eggert@cs.ucla.edu>
5610
0eca5a39
PE
5611 * tests/sets.at (Accept): Fix typos in regular expression used to
5612 sed out the final state number.
5613
2cec9080
PE
5614 Work around portability problem on Solaris 10: flex-generated
5615 files include <stdio.h> before <config.h>, which messes up
5616 because the latter defines __EXTENSIONS__. Address the problem
5617 by creating two new little files that include <config.h> first,
5618 then include the flex-generated files. Rewrite everyone else
5619 to include <config.h> first, as well.
5620 * lib/timevar.c: Always include "config.h".
5621 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
5622 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
5623 (EXTRA_bison_SOURCES): New macro.
5624 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
5625 * src/system.h: Don't include config.h.
5626 * src/LR0.c: Include <config.h> first.
5627 * src/assoc.c: Likewise.
5628 * src/closure.c: Likewise.
5629 * src/complain.c: Likewise.
5630 * src/conflicts.c: Likewise.
5631 * src/derives.c: Likewise.
5632 * src/files.c: Likewise.
5633 * src/getargs.c: Likewise.
5634 * src/gram.c: Likewise.
5635 * src/lalr.c: Likewise.
5636 * src/location.c: Likewise.
5637 * src/main.c: Likewise.
5638 * src/muscle_tab.c: Likewise.
5639 * src/nullable.c: Likewise.
5640 * src/output.c: Likewise.
5641 * src/parse-gram.y: Likewise.
5642 * src/print.c: Likewise.
5643 * src/print_graph.c: Likewise.
5644 * src/reader.c: Likewise.
5645 * src/reduce.c: Likewise.
5646 * src/relation.c: Likewise.
5647 * src/state.c: Likewise.
5648 * src/symlist.c: Likewise.
5649 * src/symtab.c: Likewise.
5650 * src/tables.c: Likewise.
5651 * src/uniqstr.c: Likewise.
5652 * src/vcg.c: Likewise.
5653
877519f8
PE
5654 * src/parse-gram.y: Fix minor problems uncovered by lint.
5655 (current_lhs, current_lhs_location): Now static.
5656 (current_assoc): Remove unused variable.
5657
5658 Cleanups so that Bison-generated parsers have less lint.
5659 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5660 Prepend /*ARGSUSED*/, for lint's sake.
5661 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5662 definition if 'lint' is defined.
5663 (YYID): New macro (or function, if lint).
5664 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5665 * data/yacc.c: Likewise.
5666 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5667 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5668 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5669 is C++ only.
5670 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5671 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5672 Use YYID(0) rather than 0, for lint.
5673 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5674 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5675
f5228370
PE
56762005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5677
5678 * tests/glr-regression.at
5679 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5680 Close memory leak reported by twlevo.
5681
69ce078b
PE
56822005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5683
6ff99711
PE
5684 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5685 all stacks.
5686 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
5687 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5688 New test case.
5689 (Duplicated user destructor for lookahead): This test now is expected
5690 to succeed.
5691
af3412cd
PE
56922005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5693
32b5b719 5694 * NEWS: Document the following change.
af3412cd
PE
5695 * data/yacc.c: Say "parser skeleton" rather than "file", since
5696 it's no longer just a file.
5697 * data/glr.c: Grant a special exception for C GLR parsers, that
5698 reads like the already-existing exception for C LALR(1) parsers.
5699 * data/glr.cc: Likewise.
5700 * data/lalr1.cc: Likewise.
5701 * data/location.cc: Likewise.
5702 * data/yacc.c: Reword the "written by" statement to clarify that
5703 it was the parser skeleton, not the entire output file.
5704 * data/glr.c: Written by Paul Hilfinger.
5705 * data/glr.cc: Written by Akim Demaille.
5706 * data/lalr1.cc: Likewise.
5707
035aa4a0
PE
57082005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5709
d9963c85
PE
5710 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5711 Fix typos in previous change that broke 'make check'.
5712 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5713 supported in C.
5714 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5715 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5716 We can revert this once things settle down.
5717
035aa4a0
PE
5718 * src/conflicts.c (conflicts_print): Don't print file name twice
5719 when %expect fails because there were no conflicts.
5720 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5721 change.
5722 * tests/conflicts.at (%expect not enough, %expect too much):
5723 (%expect with reduce conflicts): Adjust to new behavior.
5724
57252005-11-18 Akim Demaille <akim@epita.fr>
5726
5727 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5728 errors.
5729 * NEWS: Document this.
5730 * doc/bison.texinfo (Expect Decl): Likewise.
5731
d1ff7a7c
AD
57322005-11-16 Akim Demaille <akim@epita.fr>
5733
5734 Generalize the display of semantic values and locations in traces.
5735 * data/glr.c (yy_reduce_print): Fix indices (again).
5736 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5737 literal integers.
5738 * data/lalr1.cc (yyreduce_print): Rename as...
5739 (yy_reduce_print): this.
5740 Display values and locations.
5741 * data/yacc.c (yy_reduce_print): Likewise.
5742 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5743 (yysymprint): Move higher to be visible from yy_reduce_print).
5744 (yyparse): Adjust.
5745 * tests/calc.at: Adjust the expected length of the traces.
5746
6de5398d
AD
57472005-11-14 Akim Demaille <akim@epita.fr>
5748
5749 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5750 from 1 to N, while values and location start at 0.
5751 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5752
a1373f55
AD
57532005-11-14 Akim Demaille <akim@epita.fr>
5754
5755 * data/glr.c (yy_reduce_print): Fix the $ number.
5756
613d8952
AD
57572005-11-14 Akim Demaille <akim@epita.fr>
5758
5759 "Use" parse parameters.
5760 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5761 * data/glr.c, data/glr.cc: Use them.
5762 * data/glr.c (YYUSE): Have a C++ definition that supports
5763 non-pointer types.
5764
b2741627
AD
57652005-11-14 Akim Demaille <akim@epita.fr>
5766
5767 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5768
5059b5c8
AD
57692005-11-14 Akim Demaille <akim@epita.fr>
5770
42249483
AD
5771 * data/glr.cc: New.
5772 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 5773
4626a15d
AD
57742005-11-12 Akim Demaille <akim@epita.fr>
5775
5776 Let position and location be PODs.
5777 * data/location.cc (position::initialize, location::initialize): New.
5778 (position::position, location::location): Define only if
5779 b4_location_constructors is defined.
5780 * data/lalr1.cc (b4_location_constructors): Define it for backward
5781 compatibility.
5782 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5783
57842005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
5785
5786 * data/lalr1.cc: Move the body of the ctor and dtor into the
5787 parser file (instead of the header).
5788 Wrap the implementations in a "namespace yy".
5789
57902005-11-12 Akim Demaille <akim@epita.fr>
5791
5792 Have glr.c include its header file when created.
5793 * data/glr.c (b4_shared_declarations): New.
5794 Output them verbatim in the parser if !%defines, otherwise
5795 output then in the header file, and include it instead.
5796
1989d947
AD
57972005-11-11 Akim Demaille <akim@epita.fr>
5798
5799 * data/glr.c: Comment changes.
5800
58012005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
5802
5803 When yydebug, report semantic and location values for reductions.
5804 * data/glr.c (yy_reduce_print): Report the semantic values and the
5805 locations.
5806 (YY_REDUCE_PRINT): Adjust.
5807 (yyglrReduce): Use them.
5808 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5809 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5810 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5811 traces.
5812
02998094
AD
58132005-11-10 Akim Demaille <akim@epita.fr>
5814
5815 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5816 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
5817 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
5818
5210672f
PE
58192005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
5820
5821 * m4/cxx.m4, examples/Makefile.am: Don't build
5822 examples/calc++ if no C++ compiler is available. (trivial change)
5823
a8991a1d
AD
58242005-11-09 Akim Demaille <akim@epita.fr>
5825
5826 * src/scan-skel.l: Use a couple of asserts.
5827
36b5e963
AD
58282005-11-03 Akim Demaille <akim@epita.fr>
5829
5830 In some (weird) cases, the final state number is incorrect.
5831 Reported by Alexandre Duret-Lutz.
5832 * src/LR0.c (state_list_append): Remove the computation of
5833 final_state.
5834 (save_reductions): Do it here.
5835 (get_state): Alpha conversion.
5836 (generate_states): Use a for loop.
5837 * src/gram.h (item_number_is_rule_number)
5838 (item_number_is_symbol_number): New.
5839 * src/state.c: Use assert.
5840 * src/system.h: Include assert.h.
5841 * tests/sets.at (Accept): New.
5842
44e7ead1
PH
58432005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5844
5845 * data/glr.c (yyfill): Adjust comment.
36b5e963 5846 (yyresolveAction): Initialize default location properly
44e7ead1
PH
5847 for empty right-hand sides.
5848 (yydoAction): Ditto.
5849 Add comment explaining apparently dead code.
36b5e963
AD
5850 * tests/glr-regression.at
5851 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 5852 New test.
36b5e963 5853
e10a80ee
PE
58542005-10-30 Paul Eggert <eggert@cs.ucla.edu>
5855
5856 * bootstrap (cleanup_gnulib): New function. Use it to clean up
5857 gnulib when interrupted. This fixes some race conditions and
5858 works around some portability problems (one noted by Paul
5859 Hilfinger).
5860
067b32ee
AD
58612005-10-22 Akim <akim@epita.fr>
5862
5863 * Makefile.cfg: Adjust to config -> build-aux.
5864 Reported by twledo.
5865
4b367315
AD
58662005-10-21 Akim Demaille <akim@epita.fr>
5867
5868 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
5869 the %parse-params.
5870 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
5871 * data/yacc.c (b4_Pure_if): Rename as...
5872 (b4_yacc_pure_if): this.
5873 (YY_SYMBOL_PRINT, yyparse): Adjust.
5874 * doc/bison.texinfo: Formatting changes.
5875
24cc23d9
AD
58762005-10-21 Akim Demaille <akim@epita.fr>
5877
5878 Finish the transition config -> build-aux.
5879 * configure.ac, Makefile.am: Use build-aux.
5880 * config/prev-version, config/announce-gen, config/Makefile.am:
5881 Move to...
5882 * build-aux/prev-version, build-aux/announce-gen,
5883 * build-aux/Makefile.am: here.
5884
d4476375
AD
58852005-10-14 Akim Demaille <akim@epita.fr>
5886
5887 * examples/calc++/test: Use set -x only when VERBOSE.
5888
302c0aee
PE
58892005-10-13 Paul Eggert <eggert@cs.ucla.edu>
5890
5891 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
5892 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
5893
7625ec2c
AD
58942005-10-13 Akim Demaille <akim@epita.fr>
5895
5896 * src/scan-skel.l: Output the base name parts of the parser and
5897 header file names.
302c0aee 5898 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
5899 additional checks.
5900 Use this to exercise C++ outputs in subdirs.
5901 Reported by Oleg Smolsky.
5902
ba0fe3c7
PE
59032005-10-12 Paul Eggert <eggert@cs.ucla.edu>
5904
5905 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
5906 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
5907 Problem reported by John P. Hartmann.
5908 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
5909 already defined it.
5910
9b8a5ce0
AD
59112005-10-12 Akim Demaille <akim@epita.fr>
5912
5913 * src/parse-gram.y (version_check): Exit 63 to please missing
5914 (stands for "version mismatch).
5915 * tests/input.at, doc/bison.texinfo: Adjust.
5916
4f6e011e
PE
59172005-10-10 Paul Eggert <eggert@cs.ucla.edu>
5918
5919 Work around portability problems with Visual Age C compiler
5920 (xlc and xlC_r) reported by John P. Hartmann.
5921 * data/location.cc (initial_column, initial_line): Remove.
5922 All uses replaced by 0 and 1.
5923 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
5924 that xlc complains about.
5925 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 5926 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 5927 as __STDC__.
4d7aa45e
PE
5928 * data/yacc.c (YYMODERN_C): New macro, which also looks at
5929 __STDC_VERSION__. Use it everywhere instead of looking at
5930 __STDC__ and __cplusplus.
4f6e011e 5931
a1b3bf8c
AD
59322005-10-10 Akim Demaille <akim@epita.fr>
5933
5934 * examples/calc++/test: Be quiet unless VERBOSE.
5935
412e44aa
PE
59362005-10-05 Paul Eggert <eggert@cs.ucla.edu>
5937
2a4647a3
PE
5938 * data/c.m4 (yydestruct, yysymprint):
5939 Use YYUSE instead of casting to void.
5940 * data/glr.c (YYUSE): New macro.
5941 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5942 Use it instead of rolling our own.
5943 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5944 (YYCHK1):
5945 Use /*CONSTCOND*/ to suppress lint warnings.
5946 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5947 (YY_STACK_PRINT): Use 'false' not '0'.
5948 (YYUSE): New macro.
5949 (yysymprint_, yydestruct_): Use it instead of rolling our own.
5950 * data/yacc.c (YYUSE): New macro.
5951 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
5952 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
5953 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
5954
5955
412e44aa
PE
5956 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
5957 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
5958
88c6637f
PE
59592005-10-04 Paul Eggert <eggert@cs.ucla.edu>
5960
2f4f028d
PE
5961 Undo the parts of the unlocked-I/O change that substituted
5962 putc or puts for printf. This might hurt performance a bit,
5963 but some people prefer the printf style.
5964 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
5965 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
5966 All uses replaced by YYFPRINTF and YYDPRINTF.
5967 * data/yacc.c: Likewise.
5968 * lib/bitset.c (bitset_print): Likewise.
5969 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
5970 putc and puts.
5971 * lib/lbitset.c (debug_lbitset): Likewise.
5972 * src/closure.c (print_firsts, print_fderives): Likewise.
5973 * src/gram.c (grammar_dump): Likewise.
5974 * src/lalr.c (look_ahead_tokens_print): Likewise.
5975 * src/output.c (escaped_output): Likewise.
5976 (user_actions_output): Break apart two printfs.
5977 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
5978 * src/reduce.c (reduce_print): Likewise.
5979 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5980 * src/system.h: Include unlocked-io.h rathe than stdio.h.
5981
88c6637f
PE
5982 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5983 Use assignments rather than casts-to-void to suppress
5984 unused-variable warnings. This pacifies 'lint'.
5985 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
5986 unused-variable warnings.
5987
fb32e373
JMG
59882005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5989
5990 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5991
edb8f44f
PE
59922005-10-02 Paul Eggert <eggert@cs.ucla.edu>
5993
fb9c0b33
PE
5994 Use unlocked I/O for a minor performance improvement on hosts like
5995 GNU/Linux and Solaris that support unlocked I/O. The basic idea
5996 is to use the gnlib unlocked-io module, and to prefer putc and
5997 puts to printf when either will work (since the latter doesn't
5998 come in an unlocked flavor).
5999 * bootstrap (gnulib_modules): Add unlocked-io.
6000 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
6001 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
6002 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
6003 and similarly for puts and putc and printf.
6004 * data/yacc.c: Likewise.
6005 * lib/bitset.c (bitset_print): Likewise.
6006 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
6007 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
6008 to printf.
6009 * lib/lbitset.c (debug_lbitset): Likewise.
6010 * src/closure.c (print_firsts, print_fderives): Likewise.
6011 * src/gram.c (grammar_dump): Likewise.
6012 * src/lalr.c (look_ahead_tokens_print): Likewise.
6013 * src/output.c (escaped_output): Likewise.
6014 (user_actions_output): Coalesce two printfs.
2f4f028d 6015 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
6016 * src/reduce.c (reduce_print): Likewise.
6017 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 6018 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 6019
edb8f44f
PE
6020 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
6021 this confuses xgettext.
6022
b50d2359
AD
60232005-10-02 Akim Demaille <akim@epita.fr>
6024
6025 * bootstrap (gnulib_modules): Add strverscmp.
6026 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
6027 * m4/.cvsignore: Add strverscmp.m4.
6028 * src/parse-gram.y (%require): New token, new rule.
6029 (version_check): New.
6030 * src/scan-gram.l (%require): Adjust.
6031 * tests/input.at (AT_REQUIRE): New.
6032 Use it.
6033 * doc/bison.texinfo (Require Decl): New.
6034 (Calc++ Parser): Use %require.
6035
21667f64
AD
60362005-10-02 Akim Demaille <akim@epita.fr>
6037
6038 * data/location.cc: New.
6039
2b81e969
AD
60402005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
6041 Akim Demaille <akim@epita.fr>
6042
6043 Make sure -odir/foo.cc creates dir/location.hh etc.
6044 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
6045 (spec_file_prefix, spec_verbose_file, spec_graph_file)
6046 (spec_defines_file): Now const.
6047 (dir_prefix): New.
6048 (short_base_name): Remove.
6049 * src/files.c: Adjust.
6050 (dirname.h): Include.
6051 (base_name): Don't prototype it.
6052 (finput): Remove, duplicates gram_in.
6053 (full_base_name, short_base_name): Replace by...
6054 (all_but_ext, all_but_tab_ext): these.
6055 (compute_base_names): Rename as...
6056 (compute_file_name_parts): this.
6057 Update to compute the new variables, including dir_prefix.
6058 Adjust dependencies.
6059 * src/output.c (prepare): Output them.
6060 * src/reader.c: Adjust to use gram_in, not finput.
6061 * src/scan-skel.l (@dir_prefix@): New.
6062
ad6a9b97
JMG
60632005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6064
6065 * lib/subpipe.c: New function end_of_output_subpipe() added
6066 to allow support for non-posix systems. This is a no-op function
6067 for posix systems.
6068
6069 * lib/subpipe.h: New function end_of_output_subpipe() added
6070 to allow support for non-posix systems. This is a no-op function
6071 for posix systems.
6072
6073 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
6074 handle the lack of pipe/fork functionality on non-posix systems.
6075
6076 * djgpp/Makefile.maint: DJGPP specific file.
6077
6078 * djgpp/README.in: DJGPP specific file.
6079
6080 * djgpp/config.bat: DJGPP specific configuration file.
6081
6082 * djgpp/config.sed: DJGPP specific configuration file.
6083
6084 * djgpp/config.site: DJGPP specific configuration file.
6085
6086 * djgpp/config_h.sed: DJGPP specific configuration file.
6087
6088 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
6089
6090 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
6091
fc695704
AD
60922005-10-02 Akim Demaille <akim@epita.fr>
6093
6094 * data/location.cc: New, extract from...
6095 * data/lalr1.cc: here.
6096 (location.hh): Include it after the user prologue, in case the
6097 filename type is defined by the user.
6098 Forward declation location and position before the pre-prologue.
6099 (yyresult_): Rename as...
6100 (yyresult): this, it's a local variable, not an attribute.
6101 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
6102
61032005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
6104
6105 * examples/extexi: Restore the #line generation.
6106
fb9712a9
AD
61072005-09-30 Akim Demaille <akim@epita.fr>,
6108 Alexandre Duret-Lutz <adl@gnu.org>
6109
6110 Move the token type and YYSTYPE in the parser class.
6111 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
6112 (parser::token): New, from the moved free definition of tokens.
6113 (parser::semantic_value): Now a full definition instead of an
6114 indirection to YYSTYPE.
6115 (b4_post_prologue): No longer included in the header file, but
6116 in the implementation file.
6117 * doc/bison.texi (C+ Language Interface): Update.
6118 * src/parse-gram.y: Support unary %define.
6119 * tests/actions.at: Define global_tokens_and_yystype for backward
6120 compatibility until we update the tests.
6121 * tests/calc.at: Idem.
6122 (first_line, first_column, last_line, last_column): Define for lalr1.cc
6123 to simplify the code.
6124
55f0c7b1
PE
61252005-09-29 Paul Eggert <eggert@cs.ucla.edu>
6126
6127 Port to SunOS 4.1.4, which lacks strtoul and strerror.
6128 Ah, the good old days! Problem reported by Peter Klein.
6129 * bootstrap (gnulib_modules): Add strerror, strtoul.
6130 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
6131 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
6132
fb9712a9 61332005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
6134
6135 * data/c.m4 (b4_error_verbose_if): New.
6136 * data/lalr1.cc: Use it.
6137 (YYERROR_VERBOSE_IF): Remove.
6138 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
6139 parser members, replaced by...
6140 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
6141 local variables.
6142 (yysyntax_error_): Takes the state number as argument.
6143 (yyreduce_print_): Use the argument yyrule, not the former
6144 attribute yyn_.
6145
8a6f72f3
PE
61462005-09-26 Paul Eggert <eggert@cs.ucla.edu>
6147
6148 * bootstrap (gnulib_modules): Add verify.
6149 * lib/.cvsignore: Add verify.h.
6150 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
6151 * src/system.h (verify): Remove.
6152 Include verify.h instead.
6153 * src/tables.c (tables_generate): Use new API for 'verify'.
6154
0d50976f
PE
61552005-09-21 Paul Eggert <eggert@cs.ucla.edu>
6156
ebc3737e
PE
6157 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
6158 local variables whose names begin with 'yy'.
6159 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
6160 Trivial changes from Joel E. Denny.
6161
0d50976f
PE
6162 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
6163 it itself.
6164 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
6165 don't use alloca any more.
6166
6167 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
6168 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 6169 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
6170 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
6171 to match yacc.c, to test more hosts.
6172
a05b79df
PE
61732005-09-20 Paul Eggert <eggert@cs.ucla.edu>
6174
55289366
PE
6175 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
6176 doesn't affect behavior.
6177 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
6178 Solaris, AIX, MSC.
6179 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
6180 This works a bit better with glibc, if user code has already included
6181 stdlib.h.
6182 * doc/bison.texinfo (Bison Parser): Document that users can't
6183 arbitrarily use malloc and free for other purposes. Document
6184 that <alloca.h> and <malloc.h> might be included.
6185 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
6186 user must declare alloca.
6187
a05b79df
PE
6188 * HACKING (release): Forwarn the Translation Project about
6189 stable releses.
6190
3ab2ca22
AD
61912005-09-20 Akim Demaille <akim@epita.fr>
6192
6193 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
6194
a9739e7c
PE
61952005-09-19 Paul Eggert <eggert@cs.ucla.edu>
6196
a702593e
PE
6197 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
6198 (YYSTACK_ALLOC_MAXIMUM): Use it.
6199 (yysyntax_error): New function.
6200 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
6201 multiple syntax errors are reported, and alloca is being used.
6202 Instead, reallocate buffers twice as big each time, so that
6203 we waste at most half the allocated memory. Start with a small
6204 (128-byte) buffer that will suffice in most cases anyway.
6205 Use yysyntax_error to do most of the work.
6206
6207 * doc/bison.texinfo (Error Reporting, Table of Symbols):
6208 yynerrs is the number of errors reported, not the number of
6209 errors encountered.
6210
a9739e7c
PE
6211 * tests/glr-regression.at (Duplicated user destructor for lookahead):
6212 Mark it as expected to fail.
6213 Cast result of malloc; problem reported by twlevo@xs4all.nl.
6214 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
6215 Don't start user-code symbols with "yy", to avoid name space problems.
6216
f479c6c6
AD
62172005-09-19 Akim Demaille <akim@epita.fr>
6218
6219 Remove the traits, failed experiment.
6220 It never proved useful, and anyway because of the current
6221 definition, it was not possible to have several specialization of
6222 this traits, making it useless.
6223 * data/lalr1.cc (yy:traits): Remove.
6224 Inline its definitions in the parser class.
6225
e2586f82
AD
62262005-09-19 Akim Demaille <akim@epita.fr>
6227
6228 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
6229 least Mac OSX with a /usr/local install of gettext.
6230
2e8cf949
AD
62312005-09-19 Akim Demaille <akim@epita.fr>
6232
6233 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
6234 and yytoken for similarity with the other skeletons.
6235
c7fb0b90
AD
62362005-09-19 Akim Demaille <akim@epita.fr>
6237
4e26c69e 6238 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 6239
1bd0deda
PE
62402005-09-16 Paul Eggert <eggert@cs.ucla.edu>
6241
6242 * NEWS: Version 2.1.
6243
6244 * NEWS: Remove notice of yytname change, since it was never in an
6245 official release.
6246 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
6247 diagnostic.
6248 * src/output.c (prepare): Likewise.
6249 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
6250 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
6251 is not defined. This is an awful hack, but it's enough for now.
6252 All callers changed.
6253 * tests/glr-regression-at (make_value): Args are const pointers now,
6254 to avoid GCC warning.
6255 (Duplicated user destructor for lookahead): New test. Currently
6256 skipped. It fails on my host but I'm not sure it'll always fail.
6257
62582005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
6259
6260 * src/symtab.h (struct symbol): Declare the printer and destructor
6261 as const, to avoid accidental calls to free.
6262 (symbol_destructor_set, symbol_printer_set): Adjust.
6263 * src/symtab.c: Adjust.
6264
1bd0deda 62652005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
6266
6267 * data/c.m4 (b4_token_enums): New.
6268 (b4_token_defines): Rename as...
6269 (b4_token_enums_defines): this.
6270 (b4_token_defines): New, output only the #defines.
6271 * data/yacc.c, data/glr.c: Adjust.
6272 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
6273 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
6274 as default values.
6275
dbcdae2d
AD
62762005-09-16 Akim Demaille <akim@epita.fr>
6277
6278 * data/lalr1.cc (yylex_): Remove, inline its code.
6279 (yyreport_syntax_error_): Remove, replaced by...
6280 (yysyntax_error_): this which returns a string and leaves to the
6281 caller the call to the users' error function.
6282 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
6283 Move from members of the parser object...
6284 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
6285 to local variables of the parse function.
6286
70d8f291
AD
62872005-09-16 Akim Demaille <akim@epita.fr>
6288
6289 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
6290 since it's in Bison's name space.
6291
b47dbebe
PE
62922005-09-15 Paul Eggert <eggert@cs.ucla.edu>
6293
ae199bf1
PE
6294 * data/glr.c (yyresolveValue): Add default case to pacify
6295 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
6296
b47dbebe
PE
6297 * NEWS: Document when yyparse started to return 2.
6298 * doc/bison.texinfo (Parser Function): Document when yyparse
6299 returns 2.
6300
6301 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
6302 (b4_filename_type): Renamed back from b4_file_name_type. All uses
6303 changed.
6304 (class position): file_name -> filename (reverting). All uses changed.
6305
63062005-09-14 Paul Eggert <eggert@cs.ucla.edu>
6307
6308 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
6309 do anything if $@ exists. This reverts part of the 2005-07-07
6310 patch.
6311
00292f66
PE
63122005-09-11 Paul Eggert <eggert@cs.ucla.edu>
6313
6314 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
6315 contains obsolete information and isn't worth distributing as a
6316 separate file anyway.
6317 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
6318 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
6319 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
6320 (yyparse): Abort if user code uses longjmp to throw an unexpected
6321 value.
6322
a420f962
PE
63232005-09-09 Paul Eggert <eggert@cs.ucla.edu>
6324
00292f66
PE
6325 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
6326 Suggested by twlevo@xs4all.nl.
6327
127287e9
PE
6328 * data/glr.c (YYCHK1): Do not assume YYE is in range.
6329 This avoids a diagnostic from gcc -Wswitch-enum.
6330 Problem reported by twlevo@xs4all.nl.
6331
a420f962
PE
6332 * doc/bison.texinfo: Don't use "filename", as per GNU coding
6333 standards. Use "file name" or "file" or "name", depending on
6334 the context.
6335 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
6336 not to hack/foo.tab.c.
6337 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
6338 * data/glr.c: b4_filename -> b4_file_name.
6339 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
6340 All uses changed.
6341 (class position): filename -> file_name. All uses changed.
6342 * data/yacc.c: b4_filename -> b4_file_name.
6343 * lib/bitset.h: filename -> file_name in local vars.
6344 * lib/bitset_stats.c: Likewise.
6345 * src/files.c: Likewise.
6346 * src/scan-skel.l ("@output ".*\n): Likewise.
6347 * src/files.c (file_name_split): Renamed from filename_split.
6348 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
6349
63502005-09-08 Paul Eggert <eggert@cs.ucla.edu>
6351
6352 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
6353 to accommodate latest gnulib.
6354
6355 * tests/glr-regression.at (Duplicate representation of merged trees):
6356 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
6357
6358 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
6359 needed.
6360
42a6501d
PE
63612005-08-26 Paul Eggert <eggert@cs.ucla.edu>
6362
6363 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
6364 All uses changed. Invoke user destructor after an error during a
6365 split parse (trivial change from Joel E. Denny).
6366
6367 * tests/glr-regression.at
6368 (User destructor after an error during a split parse): New test case.
6369 Problem reported by Joel E. Denny in:
6370 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
6371
ef9a1faf
PE
63722005-08-25 Paul Eggert <eggert@cs.ucla.edu>
6373
5b4aaf78
PE
6374 * README-cvs: Give URLs for recommended tools.
6375 Mention Gzip version problem, and bootstrapping issues.
6376 Remove troubleshooting section, as it's somewhat obsolete.
6377
b5240ba5
PE
6378 * bootstrap (no_cache): New var, to accommodate different wget
6379 variants. Use it instead of '-C off'. Problem reported by
6380 twlevo@xs4all.nl.
6381
ef9a1faf
PE
6382 * data/glr.c (yydestroyStackItem): New function.
6383 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
6384 debugging information. Problem reported by Joel E. Denny.
6385
e6efa9da
AD
63862005-08-25 Akim Demaille <akim@epita.fr>
6387
6388 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
6389
adc90f13
PE
63902005-08-24 Paul Eggert <eggert@cs.ucla.edu>
6391
6392 * data/glr.c (yyrecoverSyntaxError, yyreturn):
6393 Don't invoke destructor on unresolved entries.
6394 * tests/glr-regression.at
6395 (User destructor for unresolved GLR semantic value): New test case.
6396 Problem reported by Joel E. Denny in:
6397 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
6398
f9315de5
PE
63992005-08-21 Paul Eggert <eggert@cs.ucla.edu>
6400
15d29c1f
PE
6401 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
6402 Add strnlen.c.
6403 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
6404 lib-prefix.m4, po.m4.
6405
dd5f2af2
PE
6406 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
6407 in yydestruct diagnostic, since it might not be an error.
6408 Problem reported by Joel Denny near end of
6409 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 6410 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
6411 * data/yacc.c (yyreturn): Likewise.
6412 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
6413
6414 * src/files.c: Remove obsolete FIXME comment.
6415
6416 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
6417 with the other templates, and to fix bogus run-on messages such
6418 as the one reported at the end of
6419 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6420 All callers changed to avoid the newline.
6421 (yyprocessOneStack): Output two lines rather than one, to accommodate
6422 the above change. This changes the debug output format slightly.
6423
f9315de5
PE
6424 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
6425 reported by Joel E. Denny in
6426 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
6427 (trivial change).
6428 * tests/glr-regression.at (Duplicate representation of merged trees):
6429 New test, from Joel E. Denny in:
6430 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
6431 * THANKS: Add Joel E. Denny.
6432
6433 * configure.ac (AC_INIT): Bump to 2.0c.
6434
04098407
PE
64352005-07-24 Paul Eggert <eggert@cs.ucla.edu>
6436
6437 * NEWS: Version 2.0b.
6438
ca5d2013
PE
6439 * Makefile.am (SUBDIRS): Put examples before tests, so that
6440 "make check" doesn't finish with "All 1 tests passed".
6441
3d54b576
PE
6442 * tests/regression.at (Token definitions): Don't rely on
6443 AT_PARSER_CHECK for data that contains backslashes. It currently
6444 uses 'echo', and 'echo' isn't portable if its argument contains
6445 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
6446 that the byte '\0xff' is not printable in the C locale; it is,
6447 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
6448 not printable, so use '\0x81' to test.
6449
d53ae497
PE
6450 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
6451 version of GCC, since the macro is used with non-GCC compilers.
6452
fc01665e
PE
6453 Fix core dump reported by Pablo De Napoli in
6454 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
6455 * tests/regression.at (Invalid inputs with {}): New test.
6456 * src/parse-gram.y (token_name): Translate type before using
6457 it as an index.
6458
04098407
PE
6459 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
6460 the user's name space. All uses changed to __attribute__
6461 ((__unused__)).
6462 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
6463 Add __attribute__ ((__noreturn__)).
6464
6465 * etc/clcommit: Remove. We weren't using it, and it failed
6466 "make maintainer-distcheck".
6467 * Makefile.maint: Merge from coreutils.
6468 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
6469 (syntax-check-rules): Change list of rules as described below.
6470 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
6471 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
6472 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
6473 (sc_trailing_space): New rules.
6474 (sc_xalloc_h_in_src): Remove.
6475 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
6476 (sc_space_tab, sc_error_exit_success, sc_changelog):
6477 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
6478 (makefile-check, po-check, author_mark_check):
6479 (makefile_path_separator_check, copyright-check):
6480 Use grep -n, to make it easier to find violations.
6481 Use CVS_LIST and CVS_LIST_EXCEPT.
6482 (header_regexp, h_re): Remove.
6483 (dd_c): New macro.
6484 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
6485 (my-distcheck): Use more-modern GCC flags.
6486 (signatures, %.asc): Remove.
6487 (rel-files, announcement): Remove signatures.
6488 Restore old updating code, even though we don't use it, so
6489 that we're the same as coreutils.
6490 (alpha, beta, major): Depend on news-date-check.
6491 Make the upload commands.
6492
6493 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
6494 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
6495 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
6496 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
6497 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
6498 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
6499 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
6500 * tests/sets.at: Likewise.
6501
6502 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
6503 we comment out the Autoconf version number.
6504 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
6505 it's error-prone and "make maintainer-distcheck" rejects it.
6506
6507 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
6508 Indent calls to "error" to pacify "make maintainer-distcheck",
6509 when the calls are not intended to be translated.
6510 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
6511
6512 * src/Makefile.am (DEFS): Use +=, to pacify
6513 "make maintainer-distcheck".
6514 (bison_SOURCES): Add scan-skel.h.
6515 (sc_tight_scope): New rule, from coreutils.
6516
6517 * src/files.c (src_extension, header_extension):
6518 Now static, not extern.
6519 * src/getargs.c (short_options): Likewise.
6520 * src/muscle_tab.c (muscle_table): Likewise.
6521 * src/parse-gram.y (current_class, current_type, current_prec):
6522 Likewise.
6523 * src/reader.c (grammar_end, previous_rule_end): Likewise.
6524 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
6525 * src/main.c (main): Cast bindtextdomain and textdomain calls to
6526 void, to avoid warning when NLS is disabled.
6527 * src/output.c: Include scan-skel.h.
6528 (scan_skel): Remove decl, since scan-skel.h does this.
6529 (output_skeleton):
6530 Indent calls to "error" to pacify "make maintainer-distcheck".
6531 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
6532 * src/reader.h (gram_end, gram_lineno): New decls to pacify
6533 "make maintainer-distcheck".
6534 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
6535 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
6536 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
6537 (skel_lex_destroy, scan_skel): Move these decls to...
6538 * src/scan-skel.h: New file.
6539 * src/uniqstr.c (uniqstr_assert):
6540 Indent calls to "error" to pacify "make maintainer-distcheck".
6541
6542 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
6543 not @VAR@.
6544
6545 * tests/torture.at: Revamp to avoid misuse of atoi that
6546 "make maintainer-distcheck" complained about.
6547
6548 * examples/extexi (message): Don't print a message more than once,
6549 and omit line-number decoration that makes Emacs compile think
6550 that informative messages are worth worrying about.
6551
65522005-07-22 Paul Eggert <eggert@cs.ucla.edu>
6553
6554 * configure.ac: Update version number.
6555
6556 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
6557 accidentally.
6558 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
6559 autogenerated by the maintainer.
6560 * examples/calc++/.cvsignore: Add *.yy.
6561
6562 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
6563 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6564 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6565
6566 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
6567
6568 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
6569 from maintainer-distcheck about casting the argument of 'free'.
6570
6571 * NEWS: Mention recent yytname changes.
6572 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
6573
6574 * bootstrap: For translations that have not yet been upgraded to
6575 the new runtime-po domain, prime the pump by extracting the
6576 relevant strings from the obsolete translations. This code can be
6577 removed once the bison-runtime domain has been translated by each
6578 team.
6579
6580 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
6581 now that token names are already quoted.
6582
6583 Fix problem reported by Anthony Heading.
6584 * data/glr.c (YYTOKEN_TABLE): New macro.
6585 (yytname): Define if YYTOKEN_TABLE.
6586 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
6587 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
6588 (YYERROR_VERBOSE): Define the same way the other skeletons do.
6589 * src/output.c (prepare_symbols): Output token_table_flag.
6590
0ffda363
PE
65912005-07-21 Paul Eggert <eggert@cs.ucla.edu>
6592
6593 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
6594 again if the first call fails.
6595
6596 * data/glr.c (yytnamerr): New function.
6597 (yyreportSyntaxError): Use it to dequote most string literals.
6598 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
6599 with other skeletons. All uses changed.
6600 (yytnameerr_): New function.
6601 (yyreport_syntax_error): Use it to dequote most string literals.
6602 * data/yacc.c (yytnamerr): New function.
6603 (yyerrlab): Use it to decode most string literals.
6604 * doc/bison.texinfo (Decl Summary, Calling Convention):
6605 Clarify quoting convention of yytname.
6606 * src/output.c (prepare_symbols): Quote all names. This undoes
6607 the 2005-04-17 change, which is now accomplished (mostly) via
6608 changes in the parsers as described above.
6609 * tests/regression.at (Token definitions, Web2c Actions):
6610 Undo most 2005-04-17 change here, too.
6611
66122005-07-20 Paul Eggert <eggert@cs.ucla.edu>
6613
6614 Fix more problems reported by twlevo@xs4all.nl.
6615 * tests/cxx-type.at: Don't pipe output of ./types through sed to
6616 remove trailing spaces. This loses the exit status of ./types,
6617 and isn't needed since ./types shouldn't be emitting trailing
6618 spaces.
6619 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
6620 as the stack isn't valid in that case.
6621
6622 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6623 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6624 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6625 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
6626 is used.
6627 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
6628 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6629 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6630 Likewise.
6631
6632 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
6633 overly-picky compilers that reject 'char *foo = "bar";'.
6634
6635 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
6636 to FILE * parameter, not to stderr. This fixes a typo introduced
6637 in the 2005-07-12 change.
6638
6639 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
6640 warnings from GCC 4.
6641
6642 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
6643 (yyglrShiftDefer, yysplitStack):
6644 Remove unused parameters b4_pure_formals. All uses changed.
6645 (yyglrShift): Remove unused parameters b4_user_formals.
6646 All uses changed.
6647 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6648
6100a9aa
PE
66492005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6650
258b75ca
PE
6651 Destructor cleanups and regularization among the three skeletons.
6652 * NEWS: Document the behavior changes.
6653 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6654 stack before failing, as the cleanup code will do it for us now.
6655 * data/lalr1.cc (yyerrlab): Likewise.
6656 * data/glr.c (yyparse): Pop everything off the stack before
6657 freeing it, so that destructors get called properly.
6658 * data/lalr1.cc (yyreturn): Likewise.
6659 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6660 This is more consistent.
6661 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6662 why destructors might be called. 1.875 -> 2.1.
6663 (Destructor Decl, Decl Summary, Table of Symbols):
6664 Some English-language cleanups for %destructor.
6665 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6666 Add output line for destructor of start symbol.
6667 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6668 because of that same extra output line.
6669
1a059451
PE
6670 * NEWS: Document minor wording changes in diagnostics of
6671 Bison-generated parsers.
6672 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6673 Remove unused formals. All uses changed.
6674 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6675 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6676 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6677 Rename yyoverflowab to yyexhaustedlab.
6678 When memory exhaustion occurs during syntax-error reporting,
6679 report it separately rather than in a single diagnostic; this
6680 eases translation.
6681 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6682 (Memory Exhausted): Renamed from Parser Stack Overflow.
6683 Revamp wording slightly to prefer "memory exhaustion".
6684 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6685
97460c78
PE
6686 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6687
30757c8c
PE
6688 Add i18n support to the GLR skeleton. Partially fix the C++
6689 skeleton; a C++ expert needs to finish this. Remove debugging
6690 msgids; there's little point to having them translated, since they
6691 can be understood only by someone who can read the
6692 (English-language) source code.
6693
6694 Generate runtime-po/bison-runtime.pot automatically, so that we
6695 don't have to worry about garbage getting in that file. We'll
6696 make sure after the next official release that old msgids don't
6697 get lost. See
6698 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6699
6700 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6701 Now auto-generated.
6702 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6703 Fix typos in explanations of the runtime file.
6704 * bootstrap: Change gettext keyword from YYI18N to YY_.
6705 Use standard Makefile.in.in in runtime-po, since we'll arrange
6706 for backward-compatible bison-runtime.po files in a different way.
6707 * data/glr.c (YY_): New macro, from yacc.c.
6708 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6709 Translate messages intended for users.
6710 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6711 the wording in the other skeletons. We don't know that the memory
6712 is virtual.
6713 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6714 Use same method that yacc.c uses.
6715 Don't translate debugging messages.
6716 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6717 it doesn't work (yet), and requires C++ expertise to fix.
6718 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6719 Move defn to a more logical place, to be consistent with other
6720 skeletons.
6721 Don't translate debugging messages.
6722 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6723 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6724 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6725 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6726
ac8c5689
PE
6727 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6728 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6729 void, not int.
6730 * tests/glr-regression.at (Badly Collapsed GLR States):
6731 Likewise.
6732 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6733 yylex should return 0 at EOF rather than aborting.
6734
6100a9aa
PE
6735 Improve tests for stack overflow in GLR parser.
6736 Problem reported by twlevo@xs4all.nl.
6737 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6738 All uses removed.
6739 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6740 can handle the problem.
6741 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6742 (yyparse): New local variable yyresult to record the result.
6743 Use result of setjmp to set it, rather than storing itinto
6744 struct.
6745 (yyDone): Remove label.
6746 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6747 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6748 if YYABORT is used).
6749 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6750 yyparse status; put status > 1 into diagnostic.
6751 Check that status==2 works.
6752 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6753 Use exit status 3 for failure to open (which shouldn't happen).
6754
15f40952
PE
67552005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6756
67fd79c4
PE
6757 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6758 1 on syntax error; just let yyparse do its thing.
6759 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6760 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6761 (Exploding the Stack Size with Alloca):
6762 (Exploding the Stack Size with Malloc):
6763 Expect exit status 2, not 1, since the parser is supposed to blow
6764 its stack. Problem reported by twlevo@xs4all.nl.
6765
15f40952
PE
6766 * data/glr.c (yyparse): Don't assume that the initial calls
6767 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6768 Print a stack-overflow message and fail instead.
6769 Initialize the line-number information before creating the stack,
6770 so that the stack-overflow message can report line zero safely.
6771
f32c66b5
PE
67722005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6773
a22ff96f 6774 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
6775 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6776 (yyuserMerge): Provide a default case if b4_mergers is empty.
6777 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6778 * tests/glr-regression.at
6779 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 6780 Add casts to pacify C++ compilers.
1beb0b24
PE
6781 * tests/glr-regression.at (Improper merging of GLR delayed action
6782 sets): Declare yylex before using it.
f32c66b5 6783 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
6784 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6785 test for valgrind; valgrind is independent of g++.
6786 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6787 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6788 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6789 Use a destructor, so that we can expand the stack. Change
6790 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 6791
d741bd1b
PE
67922005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6793
6794 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6795 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6796
0410a6e0
PE
67972005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6798
6799 * PACKAGING: New file, suggested by Bruno Haible and taken from
6800 similar wording in gettext's PACKAGING file.
6801 * NEWS: Mention PACKAGING.
6802 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6803
f7ab6a50
PE
68042005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6805
baf785db 6806 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
6807 * bootstrap: Get runtime translations into runtime-po.
6808 Create runtime-po files automatically, if possible.
6809 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6810 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6811 does not infringe on the user's name space.
6812 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6813 * doc/bison.texinfo (Internationalization): Revamp the English
6814 and Texinfo syntax a bit, to try to make it clearer.
6815 (Bison Options, Option Cross Key): Mention --print-localedir.
6816 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
6817 YYENABLE_NLS. Quote a bit more.
6818 * runtime-po/.cvsignore: New file.
6819 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
6820 * runtime-po/Rules-quot: Remove; now created by bootstrap.
6821 * runtime-po/quot.sed: Likewise.
6822 * runtime-po/boldquot.sed: Likewise.
6823 * runtime-po/en@quot.header: Likewise.
6824 * runtime-po/en@boldquot.header: Likewise.
6825 * runtime-po/insert-header.sin: Likewise.
6826 * runtime-po/remove-potcdate.sin: Likewise.
6827 * runtime-po/Makevars: Likewise.
6828 * runtime-po/LINGUAS: Likewise.
6829 * runtime-po/de.po: Likewise; we will rely on the translation project
6830 to maintain this, so "bootstrap" should get it.
0410a6e0 6831 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
6832 its value.
6833 * src/main.c (main): Bind the bison-runtime domain, too.
6834
68352005-07-12 Bruno Haible <bruno@clisp.org>
6836
6837 * data/yacc.c: Include <libintl.h> when NLS is enabled.
6838 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
6839 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
6840 * runtime-po: New directory.
6841 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
6842 $(DOMAIN).pot-update rule, so that old messages are never dropped.
6843 * runtime-po/Rules-quot: New file, copied from po/.
6844 * runtime-po/quot.sed: Likewise.
6845 * runtime-po/boldquot.sed: Likewise.
6846 * runtime-po/en@quot.header: Likewise.
6847 * runtime-po/en@boldquot.header: Likewise.
6848 * runtime-po/insert-header.sin: Likewise.
6849 * runtime-po/remove-potcdate.sin: Likewise.
6850 * runtime-po/Makevars: New file.
6851 * runtime-po/POTFILES.in: New file.
6852 * runtime-po/LINGUAS: New file.
6853 * runtime-po/bison-runtime.pot: New file.
6854 * runtime-po/de.po: New file.
6855 * m4/bison.m4: New file.
6856 * Makefile.am (SUBDIRS): Add runtime-po.
6857 (aclocaldir, aclocal_DATA): New variables.
6858 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
6859 Define aclocaldir.
6860 * src/getargs.c (usage): Document --print-localedir option.
6861 (PRINT_LOCALEDIR_OPTION): New enum item.
6862 (long_options): Add --print-localedir option.
6863 (getargs): Handle --print-localedir option.
6864 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
6865 (Internationalization): New section.
6866
22dda0f0
AD
68672005-07-12 Akim Demaille <akim@epita.fr>
6868
6869 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
6870 for consistency with the rest of the code.
6871 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
6872 Add separators.
6873
82b248ad
AD
68742005-07-12 Akim Demaille <akim@epita.fr>
6875
6876 * src/parse-gram.y: Use %printer instead of YYPRINT.
6877
fa0e9314
AD
68782005-07-12 Akim Demaille <akim@epita.fr>
6879
867a3e00
AD
6880 * src/symtab.h, src/symtab.c (symbol_print): New.
6881 * src/symlist.h, src/symlist.c (symbol_list_print): New.
6882 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
6883
68842005-07-12 Akim Demaille <akim@epita.fr>
6885
6886 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
6887 b4_at_dollar and b4_dollar_dollar.
6888
e054b190
PE
68892005-07-11 Paul Eggert <eggert@cs.ucla.edu>
6890
6891 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
6892 and Pennello's paper.
6893
34160ec4
PE
68942005-07-09 Paul Eggert <eggert@cs.ucla.edu>
6895
407d4a75
PE
6896 * data/yacc.c (yyparse): Undo previous patch. Instead,
6897 set yylsp[0] and yyvsp[0] only if the initial action
6898 sets yylloc and yylval, respectively.
6899
34160ec4
PE
6900 * data/yacc.c (yyparse): In the initial action, set
6901 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
6902 This avoids the use of undefined variables if the initial
6903 action does not set yylloc and/or yylval.
6904
c3d5a4a7
PE
69052005-07-07 Paul Eggert <eggert@cs.ucla.edu>
6906
b34d96c1
PE
6907 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
6908 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
6909 Remove from CVS. These files are automatically generated.
6910 * examples/extexi: Clarify that this file is now part of Bison,
6911 not GNU M4, and that it works with any POSIX-compatible Awk.
6912 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
6913 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
6914 so that we also get calc++-parser.yy. Geneate it.
6915 Use $(AWK), not gawk, since any conforming Awk will do.
6916 Put comment before action, since older 'make' can't handle comment
6917 in action.
6918 $(BUILT_SOURCES): List all built sources, not just some of them.
6919 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
6920 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
6921 $($(calc_sources_generated)): Remove unnecessary test for existence
6922 of target. (This had a shell syntax error anyway; a stray "x".)
6923 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
6924 calc++-parser.yy.
6925 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
6926
c3d5a4a7
PE
6927 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
6928 implied by the other modules.
6929
828c373b
AD
69302005-07-06 Akim Demaille <akim@epita.fr>
6931
6932 Bind examples/calc++ to the package.
6933 * examples/calc++/Makefile: Remove, replaced by...
6934 * examples/calc++/Makefile.am: ... this new file.
6935 * examples/calc++/test: Remove input.
6936 * examples/calc++/compile: Remove.
6937 * examples/Makefile.am: New.
6938 * configure.ac, Makefile.am: Adjust.
6939 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
6940
63cb01d6
PE
69412005-07-05 Paul Eggert <eggert@cs.ucla.edu>
6942
fd2df2ed
PE
6943 * data/glr.c (yyFail): Drastically simplify; since the format argument
6944 never had any % directives, we can simply pass it to yyerror.
6945 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
6946 be modified later, as that is the usual style in glr.c.
6947 Problems reported by Paul Hilfinger.
6948
63cb01d6
PE
6949 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
6950 and size overflow errors.
6951 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
6952 in case the user prolog sets feature-test macros like _GNU_SOURCE.
6953 (YYSIZEMAX): New macro.
6954 (yystpcpy): New function, taken from yacc.c.
6955 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
6956 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
6957 so that we don't have to maintain their signatures.
6958 (yyFail): Check for buffer overflow, by using vsnprintf rather
6959 than vsprintf. Allocate a bigger buffer if possible.
6960 Report an error if buffer allocation fails.
6961 (yyStackOverflow): New function.
6962 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
6963 the initialization was successful. It might fail if storage was
6964 exhausted.
6965 (yyexpandGLRStack): Add more checks for storage allocation failure.
6966 Use yyStackOverflow to report failures.
6967 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
6968 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
6969 Don't assume stack number fits in int.
6970 (yysplitStack): Check for storage allocation failure.
6971 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
6972 can print diagnostics on storage allocation failure. All callers
6973 changed.
6974 (yyresolveValue): Use yybool for boolean.
6975 (yyreportSyntaxError): Check for size-calculation overflow.
6976 This code is taken from yacc.c.
6977 (yyparse): Check for storage allocation errors when allocating
6978 the initial stack.
6979
1c59e0a1
AD
69802005-07-05 Akim Demaille <akim@epita.fr>
6981
6982 Extract calc++ from the documentation.
6983 * doc/bison.texinfo (Calc++): Add the extraction marks.
6984 * examples/extexi: New, from the aborted GNU Programming 2E.
6985 Separate the different paragraph of a file with empty lines.
6986 * examples/Makefile: Use it to extract the whole calc++ example.
6987
8a0adb01
AD
69882005-06-24 Akim Demaille <akim@epita.fr>
6989
6990 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
6991 class typedefs.
6992
12545799
AD
69932005-06-22 Akim Demaille <akim@epita.fr>
6994
6995 * doc/bison.texinfo (C++ Language Interface): First stab.
6996 (C++ Parsers): Remove.
6997
99be0235
AD
69982005-06-22 Akim Demaille <akim@epita.fr>
6999
7000 * data/lalr1.cc (yylex_): Honor %lex-param.
7001
0ffd4fd1
AD
70022005-06-22 Akim Demaille <akim@epita.fr>
7003
7004 Start a set of simple examples.
7005 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
7006 * examples/calc++/calc++-driver.hh,
7007 * examples/calc++/calc++-parser.yy,
7008 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
7009 * examples/calc++/compile, examples/calc++/test: New.
7010
0925ebb4
PE
70112005-06-09 Paul Eggert <eggert@cs.ucla.edu>
7012
7013 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
7014 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
7015 which stems from the 2005-05-27 patch.
7016
43d3b664
PH
70172005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7018
7019 * data/glr.c: Modify treatment of unused parameters to permit use
7020 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
7021
3062864d
PE
70222005-05-30 Paul Eggert <eggert@cs.ucla.edu>
7023
7024 Fix infringement on user name space reported by Janos Zoltan Szabo.
7025 * data/yacc.c (yyparse): strlen -> yystrlen.
7026
989b5b8e
AD
70272005-05-30 Akim Demaille <akim@epita.fr>
7028
7029 * data/lalr1.cc (_): New.
7030 Translate the various messages.
7031
bedf57f5
PE
70322005-05-27 Paul Eggert <eggert@cs.ucla.edu>
7033
7034 Fix infringement on user name space reported by Bruno Haible.
7035 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
7036 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
7037 the user's name space.
7038 (alloca): Include <stdlib.h> to get it, if it's not built in.
7039 (YYMALLOC, YYFREE): Define only if needed.
7040 (malloc, free): Declare, but only if needed, as this infringes on
7041 the user name space.
7042
4d1801f1
PE
70432005-05-25 Paul Eggert <eggert@cs.ucla.edu>
7044
7045 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
7046 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
7047 with %d format.
7048 * lib/ebitset.c (min, max): Undef before defining.
7049 * lib/vbitset.c (min, max): Likewise.
7050 * lib/subpipe.c (create_subpipe): Save local variables in case
7051 vfork clobbers them.
7052
70532005-05-24 Bruno Haible <bruno@clisp.org>
7054
7055 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
7056 error message syntax used by gcc-4.0.
7057
b94a9e1e
PE
70582005-05-23 Paul Eggert <eggert@cs.ucla.edu>
7059
85ac3861
PE
7060 * README: Mention m4 1.4.3. Remove obsolete advice about
7061 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
7062
b94a9e1e
PE
7063 * bootstrap: Remove workaround for problem I encountered with
7064 gettext 0.14.1; it seems to be fixed now.
7065
51c30d21
PE
70662005-05-22 Paul Eggert <eggert@cs.ucla.edu>
7067
009ce67d
PE
7068 * NEWS: Version 2.0a.
7069
f2a97c62
PE
7070 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
7071 the previous change.
7072
c8775f93
PE
7073 Various maintainer cleanups.
7074 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
7075 conftest*, for benefit of CVS commands run at the same time as
7076 "configure". Add build-aux, since "bootstrap" now creates it and
7077 its subfiles.
7078 * Makefile.cfg (move_if_change): Remove.
7079 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
7080 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
7081 (po_repo, do-po-update, po-update, wget_files, get-targets):
7082 (config.guess-url_prefix, config.sub-url_prefix):
7083 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
7084 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
7085 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
7086 Remove.
7087 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
7088 this is now the recommended name.
7089 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
7090 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
7091 ylwrap. These files now go into build-aux.
7092 * config/move-if-change: Remove.
7093 * config/prev-version.txt: Bump from 1.75 to 2.0.
7094
3ea5f0ec
PE
7095 * bootstrap: Add stdio-safer, unistd-safer modules.
7096 Remove m4/glibc2.m4 (introduced by latest gnulib, but
7097 we don't need it).
7098 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
7099 fopen-safer.c, stdio-safer.h, unistd-safer.h.
7100 * lib/subpipe.c: Include "unistd-safer.h".
7101 (create_subpipe): Make sure all the newly-created
7102 file descriptors are > 2, so that diagnostics don't
7103 get sent down them (which might cause Bison to hang, in theory).
7104 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
7105 * src/files.c (xfopen): Use fopen_safer, not fopen.
7106
51c30d21
PE
7107 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
7108 yesterday's yacc.c fix.
7109
cea1469d
PE
71102005-05-21 Paul Eggert <eggert@cs.ucla.edu>
7111
3ea5f0ec
PE
7112 * data/glr.c, data/lalr1.cc: Update copyright date.
7113
cea1469d
PE
7114 Fix a destructor bug reported by Wolfgang Spraul in
7115 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
7116 * data/yacc.c (yyabortlab): Don't call destructor, and
7117 don't set yychar to EMPTY.
7118 (yyoverflowlab): Don't call destructor.
7119 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
7120 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
7121 since we no longer output the message "discarding lookahead token
7122 end of input ()".
7123
5e6f62f2
PH
71242005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7125
7126 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
7127 fix a small glitch in debugging output.
7128 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
7129 after YY_SYMBOL_PRINT where needed.
7130
7131 (struct yyGLRState): Add some comments.
7132 (struct yySemanticOption): Add some comments.
7133 (union yyGLRStackItem): Add comment.
7134
7135 (yymergeOptionSets): Correct this to properly perform the union,
7136 avoiding infinite reported by Michael Rosien.
7137 Update comment.
7138
7139 * tests/glr-regression.at: Add test for GLR merging error reported
7140 by M. Rosien.
cea1469d 7141
0fb669f9
PE
71422005-05-13 Paul Eggert <eggert@cs.ucla.edu>
7143
7144 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
7145 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
7146 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
7147 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
7148 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
7149 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
7150 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
7151 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
7152 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
7153 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
7154 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
7155 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
7156 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
7157 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
7158 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
7159 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
7160 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
7161 src/derives.h, src/files.c, src/files.h, src/getargs.c,
7162 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
7163 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
7164 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
7165 src/output.h, src/parse-gram.c, src/parse-gram.h,
7166 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
7167 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
7168 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
7169 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
7170 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
7171 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
7172 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
7173 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
7174 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
7175 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
7176 tests/reduce.at, tests/regression.at, tests/sets.at,
7177 tests/synclines.at, tests/testsuite.at, tests/torture.at:
7178 Update FSF postal mail address.
7179
51f4735e
PE
71802005-05-11 Paul Eggert <eggert@cs.ucla.edu>
7181
7182 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
7183 Problem reported by Ralf Menzel.
7184
80ce3401
PE
71852005-05-01 Paul Eggert <eggert@cs.ucla.edu>
7186
7187 * tests/actions.at: Test that stack overflow invokes destructors.
7188 From Marcus Holland-Moritz.
7189 * data/yacc.c (yyerrlab): Move the code that destroys the stack
7190 from here....
7191 (yyreturn): to here. That way, destructors are called properly
7192 even if the stack overflows, or the user calls YYACCEPT or
7193 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
7194 (yyoverflowlab): Destroy the lookahead.
7195
71962005-04-24 Paul Eggert <eggert@cs.ucla.edu>
7197
7198 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
7199
72f000b0
PE
72002005-04-17 Paul Eggert <eggert@cs.ucla.edu>
7201
7202 * NEWS: Bison-generated C parsers no longer quote literal strings
7203 associated with tokens.
7204 * src/output.c (prepare_symbols): Don't escape strings,
7205 since users don't want to see C escapes.
7206 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
7207 in diagnostics.
c19683bb 7208 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
7209 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
7210
1094323f
PE
72112005-04-16 Paul Eggert <eggert@cs.ucla.edu>
7212
7213 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
7214 the data size is known to be too small and we can't increase it.
7215 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
7216
ca407bdf
PE
72172005-04-15 Paul Eggert <eggert@cs.ucla.edu>
7218
7219 * src/parse-gram.y: Include quotearg.h.
7220 (string_as_id): Quote $1 before using it as a key, since the
7221 lexer no longer quotes it for us.
7222 (string_content): Don't strip quotes, since lexer no longer
7223 quotes it for us.
7224 * src/scan-gram.l: Include quotearg.h.
7225 ("\""): Omit quote.
7226 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
7227 a key, since the rest of the lexer doesn't quote it.
7228 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
7229 * tests/regression.at (Token definitions): Check for backslashes
7230 in token strings.
7231
7232 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
7233 (YYSIZE_T): Define to unsigned long int when using an older compiler.
7234 (yyparse): Revamp code to generate long syntax error message, to
7235 make it easier to translate, and to avoid problems with arithmetic
7236 overflow. Change "virtual memory" to "memory" in diagnostic, since
7237 we don't know whether the memory is virtual.
7238
1ce59070
PE
72392005-04-13 Paul Eggert <eggert@cs.ucla.edu>
7240
7241 * NEWS: Bison-generated C parsers now use the _ macro to
7242 translate strings.
7243 * data/yacc.c (_) [!defined _]: New macro.
7244 All English strings wrapped inside this macro.
7245 * doc/bison.texinfo (Bison Parser): Document _.
7246 * po/POTFILES.in: Include src/parse-gram.c, since it now
7247 includes translateable strings that parse-gram.y doesn't.
7248
a749a695
PE
72492005-04-12 Paul Eggert <eggert@cs.ucla.edu>
7250
7251 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
7252 reverting the 2004-10-11 change to this function.
7253 (symbol_check_alias_consistency): Don't call symbol_type_set
7254 if the type name is already correct.
7255 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
7256
8fb1053b
PE
72572005-03-25 Paul Eggert <eggert@cs.ucla.edu>
7258
7259 * tests/regression.at (Token definitions): Don't use a token named
7260 c, as that generates a "#define c ..." that runs afoul of buggy
7261 stdlib.h that uses the identifier c as a member of struct
7262 drand48_data. Problem reported by Horst Wente.
7263
ff498c4a
PE
72642005-03-21 Paul Eggert <eggert@cs.ucla.edu>
7265
7266 * bootstrap: Change translation URL from
7267 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
7268 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
7269 redirection glitches. Problem reported by twlevo@xs4all.nl.
7270
65211d70
PE
72712005-03-20 Paul Eggert <eggert@cs.ucla.edu>
7272
7273 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
7274 after operands; POSIX says this isn't portable for the c99 command.
7275
9577fb1f
PE
72762005-03-18 Paul Eggert <eggert@cs.ucla.edu>
7277
7278 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
7279 immediately if a data overrun has occurred; this may help us track
7280 down what may be a spurious failure on MacOS.
7281
78b178f7
PE
72822005-03-17 Paul Eggert <eggert@cs.ucla.edu>
7283
a2599d0f
PE
7284 Respond to problems reported by twlevo@xs4all.nl.
7285
7286 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
7287
78b178f7
PE
7288 * src/vcg.h: Comment fix.
7289 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
7290 (G_CMAX): Change to -1 instead of INT_MAX.
7291
7292 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 7293
7296e729
PE
72942005-03-15 Paul Eggert <eggert@cs.ucla.edu>
7295
7296 * src/tables.c (state_number_to_vector_number): Put it inside an
7297 "#if 0", since it's not currently used. Problem reported by
7298 Roland McGrath.
7299
05ac60f3
PE
73002005-03-06 Paul Eggert <eggert@cs.ucla.edu>
7301
7302 * src/output.c (escaped_output): Renamed from
7303 escaped_file_name_output, since we now use it for symbol tags as
7304 well. All uses changed.
7305 (symbol_destructors_output, symbol_printers_output):
7306 Escape symbol tags too.
7307 Problem reported by Matyas Forstner in
7308 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
7309
7310 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
7311 not needed.
7312 * src/output.c (user_actions_output, token_definitions_output,
7313 symbol_destructors_output, symbol_printers_output): Likewise.
7314 * src/reader.c (prologue_augment): Likewise.
7315 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
7316
7317 * src/vcg.c (output_edge): Don't quote linestyle arg.
7318 Problem reported by twlevo@xs4all.nl.
7319
7eb453ac
PE
73202005-02-28 Paul Eggert <eggert@cs.ucla.edu>
7321
7322 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
7323 example, reported by Derek M Jones. Also, make the example even
7324 more outrageous, to better illustrate how bad the problem is.
7325
4c04c52a
PE
73262005-02-24 Paul Eggert <eggert@cs.ucla.edu>
7327
7328 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
7329 putsym. Typo reported by Sebastian Piping.
7330
a61e1620
PE
73312005-02-23 Paul Eggert <eggert@cs.ucla.edu>
7332
7333 * doc/bison.texinfo (Language and Grammar): some -> same
7334 (Epilogue): int he -> in the
7335 Typos reported by Sebastian Piping via Justin Pence.
7336
9ec93868
PE
73372005-02-07 Paul Eggert <eggert@cs.ucla.edu>
7338
7339 * tests/glr-regression.at (Improper handling of embedded actions
7340 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
7341 embedded actions and $-N in GLR parsers", work around an Autoconf bug
7342 with dollar signs in test names.
7343 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
7344 for a similar reason.
7345
73ce7e7e
PE
73462005-01-28 Paul Eggert <eggert@cs.ucla.edu>
7347
7348 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
7349 wants to redefine G_VIEW.
7350
2e72b98e
PE
73512005-01-27 Paul Eggert <eggert@cs.ucla.edu>
7352
7353 * src/vcg.c (get_view_str): Remove case for normal_view.
7354 Problem reported by twlevo@xs4all.nl.
7355
e0d634e5
PE
73562005-01-24 Paul Eggert <eggert@cs.ucla.edu>
7357
ccf830a4
PE
7358 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
7359 Problem reported by twlevo@xs4all.nl.
7360
e0d634e5
PE
7361 * doc/bison.texinfo: Change @dircategory from "GNU programming
7362 tools" to "Software development". Requested by Richard Stallman
7363 via Karl Berry.
7364
7bbc8cb0
PE
73652005-01-23 Paul Eggert <eggert@cs.ucla.edu>
7366
7367 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
7368 Problem reported by twlevo@xs4all.nl.
7369
08b770bc
PE
73702005-01-21 Paul Eggert <eggert@cs.ucla.edu>
7371
7372 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
7373 keyword; it's not needed with modern compilers, and it doesn't
7374 affect correctness with older compilers. Suggested by
7375 twlevo@xs4all.nl.
7376
95f22ad2
PE
73772005-01-17 Paul Eggert <eggert@cs.ucla.edu>
7378
7379 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
7380 gcc -Wswitch-default.
7381 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7382 * data/yacc.c (yyparse): Likewise.
7383
d229d15c
PE
73842005-01-12 Paul Eggert <eggert@cs.ucla.edu>
7385
7386 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
7387 already. Let config.h define any nonstandard values.
7388
ecadd90f
PE
73892005-01-10 Paul Eggert <eggert@cs.ucla.edu>
7390
7391 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
7392 for the benefit of slower hosts. Problem reported by
7393 Nelson H. F. Beebe.
7394
213744b5
PE
73952005-01-07 Paul Eggert <eggert@cs.ucla.edu>
7396
7397 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
7398 being defined and not used.
7399 * data/lalr1.cc (yyparse): Likewise.
7400 Use "if (false)" rather than "if (0)".
7401
249d3236
PE
74022005-01-05 Paul Eggert <eggert@cs.ucla.edu>
7403
7404 * TODO: Mention that we should allow NUL bytes in tokens.
7405
987cc1fb
PE
74062005-01-02 Paul Eggert <eggert@cs.ucla.edu>
7407
7408 * src/scan-skel.l (<<EOF>>): Don't close standard output.
7409 Problem reported by Hans Aberg.
7410
08fe02d9
PE
74112005-01-01 Paul Eggert <eggert@cs.ucla.edu>
7412
7413 * src/getargs.c (version): Happy new year; update overall
7414 program copyright date from 2004 to 2005.
7415
7416 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
7417 Problem reported by Hans Aberg.
7418 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
7419 (Output file names.): Add a test for the case when standard output
7420 is closed.
7421
010c0266
PE
74222004-12-26 Paul Eggert <eggert@cs.ucla.edu>
7423
7424 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
7425 to fix an oversight in the Bison 2.0 manual.
7426
da12206a
PE
74272004-12-25 Paul Eggert <eggert@cs.ucla.edu>
7428
7429 * NEWS: Version 2.0. Reformat the existing news items since
7430 1.875, so that related items are grouped together.
3a4734aa 7431 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
7432 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
7433
c935d934
PE
7434 * tests/torture.at (Exploding the Stack Size with Alloca): Set
7435 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
7436 otherwise, we're not testing alloca. Unfortunately there's no
7437 simple way to consult HAVE_ALLOCA here.
7438
da12206a
PE
7439 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
7440 for yymsg, too.
7441
7442 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
7443 hand. This avoids a warning about comparing int to size_t when
7444 GCC warnings are enabled.
7445
0a2c5137
PE
74462004-12-22 Paul Eggert <eggert@cs.ucla.edu>
7447
d7e14fc0
PE
7448 * NEWS: Bison-generated parsers no longer default to using the
7449 alloca function (when available) to extend the parser stack, due
7450 to widespread problems in unchecked stack-overflow detection.
7451 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
7452 responsibility to set it to a positive value. This lets the user
7453 specify a value that is not a preprocessor constant.
7454 * data/yacc.c (YYMAXDEPTH): Likewise.
7455 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
7456 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
7457 to be a compile-time constant. However, explain the constraints on it.
7458 Also, explain the constraints on YYINITDEPTH.
7459 (Table of Symbols): Explain that alloca is no longer the default.
7460 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
7461 to 1.
7462
0a2c5137
PE
7463 * doc/bison.texinfo (Location Default Action): Mention that n must
7464 be zero when k is zero. Suggested by Frank Heckenbach.
7465
e019c247
AD
74662004-12-22 Akim Demaille <akim@epita.fr>
7467
7468 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
7469 (parser::state_type, parser::semantic_type, parser::location_type):
7470 Private, not public.
7471 (parser::parse): Return ints, not bool.
7472 Returning a bool introduces a problem: 0 corresponds to false, and
7473 it seems weird to return false on success. Returning true changes
7474 the conventions for yyparse.
7475 Alternatively we could return void and send an exception.
7476 There is no clear consensus (yet?).
7477 (state_stack, semantic_stack, location_stack): Rename as...
7478 (state_stack_type, semantic_stack_type, location_stack_type): these.
7479 Private, not public.
7480 * tests/c++.at: New.
7481 * tests/testsuite.at, tests/Makefile.am: Adjust.
7482
72731bb7
AD
74832004-12-21 Akim Demaille <akim@epita.fr>
7484
7485 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
7486
9a0d8bec
AD
74872004-12-21 Akim Demaille <akim@epita.fr>
7488
7489 Don't impose std::string for filenames.
7490
7491 * data/lalr1.cc (b4_filename_type): New.
7492 (position::filename): Use it.
7493 (parser.hh): Move the inclusion of stack.hh and location.hh below
7494 the user code, so that needed headers for the filename type can be
7495 included first.
72731bb7
AD
7496 Forward declare them before the user code.
7497 * tests/Makefile.am (check-local, installcheck-local): Pass
7498 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 7499
99880de5
AD
75002004-12-20 Akim Demaille <akim@epita.fr>
7501
7502 Use more STL like names: my_class instead of MyClass.
7503
7504 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
7505 (SemanticStack, SemanticType, StateStack, StateType)
7506 (TokenNumberType, Stack, Slice, Traits, Parser::location)
7507 (Parser::value): Rename as...
7508 (location_stack, location_type, rhs_number_type, semantic_stack)
7509 (semantic_type, state_stack, state_type, token_number_type, stack)
7510 (slice, traits, parser::yylloc, parser::yylval): these.
7511
7512 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
7513
9bec482e
PE
75142004-12-19 Paul Eggert <eggert@cs.ucla.edu>
7515
7516 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
7517 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7518
f6fbd3da
PE
75192004-12-17 Paul Eggert <eggert@cs.ucla.edu>
7520
7521 Remove uses of 'short int' and 'unsigned short int'. This raises
7522 some arbitrary limits. It uses more memory but nowadays that's
7523 not much of an issue.
7524
7525 This change does not affect the generated parsers; that's a different
7526 task, as some users will want to conserve memory there.
7527
7528 Ideally we should use size_t to represent all object counts, and
7529 something like ptrdiff_t to represent signed differences of object
7530 counts; but that will require more code-cleanup than I have the
7531 time to do right now.
7532
7533 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
7534 Use size_t, not int or short int, to count objects.
7535 * src/closure.c (nritemset, closure): Likewise.
7536 * src/closure.h (nritemset, closure): Likewise.
7537 * src/nullable.c (nullable_compute): Likewise.
7538 * src/print.c (print_core): Likewise.
7539 * src/print_graph.c (print_core): Likewise.
7540 * src/state.c (state_compare, state_hash): Likewise.
7541 * src/state.h (struct state): Likewise.
7542 * src/tables.c (default_goto, goto_actions): Likewise.
7543
7544 * src/gram.h (rule_number, rule): Use int, not short int.
7545 * src/output.c (prepare_rules): Likewise.
7546 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
7547 errs, reductions): Likewise.
7548 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
7549 Likewise.
7550 * src/tables.c (vector_number, tally, action_number,
7551 ACTION_NUMBER_MINIMUM): Likewise.
7552 * src/output.c (muscle_insert_short_int_table): Remove.
7553
efeed023
AD
75542004-12-17 Akim Demaille <akim@epita.fr>
7555
7556 * data/lalr1.cc: Extensive Doxygenation.
7557 (error_): Rename as...
7558 (error): this, since it is visible to the user.
7559 Adjust callers.
7560 (Parser::message): Now an automatic variable from...
7561 (Parser::yyreport_syntax_error_): here.
7562 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
7563 Parser::error.
7564 * tests/input.at: Escape $.
7565
bc82c5a5
PE
75662004-12-16 Paul Eggert <eggert@cs.ucla.edu>
7567
7568 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
7569 Parenthesize rhs to avoid obscure problems with mistakes like
7570 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
7571 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7572 b4_rhs_location): Likewise.
7573 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7574 b4_rhs_location): Likewise.
7575
fd19f271
AD
75762004-12-16 Akim Demaille <akim@epita.fr>
7577
7578 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
7579 yacc.c: be sure to stay within yycheck_.
7580 * tests/actions.at: Re-enable C++ tests.
7581
10454ea4
AD
75822004-12-16 Akim Demaille <akim@epita.fr>
7583
7584 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
7585 real.
7586
c5b95ccf
AD
75872004-12-16 Akim Demaille <akim@epita.fr>
7588
7589 Use #define to handle the %name-prefix.
7590
7591 * data/glr.c, data/yacc.c: Comment changes.
7592 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
7593 so that one can refer to yylex in the parser file, and have it
7594 renamed, as is the case with other skeletons.
7595
617a8f12
AD
75962004-12-16 Akim Demaille <akim@epita.fr>
7597
7598 Move lalr1.cc internals into yy*.
7599
7600 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
7601 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
7602 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
7603 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
7604 (empty_, final_, terror_, errcode_, ntokens_)
7605 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
7606 (looka_, ilooka_, error_range_, nerrs_):
7607 Rename as...
7608 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
7609 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
7610 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
7611 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
7612 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
7613 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
7614 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
7615 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
7616 these.
7617
1e547e6e
PE
76182004-12-15 Paul Eggert <eggert@cs.ucla.edu>
7619
7620 Fix some problems reported by twlevo at xs4all.
7621 * src/symtab.c (symbol_new): Report an error if the input grammar
7622 contains too many symbols. This is better than calling abort() later.
7623 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
7624 (struct node, struct graph):
7625 Rename member expand to stretch. All uses changed.
7626 (struct graph): Remove member layoutalgorithm. All uses removed.
7627 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
7628 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
7629 All uses changed.
7630 (N_STRETCH): Rename from N_EXPAND. All uses changed.
7631
735d6bd4
AD
76322004-12-15 Akim Demaille <akim@epita.fr>
7633
7634 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
7635 Add more Doxygen comments.
7636 (symprint_, stack_print_, reduce_print_, destruct_, pop)
7637 (report_syntax_error_, translate_): Rename as...
7638 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
7639 (yypop_, yyreport_syntax_error_, yytranslate_): this.
7640
2e1f5829
AD
76412004-12-15 Akim Demaille <akim@epita.fr>
7642
7643 * data/lalr1.cc (lex_): Rename as...
7644 (yylex_): this.
7645 Move the trace here.
7646 Take the %name-prefix into account.
7647 Reported by Alexandre Duret-Lutz.
7648
a3cb6248
AD
76492004-12-15 Akim Demaille <akim@epita.fr>
7650
7651 Simplify the C++ parser constructor.
7652
7653 * data/lalr1.cc (debug_): Rename as...
7654 (yydebug_): so that the parser's internals are always in the yy*
7655 pseudo namespace.
7656 Adjust uses.
7657 (b4_parse_param_decl): Remove the leading comma as it is now only
7658 called as unique argument list.
7659 (Parser::Parser): Remove the constructor accepting a location and
7660 an initial debugging level.
7661 Remove from the other ctor the argument for the debugging level.
7662 (debug_level_type, debug_level, set_debug_level): New.
7663
7664 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7665 constructor calls.
7666
07fed891
AD
76672004-12-15 Akim Demaille <akim@epita.fr>
7668
7669 Remove b4_root related material: failure experiment
a3cb6248 7670 (which goal was to allow to derive from a class).
07fed891
AD
7671
7672 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7673 definitions and uses.
7674
e603eaa5
PE
76752004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7676
7677 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7678 not 2, since it's not portable to subtract 1 from the start of an
7679 array. The new item 0 is never set or used. All uses changed.
7680
7681 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7682 the default definition of YYLLOC_DEFAULT. Problem reported
7683 by Frank Heckenbach.
7684
fafb007d
PE
76852004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7686
7687 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7688 the normal case and one for the error case. Just use the
7689 first one uniformly. Problem reported by Frank Heckenbach.
7690 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7691 use exactly the same macro in both places.
7692 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7693 so that the normal-case YYRHSLOC works for the error case too.
7694 All uses changed.
7695 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7696 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7697 * doc/bison.texinfo (Location Default Action): Don't claim that
7698 we have an array of locations. Use the same macro for both glr
7699 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7700 the index is 0.
7701
48814dcd
PE
77022004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7703
a4e1a53b
PE
7704 * HACKING: Update email addresses to send announcements to.
7705
48814dcd
PE
7706 * configure.ac (AC_INIT): Bump version to 1.875f.
7707
337116ba
PE
77082004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7709
7710 * NEWS: Version 1.875e.
7711 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7712
7713 * src/scan-skel.l: Include "complain.h", for "fatal".
7714
7715 * src/relation.h (relation_print, relation_digraph):
7716 Relation sizes are of type relation_node, not size_t (this is
7717 merely a doc fix, since the two types are equivalent).
7718 (relation_transpose): Relation sizes are of type relation_node,
7719 not int.
7720 * src/relation.c: Likewise.
7721 (top, infinity): Now of type relation_node, not int.
7722 (traverse, relation_transpose): Use relation_node, not int.
7723
7724 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7725 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7726 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7727
7728 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 7729 specifying whether the test should be skipped. Use it tp
337116ba 7730 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 7731 fail on some hosts, and should be skipped.
337116ba 7732
da2a7671
PE
77332004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7734
7735 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7736 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7737 unless otherwise specified below.
7738
7739 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7740 to allocate kernel_base, kernel_items, kernel_size, since
7741 they needn't be initialized to 0.
7742 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7743 * src/closure.c (new_closure): Likewise, for itemset.
7744 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7745 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7746 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7747 (build_relations): Likewise for edge, states1, includes.
7748 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7749 * src/reader.c (packgram): Likewise, for ritem, rules.
7750 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7751 * src/relation.c (relation_digraph): Likewise for VERTICES.
7752 (relation_transpose): Likewise for new_R, end_R.
7753 * src/symtab.c (symbols_token_translations_init): Likewise for
7754 token_translations.
7755 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7756 (token_actions): Likewise for yydefact, actrow, conflrow,
7757 conflict_list.
7758 (save_column): Likewise for froms[symno], tos[symno].
7759 (goto_actions): Likewise for state_count.
7760 (pack_table): Likewise for base, pos, check.
7761 (tables_generate): Likewise for width.
7762
7763 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7764 for initial core. Just have a separate core, so we needn't worry
7765 about whether kernel_size and kernel_base are initialized.
7766
7767 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7768 kernel_size, kernel_items): Remove unnecessary initialization.
7769 * src/conflicts.c (conflicts): Likewise.
7770 * src/derives.c (derives): Likewise.
7771 * src/muscle_tablc (muscle_insert): Likewise.
7772 * src/relation.c (relation_digraph): Likewise.
7773 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7774 conflrow, conflict_table, conflict_list, table, check):
7775 Likewise.
7776
7777 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7778 This is because all callers pass unsigned int.
7779 * src/closure.h (new_closure): Likewise.
7780
7781 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7782 (build_relations): Initialize includes[i] in all cases.
7783 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7784 and rules[ruleno].precsym. Initialize members in order.
7785 * src/relation.c (relation_transpose): Always initialize new_R[i]
7786 and end_R[i].
7787 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7788
7789 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7790 conflict_list[0] was always 0, but now it isn't initialized.
7791
7792 * src/table.c (table_grow): When conflict_table grew, the grown
7793 area wasn't cleared. Fix this.
7794
7795 * lib/.cvsignore: Add strdup.c, strdup.h.
7796 * m4/.cvsignore: Add strdup.m4.
7797
00baeeac
PE
77982004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7799
7800 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7801 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7802 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7803 ngotos + 1 without checking for overflow.
7804 (build_relations): Use END_NODE, not -1, to denote end of edges.
7805 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7806 build_relations): Use goto_number, not int, for goto numbers.
7807 * src/tables.c (save_column, default_goto): Likewise.
7808
be3d9d42
AD
78092004-11-23 Akim Demaille <akim@epita.fr>
7810
7811 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7812 of #defining from yystype.
7813 Don't typedef yystype, C++ does not need it.
7814 This lets it possible to forward declare it as union.
7815
78e526d5
PE
78162004-11-23 Paul Eggert <eggert@cs.ucla.edu>
7817
7818 * bootstrap (gnulib_modules): Add extensions.
7819 Problem reported by Jim Meyering.
7820
afbb696d
PE
78212004-11-22 Paul Eggert <eggert@cs.ucla.edu>
7822
7823 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
7824 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
7825 src/system.h, src/tables.c: XFREE -> free, to accommodate
7826 recent change to gnulib xalloc.h.
78e526d5 7827 Problem reported by Jim Meyering.
afbb696d 7828
c1f8f16a
AD
78292004-11-17 Akim Demaille <akim@epita.fr>
7830
7831 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
7832
db7e5eb5 78332004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
7834 Alexandre Duret-Lutz <adl@gnu.org>
7835
7836 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
7837 changes.
7838 (YYCDEBUG): Adjust.
7839 Use it instead of cdebug_.
7840 (Parser::debug_stream, Parser::set_debug_stream): New.
7841 (Parser::symprint_): Define cdebug_ for temporary backward
7842 compatibility.
7843 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
7844 debug_stream ().
7845
68e11668
AD
78462004-11-17 Akim Demaille <akim@epita.fr>
7847
7848 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
7849 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
7850 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
7851 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7852
97cbc73e
PE
78532004-10-27 Paul Eggert <eggert@cs.ucla.edu>
7854
7855 * data/glr.c (yyloc_default): Remove; not used.
7856 Problem reported by Frank Heckenbach.
7857
e342c3be
AD
78582004-10-25 Akim Demaille <akim@epita.fr>
7859
7860 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
7861 Introduce another definition to address simple location arrays.
7862 (yyGLRStack): New member: yyerror_range.
7863 (yyrecoverSyntaxError, yyparse): Update it.
7864 (yyrecoverSyntaxError): Use it when shifting the error token to
7865 have an accurate range, equivalent to the one computed by both
7866 yacc.c and lalr1.cc.
7867 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
7868 that column numbers start at column 0, as per GNU Coding
7869 Standards, the others tests, and the doc.
7870 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
7871 Adjust to the above change (first column is 0).
7872 And adjust the location of the "<error>", now covering the whole
7873 line.
7874
93602feb 78752004-10-22 Akim Demaille <akim@epita.fr>
04098407 7876 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
7877
7878 Remove some arbitrary limits on goto numbers and relations.
7879 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
7880 initial values, since they're never used.
7881 (set_goto_map): ngotos is now unsigned, so test for overflow
7882 by seeing whether it wraps around to zero.
7883 * src/lalr.h (goto_number): Now size_t, not short int.
7884 (GOTO_NUMBER_MAXIMUM): Remove.
7885 * src/relation.c (relation_print, traverse, relation_transpose):
7886 Check for END_NODE rather than looking at sign.
7887 * src/relation.h (END_NODE): New macro.
7888 (relation_node): Now size_t, not short int.
7889
dba08b04
PE
78902004-10-22 Paul Eggert <eggert@cs.ucla.edu>
7891
7892 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
7893 keyword, not an identifier. Problem reported by Baron Schwartz in
7894 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
7895
df09ef2e
AD
78962004-10-11 Akim Demaille <akim@epita.fr>
7897
7898 * src/symtab.c (symbol_check_alias_consistency): Also check
7899 type names, destructors, and printers.
7900 Reported by Alexandre Duret-Lutz.
7901 Recode the handling of associativity and precedence in terms
7902 of symbol_precedence_set.
7903 Accept no redeclaration at all, not even equal to the previous
7904 value.
7905 (redeclaration): New.
7906 Use it to factor redeclaration complaints.
7907 (symbol_make_alias): Don't set the type of the alias, let
7908 symbol_check_alias_consistency do it as for other features.
7909 * src/symtab.h (symbol): Add new member prec_location, and
7910 type_location.
7911 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
7912 * tests/input.at (Incompatible Aliases): New.
7913
146bc99d
PE
79142004-10-09 Paul Eggert <eggert@cs.ucla.edu>
7915
7916 .cvsignore fixes to accommodate gnulib changes,
7917 and the practice of naming build directories "_build".
7918 * .cvsignore: Add "_*". Sort.
7919 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
7920 * m4/.cvsignore: Add "*_gl.m4".
7921
e503aa60
AD
79222004-10-06 Akim Demaille <akim@epita.fr>
7923
7924 * src/parse-gram.y (add_param): Fix the truncation of trailing
7925 spaces.
7926
b4a20338
AD
79272004-10-05 Akim Demaille <akim@epita.fr>
7928
7929 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
7930 whether the reducion was empty or not. This leaves room to
7931 improve the use of YYLLOC_DEFAULT in such a case.
7932 lalr1.cc is still experimental, so changing this is acceptable.
7933 And finally, there are probably not many users who changed the
7934 handling of locations in GLR, so changing is admissible too.
7935
7936 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
7937 empty reduction, set @$ to an empty location ending the previously
7938 stacked symbol.
7939 Adjust uses to make sure the code is triggered on empty
7940 reductions.
7941 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
7942 expected output: empty reductions have empty locations.
7943
f85a5e6f
AD
79442004-09-29 Akim Demaille <akim@epita.fr>
7945
7946 * data/lalr1.cc: Move towards a more standard C++ coding style
7947 for templates: Class < T > -> Class<T>.
7948
b203fc2c
AD
79492004-09-29 Akim Demaille <akim@epita.fr>
7950
7951 * data/lalr1.cc: Reinstall the former ctor, for sake of
7952 compatibility, but warn it will be removed.
7953 Move towards a more standard C++ coding style (i.e., type *var ->
7954 type* var).
7955
5b7e1e73
PE
79562004-09-27 Paul Eggert <eggert@cs.ucla.edu>
7957
3fee967f
PE
7958 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
7959 since it's less likely to work if NULs are involved in the future.
5b7e1e73 7960
0dcca5c2
AD
79612004-09-27 Akim Demaille <akim@epita.fr>
7962
7963 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
7964
6dde1c82
AD
79652004-09-27 Akim Demaille <akim@epita.fr>
7966
7967 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 7968 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
7969 and argument names.
7970 (b4_cc_constructor_call): Likewise.
7971
b233d555
AD
79722004-09-24 Akim Demaille <akim@epita.fr>
7973
7974 * src/parse-gram.y (add_param): Strip the leading and trailing
7975 blanks from a formal argument declaration.
7976 (YY_LOCATION_PRINT): New.
7977
619404e3
AD
79782004-09-24 Akim Demaille <akim@epita.fr>
7979
7980 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
7981 after the location.
7982
dd8d9022
AD
79832004-09-24 Akim Demaille <akim@epita.fr>
7984
7985 * doc/bison.texinfo (Table of Symbols): Sort.
7986
0092f063
AD
79872004-09-21 Akim Demaille <akim@epita.fr>
7988
7989 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
7990 the useless parentheses.
7991 Suggested by Paul Eggert.
7992
451364ed
AD
79932004-09-20 Akim Demaille <akim@epita.fr>
7994
7995 Let the initial-action act on the look-ahead, and use it for the
7996 "initial push" (corresponding to an hypothetical beginning-of-file).
7997 And let lalr1.cc honor %initial-action.
7998
7999 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
8000 example.
8001 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
8002 (Parser::Parser): Remove the ctor that used to initialize it.
8003 (Parser::parse): Like in the other skeletons, issue the "starting
8004 parse" message before any action.
8005 Honor %initial-action.
8006 Initialize the stacks with the lookahead.
8007 * data/yacc.c: Let $$ and @$ in %initial-action designate the
8008 look-ahead.
8009 Push them in the stacks.
8010 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
8011
18d192f0
AD
80122004-09-20 Akim Demaille <akim@epita.fr>
8013
8014 * doc/bison.texinfo (Initial Action Decl): New.
8015
b8458aa5
AD
80162004-09-20 Akim Demaille <akim@epita.fr>
8017
8018 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
8019 clearer criterion to define it.
8020 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
8021 When reducing on an empty RHS, use the latest stacked location as
8022 location.
8023 yylloc is not always available.
8024 * data/glr.c: Likewise.
8025 Also, honor initial-actions.
8026
3fc16193
AD
80272004-09-20 Akim Demaille <akim@epita.fr>
8028
8029 * data/yacc.c (YY_LOCATION_PRINT): New.
8030 Define when we know YYLTYPE's structure, i.e., when the default
8031 YYLLOC_DEFAULT is used.
8032 * data/c.m4 (b4_yysymprint_generate): Use it.
8033 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
8034 value of the result.
8035 (error_start_): Replace with...
8036 (error_range_): this location array.
8037 This allows to replace code relying on the implementation of
8038 locations by portable code.
8039 * data/yacc.c (yylerrsp): Replace with...
8040 (yyerror_range): this.
8041 Every time a token is popped, update yyerror_range[0], to have an
8042 accurate location for the error token.
8043 * data/glr.c (YY_LOCATION_PRINT): New.
8044 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
8045 deference a pointer.
8046 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
8047 report the location in %printers.
8048
8049 * src/scan-skel.l: Instead of abort, report error messages to ease
8050 understanding skeleton scanning failures.
8051
ecfe33e7
AD
80522004-09-16 Akim Demaille <akim@epita.fr>
8053
8054 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
8055 (iterator, const_iterator): these, to be more in the C++ spirit.
8056 Also, return reverse iterators so that when displaying the stack
8057 we display its bottom first.
8058 (Parser::stack_print_, Parser::reduce_print_): Match the messages
8059 from yacc.c.
8060 We should probably use vector here though.
8061
1576d44d
AD
80622004-09-16 Akim Demaille <akim@epita.fr>
8063
8064 Have more complete shift traces.
8065
8066 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
8067 to report Shifts instead of ad hoc YYDPRINTF invocations,
8068 including for the error token.
8069 * data/lalr1.cc (symprint_): Output the location.
8070 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
8071 output the location within the %printer.
8072 Activate GLR tests, at least to make sure they compile properly.
8073 They still don't pass though.
8074 * tests/calc.at: Adjust expect verbose output, since now "Entering
8075 state..." is on a different line than the "Shifting" message.
8076
9c66f418
AD
80772004-09-08 Akim Demaille <akim@epita.fr>
8078
8079 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
8080 Bison directive from the Bison file to the invocation of this
8081 macro, so that these directives are passed to
8082 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
8083 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
8084 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
8085 the extra Bison directives instead of the whole series.
8086 Change the grammar so that there are recoverable errors, and
8087 unrecoverable errors. Now we can have the parser give up before
8088 consuming the whole input. As a result we now can observe that
8089 the lookahead is freed when needed.
8090 Change the parser source to parse argv[1] instead of a hard coded
8091 string.
8092 Simplify yylex, and give a value and location to EOF.
8093 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
8094 passed directives already coded in the file.
8095 Add some tests to check the location of "error".
8096 For some tests, the C++ parser is correct, and not yacc.c.
8097 For other tests, they provide different, but unsatisfying, values,
8098 so keep the C++ value so that at least one parser is "correct"
8099 according to the test suite.
8100 (Actions after errors): Remove, this is subsumed by the
8101 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
8102
52d5733f
AD
81032004-09-06 Akim Demaille <akim@epita.fr>
8104
8105 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 8106 (Parser::pop): New.
52d5733f
AD
8107 Use it.
8108
a0e68930
AD
81092004-09-06 Akim Demaille <akim@epita.fr>
8110
8111 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
8112 argument, an informative message.
8113 Call YY_SYMBOL_PRINT.
8114 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
8115 * data/lalr1.cc (destruct_): Likewise.
8116 In addition, no longer depend on b4_yysymprint_generate and
8117 b4_yydestruct_generate to generate these functions, do it "by
8118 hand".
8119
e757bb10
AD
81202004-09-03 Akim Demaille <akim@epita.fr>
8121
8122 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
8123 invoked, yydestruct the lookahead.
8124 * tests/calc.at (Calculator $1): Update the expected lengths of
8125 traces: there is an added line for the discarded lookahead.
8126 * doc/bison.texinfo (Destructor Decl): Some rewording.
8127 Define "discarded" symbols.
8128
0fe1f06d
AD
81292004-09-02 Akim Demaille <akim@epita.fr>
8130
8131 * data/lalr1.cc (translate_, destruct_): No reason to be static.
8132
284acc8b
AD
81332004-09-02 Akim Demaille <akim@epita.fr>
8134
8135 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
8136 (YYDSYMPRINTF): Rename as...
8137 (YY_SYMBOL_PRINT): this.
8138 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
8139 two.
8140 Use it instead of direct symprint_ calls.
8141 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
8142 one.
8143
a5eb1ed2
AD
81442004-09-02 Akim Demaille <akim@epita.fr>
8145
b7c72fe1
AD
8146 * data/lalr1.cc (b4_yysymprint_generate): New.
8147 (symprint_): New member function, defined when YYDEBUG.
8148 Use it consistently instead of token/nterm debugging output by
8149 hand.
a5eb1ed2
AD
8150 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
8151 %printer calls to use cdebug_ when using lalr1.cc.
8152
417141dd
AD
81532004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
8154
8155 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
8156 with #ifdef YYDEBUG.
8157
2fa09258
AD
81582004-08-26 Akim Demaille <akim@epita.fr>
8159
8160 * doc/bison.texinfo (Implementing Loops): Rename as...
8161 (Implementing Gotos/Loops): this.
8162
9378b508
PE
81632004-08-13 Paul Eggert <eggert@cs.ucla.edu>
8164
8165 Adjust to latest gnulib.
8166 * bootstrap (gnulib_modules): Add xalloc-die.
8167 Set LC_ALL=C so that file names sort consistently.
8168 Prefer the gnulib copies of gettext.m4, glibc21.m4,
8169 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
8170 uintmax_t.m4, ulonglong.m4.
8171 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
8172 po.m4 since we are now using _gl.m4 instead.
8173
87a8ad5c
PE
81742004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
8175
8176 * src/scan-action.l: Remove. Scanning of semantic actions is
8177 handled in scan-gram.l.
8178
dca81a78
PE
81792004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
8180
8181 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
8182
8183 * src/location.h (struct): The file member is a uniqstr.
8184 (equal_boundaries): Use UNIQSTR_EQ for comparison.
8185
c9cbf7c5
PE
81862004-07-22 Paul Eggert <eggert@cs.ucla.edu>
8187
8188 Fix bug with non-%union parsers that have printers or destructors,
8189 which led to a Bison core dump. Reported by Peter Fales in
8190 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 8191
c9cbf7c5
PE
8192 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
8193 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
8194 not to our own type.
8195 * src/output.c (symbol_destructors_output, symbol_printers_output):
8196 Don't assume %union.
8197 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
8198 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
8199 UNION-FLAG. All callers changed.
8200 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
8201 Use type char, not unsigned int, when declaring an array of char;
8202 this lets us remove a cast.
8203 (Printers and Destructors): Add non-%union test cases.
8204
fa7e68c3
PE
82052004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8206
8207 * doc/bison.texinfo: Minor editorial changes, mostly to the new
8208 GLR writeups. E.g., avoid frenchspacing and the future tense,
8209 change "lookahead" to "look-ahead", and change "wrt" to "with
8210 respect to".
2fa09258 8211
fa7e68c3
PE
82122004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8213
8214 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
8215 New sections, split off from the GLR Parsers section. Put the new
8216 Simple GLR Parser near the start of the GLR section, for clarity.
8217 Rewrite connective text.
8218
99a9344e
PE
82192004-06-21 Frank Heckenbach <frank@g-n-u.de>
8220
8221 * doc/bison.texinfo (Simple GLR Parsers): New section.
8222
8dd162d3
PE
82232004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8224
8225 * NEWS, TODO, doc/bison.texinfo:
8226 Use "look-ahead" instead of "lookahead", to be consistent.
8227 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
8228 while we're fixing "look-ahead".
8229 * src/conflicts.c (shift_set): Renamed from shiftset.
8230 (look_ahead_set): Renamed from lookaheadset.
8231 * src/print.c: Likewise.
8232 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
8233 name for "lookahead".
8234 (report_types, usage): Likewise.
8235 * src/getargs.h (report_look_ahead_tokens): Renamed from
8236 report_lookaheads.
8237 * src/lalr.c (compute_look_ahead_tokens): Renamed from
8238 compute_lookaheads.
8239 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
8240 (look_ahead_tokens_print): Renamed from lookaheads_print.
8241 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
8242 state_rule_lookaheads_print.
8243 * src/state.h: Likewise.
8244 (reductions.look_ahead_tokens): Renamed from lookaheads.
8245 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
8246 AT_DATA_LOOKAHEADS_GRAMMAR.
8247
57a90331
PE
82482004-06-03 Paul Eggert <eggert@cs.ucla.edu>
8249
8250 * README: Update location of patched M4 distribution.
8251
8ed3234a
PE
82522004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
8253
8254 Don't assume the C++ compiler takes the same arguments as the C compiler
8255 (trivial change).
8256 * configure.ac (O0CXXFLAGS): New var.
8257 * tests/atlocal.in (CXXFLAGS): Use it.
8258
07971983
PE
82592004-05-29 Paul Eggert <eggert@cs.ucla.edu>
8260
8261 Fix some "make check" problems with C++ reported by
8262 Albert Chin-A-Young for Tru64 C++ in this thread:
8263 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
8264
8265 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
8266 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8267 Output to a .cc file for C++, not to a .c file.
8268 * tests/calc.at (AT_CHECK_CALC): Likewise.
8269 * tests/regression.at (AT_CHECK_DANCER): Likewise.
8270 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
8271
29058652
PE
82722004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
8273
8274 * tests/calc.at, tests/actions.at: Workaround for SGI
8275 C++ compiler. (trivial change)
8276
62cb8a99
PE
82772004-05-27 Paul Eggert <eggert@cs.ucla.edu>
8278
fd418816
PE
8279 Spent a few hours checking out which prerequisite versions the
8280 current sources actually require. I went all the way back to
8281 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
8282 a seemingly endless set of combinations of versions more recent
8283 than that. The bottom line is that the current sources require
8284 fairly recent versions of the build tools, and it'll be some work
8285 to change this.
8286 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
8287 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
8288 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
8289 Add comments explaining why those particular versions are
8290 currently needed.
2fa09258 8291
62cb8a99
PE
8292 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
8293 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 8294 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
8295
8296 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
8297 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
8298
caa52c10
PE
82992004-05-26 Paul Eggert <eggert@cs.ucla.edu>
8300
8301 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
8302 0.11.5. Suggested by Bruno Haible.
8303 * bootstrap: Remove gettext version checking.
8304
8305 * doc/bison.texinfo (Decl Summary): Also mention that %union
8306 can depend on prerequisite types. Problem reported by Tim
8307 Van Holder.
8308
4bfd5e4e
PE
83092004-05-25 Paul Eggert <eggert@cs.ucla.edu>
8310
2cef3017
PE
8311 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
8312 * README-alpha: Don't tell people not to package this.
8313
b9c85d5c
PE
8314 * bootstrap: Don't assume $(...) works; use `...` instead.
8315 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
8316 gettext better.
8317
4bfd5e4e
PE
8318 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
8319 put into the -d output file, and mention what to do if YYSTYPE is
8320 defined as a macro.
8321
6a36ff94
PE
83222004-05-24 Paul Eggert <eggert@cs.ucla.edu>
8323
6712933e
PE
8324 Undo change made earlier today: it caused autopoint to not bring
8325 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
8326 autopoint's.
8327
8328 * bootstrap: Check that gettext version matches what's in
8329 configure.ac. Warn users to ignore robots.txt ERROR 404.
8330 * bootstrap: Undo today's earlier change (logged below).
8331 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 8332
6a36ff94
PE
8333 The gettext version checking is causing more trouble than it's
8334 curing; remove it. Problem reported by Paul Hilfinger.
8335
8336 * bootstrap: Issue a warning that one can expect a message
8337 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
8338 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
8339
209ea708
PE
83402004-05-23 Paul Eggert <eggert@cs.ucla.edu>
8341
8342 Ensure that the C++ compiler used for testing actually works on a
8343 simple test program; if not, skip the C++-related tests. Problem
8344 reported by Vin Shelton in:
161a71f3 8345 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
8346
8347 * m4/cxx.m4: New file.
8348 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
8349 * tests/atlocal.in (BISON_CXX_WORKS): Add.
8350 * tests/local.at (AT_COMPILE_CXX): Use it.
8351
41ca2549
PE
83522004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8353
383e69dc
PE
8354 * data/glr.c (yylloc): Output this macro even if locations are not
8355 being generated, as the GLR parser needs it even in that case.
8356 Problem reported by Troy A. Johnson
8357 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
8358
41ca2549
PE
8359 * configure.ac (AC_INIT): Update to 1.875e.
8360
e476c87d
PE
83612004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8362
8363 * NEWS: Version 1.875d.
8364 * configure.ac (AC_INIT): Likewise.
8365 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
8366
8367 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
8368 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
8369 lalr1.cc runs afoul of the first, and the last two are no longer
8370 supported by GCC 3.4.0.
8371 * README: Mention GNU m4 1.4 or later; mention m4 patches.
8372 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
8373
233a88ad
PE
83742004-05-06 Paul Eggert <eggert@cs.ucla.edu>
8375
8376 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
8377 unsigned int, for compatibility with latest gnulib hash module.
8378 * src/state.c (state_hash, state_hasher): Likewise.
8379 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
8380 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 8381
12ffdd28
PE
83822004-05-03 Paul Eggert <eggert@cs.ucla.edu>
8383
8384 * NEWS: Unescaped newlines are no longer allowed in char & strings.
8385
8386 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
8387 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
8388 character and string literals.
8389 (unexpected_end): New function.
8390 (unexpected_eof): Use it.
8391 (unexpected_newline): New function.
8392 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
8393 actions.
e476c87d 8394
12ffdd28
PE
8395 * NEWS: Document %expect-rr.
8396
8397 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
8398 Fix typo by replacing $1 with $option.
8399 Remove more 'intl'-related files.
9668e2be 8400 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
8401
8402 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
8403 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
8404 strtoul.c.
8405 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
8406 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
8407 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
8408 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
8409 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
8410 * src/.cvsignore: Add *.output.
8411
8412 * src/parse-gram.y: Put copyright notice inside %{ %} so it
8413 gets copied to the output file.
e476c87d 8414
1f65350a
PE
84152004-04-28 Paul Eggert <eggert@twinsun.com>
8416
8417 Get files from the gnulib and po repositories, instead of relying
8418 on them being in our CVS. Upgrade to latest versions of gnulib
8419 and Automake.
8420
8421 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
8422 * bootstrap: Bootstrap from gnulib and po repositories.
8423 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
8424 * README-cvs: Document these changes. Remove version numbers from
8425 mentions of build tools, since they change so often. Mention Flex.
8426
8427 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
8428 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
8429 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
8430 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 8431 does this for us.
12ffdd28
PE
8432 (AC_ISC_POSIX): Remove; we no longer support this
8433 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
8434 (AC_HEADER_STDC): Remove: we now assume C89 or better.
8435 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
8436 Do not check for C89 headers, except for locale.h which is used
8437 by the Yacc library and must port to K&R hosts.
8438 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
8439 Do not check for C89 functions, except for setlocale which is
8440 used by the Yacc library.
8441 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
8442 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
8443 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
8444 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
8445 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
8446 AM_GNU_GETTEXT): Remove; now done by:
8447 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
8448 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
8449 for us.
8450
8451 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
8452 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
8453 Define to empty, as gnulib.mk will do the rest for us.
8454 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
8455 for us.
8456 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
8457 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
8458
8459 * src/files.c: Include gnulib's xstrndup.h.
8460
8461 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
8462 (REALLOC): Use xnrealloc, for likewise.
8463 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
8464 (strnlen, memrchr): Remove decls; functions no longer used.
8465 Include <stpcpy.h>.
8466
8467 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
8468 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
8469 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
8470 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
8471 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
8472 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
8473 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
8474 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
8475 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
8476 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
8477 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
8478 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8479 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
8480 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
8481 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
8482 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
8483 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
8484 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
8485 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
8486 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
8487 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
8488 Remove, as these files are now generated automatically
8489 by bootstrap or automake.
8490
8491 * po/ChangeLog: Remove: all but one entry was a duplicate
8492 of this file, and I moved that 2000-11-02 entry here.
8493
8494 * config/.cvsignore: Add Makefile, depcomp, install-sh.
8495 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
8496 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
8497 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
8498 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
8499 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
8500 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
8501 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
8502 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
8503 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
8504 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
8505 xstrndup.h.
8506 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
8507 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
8508 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
8509 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
8510 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
8511 * src/.cvsignore: Remove *_.c.
8512
8513
8514 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
8515 support it. (The latest stable gzip doesn't.)
8516
85172004-04-27 Paul Eggert <eggert@twinsun.com>
8518
8519 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
8520 case, as stos_ is now used by destructors due to the 2004-02-09
8521 change.
8522
8523 Remove more K&R C support.
8524 * lib/libiberty.y (PARAMS): Remove. All uses removed.
8525 * lib/subpipe.c (errno): Remove decl.
8526 Include <stdlib.h> unconditionally.
8527 (EXIT_FAILURE): Remove macro.
8528 * src/complain.c (vfprintf, strerror): Remove.
8529 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
8530 unconditionally.
8531 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
8532 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
8533 (strchr, strspn, memchr): Remove decls.
8534 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
8535 unconditionally. Do not declare perror.
8536 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
8537 unconditionally.
8538
8539 * src/complain.c (_): Remove useless defn, as system.h defines this.
8540
8541 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
8542 with latest obstack.h.
8543 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
8544 to procedure types, as obstack.h now does that for us.
8545 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
8546
8547 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
8548 so that this include file can stand alone.
8549 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
8550 does this now. Include subpipe.h first after config.h, to
8551 test whether it can stand alone.
8552
8553 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
8554 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
8555 unused declaration.
8556
8557 * tests/synclines.at (%union synch line): Put a dummy member in
8558 the union, because empty unions aren't allowed in C. Caught
8559 by GCC 3.4.0.
8560
4f16766c
PE
85612004-04-13 Jim Meyering <jim@meyering.net>
8562
8563 * src/conflicts.c (conflicts_print): Correct format string typo:
8564 use `%%' to produce literal `%'. (trivial change)
8565
779e7ceb
PE
85662004-03-30 Paul Eggert <eggert@twinsun.com>
8567
8568 * src/getargs.c (version): Update copyright year to 2004.
8569
8570 * data/c.m4 (b4_int_type): Use 'short int' rather than
8571 'short', and similarly for 'long', 'unsigned', etc.
8572 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
8573 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
8574 yy_yypstack, yydumpstack): Likewise.
8575 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
8576 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
8577 Likewise.
8578 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
8579 yy_stack_print, yyparse): Likewise.
8580 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
8581 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
8582 * lib/bitset.c (bitset_print): Likewise.
8583 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
8584 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8585 * lib/bitsetv.c (bitsetv_dump): Likewise.
8586 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
8587 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
8588 Likewise.
8589 * src/LR0.c (allocate_itemsets): Likewise.
8590 * src/gram.h (rule_number, rule): Likewise.
8591 * src/lalr.h (goto_number): Likewise.
8592 * src/nullable.c (nullable_compute): Likewise.
8593 * src/output.c (prepare_rules): Likewise.
8594 * src/relation.c (relation_print, relation_digraph): Likewise.
8595 * src/relation.h (relation_node): Likewise.
8596 * src/state.h (state_number, transitions, errs, reductions,
8597 struct state): Likewise.
8598 * src/symtab.h (symbol_number, struct symbol): Likewise.
8599 * src/tables.c (vector_number, tally, action_number,
8600 default_goto, goto_actions): Likewise.
8601 * tests/existing.at (GNU Cim Grammar): Likewise.
8602 * tests/regression.at (Web2c Actions): Likewise.
8603
8604 * src/output.c (muscle_insert_short_int_table): Renamed from
8605 muscle_insert_short_table. All uses changed.
8606
d6328241
PH
86072004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8608
8609 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
8610 (declaration): Replace expected_conflicts with expected_sr_conflicts.
8611 Add %expect-rr rule.
4f16766c 8612
d6328241
PH
8613 * src/scan-gram.l: Recognize %expect-rr.
8614
4f16766c 8615 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 8616 expected_conflicts.
4f16766c 8617 (expected_rr_conflicts): Declare.
d6328241
PH
8618
8619 * src/conflicts.c (expected_sr_conflicts): Rename from
8620 expected_conflicts.
8621 (expected_rr_conflicts): Define.
8622 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
8623 for GLR parsers.
8624 Use expected_sr_conflicts in place of expected_conflicts.
8625 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 8626
d6328241 8627 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 8628
1452af69
PE
86292004-03-08 Paul Eggert <eggert@gnu.org>
8630
8631 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 8632 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
8633
8634 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
8635 in lalr1.cc.
8636 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
8637 * src/scan-gram.l (scan_integer): New function.
8638 ({int}): Use it.
8639 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
8640 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
8641 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
8642 Say "long int", not "long", for uniformity with GNU style.
8643
006d217d
PE
86442004-02-25 Paul Eggert <eggert@twinsun.com>
8645
8646 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8647 compilers. This fixes a problem with Intel's C++ compiler being
8648 chatty, reported by Guido Trentalancia in
161a71f3 8649 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 8650
c2729758
ADL
86512004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8652
8653 Support %destructor and merge error locations in lalr1.cc.
8654
8655 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8656 (Parser::stos_): Define unconditionally.
8657 (Parser::destruct_): New method. Generate its body with
8658 b4_yydestruct_generate.
8659 (Parser::error_start_): New attribute.
8660 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8661 token which are discarded.
8662 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8663 error_start_ when erroneous token are discarded.
8664 (Parser::parse) <yyerrlab1>: Compute the location of the error
8665 token so that it covers all the discarded tokens.
8666 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8667 it can be called with `%skeleton "lalr1.cc"', and do that.
8668
dd0e0635
PE
86692004-02-02 Paul Eggert <eggert@twinsun.com>
8670
8671 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8672 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8673 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8674 There's no need to mention top_builddir since Automake does that
8675 for us.
8676 (INCLUDES): Remove, as Automake says it's obsolescent.
8677 Contents migrated into AM_CPPFLAGS as described above.
8678 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8679
86802004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8681
8682 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8683 (yyreportSyntaxError): Handle case where lookahead token is
8684 YYEMPTY.
8685
be16239b
PH
86862004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8687
8688 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8689 resulting parsers are compilable with C++.
8690
5fa90832
PE
86912003-12-23 Paul Eggert <eggert@twinsun.com>
8692
8693 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8694 * src/output.c (output_skeleton): Rename local var.
8695 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8696 Bison tokens, as this runs afoul of the 2003-10-07 change that
8697 disallowed NUL bytes in character constants or string literals.
8698
8699 * tests/local.at: Require Autoconf 2.59's Autotest.
8700 * tests/testsuite.at: Don't include local.at, since we now assume
8701 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8702 including it.
8703 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8704 multiple inclusion warnings.
dd0e0635 8705
b165c324
AD
87062003-12-02 Akim Demaille <akim@epita.fr>
8707
8708 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8709 conditions.
8710 From Bruno Haible.
8711
26e06a21
ADL
87122003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8713
8714 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8715
92ac3705
PE
87162003-10-07 Paul Eggert <eggert@twinsun.com>
8717
6a5ecb38
PE
8718 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8719 if testsuite doesn't exist.
8720
92ac3705
PE
8721 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8722 literals, unfortunately.
8723 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8724 Complain about NUL bytes in character constants or string literals.
8725
91d2c560
PE
87262003-10-05 Paul Eggert <eggert@twinsun.com>
8727
8728 * NEWS: Don't document %no-default-prec, as it's still
8729 too experimental.
8730 * doc/bison.texinfo: Document %no-default-prec only if
8731 the defaultprec flag is set. Normally it's not.
8732
0cc3da3a
PE
87332003-10-04 Paul Eggert <eggert@twinsun.com>
8734
8735 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8736 non-modifiable lvalue, instead of a modifiable one.
8737 * doc/bison.texinfo (Actions): Document that $$ can
8738 be assigned to. Do not claim that $$ and $N are
8739 array element references: user code should not rely on this.
8740
22fccf95
PE
87412003-10-01 Paul Eggert <eggert@twinsun.com>
8742
8743 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8744 (grammar_declaration): Use it.
8745 * src/scan-gram.l: New token %no-default-prec.
8746 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8747 * NEWS, doc/bison.texinfo: Document the above.
8748
fc8f2965
AD
87492003-10-01 Akim Demaille <akim@epita.fr>
8750
8751 VCG no longer supports long_straight_phase.
8752
8753 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8754 * src/print_graph.c (print_graph): Adjust.
8755
39a06c25
PE
87562003-09-30 Frank Heckenbach <frank@g-n-u.de>
8757 and Paul Eggert <eggert@twinsun.com>
8758
8759 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8760 Table of Symbols): Document %default-prec.
8761 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8762 (grammar_declaration): Set default_prec on %default-prec.
8763 * src/scan-gram.l (%default-prec): New token.
8764 * src/reader.h (default_prec): New flag.
8765 * src/reader.c: Likewise.
8766 (packgram): Handle it.
8767 * tests/conflicts.at (%default-prec without %prec,
8768 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 8769
39a06c25
PE
87702003-09-30 Paul Eggert <eggert@twinsun.com>
8771
8772 * tests/testsuite.at: Include local.at, not input.at, fixing
8773 a typo in the 2003-08-25 patch.
8774
62b6aef9
AD
87752003-08-27 Akim Demaille <akim@epita.fr>
8776
8777 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8778 GCC warnings.
8779
89e1cc61
AD
87802003-08-26 Akim Demaille <akim@epita.fr>
8781
8782 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8783 "<\#" to avoid magic from Gnus when posting parts of this script.
8784
a08460b0
AD
87852003-08-26 Akim Demaille <akim@epita.fr>
8786
8787 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8788 (Parser::parse): here.
8789 Adjust: nerrs and errstatus is now replaced by...
8790 (Parser::nerrs_, Parser::errstatus_): New.
8791
603f1cfd
AD
87922003-08-25 Akim Demaille <akim@epita.fr>
8793
8794 * config/announce-gen, Makefile.cfg: New.
8795 * Makefile.am: Adjust.
8796 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8797 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8798
cd3684cf
AD
87992003-08-25 Akim Demaille <akim@epita.fr>
8800
8801 When reducing initial empty rules, Bison parser read an initial
8802 location that is not defined. This results in garbage, and that
8803 affects Bison's own parser. Therefore we need (i) to extend Bison
8804 to support a means to initialize this location, and (ii) to use
8805 this CVS Bison to fix CVS Bison's parser.
8806
8807 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8808 with...
8809 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8810 * src/parse-gram.y: Adjust.
8811 (%initial-action): New.
8812 (%error-verbose): Since we require CVS Bison, there is no reason
8813 not to use it.
8814 * src/scan-gram.l: Adjust.
8815 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8816 * data/yacc.c (yyparse): Use b4_initial_action.
8817
4e03e201
AD
88182003-08-25 Akim Demaille <akim@epita.fr>
8819
8820 * doc/bison.texinfo: Don't promote stdout for error messages.
8821
8c182d05
AD
88222003-08-25 Akim Demaille <akim@epita.fr>
8823
8824 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
8825 From Alexandre Duret-Lutz.
8826
6a60c4cf
PE
88272003-08-25 Akim Demaille <akim@epita.fr>
8828
8829 Version 1.875c.
8830
25f66e1a
AD
88312003-08-25 Akim Demaille <akim@epita.fr>
8832
8833 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
8834 Use them.
8835
5348bfbe
AD
88362003-08-25 Akim Demaille <akim@epita.fr>
8837
8838 * data/lalr1.cc (Parser::reduce_print_): New.
8839 Use it.
8840
47301314
AD
88412003-08-25 Akim Demaille <akim@epita.fr>
8842
8843 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
8844 error recovery loops. This patch is based on
161a71f3 8845 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
8846 Also, augment the similarity between lalr1.cc and yacc.c.
8847 Note: the locations of error recovery rules are not correct yet.
8848
8849 * data/lalr1.cc: Comment changes to augment the similarity between
8850 lalr1.cc and yacc.c.
8851 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
8852 (yyerrlab1): Remove, but where it used to be (now the bottom part of
8853 yyerrlab), when hitting EOF, pop the whole stack here instead of
8854 merely falling thru the default error handling mechanism.
8855 (yyerrorlab): New label, with the old contents of YYERROR,
8856 plus the following change: pop the stack of rhs corresponding
8857 to the production that invoked YYERROR. That is how Yacc
8858 behaves (required by POSIX).
8859 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
8860 fail.
8861
1f7a61ff
AD
88622003-08-25 Akim Demaille <akim@epita.fr>
8863
8864 Tune local.at so that people can "autom4te -l autotest calc.at -o
8865 calc" for instance, to extract a sub test suite.
8866
8867 * tests/testsuite.at: Move the initialization, Autotest version
8868 requirement, and AT_TESTED invocation into...
8869 * tests/local.at: here.
8870 * tests/testsuite.at: Include it for compatibility with Autoconf
8871 2.57.
8872 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
8873 be ignore.
8874
327b5b56
PE
88752003-08-04 Paul Eggert <eggert@twinsun.com>
8876
8877 Rework code slightly to avoid gcc -Wtraditional warnings.
8878 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
8879 The returned value is now stored in *YY0. All callers changed.
8880 * src/output.c (merge_output): Adjust to the above change.
8881
0051e3ed
PE
88822003-07-26 Paul Eggert <eggert@twinsun.com>
8883
8884 * data/glr.c (YYASSERT): New macro.
8885 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
8886 yyresolveStates, yyprocessOneStack):
8887 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
8888 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 8889
137437c6
PE
88902003-07-25 Paul Eggert <eggert@twinsun.com>
8891
5b620e06
PE
8892 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
8893 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 8894 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
8895 by Frank Heckenbach, though I have omitted the structure-initialization
8896 part of his glr-knr.diff patch since I recall that the Portable
8897 C Compiler didn't require that change.
8898
137437c6
PE
8899 Let the user specify how to allocate and free memory.
8900 Derived from a suggestion by Frank Heckenbach in
161a71f3 8901 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
8902 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
8903 All uses of free, malloc, realloc changed to use these macros,
8904 and unnecessary casts removed.
8905 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
8906
ddb85ca5
PE
89072003-07-06 Matthias Mann <MatthiasMann@gmx.de>
8908
8909 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
8910 use s.empty() rather than s == "" to test for empty string; see
161a71f3 8911 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
8912 (trivial change)
8913
39910e09
AD
89142003-06-25 Akim Demaille <akim@epita.fr>
8915
8916 * config/depcomp, config/install-sh: Update from masters.
8917
0ae99356
PE
89182003-06-20 Paul Eggert <eggert@twinsun.com>
8919
8920 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
8921 and return properly parenthesized result.
8922 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
8923 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8924 Remove unnecessary parentheses from uses.
8925 * doc/bison.texinfo (Location Default Action): Describe the
8926 conventions for parentheses.
8927
cd05d13c
PE
89282003-06-19 Paul Eggert <eggert@twinsun.com>
8929
81fd08ca
PE
8930 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
8931 yyreportTree): Do not assume that size_t is the same width as int,
8932 when printing sizes. Print sizes using an unsigned format.
8933 Problem reported by Frank Heckenbach in
161a71f3 8934 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 8935
cd05d13c
PE
8936 Port to Forte Developer 7 C compiler.
8937 * data/glr.c (struct YYLTYPE): If locations are not being used,
8938 declare a single dummy member, as empty structs do not conform
8939 to the C standard.
8940 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
8941 the Forte Developer 7 C compiler complains that end-of-loop
8942 code is not reached.
8943
4dcf140b
PE
89442003-06-17 Paul Eggert <eggert@twinsun.com>
8945
8946 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
8947 avoid warnings from picky compilers about redefinition of PARAMS.
8948
8dd76bee
PE
89492003-06-17 Paul Eggert <eggert@twinsun.com>
8950
8951 Version 1.875b.
8952
8953 * NEWS: Document 1.875b.
8954
8955 * lib/bbitset.h: Do not include config.h; that's the includer's job.
8956 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
8957 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
8958 Don't use 'index' in comments, as it's a builtin fn on some hosts.
8959 * lib/bitset_stats.c: Include gettext.h unconditionally, as
8960 per recent gettext manual's suggestion.
8961 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
8962 Use prototypes, not old-style definitions.
8963 * lib/lbitset.c (lbitset_unused_clear): Likewise.
8964 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
8965 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
8966 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
8967 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
8968 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
8969 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
8970 vbitset_or_and_cmp, vbitset_copy): Likewise.
8971
8972 * lib/libiberty.h: Do not include config.h; that's the includer's job.
8973 Do not include <stdlib.h>.
8974 (PARAMS): Define unconditionally for C89.
8975 (ATTRIBUTE_NORETURN): Remove.
8976 (ATTRIBUTE_UNUSED): Define unconditionally.
8977
8978 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 8979 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
8980 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
8981 * lib/vbitset.c, lib/vbitset.h: New files.
8982 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
8983 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
8984 from libbitset.
8985
8986 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
8987 `How Can I Reset @code{yyparse}', since texinfo does not allow
8988 arbitrary @ in node names.
8989
8990 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
8991 shouldn't be needed according to the gettext 0.12.1 documentation
8992 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 8993 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 8994 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 8995 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 8996
8dd76bee
PE
8997 * lib/.cvsignore: Add stdbool.h.
8998 * m4/.cvsignore: Add nls.m4, po.m4.
8999
9000 Upgrade to CVS gnulib.
9001 * stdbool_.h: File renamed from stdbool.h.in.
9002 * configure.ac (AM_STDBOOL_H): Invoke this instead of
9003 AC_HEADER_STDBOOL.
9004 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
9005 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
9006 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
9007 (MOSTLYCLEANFILES): New var.
9008 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
9009 (stdbool.h): New rule.
9010 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
9011 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
9012 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
9013 m4/quote.m4: Upgrade to today's gnulib.
9014
9015 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
9016 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
9017 the tests right now.
9018 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
9019 yyerror are declared before use; C99 requires this.
9020
25005f6a
PH
90212003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9022
9023 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
9024 first.
9025 (yyrecoverSyntaxError): Correct the logic for setting and testing
9026 yyerrState.
9027 Correct comment on handling EOF.
9028 Allow states with only a default reduction, rather than failing
8dd76bee 9029 (I can't quite reconstruct why these were not allowed before).
25005f6a 9030
137437c6 9031 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 9032 buffer overruns, corrupting state.
8dd76bee
PE
9033
9034 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
9035 definition.
9036 * src/reader.h (max_left_semantic_context): New variable declaration.
9037 * src/scan-gram.l (max_left_semantic_context): Define.
9038 (handle_action_dollar): Update max_left_semantic_context.
9039 * data/glr.c (YYMAXLEFT): New definition.
9040 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
9041 (yyresolveAction): Ditto.
9042
9043 Fixes to problems with location handling in GLR parsers reported by
9044 Frank Heckenbach (2003/06/05).
9045
9046 * data/glr.c (YYLTYPE): Make trivial if locations not used.
9047 (YYRHSLOC): Add parentheses, and define only if locations used.
9048 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
9049 locations not used.
9050 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
9051 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 9052
25005f6a
PH
9053 * tests/cxx-type.at: Exercise location information; update tests
9054 to differentiate output with and without locations.
8dd76bee 9055 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
9056 because default YYLTYPE not yet defined.
9057 Change semantic actions to compute strings, rather than printing
9058 them directly (to test proper passing of semantics values). Change
9059 output to prefix notation and update test data and expected results.
9060 (yylex): Track locations.
9061 (stmtMerge): Return value rather than printing, and include arguments
9062 in value.
8dd76bee 9063
711f40b7
PE
90642003-06-03 Paul Eggert <eggert@twinsun.com>
9065
9066 Avoid warnings generated by GCC 2.95.4 when Bison is
9067 configured with --enable-gcc-warnings.
9068 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
9069 yy::]b4_parser_class_name[::translate_,
9070 yy::Stack::operator[] (unsigned),
9071 yy::Stack::operator[] (unsigned) const,
9072 yy::Slice::operator[] (unsigned),
9073 yy::Slice::operator[] (unsigned) const):
9074 Rename local vars to avoid warnings.
9075 * tests/glr-regression.at (Improper handling of embedded actions
9076 and $-N in GLR parsers): Remove unused local variable from yylex.
9077 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
9078 (void) as arg when not pure, since we now assume C89 when building
9079 Bison. Pacify GCC by using parameter.
9080
ac695f7d
PE
90812003-06-02 Paul Eggert <eggert@twinsun.com>
9082
9083 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
9084 yy::Location::lines, yy::Location::columns): Rename arguments
9085 to avoid shadowing; this removes a warning generated by GCC 3.3.
9086
26ec81e0
PE
90872003-06-01 Paul Eggert <eggert@twinsun.com>
9088
9089 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
9090 to g++, as GCC 3.3 complains if you do it.
9091 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
9092 everything that WARNING_CFLAGS has, except omit warnings
9093 not suitable for C++.
9094 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
9095 * tests/atlocal.in (CXXFLAGS): New var.
9096 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
9097
9098 Fix a GLR parser bug I reported in February; see
161a71f3 9099 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
9100 The problem was that GLR parsers did not conform to the C standard,
9101 because actions like { $1 = $2 + $3; } expanded to expressions
9102 that invoked YYFILL in separate subexpressions, and YYFILL assigned
9103 to a local variable. The C standard says that expressions
9104 like (var = f ()) + (var = f ()) have undefined behavior.
9105 Another problem was that GCC sometimes issues warnings that
9106 yyfill and its parameters are unused.
9107
9108 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
9109 as possibly unused.
9110 (yyfill): New function.
9111 (YYFILL): Use it.
9112 (yyuserAction): Change type of yynormal to bool, so that it matches
9113 the new yyfill signature. Mark it as possibly unused.
9114
9115
9116 Follow up on a bug I reported in February, where a Bison-generated
9117 parser can loop. Provide a test case and a fix for yacc.c. I
9118 don't have a fix for lalr1.cc or for glr.c, unfortunately.
9119 The original bug report is in:
161a71f3 9120 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
9121
9122 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
9123 macro's size was becoming unwieldy.
9124 (yyerrlab): Do not discard an empty lookahead symbol, as this
9125 might destroy garbage.
9126 (yyerrorlab): New label, with the old contents of YYERROR,
9127 plus the following change: pop the stack of rhs corresponding
9128 to the production that invoked YYERROR. That is how Yacc
9129 behaves, and POSIX requires this behavior.
9130 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
9131 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
9132 Define 'alarm' to do nothing if unistd.h is not available.
9133 Add a new rule "exp: '-' error;" to test the above change to
9134 data/yacc.c. Use 'alarm' to abort any test taking longer than
9135 10 seconds, as it's probably looping.
9136 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
9137 Also, the new yacc.c generates two fewer diagnostics for an
9138 existing test.
9139
d0829076
PE
91402003-05-24 Paul Eggert <eggert@twinsun.com>
9141
c6ae27df
PE
9142 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
9143 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
9144 This fixes a problem reported by John Bowman when the Compaq/HP
9145 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
9146 -ansi -Wall -gall).
9147 * data/yacc.c (union yyalloc): Likewise.
9148 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 9149
d0829076
PE
9150 Switch from 'int' to 'bool' where that makes sense.
9151
9152 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
9153 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
9154 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
9155 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
9156 Return or accept bool, not int. All callers changed.
9157 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
9158 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
9159 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
9160 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
9161 bitset_or_and_cmp_): Likewise.
9162 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
9163 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
9164 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
9165 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
9166 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
9167 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
9168 bitset_stats_or_and_cmp): Likewise.
9169 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
9170 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
9171 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
9172 ebitset_xor_cmp): Likewise.
9173 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
9174 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
9175 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
9176 lbitset_xor_cmp): Likewise.
9177 * lib/bbitset.h: Include <stdbool.h>.
9178 (struct bitset_vtable): The following members now return bool, not
9179 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
9180 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
9181 or_and_cmp).
9182 * src/conflicts.c (count_rr_conflicts): Likewise.
9183 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
9184 All uses changed.
9185 * lib/ebitset.c (ebitset_obstack_init): Likewise.
9186 * lib/lbitset.c (lbitset_obstack_init): Likewise.
9187 * src/getargs.c (debug_flag, defines_flag, locations_flag,
9188 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9189 graph_flag): Likewise.
9190 * src/getargs.h (debug_flag, defines_flag, locations_flag,
9191 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9192 graph_flag): Likewise.
9193 * src/output.c (error_verbose): Likewise.
9194 * src/output.h (error_verbose): Likewise.
9195 * src/reader.c (start_flag, typed): Likewise.
9196 * src/reader.h (typed): Likewise.
9197 * src/getargs.c (LOCATIONS_OPTION): New constant.
9198 (long_options, getargs): Use it.
9199 * src/lalr.c (build_relations): Use bool, not int.
9200 * src/nullable.c (nullable_compute): Likewise.
9201 * src/print.c (print_reductions): Likewise.
9202 * src/tables.c (action_row, pack_vector): Likewise.
9203 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
9204 * src/output.c (prepare): Use it.
9205 * src/output.c (token_definitions_output,
9206 symbol_destructors_output, symbol_destructors_output): Use string,
9207 not boolean integer, to keep track of whether to output separator.
9208 * src/print_graph.c (print_core): Likewise.
9209 * src/state.c (state_rule_lookaheads_print): Likewise.
9210
9211 * config/install-sh: Sync from automake 1.7.5.
9212
6b2584b7
PE
92132003-05-14 Paul Eggert <eggert@twinsun.com>
9214
9215 * src/parse-gram.y (rules_or_grammar_declaration): Require a
9216 semicolon after a grammar declaration, in the interest of possible
9217 future changes to the Bison input language.
9218 Do not allow a stray semicolon at the start of the grammar.
9219 (rhses.1): Allow one or more semicolons after any rule, including
9220 just before "|" as required by POSIX.
9221 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
9222 grammar.
9223
caf37a36
ADL
92242003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
9225
9226 %parse-param support for lalr1.cc.
9227
9228 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
9229 b4_cc_constructor_calls, b4_cc_constructor_call,
9230 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
9231 definitions.
9232 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
9233 parse-param arguments.
9234 (yy::b4_parser_class_name): Declare instance variables to
9235 hold parse-param arguments.
9236 * tests/calc.at: s/value/semantic_value/ because value clashes
9237 with a member of yy::b4_parser_class_name. Adjust C++ code
9238 to handle %parse-param. Enable %parse-param test in C++.
9239
3ab37077
PE
92402003-05-12 Paul Eggert <eggert@twinsun.com>
9241
9242 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
9243 English a bit. Fix fclose typo. Change "const char" to "char
9244 const", and use ANSI C rather than K&R for "main". Suggest
9245 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
9246 and suggest yy_switch_to_buffer.
9247
92482003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
9249
9250 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
9251 C89. This avoids a diagnostic on compilers that define __STDC__
9252 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 9253 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 9254
e743727f
PE
92552003-05-03 Paul Eggert <eggert@twinsun.com>
9256
9257 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
9258 Do not overrun array bounds.
9259 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 9260 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 9261
916708d5
AD
92622003-04-29 Akim Demaille <akim@epita.fr>
9263
9264 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
9265 * src/getargs.c, src/getargs.h: here, as bool, not int.
9266 (nondeterministic_parser): New.
9267 * src/parse-gram.y, src/scan-gram.l: Support
9268 %nondeterministic-parser.
9269 * src/output.c (prepare): Use nondeterministic_parser instead
9270 of glr_parser where appropriate.
9271 * src/tables.c (conflict_row, action_row, save_row)
9272 (token_actions, token_actions, pack_vector): Ditto.
9273
a06ea4aa
AD
92742003-04-29 Akim Demaille <akim@epita.fr>
9275
9276 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
9277
211074ca
AD
92782003-04-29 Akim Demaille <akim@epita.fr>
9279
9280 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
9281 with %pure-parser and %locations to exercise the patch from Yakov
9282 Markovitch below.
9283
6175ffe3
PE
92842003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
9285
9286 * data/yacc.c: (b4_lex_param): Corrected for the case where
9287 %lex-param is provided and %pure-parser isn't.
9288
b1e95857
PE
92892003-04-27 Paul Eggert <eggert@twinsun.com>
9290
9291 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 9292 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
9293 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
9294 if it is not defined.
9295 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
9296
acda9df6
PE
92972003-04-26 Paul Eggert <eggert@twinsun.com>
9298
3470c57b
PE
9299 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
9300 Declare to be of type suitable for the ninf value itself, not of
9301 type suitable for the corresponding table, since the latter might
9302 be unsigned but the ninf value might be negative. This fixes a
9303 bug reported by Alexandre Duret-Lutz in
161a71f3 9304 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 9305
acda9df6
PE
9306 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
9307 invokes it. We shouldn't invoke it twice because it will attempt
9308 to put error.o in the archive twice. This fixes a glitch reported
9309 by Martin Mokrejs in
161a71f3 9310 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 9311
b5250f26
PE
93122003-04-21 Paul Eggert <eggert@twinsun.com>
9313
9314 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
9315 to gnulib.
9316
089ac0f1
PE
93172003-04-21 Yakov Markovitch <Markovitch@iso.ru>
9318
9319 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
9320 Fix obvious typo that results in uncompilable GLR parsers
9321 when both %pure-parser and %locations are used. (trivial change)
9322
5ededac6
PE
93232003-04-17 Paul Eggert <eggert@twinsun.com>
9324
1b8f2fff
PE
9325 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
9326 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
9327 Do not insert the expected token via unput, as this runs afoul
9328 of a POSIX-compatibility bug in flex 2.5.31.
9329 All uses changed to BEGIN the parent state,
9330 since we no longer insert the expected token via unput.
9331 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
9332 that is no longer emitted after the above change.
9333
5ededac6
PE
9334 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
9335 the first one. This change is from Paul Hilfinger, and it fixes
9336 regression reported by Werner Lemberg in
161a71f3 9337 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
9338
9339 (resolve_sr_conflict): Don't invoke state_errs_set
9340 unless one or more tokens have been explicitly made errors.
9341 Otherwise, the above change causes Bison to abort.
9342
9343 * tests/existing.at (GNU pic Grammar): New test case, taken from
9344 Lemberg's email.
9345
b8be9132
AD
93462003-03-31 Akim Demaille <akim@epita.fr>
9347
9348 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
9349
d423d460
AD
93502003-03-31 Akim Demaille <akim@epita.fr>
9351
9352 * src/output.c (prepare_symbols): Avoid trailing spaces in the
9353 output.
9354
c7e441b4
AD
93552003-03-31 Akim Demaille <akim@epita.fr>
9356
9357 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
9358 From Paul Hilfinger.
9359
231897ad
AD
93602003-03-29 Akim Demaille <akim@epita.fr>
9361
9362 * m4/error.m4: Do not put under dynamic conditions some code which
9363 expansion is under static control.
9364
5b066063
AD
93652003-03-29 Akim Demaille <akim@epita.fr>
9366
9367 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
9368
22a74fec
AD
93692003-03-29 Akim Demaille <akim@epita.fr>
9370
9371 * doc/bison.texinfo (Strings are Destroyed): New.
9372
0eee27e7
PE
93732003-03-13 Paul Eggert <eggert@twinsun.com>
9374
9375 * .cvsignore: Add configure.lineno.
9376 * src/.cvsignore: Add yacc.
9377 * tests/.cvsignore: Add testsuite.log.
9378 * doc/fdl.texi: Sync with latest FSF version.
9379
f61aad93
PE
93802003-03-12 Paul Eggert <eggert@twinsun.com>
9381
537636c7
PE
9382 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
9383 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
9384 cursor, instead of leaving it undefined. This fixes a bug
9385 reported by Tim Van Holder in
161a71f3 9386 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
9387 * tests/input.at (Torturing the Scanner): Test the scanner on
9388 an empty input file, which was Tim Van Holder's test case.
9389
9390 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
9391 <sys/resource.h> can be included, include sys/time.h and
9392 sys/times.h first, if available. This works around the SunOS
9393 4.1.4 porting bug reported by Bruce Becker in
161a71f3 9394 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
9395
9396 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
9397 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
9398 AC_HEADER_SYS_WAIT.
9399
f61aad93
PE
9400 Merge changes from gnulib. This was prompted because the CVS
9401 snapshot didn't build on Solaris 7 due to strnlen problems.
9402
9403 These changes need to be merged back into gnulib:
9404 * lib/hash.c: Include <stdbool.h> unconditionally.
9405 * m4/onceonly.m4 (m4_quote): New macro.
9406 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
9407 Quote AC_FOREACH variable-expansions properly.
9408 The 2003-01-03 obstack.h change also needs merging.
9409 {end of changes requiring merging}
5b066063 9410
f61aad93
PE
9411 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9412 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
9413 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
9414 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
9415 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
9416 New files, imported from gnulib.
9417 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
9418 above.
9419
9420 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
9421 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
9422 gnulib sources.
9423
9424 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
9425 Add.
9426 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
9427 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
9428 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
9429 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
9430 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
9431 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
9432 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
9433 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
9434 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
9435 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
9436 (jm_PREREQ_ARGMATCH): Remove.
9437 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
9438 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
9439
9440 * src/system.h: Include <stdbool.h> unconditionally.
9441
9442 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
9443 assuming at least C89 in the bitset code for some time now.
9444
d2ffe116
AD
94452003-03-03 Akim Demaille <akim@epita.fr>
9446
9447 * ro.po: New.
9448
052826fd
AD
94492003-03-02 Akim Demaille <akim@epita.fr>
9450
9451 * doc/bison.texinfo (Table of Symbols): Reactivate the
9452 documentation for %lex-param, and %parse-param.
9453
c4749565
AD
94542003-03-02 Akim Demaille <akim@epita.fr>
9455
9456 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
9457 generate verbose error messages.
9458 Use the number of tokens as an upper bound in yytname, as it
9459 cannot be a non terminal.
9460
d5286af1
AD
94612003-03-02 Akim Demaille <akim@epita.fr>
9462
9463 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
9464 message.
9465
22e304a6
AD
94662003-03-02 Akim Demaille <akim@epita.fr>
9467
22e304a6
AD
9468 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
9469 Use them to exercise yycheck overrun.
9470 Based on Andrew Suffield's grammar.
9471
67a25fed
AD
94722003-03-02 Akim Demaille <akim@epita.fr>
9473
9474 Create tests/local.at for Bison generic testing macros.
9475
9476 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
9477 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
9478 This new file.
9479 * tests/calc.at (AT_CHECK_CALC): Adjust.
9480 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
9481 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
9482 * tests/local.at: here.
9483 (AT_COMPILE_CXX): Tags the tests using it as c++.
9484 Ignore the test if CXX is not functional.
9485
9c2b381f
PE
94862003-03-01 Paul Eggert <eggert@twinsun.com>
9487
9488 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
9489 not loc->end, since loc->end might contain garbage and this leads
9490 to undefined behavior on some platforms.
9491 (id_loc, token_start): Use (IF_LINTed) initial values that do not
9492 depend on *loc, so that the reader doesn't give the the false
9493 impression that *loc is initialized.
9494 (<INITIAL>"%%"): Do not bother setting code_start, since its value
9495 does not survive the return.
9496
0433ba88
AD
94972003-03-01 Akim Demaille <akim@epita.fr>
9498
9499 * src/scan-gram.l (code_start): Always initialize it when entering
9500 into yylex, as SC_EPILOGUE is activated *before* the corresponding
9501 yylex invocation. An alternative would be making it static, but
9502 then it starts with the second %%'s beginning, instead of its end.
9503
b305ea69
PE
95042003-02-28 Paul Eggert <eggert@twinsun.com>
9505
9506 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
9507 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 9508 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 9509
c3d25e01
PE
95102003-02-26 Paul Eggert <eggert@twinsun.com>
9511
9512 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
9513 Remove Sequent/Pyramid discussion (nobody uses them any more).
9514 Merge VMS and MS-DOS discussion; these ports may well be dead
9515 but let's keep mentioning them for now. Put <> around email
9516 addresses. Add copyright notice.
9517
c267ffbc
PE
95182003-02-24 Paul Eggert <eggert@twinsun.com>
9519
9520 * data/glr.c (yy_reduce_print): yylineno -> yylno,
9521 to avoid collision with flex use of yylineno.
9522 Problem reported by Bruce Lilly in
161a71f3 9523 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
9524 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9525 * data/yacc.c (yy_reduce_print): Likewise.
9526
9527 * config/depcomp: Sync with Automake 1.7.3.
9528
f939fc12
AD
95292003-02-21 Akim Demaille <akim@epita.fr>
9530
9531 * data/lalr1.cc: Use temporary variables instead of casts to
9532 change integer types.
9533 Suggested by Paul Eggert.
9534
95923bd6
AD
95352003-02-21 Akim Demaille <akim@epita.fr>
9536
9537 * doc/bison.texinfo: Use "location" consistently to refer to @n,
9538 to avoid confusions with lalr1.cc's notion of Position.
9539 Suggested by Paul Eggert.
9540
2cdc240e
AD
95412003-02-20 Akim Demaille <akim@epita.fr>
9542
9543 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
9544 before initial_columns.
9545 (location.hh): Use consistent variable names when defining the
9546 operator<<.
9547 Use "last" so that we subtract from Positions, not from unsigned.
9548
5d003116
AD
95492003-02-20 Akim Demaille <akim@epita.fr>
9550
9551 * data/lalr1.cc (position.hh): New subfile, including the extended
9552 and Doxygen'ed documentation of class Position.
9553 (location.hh): Use it.
9554 Document a` la Doxygen.
ba1ecc07 9555 With the help of Benoit Perrot.
5d003116 9556
d02b25f9
AD
95572003-02-20 Akim Demaille <akim@epita.fr>
9558
9559 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
9560 AT_YACC_IF.
9561 Redefine AT_YYERROR_SEES_LOC_IF using it.
9562 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
9563 not defined.
9564 Don't use the location in yy::Parser::error_ and
9565 yy::Parser::print_ when not %locations.
9566 Activate more lalr1.cc tests.
9567
0d1c3a04
AD
95682003-02-19 Akim Demaille <akim@epita.fr>
9569
9570 * data/lalr1.cc: When displaying a line number, be sure to make it
9571 an int.
9572
60a777aa
AD
95732003-02-19 Akim Demaille <akim@epita.fr>
9574
9575 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
9576 Remove, useless.
9577 (YYABORT, YYACCEPT, YYERROR): New.
9578 * tests/calc.at: Renable the lalr1.cc test.
9579
0b86fc41
AD
95802003-02-19 Akim Demaille <akim@epita.fr>
9581
9582 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
9583 error recovery, mixing with/without pops and discarding of the
9584 lookahead.
9585 Exercise YYERROR.
9586 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
9587
da99a5dc
PE
95882003-02-17 Paul Eggert <eggert@twinsun.com>
9589
9590 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
9591 * tests/testsuite.at (AT_COMPILE): Use them.
9592 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 9593 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 9594
93b8c255
PE
95952003-02-12 Paul Eggert <eggert@twinsun.com>
9596
9597 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
9598 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 9599 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
9600 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
9601 Check for malloc failure, for consistency with yacc.c.
9602 (yytname_size): Remove, for consistency with yacc.c.
9603
9604 The bug still remains in data/lalr1.cc, as I didn't have time
9605 to fix it there.
9606
7548fed2
AD
96072003-02-06 Akim Demaille <akim@epita.fr>
9608
9609 * configure.ac (GXX): Rename as...
9610 (CXX): this, to keep the original Autoconf semantics.
9611 Require 2.57.
9612 * data/lalr1.cc: Fix b4_copyright invocations.
9613 If YYDEBUG is not defined, don't depend upon name_ being defined.
9614 (location.hh): Include string and iostream.
9615 (Position::filename): New member.
9616 (Position::Position ()): New.
9617 (operator<< (Position)): New.
9618 (operator- (Position, int)): New.
9619 (Location::first, Location::last): Rename as...
9620 (Location::begin, Location::end): these, to mock the conventional
9621 iterator names.
9622 (operator<< (Location)): New.
9623 * tests/atlocal.in (CXX): New.
9624 * tests/testsuite.at (AT_COMPILE_CXX): New.
9625 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
9626 locations in a more synthetic way.
9627 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
9628 lalr1.cc is used.
9629 Adjust the C locations to match those from Emacs: first column is
9630 column 0.
9631 Change all the expected results.
9632 Conform to the GCS: simplify the locations when applicable.
9633 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
9634 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
9635 these CPP macros with the m4 macros new defined by...
9636 (AT_CHECK_PUSHDEFS): this, i.e.:
9637 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 9638 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
9639 New macros.
9640 (AT_CHECK_POPDEFS): Undefine them.
9641 (AT_CHECK_CALC_LALR1_CC): New.
9642 Use it for the first lalr1.cc test.
9643
43a176ef
AD
96442003-02-04 Akim Demaille <akim@epita.fr>
9645
9646 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9647 Location as is defined.
9648
fc049e9c
AD
96492003-02-04 Akim Demaille <akim@epita.fr>
9650
9651 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9652 name_ being defined.
9653
a737b216
PE
96542003-02-03 Paul Eggert <eggert@twinsun.com>
9655
9656 * src/gram.h (start_symbol): Remove unused decl.
9657
9658 Use more-consistent naming conventions for local vars.
9659
9660 * src/derives.c (derives_compute): Change type of local var from
9661 int to rule_number.
9662 * src/gram.c (grammar_rules_partial_print): Likewise.
9663 * src/print.c (print_core): Likewise.
9664 * src/reduce.c (reduce_grammar_tables): Likewise.
9665
9666 * src/gram.c (grammar_dump): Change name of item_number *
9667 local var from r to rp.
9668 * src/nullable.c (nullable_compute): Likewise.
9669
9670 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9671
9672 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9673 for symbol or symbol_number var.
9674 * src/reader.c (grammar_start_symbol_set): Likewise.
9675 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9676 Likewise.
9677 * src/state.c (transitions_to): Likewise.
9678 * src/state.h: Likewise.
9679 * src/tables.c (symbol_number_to_vector_number): Likewise.
9680
9681 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9682 char * var.
9683
9684 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9685 var.
9686
9687 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9688 var.
9689
9690 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9691 Use str, not s, for char * var. Use ch, not c, for character var.
9692 Use size for size var.
9693
9694 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9695 char * var.
9696 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9697 uniqstr var.
9698 * src/uniqstr.h: Likewise.
9699
9700 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9701 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9702 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9703 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9704 param to have same name as that of enum, so that we don't use
9705 "s" to stand for a non-state.
9706
68e93ad5
AD
97072003-02-02 Akim Demaille <akim@epita.fr>
9708
9709 * src/scan-skel.l: Scan more than one inert character per yylex
9710 invocation.
9711
92898986
PE
97122003-02-01 Paul Eggert <eggert@twinsun.com>
9713
9714 Version 1.875a.
9715
1d9d5d71
PE
9716 * po/LINGUAS: Add ms.
9717
0435d061
AD
97182003-01-30 Akim Demaille <akim@epita.fr>
9719
9720 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9721
6029a57f
PH
97222003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9723
9724 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9725 of $1.
0435d061
AD
9726
9727 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 9728 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 9729 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 9730
6029a57f
PH
9731 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9732 (b4_rhs_location): Ditto.
0435d061 9733 (yyfill): New function to copy from stack tree into array
6029a57f 9734 incrementally.
0435d061
AD
9735 (yyuserAction): Modify to allow incremental move of semantic values
9736 to rhs array when in GLR mode.
9737 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
9738 as needed.
9739 Remove dummy use of yystack, as there is now a guaranteed use.
9740 (yydoAction): Modify to allow incremental move of semantic values
9741 to rhs array when in GLR mode.
9742 (yyresolveAction): Ditto.
9743 (yyglrShiftDefer): Update comment.
0435d061 9744 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
9745 (yyglrReduce): Ditto.
9746 (yydoAction): Ditto
0435d061 9747
6029a57f
PH
9748 * tests/glr-regr1.at: Rename to ...
9749 * tests/glr-regression.at: Add new regression test for the problems
9750 described above (adapted from S. Eken).
9751 Update copyright notice.
9752 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9753 * tests/Makefile.am: Ditto.
9754
6cee6297
PE
97552003-01-28 Paul Eggert <eggert@twinsun.com>
9756
9757 * data/lalr1.cc: Do not use @output_header_name@ unless
9758 b4_defines_flag is set. This fixes two bugs reported by
9759 Tim Van Holder in
161a71f3
PE
9760 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9761 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 9762
b2a836b5
PE
97632003-01-21 Paul Eggert <eggert@twinsun.com>
9764
9765 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9766 we don't need to worry about yyerrlab1 being reported as an
9767 "unused label" by non-GCC C compilers. The downside is that if
9768 locations are used then a couple of statements are duplicated each
9769 time YYERROR is invoked, but the upside is that the warnings
9770 should vanish.
9771 (yyerrlab1): Move code to YERROR.
9772 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9773 This reverts some of the 2002-12-27 change.
9774
4196b931
PE
97752003-01-17 Paul Eggert <eggert@twinsun.com>
9776
9777 * src/output.c (symbol_printers_output): Fix typo that led
9778 to core dump. Problem reported by Antonio Rus in
161a71f3 9779 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 9780
3ae831b4
AD
97812003-01-13 Akim Demaille <akim@epita.fr>,
9782 Quoc Peyrot <chojin@lrde.epita.fr>,
9783 Robert Anisko <anisko_r@lrde.epita.fr>
9784
9785 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9786 when the stacks contain one element, as the loop would otherwise
9787 free the last state, and then use the top state (the one we just
9788 popped). This means that the initial elements will not be freed
9789 explicitly, as is the case in yacc.c; it is not a problem, as
9790 these elements have fake values.
9791
e3aa65c5
PE
97922003-01-11 Paul Eggert <eggert@twinsun.com>
9793
9794 * NEWS: %expect-violations are now just warnings, reverting
9795 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9796 bootstrapping problem reported by Matthias Klose; see
161a71f3 9797 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
9798 * src/conflicts.c (conflicts_print): Likewise.
9799 * tests/conflicts.at (%expect not enough, %expect too much,
9800 %expect with reduce conflicts): Likewise.
9801 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9802 that the warning is enabled if the number of conflicts changes
9803 (not necessarily increases).
9804
9805 * src/getargs.c (version): Update copyright year.
9806
f0057011
AD
98072003-01-09 Akim Demaille <akim@epita.fr>
9808
9809 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9810
1ee6d2a0
PE
98112003-01-08 Paul Eggert <eggert@twinsun.com>
9812
9813 * Makefile.maint (WGETFLAGS):
9814 New macro, containing "-C off" to disable proxy caches.
9815 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9816 (rel-check): Use $(WGET) instead of wget.
9817
d4fd77c4
PE
98182003-01-06 Paul Eggert <eggert@twinsun.com>
9819
9820 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
9821 the GLR paper of Scott, Johnstone and Hussain.
9822
464c6927
PE
98232003-01-04 Paul Eggert <eggert@twinsun.com>
9824
d600ee67
PE
9825 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
9826 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
9827 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
9828 (EXTRA_LIBRARIES): New var, for liby.a.
9829 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
9830 (EXTRA_SCRIPTS): New var, for yacc.
9831
464c6927
PE
9832 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
9833 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
9834 Problem reported by Nelson H. F. Beebe.
9835
98362003-01-03 Paul Eggert <eggert@twinsun.com>
9837
9838 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
9839 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
9840 when compiling Bison 1.875's `bitset bset = obstack_alloc
9841 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
9842
9843 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
9844 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
9845 grow to a huge size with typical invocation.
d600ee67 9846
464c6927
PE
9847 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
9848 Use the pattern recommended by Autoconf 2.57, except also protect
9849 against double-definition.
9850 * src/system.h: Likewise.
9851 Portability issues reported by Nelson H. F. Beebe.
d600ee67 9852
464c6927
PE
9853 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
9854 All uses changed. Provide a definition in both C and C++.
9855 (yytrue, yyfalse): Define even if defined (__cplusplus).
9856
9857 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
9858 Reported by Nelson H. F. Beebe.
d600ee67 9859
464c6927
PE
9860 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
9861
0f42c7d5
PE
98622003-01-02 Paul Eggert <eggert@twinsun.com>
9863
9864 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
9865 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
9866 Bug reported by Nelson H. F. Beebe.
9867
dc546b0f
PE
98682003-01-01 Paul Eggert <eggert@twinsun.com>
9869
9870 * Version 1.875.
9871
2c09b6a7
PE
98722002-12-30 Paul Eggert <eggert@twinsun.com>
9873
9874 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
9875 Moved here from...
9876 (<INITIAL>","): Here. This causes stray "," to be treated
9877 more uniformly.
9878
dc546b0f 9879 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
9880 last brace in braced code when not in Yacc mode, for compatibility
9881 with Bison 1.35. This resurrects the 2001-12-15 patch to
9882 src/reader.c.
9883
9884 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
9885 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
9886
535c0f63
PE
98872002-12-28 Paul Eggert <eggert@twinsun.com>
9888
9889 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
9890 that of SYM's type. This fixes Debian bug 168069, reported by
9891 Thomas Olsson.
d600ee67 9892
963fcc17
PE
98932002-12-28 Paul Eggert <eggert@twinsun.com>
9894
9895 Version 1.75f.
9896
9897 Switch back to the Yacc style of conflict reports, undoing some
9898 of the 2002-07-30 change.
9899 * doc/bison.texinfo (Understanding): Use Yacc style for
9900 conflict reports. Also, use new way of locating rules.
9901 * src/conflicts.c (conflict_report):
9902 Renamed from conflict_report_yacc, removing the old
9903 'conflict_report'. Translate the entire conflict report at once,
9904 so that we don't assume that "," has the same interpretation in
9905 all languages.
9906 (conflicts_output): Use Yacc-style conflict report for each state,
9907 instead of our more-complicated style.
9908 (conflicts_print): Use Yacc-style conflict report, except print
9909 the input file name when not emulating Yacc.
9910 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
9911 Conflicted Reduction, %expect not enough, %expect too much,
9912 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
9913 * tests/existing.at (GNU Cim Grammar): Likewise.
9914 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
9915
9916 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
9917 fatal): Don't invoke fflush; it's not needed and it might even be
9918 harmful for stdout, as stdout might not be open.
9919 * src/reduce.c (reduce_print): Likewise.
9920
b1efe548
PE
99212002-12-27 Paul Eggert <eggert@twinsun.com>
9922
9923 Fix a bug where error locations were not being recorded correctly.
9924 This problem was originally reported by Paul Hilfinger in
161a71f3 9925 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
9926
9927 * data/yacc.c (yyparse): New local var yylerrsp, to record the
9928 top of the location stack's error locations.
9929 (yyerrlab): Set it. When discarding a token, push its location
9930 onto yylerrsp so that we don't lose track of the error's end.
9931 (yyerrlab1): Now is only the target of YYERROR, so that we can
9932 properly record the location of the action that failed. For GCC
9933 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
9934 GCC warning about yyerrlab1 being unused if YYERROR is unused.
9935 (yyerrlab2): New label, which yyerrlab now falls through to.
9936 Compute the error's location by applying YYLLOC_DEFAULT to
9937 the locations of all the symbols that went into the error.
9938 * doc/bison.texinfo (Location Default Action): Mention that
9939 YYLLOC_DEFAULT is also invoked for syntax errors.
9940 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9941 Error locations include the locations of all the tokens that were
9942 discarded, not just the last token.
d600ee67 9943
983c5c2c
PE
99442002-12-26 Paul Eggert <eggert@twinsun.com>
9945
b1efe548
PE
9946 * src/files.c: Include quote.h.
9947 (compute_output_file_names): Warn if we detect conflicting
9948 outputs to the same file. This should catch the misunderstanding
9949 exemplified by Debian Bug 165349, reported by Bruce Stephens..
9950
9951 * src/conflicts.c (conflicts_print): If the user specifies
9952 "%expect N", report an error if there are any reduce/reduce
9953 conflicts. This is what the manual says should happen.
9954 This fixes Debian bug 130890, reported by Anthony DeRobertis.
9955 * tests/conflicts.at (%expect with reduce conflicts): New test.
9956
983c5c2c
PE
9957 Don't use m4_include on relative file names, as it doesn't work as
9958 desired if there happens to be a file with that name under ".".
d600ee67 9959
983c5c2c
PE
9960 * m4sugar/version.m4: Remove; it was included but it wasn't used.
9961 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
9962 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
9963 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
9964 * src/output.c (output_skeleton): Use full path names when
9965 specifying a file to include; don't rely on include path, as
9966 it's unreliable when the working file contains a file with
9967 that name.
d600ee67 9968
983c5c2c
PE
99692002-12-25 Paul Eggert <eggert@twinsun.com>
9970
9971 Remove obsolete references to bison.simple and bison.hairy.
9972 Problem mentioned by Aubin Mahe in
161a71f3 9973 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
9974 * data/glr.c: Comment fix.
9975 * doc/bison.1: Remove references. Also, mention "yacc".
9976
9977 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
9978 with -g option.
9979
9980 * src/parse-gram.y (declaration): Use enum "report_states" rather
9981 than its numeric value 1.
9982
9983 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
9984 opening a new one. This fixes Debian bug 165349, reported by
9985 Bruce Stephens.
9986
23f2d9dc
PE
99872002-12-24 Paul Eggert <eggert@twinsun.com>
9988
9989 Version 1.75e.
9990
9991 * Makefile.maint (cvs-update): Don't assume that the shell
9992 supports $(...), as Solaris sh doesn't.
9993
9994 * src/parse-gram.y (lloc_default): Remove test for empty
9995 nonterminals at the end, since it didn't change the result.
9996
99972002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
9998
9999 If the user does not define YYSTYPE as a macro, Bison now declares it
10000 using typedef instead of defining it as a macro. POSIX requires this.
10001 For consistency, YYLTYPE is also declared instead of defined.
10002
10003 %union directives can now have a tag before the `{', e.g., the
10004 directive `%union foo {...}' now generates the C code
10005 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
10006 The default union tag is `YYSTYPE', for compatibility with Solaris 9
10007 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
10008 instead of `yyltype'.
10009
10010 `yystype' and `yyltype' are now obsolescent macros instead of being
10011 typedefs or tags; they are no longer documented and will be
10012 withdrawn in a future release.
10013
10014 * data/glr.c (b4_location_type): Remove.
10015 (YYSTYPE): Renamed from yystype.
10016 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
10017 (struct YYLTYPE): Renamed from struct yyltype.
10018 (YYLTYPE): Renamed from yyltype.
10019 (yyltype, yystype): New (and obsolescent) macros,
10020 for backward compatibility.
10021 * data/yacc.c: Likewise.
10022
10023 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
10024 does not specify a union tag. This is for compatibility with
10025 Solaris 9 yacc.
10026
10027 * src/parse-gram.y (add_param): 2nd arg is now char * not char
10028 const *, since it is now modified by stripping surrounding { }.
10029 (current_braced_code): Remove.
10030 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
10031 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
10032 trailing " {...}". Now of type <chars>.
10033 (grammar_declaration): Adjust to bundled tokens.
10034 (code_content): Remove; stripping is now done by add_param.
10035 (print_token_value): Print contents of bundled tokens.
10036 (token_name): New function.
10037
10038 * src/reader.h (braced_code, current_braced_code): Remove.
10039 (token_name): New decl.
10040
10041 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
10042 token_type, not braced_code code_kind. All uses changed.
10043 (SC_PRE_CODE): New state, for scanning after a keyword that
10044 has (or usually has) an immediately-following braced code.
10045 (token_type): New local var, to keep track of which token type
10046 to return when scanning braced code.
10047 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 10048 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
10049 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
10050 instead of returning a token type immediately.
10051 (<INITIAL>"{"): Set token type.
10052 (<SC_BRACED_CODE>"}"): Use it.
10053 (handle_action_dollar, handle_action_at): Now returns bool
10054 indicating success. Fail if ! current_rule; this prevents a core dump.
10055 (handle_symbol_code_dollar, handle_symbol_code_at):
10056 Remove; merge body into caller.
10057 (handle_dollar, handle_at): Complain in invalid contexts.
10058
10059 * NEWS, doc/bison.texinfo: Document the above.
10060 * NEWS: Fix years and program names in copyright notice.
10061
879ca4f8
PE
100622002-12-17 Paul Eggert <eggert@twinsun.com>
10063
10064 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
10065 Reporting, Table of Symbols): Omit mentions of %lex-param and
10066 %parse-param from the documentation for now.
10067
1c5fe69d
PE
100682002-12-15 Paul Eggert <eggert@twinsun.com>
10069
10070 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
10071 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
10072 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
10073 disagreed with the Bison documentation. Bug
10074 reported by Andrew Walrond.
d600ee67 10075
1c5fe69d
PE
10076 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
10077 as the caller now does that.
10078 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
10079 (YYEMPTY): Parenthesize right hand side, since others use it.
10080 (yyparse): Don't assume that our generated code is the only code
10081 that sets yychar.
10082
d1de5372
PE
100832002-12-13 Paul Eggert <eggert@twinsun.com>
10084
10085 Version 1.75d.
10086
10087 POSIX requires a "yacc" command.
10088 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
10089 (MOSTLYCLEANFILES): Add yacc.
10090 (yacc): New rule.
1c5fe69d 10091 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
10092 as an alias for bison y.
10093
10094 * po/LINGUAS: Add da.
d600ee67 10095
d1de5372
PE
10096 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
10097 problem with latest <getopt.h>.
10098 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
10099
10100 * doc/fdl.texi: Upgrade to 1.2.
10101 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
10102 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
10103 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
10104 gnulib.
10105 * config/install-sh: Sync with autotools.
10106
10107 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 10108 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
10109 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
10110 locations are requested.
10111 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
10112 locations are requested.
10113
d0f3fe23
PE
101142002-12-12 Paul Eggert <eggert@twinsun.com>
10115
10116 Remove unportable casts and storage allocation tricks.
10117 While we're at it, remove almost all casts, since they
10118 usually aren't needed and are a sign of trouble.
10119
10120 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
10121
10122 * src/derives.c (derives_compute): Do not subtract NTOKENS from
10123 the pointer DSET returned by malloc; this isn't portable.
10124 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
10125 Similarly for DERIVES.
10126 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
10127 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
10128 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
10129
10130 * src/derives.c (derives_compute): Do not bother invoking
10131 int_of_rule_number, since rule numbers are integers.
10132
10133 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
10134 rather than XMALLOC (char, N).
10135
10136 * src/files.c (filename_split): Rewrite to avoid cast.
10137
10138 * src/gram.h (symbol_number_as_item_number,
10139 item_number_as_symbol_number, rule_number_as_item_number,
10140 item_number_as_rule_number):
10141 Now inline functions rather than macros, to avoid casts.
10142 * src/state.h (state_number_as_int): Likewise.
10143 * src/tables.c (state_number_to_vector_number,
10144 symbol_number_to_vector_number): Likewise.
10145
10146 * src/gram.h (int_of_rule_number): Remove; no longer used.
10147
10148 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
10149 since the resulting storage is always stored into.
10150
10151 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
10152 where it's needed.
10153
10154 * src/muscle_tab.c (muscle_m4_output):
10155 Now inline. Return bool, not int.
10156 * src/state.c (state_compare): Likewise.
10157 * src/symtab.c (symbol_check_defined,
10158 symbol_check_alias_consistency, symbol_pack, symbol_translation,
10159 hash_compare_symbol, hash_symbol):
10160 Likewise.
10161 * src/uniqstr.c (uniqstr_print): Likewise.
10162 * src/muscle_tab.c (muscle_m4_output_processor):
10163 New function, to avoid casts.
10164 * src/state.c (state_comparator, stage_hasher): Likewise.
10165 * src/symtab.c (symbol_check_defined_processor,
10166 symbol_check_alias_consistency_processor, symbol_pack_processor,
10167 symbol_translation_processor, hash_symbol_comparator,
10168 hash_symbol_hasher): Likewise.
10169 * src/uniqstr.c (uniqstr_print_processor): Likewise.
10170 * src/muscle_tab.c (muscles_m4_output):
10171 Use new functions instead of casting old functions unportably.
10172 * src/state.c (state_hash_new): Likewise.
10173 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
10174 symbols_token_translations_init):
10175 Likewise.
10176 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
10177
10178 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
10179 var instead of casting to long, to avoid casts.
10180 (prepare_states): Use MALLOC rather than alloca, so that we don't
10181 have to worry about alloca.
10182 * src/state.c (state_hash_lookup): Likewise.
10183
10184 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
10185 local var instead of casting to unsigned char, to avoid casts.
10186
10187 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
10188 STATE_ALLOC): Remove.
10189 (transitions_new, errs_new, reductions_new, state_new): Use malloc
10190 rather than calloc, and use offsetof to avoid allocating slightly
10191 too much storage.
10192 (state_new): Initialize all members.
10193
10194 * src/state.c (state_hash): Use unsigned accumulator, not signed.
10195
10196 * src/symtab.c (symbol_free): Remove; unused.
10197 (symbol_get): Remove cast in lhs of assignment.
10198 (symbols_do): Now static. Accept generic arguments, not
10199 hashing-related ones.
10200
10201 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
10202 (symbol_processor): Remove.
10203 (symbols_do): Remove decl; now static.
10204
10205 * src/system.h (alloca): Remove; decl no longer needed.
10206 (<stddef.h>): Include, for offsetof.
10207 (<inttypes.>, <stdint.h>): Include if available.
10208 (uintptr_t): New type, if system lacks it.
10209 (CALLOC, MALLOC, REALLOC): New macros.
10210 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
10211 new macros.
10212
10213 * src/tables.c (table_size): Now int, to pacify GCC.
10214 (table_grow, table_ninf_remap): Use signed table size.
10215 (save_row): Don't bother initializing locals when not needed.
10216 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
10217 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
10218
10219 * src/vcg.h: Correct misspellings.
10220
10221 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
10222
10223
10224 * src/getargs.c (getargs): Don't assume EOF == -1.
10225
26b4a969
PE
102262002-12-09 Paul Eggert <eggert@twinsun.com>
10227
10228 Change identifier spellings to avoid collisions with names
10229 that are reserved by POSIX.
10230
10231 Don't use names ending in _t, since POSIX reserves them.
10232 For consistency, remove _e and _s endings -- they're weren't
10233 needed to remove ambiguity. All uses changed.
10234 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
10235 turn was just renamed from struniq_t.
10236 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
10237 which in turn was just renamed from struniq_processor_t.
10238 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
10239 in turn was renamed from hash_compare_struniq_t.
10240 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
10241 (state_list): Renamed from state_list_t.
10242 * src/assoc.h (assoc): Renamed from assoc_t.
10243 * src/conflicts.c (enum conflict_resolution): Renamed from
10244 enum conflict_resolution_e.
10245 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
10246 (rule_list): Renamed from rule_list_t.
10247 * src/getargs.h (enum trace): Renamed from enum trace_e.
10248 (enum report): Renamed from enum report_e.
10249 * src/gram.h (item_number): Renamed from item_number_t.
10250 (rule_number): Renamed from rule_number_t.
10251 (struct rule_s): Remove the "rule_s" part; not used.
10252 (rule): Renamed from rule_t.
10253 (rule_filter): Renamed from rule_filter_t.
10254 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
10255 (goto_list): Renamed from goto_list_t.
10256 * src/lalr.h (goto_number): Renamed from goto_number_t.
10257 * src/location.h (location): Renamed from location_t.
10258 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
10259 and moved here from:
10260 * src/muscle_tab.h (muscle_entry_t): here.
10261 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
10262 (rule_list): Renamed from rule_list_t.
10263 * src/print_graph.c (static_graph): Renamed from graph.
10264 * src/reader.h (braced_code): Renamed from braced_code_t.
10265 Remove brace_code_e tag.
10266 * src/relation.h (relation_node): Renamed from relation_node_t.
10267 (relation_nodes): Renamed from relation_nodes_t.
10268 (relation): Renamed from relation_t.
10269 * src/state.h (state_number): Renamed from state_number_t.
10270 (struct state): Renamed from struct state_s.
10271 (state): Renamed from state_t.
10272 (transitions): Renamed from transitions_t. Unused (and
10273 misspelled) transtion_s tag removed.
10274 (errs): Renamed from errs_t. Unused errs_s tag removed.
10275 (reductions): Renamed from reductions_t. Unused tag
10276 reductions_s removed.
10277 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
10278 (struct symbol_list): Renamed from struct symbol_list_s.
10279 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
10280 (struct symbol): Renamed from struct symbol_s.
10281 (symbol): Renamed from symbol_t.
10282 * src/tables.c (vector_number): Renamed from vector_number_t.
10283 (action_number): Renamed from action_t.
10284 * src/tables.h (base_number): Renamed from base_t.
10285 * src/vcg.h (enum color): Renamed from enum color_e.
10286 (enum textmode): Renamed from enum textmode_e.
10287 (enum shape): Renamed from enum shape_e.
10288 (struct colorentry): Renamed from struct colorentry_s.
10289 (struct classname): Renamed from struct classname_s.
10290 (struct infoname): Renamed from struct infoname_s.
10291 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
10292 (enum decision): Renamed from enum decision_e.
10293 (enum orientation): Renamed from enum orientation_e.
10294 (enum alignment): Renamed from enum alignment_e.
10295 (enum arrow_mode): Renamed from enum arrow_mode_e.
10296 (enum crossing_type): Renamed from enum crossing_type_e.
10297 (enum view): Renamed from enum view_e.
10298 (struct node): Renamed from struct node_s.
10299 (node): Renamed from node_t.
10300 (enum linestyle): Renamed from enum linestyle_e.
10301 (enum arrowstyle): Renamed from enum arrowstyle_e.
10302 (struct edge): Renamed from struct edge.
10303 (edge): Renamed from edge_t.
10304 (struct graph): Renamed from struct graph_s.
10305 (graph): Renamed from graph_t.
10306 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
10307 Rename value_t -> value.
10308 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
10309 value_t_as_yystype -> value_as_yystype.
10310
10311 Don't include <errno.h> in the mainstream code, since it
10312 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
10313 * lib/get-errno.c, lib/get-errno.h: New files.
10314 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
10315 get-errno.c.
10316 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
10317 * src/output.c (output_skeleton): Likewise.
10318 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
10319 instead of errno.
10320 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
10321 Likewise.
10322 (handle_action_dollar, handle_action_at): Likewise.
10323 * src/system.h: Do not include <errno.h>.
10324 (TAB_EXT): Renamed from EXT_TAB.
10325 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
10326
10327 Avoid str[a-z]*, since <string.h> reserves that name space.
10328 Change all instances of "struniq" in names to "uniqstr", and
10329 likewise for "STRUNIQ" and "UNIQSTR".
10330 * src/uniqstr.c: Renamed from src/struniq.c.
10331 * src/uniqstr.h: Renamed from src/struniq.h.
10332 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
10333 * src/files.c (strsuffix): Remove; unused.
10334 (concat2): Renamed from stringappend. Now static.
10335 * src/files.h (strsuffix, stringappend): Remove; unused.
10336 * src/parse-gram.y (<chars>): Renamed from <string>.
10337 (<uniqstr>): Renamed from <struniq>.
10338 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
10339 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
10340 (struct graph_s.expand): Renamed from struct graph_s.stretch.
10341 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
10342 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
10343 (N_EXPAND): Renamed from N_STRETCH.
10344
10345 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
10346 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
10347 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
10348 Remove; unused.
10349 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
10350 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
10351 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
10352 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
10353 (BASE_MAXIMUM): Renamed from BASE_MAX.
10354 (BASE_MINIMUM): Renamed from BASE_MIN.
10355 (ACTION_MAX): Remove; unused.
10356 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
10357 Unnecessary casts removed from above defines.
10358
10359
10360 Fix misspelling in names.
10361 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
10362 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
10363 G_NODE_ALIGNEMENT.
10364
10365
10366 * lib/timevar.c (timevar_report): Renamed from time_report,
10367 for consistency with other names.
10368 * lib/timevar.h (timevar_report): New decl.
10369 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
10370
10371
10372 Sort include-file uses.
10373
10374 Reorder all include files under src to be in the order "system.h".
10375 then the ../lib include files in angle brackets (alphabetized),
10376 then the . include files in double-quotes (alphabetized). Fix
10377 dependency breakages encountered in this process, as follows:
10378 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
10379 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
10380 * src/state.h: Include "symtab.h".
10381
996b1c7e
PE
103822002-12-08 Paul Eggert <eggert@twinsun.com>
10383
10384 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
10385 since this causes problems when __file__ contains character
10386 sequences like "@" that are treated specially by src/scan-skel.l.
10387 Instead, just use the file's basename. This fixes the bug
10388 reported by Martin Mokrejs in
161a71f3 10389 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 10390
e19c4e5d
PE
103912002-12-06 Paul Eggert <eggert@twinsun.com>
10392
10393 Add support for rules that do not have trailing semicolons, as
10394 POSIX requires. Improve the quality of locations in Bison
10395 diagnostics.
26b4a969 10396
e19c4e5d
PE
10397 * src/location.c: Include <quotearg.h>.
10398 (empty_location): Now const.
10399 (location_print): New function. Follow the recommendation of the
10400 GNU Coding Standards for locations that span file boundaries.
10401 * src/location.h: Do not include <quotearg.h>; no longer needed.
10402 (boundary): New type.
10403 (location_t): Use it. This allows locations to span file boundaries.
10404 All member uses changed: file -> start.file or end.file (as needed),
10405 first_line -> start.line, first_column -> start.column,
10406 last_line -> end.line, last_column -> end.column.
10407 (equal_boundaries): New function.
10408 (LOCATION_RESET, LOCATION_STEP): Remove.
10409 (LOCATION_PRINT): Remove. All callers changed to use location_print.
10410 (empty_location): Now const.
10411 (location_print): New decl.
10412 * src/parse-gram.y (lloc_default): New function, which handles
10413 empty locations more accurately.
10414 (YYLLOC_DEFAULT): Use it.
10415 (%token COLON): Remove.
10416 (%token ID_COLON): New token.
26b4a969 10417 (rules): Use it.
e19c4e5d
PE
10418 (declarations, rules): Remove trailing semicolon.
10419 (declaration, rules_or_grammar_declaration):
10420 Allow empty (";") declaration.
10421 (symbol_def): Remove empty actions; no longer needed.
10422 (rules_or_grammar_declaration): Remove trailing semicolon.
10423 (semi_colon.opt): Remove.
10424 * src/reader.h: Include location.h.
10425 (scanner_cursor): New decl.
10426 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
10427 rolling our own.
10428 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
10429 of *loc.
10430 (STEP): Remove. No longer needed, now that adjust_location does
10431 the work. All uses removed.
10432 (scanner_cursor): New var.
10433 (adjust_location): Renamed from extend_location. It now sets
10434 *loc and adjusts the scanner cursor. All uses changed.
10435 Don't bother testing for CR.
10436 (handle_syncline): Remove location arg; now updates scanner cursor.
10437 All callers changed.
10438 (unexpected_end_of_file): Now accepts start boundary of token or
10439 comment, not location. All callers changed. Update scanner cursor,
10440 not the location.
10441 (SC_AFTER_IDENTIFIER): New state.
10442 (context_state): Renamed from c_context. All uses changed.
10443 (id_loc, code_start, token_start): New local vars.
10444 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
10445 processing of Yacc white space and equivalents here.
10446 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
10447 instead of returning ID immediately, since we need to search for
10448 a subsequent colon.
10449 (<INITIAL>"'", "\""): Save token_start.
10450 (<INITIAL>"%{", "{", "%%"): Save code_start.
10451 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
10452 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
10453 BEGIN context_state at end, not INITIAL.
10454 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
10455 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
10456 Return correct token start.
10457 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
10458 the start of a character, string or multiline comment is found.
10459 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
10460 Reduction): Adjust reported locations to match the more-precise
10461 results now expected.
10462 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
10463 * tests/reduce.at (Useless Rules, Reduced Automaton,
10464 Underivable Rules): Likewise.
10465 * tests/regression.at (Invalid inputs): No longer `expecting ";"
10466 or "|"' now that so many other tokens are allowed by the new grammar.
10467
10468 * src/complain.h (current_file): Remove duplicate decl;
10469 current_file is now owned by files.h.
10470 * src/complain.c, src/scan-gram.l: Include files.h.
10471
104722002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 10473
e19c4e5d
PE
10474 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
10475 promotes to int; it might be unsigned int.
10476 * data/yacc.c (yy_reduce_print): Likewise.
10477
10478 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
10479 be #defined in the prologue, not in the Bison declarations.
10480 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 10481
b64755e3
PE
104822002-12-02 Paul Eggert <eggert@twinsun.com>
10483
10484 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
10485 * lib/strtoul.c: New file, from gnulib.
10486 This fixes a porting bug reported by Peter Klein in
161a71f3 10487 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 10488
6e746484
PE
104892002-11-30 Paul Eggert <eggert@twinsun.com>
10490
b64755e3
PE
10491 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
10492 and put only a forward declaration in the prologue. This is for
10493 consistency with the other scanner helper functions.
10494
6ba55592
PE
10495 Type clashes now generate warnings, not errors, since it
10496 appears that POSIX may allow some grammars with type clashes.
10497 * src/reader.c (grammar_current_rule_check): Warn about
10498 type clashes instead of complaining.
10499 * tests/input.at (Type Clashes): Expect warnings, not complaints.
10500
6e746484
PE
10501 Add Yacc library, since POSIX requires it.
10502 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
10503 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
10504 * lib/main.c, lib/yyerror.c: New files.
10505
10506 gram_error can be static; it need not be extern.
10507 * src/reader.h (gram_error): Remove decl.
10508 * src/parse-gram.y (gram_error): Now static. Add static decl.
10509 (print_token_value): Omit parameter names from forward decl,
10510 for consistency.
10511
88510f9c
PE
105122002-11-29 Paul Eggert <eggert@twinsun.com>
10513
6e746484
PE
10514 * doc/bison.texinfo: Emphasize that yylex and yyerror must
10515 be declared before being used. E.g., one should typically
10516 declare them in the prologue. Use GNU coding style in examples.
10517 Put "const" consistently after the type it modifies. Mention
10518 that C99 supports "inline". Mention that yyerror traditionally
10519 returns "int".
10520
88510f9c
PE
10521 %parse-param and %lex-param now take just one argument, the
10522 declaration; the argument name is deduced from the declaration.
10523
10524 * doc/bison.texinfo (Parser Function, Pure Calling, Error
10525 Reporting, Table of Symbols): Document this.
10526 * src/parse-gram.y (add_param): New function.
10527 (COMMA): Remove.
10528 (declaration): Implement new rule for %parse-param and %lex-param.
10529 * src/scan-gram.l: "," now elicits a warning, rather than being
10530 a token; this is more compatible with byacc.
10531 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
10532
bb92250c
PE
105332002-11-27 Paul Eggert <eggert@twinsun.com>
10534
10535 Rename identifiers to avoid real and potential collisions.
10536
10537 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
10538 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 10539 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
10540 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10541 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
10542 * src/parse-gram.y (print_token_value): Renamed from yyprint.
10543 All uses changed.
10544 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
10545 The name "yycontrol" violates the name space rules, and this stuff
10546 wasn't being used anyway.
10547 (input): Remove action; this stuff wasn't being used.
10548 (gram_error): Rename local variable yylloc -> loc.
10549 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
10550 (YY_DECL): Don't use "yy" at start of local variables.
10551 All uses changed, e.g., yylloc -> loc.
10552 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
10553 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
10554 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
10555 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
10556
10557 * src/parse-gram.y (gram_error): loc is now const *.
10558 * src/reader.h (gram_error): Likewise.
10559
3af4feb2
PE
105602002-11-24 Paul Eggert <eggert@twinsun.com>
10561
10562 Version 1.75c.
10563
10564 * tests/actions.at (Actions after errors): Use an output format
10565 more similar to that of the Printers and Destructors test.
10566 Test the position of the ';' token too.
10567 (Printers and Destructors): Likewise.
10568 (Printers and Destructors: %glr-parser): Remove for now, to avoid
10569 unnecessarily alarming people when the test fails.
10570
10571 * data/yacc.c (yyerrlab1): Move this label down, so that the
10572 parser does not discard the lookahead token if the user code
10573 invokes YYERROR. This change is required for POSIX conformance.
10574
10575 * lib/error.c: Sync with gnulib.
10576
105772002-11-22 Paul Eggert <eggert@twinsun.com>
10578
10579 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
10580 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
10581 * lib/xmalloc.c: Likewise.
26b4a969 10582
58004308
PE
105832002-11-20 Paul Eggert <eggert@twinsun.com>
10584
10585 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
10586
105872002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 10588
58004308
PE
10589 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
10590 should use `if (! x) abort ();' rather than `assert (x);', and
10591 anyway it's one less thing to worry about configuring.
10592
10593 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
10594 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
10595 and replace all instances of assert with abort.
10596 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10597 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
10598
10599 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
10600 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
10601 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
10602 hash_find_entry, hash_rehash, hash_insert): Likewise.
10603 * src/conflicts.c (resolve_sr_conflict): Likewise.
10604 * src/lalr.c (set_goto_map, map_goto): Likewise.
10605 * src/nullable.c (nullable_compute): Likewise.
10606 * src/output.c (prepare_rules, token_definitions_output): Likewise.
10607 * src/reader.c (packgram, reader): Likewise.
10608 * src/state.c (state_new, state_free, state_transitions_set,
10609 state_reduction_find): Likewise.
10610 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
10611 symbol_pack): Likewise.
10612 * src/tables.c (conflict_row, pack_vector): Likewise.
10613 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10614 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10615 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
10616 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
10617
10618 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
10619 (ARGMATCH_CONSTRAINT): New macro.
10620 (ARGMATCH_ASSERT): Use it.
10621
10622 * src/system.h (verify): New macro.
10623 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
10624 rather than assert.
10625 * src/tables.c (tables_generate): Likewise.
10626
10627 * src/struniq.c (struniq_assert): Now returns void, and aborts
10628 if the assertion is false.
10629 (struniq_assert_p): Remove.
10630 * src/struniq.h: Likewise.
10631
76ae8198
PE
106322002-11-18 Paul Eggert <eggert@twinsun.com>
10633
10634 * data/glr.c (yygetLRActions): Replace `yyindex' with
10635 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
10636 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 10637 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 10638
d3c4e709
AD
106392002-11-18 Akim Demaille <akim@epita.fr>
10640
10641 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
10642 space.
10643 From Tim Van Holder.
10644
8d8a7238
PE
106452002-11-17 Paul Eggert <eggert@twinsun.com>
10646
10647 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10648 to "SyntaxError" for consistency with my 2002-11-15 change.
10649
10650 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10651 not define to {}, since this breaks the common use of `YYDPRINTF
10652 ((...));' if a single statement is desired (e.g. before `else').
10653 Work around GCC warnings by surrounding corresponding calls with
10654 {} if needed.
10655 (yyhasResolvedValue): Remove unused function.
10656 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10657 loop body.
10658 (yyreportSyntaxError): Renamed from yyreportParseError.
10659 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10660 All uses changed.
10661 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10662 extern when possible. Remove unused initializations.
10663
b0937b22
AD
106642002-11-16 Akim Demaille <akim@epita.fr>
10665
10666 Augment the similarity between GLR and LALR traces.
10667
10668 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10669 (YY_REDUCE_PRINT): New.
10670 (yyparse): Use them.
10671 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10672 YYDPRINT here.
10673 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10674 state reached after the reduction/recovery, since...
10675 (yyparse, yyprocessOneStack): Report the state we are entering in.
10676
c5e3e510
AD
106772002-11-16 Akim Demaille <akim@epita.fr>
10678
10679 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10680 Add support for --trace=skeleton.
10681 * src/scan-skel.l: %option debug.
10682 Scan strings of non-@ or \n instead of character by character.
10683 (scan_skel): Handle trace_skeleton.
10684 (QPUTS): New.
10685 (@output_parser_name@, @output_header_name@): ``Restore'' their
10686 support (used to be M4 macros).
10687 * data/yacc.c: Quote larger chunks, a la glr.c.
10688 * data/lalr1.cc: Likewise.
10689 The header guards are no longer available, so use some other
10690 string than `YYLSP_NEEDED'.
10691
4c6cc1db
AD
106922002-11-16 Akim Demaille <akim@epita.fr>
10693
10694 Make the ``Printers and Destructors'' test more verbose, taking
10695 `yacc.c''s behavior as (possibly wrong) reference.
10696
10697 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10698 instead of fprint on stdout.
10699 Set and report the last_line of the symbols.
10700 Consistently display values and locations.
10701
6d9e8019
PE
107022002-11-16 Paul Eggert <eggert@twinsun.com>
10703
10704 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10705
6e649e65
PE
107062002-11-15 Paul Eggert <eggert@twinsun.com>
10707
b25d88f6
PE
10708 * tests/actions.at (Actions after errors): New test case.
10709
6e649e65
PE
10710 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10711 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10712 tests/action.at, tests/calc.at, tests/conflicts.at,
10713 tests/cxx-type.at, tests/regression.at:
10714 "parse error" -> "syntax error" for POSIX compatibility.
10715 "parsing stack overflow..." -> "parser stack overflow" so
10716 that code matches Bison documentation.
10717
0f39aab9
AD
107182002-11-15 Akim Demaille <akim@epita.fr>
10719
10720 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10721 take two BRACED_CODE, not two string_content.
10722 Free the scanner's obstack when we are done.
10723 (code_content): New.
10724 * tests/calc.at: Adjust.
10725 * doc/bison.texinfo: Adjust.
10726 Also, make sure to include the `,' for these declarations.
10727
761c1926
AD
107282002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10729
10730 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10731 definition; avoids potential autoreconf problems.
10732
b0f98b10
AD
107332002-11-15 Akim Demaille <akim@epita.fr>
10734
10735 Always check the value returned by yyparse.
10736
10737 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10738 returned by yyparse.
10739 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10740 Adjust calls.
10741 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10742 returned by yyparse.
10743
970785f1
PH
107442002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10745
10746 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10747 on input.at test.
10748
8fcc7db1
PE
107492002-11-14 Paul Eggert <eggert@twinsun.com>
10750
7ec1b48e
PE
10751 * src/output.c (output_skeleton): Call xfopen instead of
10752 duplicating xfopen's body.
10753
cfff7583 10754 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 10755 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 10756
8fcc7db1
PE
10757 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10758 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10759 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10760 file twice in the grammar, as an extra check.
10761
10762 * tests/input.at (Torturing the Scanner): Surround the
10763 backslash-newline tests with "#if 0", to make it less likely that
10764 we'll run into compiler bugs. Bring back solitary \ inside
10765 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 10766 test backslash-newline in C character constant.
8fcc7db1 10767
4e8d992c
AD
107682002-11-14 Akim Demaille <akim@epita.fr>
10769
10770 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10771 status of the compiler.
f32b346d 10772 Calling `exit 1' is no longer needed.
4e8d992c
AD
10773 Reported by Nelson H. F. Beebe.
10774
9501dc6e
AD
107752002-11-14 Akim Demaille <akim@epita.fr>
10776
10777 * tests/atlocal.in (CPPFLAGS): We have config.h.
10778 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10779 New.
10780 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10781 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10782 * tests/regression.at, tests/torture.at: Use them for all the
10783 grammars that are to be compiled.
10784 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10785 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10786 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10787
18b519c0
AD
107882002-11-14 Akim Demaille <akim@epita.fr>
10789
10790 * doc/bison.texinfo: Various formatting changes (alignments in
10791 samples, additional @group/@end group, GCS in samples.
10792 Use @deffn instead of simple @table to define the directives,
10793 macros, variables etc.
10794
9a86cdb9
PE
107952002-11-13 Paul Eggert <eggert@twinsun.com>
10796
daa33def 10797 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 10798 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 10799
daa33def 10800 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 10801 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
10802 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10803 * tests/headers.at (export YYLTYPE): Likewise.
10804
10805 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 10806 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 10807
9a86cdb9
PE
10808 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10809 comments, since they're not portable. Use GNU coding style.
10810
9c1e26bd
AD
108112002-11-13 Akim Demaille <akim@epita.fr>
10812
10813 * data/yacc.c: Leave bigger chunks of quoted text.
10814 (YYDSYMPRINTF): New.
10815 Use it to report symbol activities.
10816 * data/glr.c (YYDSYMPRINTF): New.
10817 Use it.
10818
87f721cc
PE
108192002-11-12 Paul Eggert <eggert@twinsun.com>
10820
10821 Version 1.75b.
10822
10823 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
10824 (yyglrReduce): Return yyok, not 0.
10825 This should avoid the enumerated-type warnings reported
464c6927 10826 by Nelson H. F. Beebe in
161a71f3 10827 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
10828
10829 * lib/bbitset.h (BITSET_INLINE): Remove.
10830 * lib/bitset.h [! BITSET_INLINE]: Remove.
10831 (bitset_set, bitset_reset, bitset_test): Rename local vars
10832 to avoid shadowing warnings by GCC.
10833
10834 * data/glr.c (inline): Remove #define. It's the user's
10835 responsibility to #define it away, just like 'const'.
464c6927 10836 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 10837 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 10838
87f721cc
PE
10839 * Makefile.maint (po-check): Scan .l and .y files instead of the
10840 .c and the .h files that they generate. This fixes the bug
10841 reported by Tim Van Holder in:
161a71f3 10842 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
10843 Look for N_ as well as for _. Try to avoid matching #define for
10844 N_ and _.
10845 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
10846 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
10847 * src/scan-gram.l: Revamp regular expressions so that " and '
10848 do not confuse xgettext.
10849
10850 * src/struniq.h (struniq_new): Do not declare the return type
10851 to be 'const'; this violates the C standard.
10852 * src/struniq.c (struniq_new): Likewise.
10853
be14ade5
AD
108542002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
10855
10856 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
10857 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
10858 linker.
10859
05291fbc
AD
108602002-11-12 Akim Demaille <akim@epita.fr>
10861
10862 * Makefile.maint: Sync with Autoconf:
10863 (local_updates): New.
10864
1f5fd52e
AD
108652002-11-12 Akim Demaille <akim@epita.fr>
10866
10867 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
10868
283f1e64
AD
108692002-11-12 Akim Demaille <akim@epita.fr>
10870
10871 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
10872 locations.
10873
886b69d1
AD
108742002-11-12 Akim Demaille <akim@epita.fr>
10875
10876 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
10877 not yyvalue.
10878
3df37415
AD
108792002-11-12 Akim Demaille <akim@epita.fr>
10880
10881 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
10882 Use it to test the GLR parser.
10883
7bd6c77e
AD
108842002-11-12 Akim Demaille <akim@epita.fr>
10885
10886 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
10887 defines it.
10888 * data/glr.c (yystos): New.
10889 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
10890 (YYDSYMPRINT): New.
10891 (yyval): Don't define it, it is handled via M4.
10892 (yyrecoverParseError): Free verbosely the discarded symbols.
10893 * data/yacc.c (yysymprint): Remove, rather...
10894 (b4_yysymprint_generate): invoke.
10895 * data/c.m4 (b4_yysymprint_generate): New.
10896 Accept pointers as arguments, as opposed to the version from
10897 yacc.c.
10898 (b4_yydestruct_generate): Likewise.
10899 * tests/cations.at (Printers and Destructors): Use Bison directives
10900 instead of CPP macros.
10901 Don't rely on internal details.
10902
b0400cc6
AD
109032002-11-12 Akim Demaille <akim@epita.fr>
10904
10905 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
10906 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
10907 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
10908 it against YYEMPTY and so forth), work on yytoken (i.e., set
10909 it to YYEMPTY etc.).
10910 (yydestruct): Replace with a b4_yydestruct_generate invocation.
10911 (b4_symbol_actions): Remove.
10912 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
10913 for 0, end-of-input.
10914
72f889cc
AD
109152002-11-12 Akim Demaille <akim@epita.fr>
10916
10917 * doc/bison.texinfo (Destructor Decl): New.
10918
b1ae9233
AD
109192002-11-12 Akim Demaille <akim@epita.fr>
10920
10921 * src/tables.c (tables_generate): Use free for pointers that
10922 cannot be NULL, not XFREE.
10923 (pack_vector): Use assert, not fatal, for bound violations.
10924 * src/state.c (state_new): Likewise.
10925 * src/reader.c (reader): Likewise.
10926 * src/lalr.c (set_goto_map): Likewise.
72f889cc 10927 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
10928 the file name.
10929
7ec2d4cd
AD
109302002-11-12 Akim Demaille <akim@epita.fr>
10931
10932 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
10933 Restore.
10934 * src/scan-gram.l (last_string): Is global to the file, not to
10935 yylex.
10936 * src/parse-gram.y (input): Don't append the epilogue here,
10937 (epilogue.opt): do it here, and free the scanner's obstack.
10938 * src/reader.c (epilogue_set): Rename as...
10939 (epilogue_augment): this.
10940 * data/c.m4 (b4_epilogue): Defaults to empty.
10941
573a6cd3
AD
109422002-11-12 Akim Demaille <akim@epita.fr>
10943
10944 * src/getargs.c (long_options): Remove duplicates.
10945 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
10946 Remove.
10947 * doc/bison.rnh: Remove.
10948 * doc/bison.texinfo (VMS Invocation): Remove.
10949
95612cfa
AD
109502002-11-12 Akim Demaille <akim@epita.fr>
10951
10952 * src/struniq.h, src/struniq.c (struniq_t): Is const.
10953 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
10954
10955 Use struniq for symbols.
10956
10957 * src/symtab.h (symbol_t): The tag member is a struniq.
10958 (symbol_type_set): Adjust.
10959 * src/symtab.c (symbol_new): Takes a struniq.
10960 (symbol_free): Don't free the tag member.
10961 (hash_compare_symbol_t, hash_symbol_t): Rename as...
10962 (hash_compare_symbol, hash_symbol): these.
10963 Use the fact that tags as struniqs.
10964 (symbol_get): Use struniq_new.
10965 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
10966 Returns a strniq.
10967 * src/reader.h (merger_list, grammar_currentmerge_set): The name
10968 and type members are struniqs.
10969 * src/reader.c (get_merge_function)
10970 (grammar_current_rule_merge_set): Adjust.
10971 (TYPE, current_type): Are struniq.
10972
10973 Use struniq for file names.
10974
10975 * src/files.h, src/files.c (infile): Split into...
10976 (grammar_file, current_file): these.
10977 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
10978 * src/reduce.c (reduce_print): Likewise.
10979 * src/getargs.c (getargs): Likewise.
10980 * src/complain.h, src/complain.c: Likewise.
10981 * src/main.c (main): Call struniqs_new early enough to use it for
10982 file names.
10983 Don't free the input file name.
10984
3e6656f9
AD
109852002-11-12 Akim Demaille <akim@epita.fr>
10986
10987 * src/symtab.c (symbol_free): Remove dead deactivated code:
10988 type_name are properly removed.
10989 Don't use XFREE to free items that cannot be NULL.
10990 * src/struniq.h, src/struniq.c: New.
10991 * src/main.c (main): Initialize/free struniqs.
10992 * src/parse-gram.y (%union): Add astruniq member.
10993 (yyprint): Adjust.
10994 * src/scan-gram.l (<{tag}>): Return a struniq.
10995 Free the obstack bit that used to store it.
10996 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
10997
7672019c
PE
109982002-11-11 Paul Eggert <eggert@twinsun.com>
10999
11000 Revamp to fix many (but not all) of the C- and M4-related quoting
11001 problems. Among other things, this fixes the Bison bug reported
11002 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 11003 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
11004
11005 Use new @ escapes consistently. Represent brackets with @{ and @}
11006 rather than @<:@ and @:>@, since this works a bit better with dumb
11007 editors like vi. Represent @ with @@, since @ is now consistently
11008 an escape. Use @oline@ and @ofile@ rather than __oline__ and
11009 __ofile__, to avoid unexpected expansions. Similarly, use @output
11010 rather than #output.
11011
11012 * data/c.m4 (b4_copyright): Omit file name from comment, since
11013 the file name could contain "*/".
11014 (b4_synclines_flag): Don't quote the 2nd argument; it should already
11015 be quoted. All uses changed.
11016
11017 * data/glr.c: Use new @ escapes consistently.
11018 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
11019 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
11020 Remove, since they couldn't handle arbitrary characters in file
11021 names.
11022 * data/lalr1.cc: Likewise.
11023 * data/yacc.c: Likewise.
11024
11025 * src/files.c (output_infix): Remove; all uses removed.
11026 * src/files.h: Likewise.
11027
11028 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
11029 mishandled funny characters in file names, and anyway it isn't
11030 needed any more.
11031 * data/yacc.c: Likewise.
11032 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
11033
11034 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
11035 * data/yacc.c: Likewise.
11036
11037 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
11038 strings now.
11039 (muscle_init): Quote filename as a C string.
11040 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
11041 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
11042 * src/output.c (escaped_file_name_output): New function.
11043 (prepare_symbols): Quote tokens for M4.
11044 (prepare): Don't insert output_infix, output_prefix,
11045 output_parser_name, output_header_name; this is now down by scan-skel.
11046 Insert skeleton as a C string.
11047
11048 * src/output.c (user_actions_output, symbol_destructors_output,
11049 symbol_printers_output): Quote filenames for C and M4.
11050 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11051
11052 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
11053 escapes other than \\ and \'; this simplifies the code.
11054 (<SC_STRING>): Likewise, for \\ and \".
11055 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
11056 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
11057 Use new escapes @{ and @} for [ and ].
11058
11059 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
11060 them with auto vars.
11061 Switch to new escape scheme, where @ is the escape character uniformly.
11062 Abort if a stray escape character is found. Avoid unbounded input
11063 buffer when parsing non-escaped text.
11064
11065 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
11066 __oline__, #output, $@, and @{ do not have unintended meanings.
11067
acea4f3b
PE
110682002-11-09 Paul Eggert <eggert@twinsun.com>
11069
11070 Fix the test failure due to GCC warnings described in
161a71f3 11071 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
11072 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
11073 evaluate to 0 if it's impossible for NINF to be in the respective
11074 table.
11075 (yygetLRActions, yyrecoverParseError): Use them.
11076
11077 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
11078 counted in the token inserted at end of file. Now takes
11079 location_t *, not location_t, so that the location can be
11080 adjusted. All uses changed.
11081
11082 * tests/regression.at (Invalid inputs): Adjust wording in
11083 diagnostic to match the new behavior.
11084
11085 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
11086 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
11087 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
11088 abort ();'. This reduces the runtime of the "Many lookaheads"
11089 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
11090 GCC 3.2.
11091
20ef1ad5
PE
110922002-11-07 Paul Eggert <eggert@twinsun.com>
11093
11094 * src/parse-gram.y (CHARACTER): Remove unused token.
11095 All uses removed.
11096
11097 * src/scan-gram.l: Remove stack option. We no longer use the
11098 stack, since the stack was never deeper than 1; instead, use the
11099 new auto var c_context to record the stacked value.
11100
11101 Remove nounput option. At an unexpected end of file, we now unput
11102 the minimal input necessary to end cleanly; this simplifies the
11103 code.
11104
11105 Avoid unbounded token sizes where this is easy.
11106
11107 (unexpected_end_of_file): New function.
11108 Use it to systematize the error message on unexpected EOF.
11109 (last-string): Now auto, not static.
11110 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
11111 (scanner_last_string_free): Remove; not used.
11112 (percent_percent_count): Move decl to just before use.
11113 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
11114 not the (never otherwised-used) CHARACTER.
11115
93724f13
AD
111162002-11-07 Akim Demaille <akim@epita.fr>
11117
11118 Let yyerror always receive the msg as last argument, so that
11119 yyerror can be variadic.
11120
11121 * data/yacc.c (b4_yyerror_args): New.
11122 Use it when calling yyerror.
11123 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
11124 Use it when calling yyerror.
11125 * doc/bison.texinfo (Error Reporting): Adjust.
11126 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
11127 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
11128
6e40b4eb
AD
111292002-11-06 Akim Demaille <akim@epita.fr>
11130
11131 #line should have quoted strings.
11132 Ideally, this should be done by m4_quotearg.
11133
11134 * src/scan-skel.l: Include quotearg.h.
11135 Quote __ofile__.
11136 * src/output.c (symbol_printers_output)
11137 (symbol_destructors_output): Quote the file name.
11138
2dfbfc12
AD
111392002-11-06 Akim Demaille <akim@epita.fr>
11140
11141 * tests/regression.at (Invalid inputs): Adjust to the recent
11142 messages.
11143
437c2d80
AD
111442002-11-06 Akim Demaille <akim@epita.fr>
11145
11146 Restore --no-lines.
11147 Reported by Jim Kent.
11148
11149 * data/c.m4 (b4_syncline): New.
11150 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
11151 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
11152 * src/output.c (user_actions_output): Likewise.
11153 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 11154 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 11155
900c5db5
AD
111562002-11-06 Akim Demaille <akim@epita.fr>
11157
11158 * src/main.c (main): Free `infile'.
11159 * src/scan-gram.l (handle_syncline): New.
11160 Recognize `#line'.
11161 * src/output.c (user_actions_output, symbol_destructors_output)
11162 (symbol_printers_output): Use the location's file name, not
11163 infile.
11164 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11165
e183b123 111662002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 11167
e183b123 11168 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 11169 either has GLR conflict entries.
e183b123 11170
193eb6b7
PE
111712002-11-05 Paul Eggert <eggert@twinsun.com>
11172
e183b123
PE
11173 * src/scan-gram.l: Use more accurate diagnostics, e.g.
11174 "integer out of range" rather than "invalid value".
11175 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
11176 accordingly.
11177
193eb6b7
PE
11178 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
11179 Also, remove one static variable in the scanner.
11180
11181 * src/scan-gram.l (braces_level): Now auto, not static.
11182 Initialize to zero if the compiler is being picky.
11183 (INITIAL): Clear braces_level instead of incrementing it.
11184 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
11185 as POSIX 1003.1-2001 requires.
11186 * src/system.h (IF_LINT): New macro, taken from coreutils.
11187 * configure.ac: Define "lint" if --enable-gcc-warnings.
11188
29c01725
AD
111892002-11-05 Akim Demaille <akim@epita.fr>
11190
11191 * src/scan-gram.l: When it starts with `%', complain about the
11192 whole directive, not just that `invalid character: %'.
11193
8aeac3ca
AD
111942002-11-04 Akim Demaille <akim@epita.fr>
11195
11196 * Makefile.maint: Update from Autoconf.
11197 (update, cvs-update, po-update, do-po-update): New.
11198
793a58bb
AD
111992002-11-04 Akim Demaille <akim@epita.fr>
11200
11201 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
11202 and yyerror.
11203 Have yyerror `use' its arguments.
11204 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
11205 returns true when location & yacc & pure & parse-param.
11206 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
11207
c4d720cd
AD
112082002-11-04 Akim Demaille <akim@epita.fr>
11209
11210 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
11211 clashes.
11212 * src/scan-gram.l: Use [\'] instead of ['] to pacify
11213 font-lock-mode.
11214 Use complain_at.
11215 Use quote, not quote_n since LOCATION_PRINT no longer uses the
11216 slot 0.
11217
613a0dc5
PE
112182002-11-03 Paul Eggert <eggert@twinsun.com>
11219
11220 * src/reader.c (get_merge_function, grammar_current_rule_check):
11221 Use consistent diagnostics for reporting type name clashes.
11222 Quote the types with <>, for consistency with Yacc.
11223 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
11224
2a8d363a
AD
112252002-11-03 Akim Demaille <akim@epita.fr>
11226
11227 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
11228 New.
11229 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
11230 (b4_parse_param): Remove.
11231 Use b4_identification.
11232 Propagate b4_pure_args where needed to pass them to yyerror.
11233 * data/glr.m4 (b4_parse_param): Remove.
11234 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
11235 (b4_lpure_formals): New.
11236 Use b4_identification.
11237 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
11238 b4_user_formals and b4_user_args.
11239 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
11240 (yyreportAmbiguity): When using a pure parser, also need
11241 the location, and the parse-params.
11242 Adjust callers.
11243 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
11244 When using a pure parser, also need the parse-params.
11245 Adjust callers.
11246 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
11247 (%pure-parser + %parse-param) LALR and GLR parsers.
11248 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
11249 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
11250 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
11251 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
11252 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
11253 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
11254 * doc/bison.texinfo: Untabify the whole file.
11255 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
11256 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
11257 (Error Reporting): Adjust to these new directives.
11258 Document %error-verbose, deprecate YYERROR_VERBOSE.
11259
9e32add8
AD
112602002-11-03 Akim Demaille <akim@epita.fr>
11261
11262 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
11263 AT_CHECK_CALC_GLR invocations to use % directives, instead of
11264 command line options.
11265 * tests/cxx-type.at: Formatting changes.
11266
b02d90a5
PE
112672002-11-03 Paul Eggert <eggert@twinsun.com>
11268
11269 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
11270 to count columns correctly, and to check for invalid inputs.
9e32add8 11271
b02d90a5
PE
11272 Use mbsnwidth to count columns correctly. Account for tabs, too.
11273 Include mbswidth.h.
11274 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
11275 (extend_location): New function.
11276 (YY_LINES): Remove.
11277
11278 Handle CRLF in C code rather than in Lex code.
11279 (YY_INPUT): New macro.
11280 (no_cr_read): New function.
11281
11282 Scan UCNs, even though we don't fully handle them yet.
11283 (convert_ucn_to_byte): New function.
11284
11285 Handle backslash-newline correctly in C code.
11286 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
11287 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
11288 all uses changed.
11289 (tag, splice): New EREs. Do not allow NUL or newline in tags.
11290 Use {splice} wherever C allows backslash-newline.
11291 YY_STEP after space, newline, vertical-tab.
11292 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 11293
b02d90a5
PE
11294 (letter, id): Don't assume ASCII; e.g., spell out a-z.
11295
11296 ({int}, handle_action_dollar, handle_action_at): Check for integer
11297 overflow.
9e32add8 11298
b02d90a5
PE
11299 (YY_STEP): Omit trailing semicolon, so that it's more like C.
11300
11301 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
11302 as well as \000. Check for UCHAR_MAX, not 255.
11303 Allow \x with an arbitrary positive number of digits, as in C.
11304 Check for overflow here.
11305 Allow \? and UCNs, for compatibility with C.
11306
11307 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
11308 with quote slot used by complain_at.
11309
11310 * tests/input.at: Add tests for backslash-newline, m4 quotes
11311 in symbols, long literals, and funny escapes in strings.
11312
11313 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
11314 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
11315 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
11316 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
11317 * m4/mbswidth.m4: New file, from GNU coreutils.
11318
11319 * doc/bison.texinfo (Grammar Outline): Document // comments.
11320 (Symbols): Document that trigraphs have no special meaning in Bison,
11321 nor is backslash-newline allowed.
11322 (Actions): Document that trigraphs have no special meaning.
11323
11324 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
11325 no longer used.
11326
113272002-11-02 Paul Eggert <eggert@twinsun.com>
11328
11329 * src/reader.c: Don't include quote.h; not needed.
11330 (get_merge_function): Reword warning to be consistent with
11331 type clash diagnostic in grammar_current_rule_check.
11332
11333 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
11334 bug in trigraph handling.
11335
11336 * src/output.c (prepare_symbols): When printing token names,
11337 escape "[" as "@<:@" and likewise for "]".
11338
11339 * src/system.h (errno): Remove declaration, as we are now
11340 assuming C89 or better, and C89 guarantees errno.
11341
762b212b
PE
113422002-10-30 Paul Eggert <eggert@twinsun.com>
11343
11344 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
11345 Check for close failures.
11346 * src/files.h (xfclose): Return void, not int, since it always
11347 returned zero.
11348 * src/files.c (xfclose): Likewise. Report I/O error if ferror
11349 indicates one.
11350 * src/output.c (output_skeleton): Use xfclose rather than fclose
11351 and ferror. xfclose now checks ferror.
11352
11353 * data/glr.c (YYLEFTMOST_STATE): Remove.
11354 (yyreportTree): Use a stack-based leftmost state. This avoids
11355 our continuing battles with bogus warnings about initializers.
11356
56100c60
AD
113572002-10-30 Akim Demaille <akim@epita.fr>
11358
11359 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
11360 #if.
11361
51b4a04c
PH
113622002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11363
11364 * tests/glr-regr1.at: New test for reported regressions.
11365 * tests/testsuite.at: Add glr-regr1.at test.
11366 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 11367
bf1ebda2
PE
113682002-10-24 Paul Eggert <eggert@twinsun.com>
11369
5c16c6b1
PE
11370 Version 1.75a.
11371
bf1ebda2
PE
11372 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
11373 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
11374 we use malloc. Don't assume 'A' through 'Z' are contiguous.
11375 Don't assume strdup exists; POSIX says its an XSI extension.
11376 Check for buffer overflow on input.
11377
b526ee61
AD
113782002-10-24 Akim Demaille <akim@epita.fr>
11379
11380 * src/output.c (output_skeleton): Don't disable M4sugar comments
11381 too soon: it results in comments being expanded.
11382 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
11383 first output.
11384
f1886bb2
AD
113852002-10-24 Akim Demaille <akim@epita.fr>
11386
11387 * data/yacc.c (m4_int_type): New.
11388 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
11389 char' as only yacc.c wants K&R portability.
11390 * data/glr.c (yysigned_char): Remove.
11391 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
11392 Reported by Quoc Peyrot.
11393
c5576256
PE
113942002-10-23 Paul Eggert <eggert@twinsun.com>
11395
11396 * src/main.c (main): With --trace=time, report times even if a
11397 non-fatal error occurs. Formerly, the times were reported in some
11398 such cases but not in others.
11399 * src/reader.c (reader): Just return if a complaint has been issued,
11400 instead of exiting, so that 'main' can report times.
11401
27b0ffea
AD
114022002-10-22 Akim Demaille <akim@epita.fr>
11403
11404 * src/system.h: Include sys/types.
11405 Reported by Bert Deknuydt.
11406
223a7883
PE
114072002-10-23 Paul Eggert <eggert@twinsun.com>
11408
11409 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
11410 Suggested by Art Haas.
11411
114122002-10-22 Paul Eggert <eggert@twinsun.com>
11413
11414 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
11415 decl; not needed any more.
11416 * src/main.c (main): Use return to exit, undoing yesterday's change.
11417 The last OS that we could find where this wouldn't work is
11418 SunOS 3.5, and that's too old to worry about now.
11419
11420 * data/glr.c (struct yyltype): Define members even when not
11421 doing locations. This is more consistent with yacc.c, and it
11422 works around the following bug reports:
161a71f3
PE
11423 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
11424 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 11425
223a7883
PE
11426 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
11427 @acronym consistently. Standardize on "Yacc" instead of "YACC",
11428 "Algol" instead of "ALGOL". Give a bit more history about BNF.
11429
8b76775a
AD
114302002-10-22 Akim Demaille <akim@epita.fr>
11431
11432 * data/README: New.
11433
6db10d14
PE
114342002-10-21 Paul Eggert <eggert@twinsun.com>
11435
11436 Be consistent about 'bool'; the old code used an enum in one
11437 module and an int in another, and this violates the C standard.
11438 * m4/stdbool.m4: New file, from coreutils 4.5.3.
11439 * configure.ac (AC_HEADER_STDBOOL): Add.
11440 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
11441 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
11442 * src/symtab.c (hash_compare_symbol_t): Likewise.
11443 * src/system.h (bool, false, true): Use a definition consistent
11444 with ../lib/hash.c. All uses changed.
11445
11446 * src/complain.c (warning_issued): Renamed from warn_message_count,
11447 so that we needn't worry about integer overflow (!).
11448 Now of type bool. All uses changed.
11449 (complaint_issued): Renamed from complain_message_count; likewise.
11450
11451 * src/main.c (main): Use exit to exit with failure.
27b0ffea 11452
6db10d14
PE
11453 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
11454 rather than 1 and 0.
11455 * src/main.c (main): Likewise.
11456 * src/getargs.c (getargs): Likewise.
11457 * src/reader.c (reader): Likewise.
11458
11459 * src/getarg.c (getargs): Remove duplicate code for
11460 "Try `bison --help'".
11461
11462 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
11463 What was that "2" for?
11464
11465 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
11466 * src/getargs.c (usage): Likewise.
11467
11468 * src/getargs.c (getargs): When there are too few operands, report
11469 the last one. When there are too many, report the first extra
11470 one. This is how diffutils does it.
11471
92a060fd
PE
114722002-10-20 Paul Eggert <eggert@twinsun.com>
11473
11474 Remove K&R vestiges.
11475 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
11476 * src/complain.c (VA_START): Remove. Assume prototypes.
11477 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
11478 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
11479 fatal): Assume prototypes.
11480 * src/complain.h: Assume prototypes.
11481 * src/system.h (PARAMS): Remove.
11482 Include <limits.h> unconditionally, since it's guaranteeed even
11483 for a freestanding C89 compiler.
11484 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
11485 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 11486
e7cb57c0
AD
114872002-10-20 Akim Demaille <akim@epita.fr>
11488
11489 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
11490 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
11491 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
11492 (yyresolveStates, yyresolveAction, yyresolveStack)
11493 (yyprocessOneStack): Use them.
11494 (yy_reduce_print): New.
11495 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
11496
0245f82d
AD
114972002-10-20 Akim Demaille <akim@epita.fr>
11498
11499 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
11500 arguments and output `void'.
11501 (b4_c_function): Rename as...
11502 (b4_c_function_def): this.
11503 (b4_c_function_decl, b4_c_ansi_function_def)
11504 (b4_c_ansi_function_decl): New.
11505 Change the interpretation of the arguments: before `int, foo', now
11506 `int foo, foo'.
11507 * data/yacc.c (yyparse): Prototype and define thanks to these.
11508 Adjust b4_c_function_def uses.
11509 * data/glr.c (yyparse): Likewise, but ANSI only.
11510
39912f52
AD
115112002-10-20 Akim Demaille <akim@epita.fr>
11512
11513 * src/output.c (prepare): Move the definition of `tokens_number',
11514 `nterms_number', `undef_token_number', `user_token_number_max'
11515 to...
11516 (prepare_tokens): Here.
11517 (prepare_tokens): Rename as...
11518 (prepare_symbols): this.
11519 (prepare): Move the definition of `rules_number' to...
11520 (prepare_rules): here.
11521 (prepare): Move the definition of `last', `final_state_number',
11522 `states_number' to...
11523 (prepare_states): here.
11524 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
11525
20c1e2ad
AD
115262002-10-20 Akim Demaille <akim@epita.fr>
11527
11528 * src/tables.h, src/tables.c, src/output.c: Comment changes.
11529
21964f43
AD
115302002-10-20 Akim Demaille <akim@epita.fr>
11531
11532 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
11533 * data/c.m4: here.
11534
66d30cd4
AD
115352002-10-20 Akim Demaille <akim@epita.fr>
11536
11537 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
11538 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
11539 `pair'.
11540 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
11541 `name' to...
11542 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
11543 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
11544 These.
11545
95f2c9fe
PE
115462002-10-19 Paul Eggert <eggert@twinsun.com>
11547
11548 Do not create a temporary file, as that involves security and
11549 cleanup headaches. Instead, use a pair of pipes.
11550 Derived from a suggestion by Florian Krohm.
11551 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
11552 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
11553 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
11554 (BISON_PREREQ_SUBPIPE): Add.
11555 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
11556 Add subpipe.h, subpipe.c.
11557 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
11558 * po/POTFILES.in: Add lib/subpipe.c.
11559 * src/output.c: Include "subpipe.h".
11560 (m4_invoke): Remove decl.
11561 (scan_skel): New decl.
11562 (output_skeleton): Use pipe rather than temporary file for m4 input.
11563 Check that m4sugar.m4 is readable, to avoid deadlock.
11564 Check for pipe I/O error.
11565 * src/scan-skel.l (readpipe): Remove decl.
11566 (scan_skel): New function, to be used in place of m4_invoke.
11567 Read from stream rather than file.
66d30cd4 11568
95f2c9fe
PE
11569 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
11570 float, as this generates a warning on Solaris 8 + GCC 3.2 with
11571 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
11572 this generates a more-accurate value anyway.
11573
11574 * lib/timevar.c (timervar_accumulate): Rename locals to
11575 avoid confusion with similarly-named more-global.
11576 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
11577
11578 * src/output.c (prepare): Use xstrdup to convert char const *
11579 to char *, to avoid GCC warning.
11580
c19988b7
AD
115812002-10-19 Akim Demaille <akim@epita.fr>
11582
11583 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
11584 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
11585 Use them to have `calc.y' ready for %pure-parser.
11586 * data/yacc.c (YYLEX): Pass a yylex return type to
11587 b4_c_function_call.
11588
ae7453f2
AD
115892002-10-19 Akim Demaille <akim@epita.fr>
11590
11591 Prototype support of %lex-param and %parse-param.
11592
11593 * src/parse-gram.y: Add the definition of the %lex-param and
11594 %parse-param tokens, plus their rules.
11595 Drop the `_' version of %glr-parser.
11596 Add the "," token.
11597 * src/scan-gram.l (INITIAL): Scan them.
11598 * src/muscle_tab.c: Comment changes.
11599 (muscle_insert, muscle_find): Rename `pair' as `probe'.
11600 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
11601 (muscle_entry_s): The `value' member is no longer const.
11602 Adjust all dependencies.
11603 * src/muscle_tab.c (muscle_init): Adjust: use
11604 MUSCLE_INSERT_STRING.
11605 Initialize the obstack earlier.
11606 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
11607 (muscle_pair_list_grow): New.
11608 * data/c.m4 (b4_c_function_call, b4_c_args): New.
11609 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
11610 * tests/calc.at: Use %locations, not --locations.
11611 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
11612
0e575721
AD
116132002-10-19 Akim Demaille <akim@epita.fr>
11614
11615 * src/getargs.c (usage): Take status as argument and exit
11616 accordingly.
11617 Report the traditional `Try ... --help' message when status != 0.
11618 (usage, version): Don't take a FILE * as arg, it is pointless.
11619 (getargs): When there is an incorrect number of arguments, make it
11620 an error, and report it GNUlically thanks to `usage ()'.
11621
724ce7f5
PE
116222002-10-18 Paul Eggert <eggert@twinsun.com>
11623
3a781eb2
PE
11624 * data/glr.c (yyreportParseError): Don't assume that sprintf
11625 yields the length of the printed string, as this is not true
11626 on SunOS 4.1.4. Reported by Peter Klein.
11627
724ce7f5
PE
11628 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
11629 * tests/conflicts.at (%nonassoc and eof): Likewise.
11630 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
11631
473d0a75
AD
116322002-10-17 Akim Demaille <akim@epita.fr>
11633
11634 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
11635 * src/getargs.c (trace_types, trace_args): Adjust.
11636 * src/reader.c (grammar_current_rule_prec_set)
11637 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
11638 Standardize error messages.
11639 And s/@prec/%prec/!
11640 (reader): Use trace_flag to enable scanner/parser debugging,
11641 instead of an adhoc scheme.
11642 * src/scan-gram.l: Remove trailing debugging code.
11643
e76d2469
PE
116442002-10-16 Paul Eggert <eggert@twinsun.com>
11645
93e2236a
PE
11646 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11647 MUSCLE_TAB_H.
11648
e76d2469
PE
11649 * NEWS: Officially drop support for building Bison with K&R C,
11650 since it didn't work anyway and it's not worth worrying about.
11651 * Makefile.maint (wget_files): Remove ansi2knr.c.
11652 (ansi2knr.c-url_prefix): Remove.
11653 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11654 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11655 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11656
5bd1c419
PE
116572002-10-15 Paul Eggert <eggert@twinsun.com>
11658
11659 Stop using the "enum_" trick for K&R-style function definitions;
11660 it confused me, and I was the author! Instead, assume that people
11661 who want to use K&R C compilers (when using these modules in GCC,
11662 perhaps?) will run ansi2knr.
11663
11664 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11665 All uses of "enum_" changed to "enum ".
11666 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11667 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 11668
5bd1c419
PE
11669 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11670 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11671 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11672 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11673 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11674 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11675 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11676 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11677 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11678 Use function prototypes; this removes the need for declaring
11679 static functions simply to provide their prototypes.
11680 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11681 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11682 bitset_count_, bitset_create, bitset_dump, bitset_first,
11683 bitset_free, bitset_init, bitset_last, bitset_next,
11684 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11685 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11686 bitset_print, bitset_release_memory, bitset_toggle_,
11687 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11688 debug_bitset): Likewise.
11689 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11690 * lib/bitset_stats.c (bitset_log_histogram_print,
11691 bitset_percent_histogram_print, bitset_stats_and,
11692 bitset_stats_and_cmp, bitset_stats_and_or,
11693 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11694 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11695 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11696 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11697 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11698 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11699 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11700 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11701 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11702 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11703 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11704 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11705 bitset_stats_zero): Likewise.
11706 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11707 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11708 bitsetv_dump, debug_bitsetv): Likewise.
11709 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11710 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11711 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11712 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11713 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11714 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11715 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11716 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11717 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11718 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11719 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11720 Likewise.
11721 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11722 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11723 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11724 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11725 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11726 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11727 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11728 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11729 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11730 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11731 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 11732
ae26e1f0
AD
117332002-10-14 Akim Demaille <akim@epita.fr>
11734
11735 Version 1.75.
11736
d43baf71
AD
117372002-10-14 Akim Demaille <akim@epita.fr>
11738
11739 * tests/Makefile.am (maintainer-check-posix): New.
11740
7ebc83e3
AD
117412002-10-14 Akim Demaille <akim@epita.fr>
11742
11743 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11744 member.
11745
05846dae
AD
117462002-10-14 Akim Demaille <akim@epita.fr>
11747
11748 * src/tables.c (table_ninf_remap): base -> tab.
11749 Reported by Matt Rosing.
11750
1318e37d
PE
117512002-10-14 Paul Eggert <eggert@twinsun.com>
11752
447fbb17
PE
11753 * tests/action.at, tests/calc.at, tests/conflicts.at,
11754 tests/cxx-type.at, tests/headers.at, tests/input.at,
11755 tests/regression.at, tests/synclines.at, tests/torture.at:
11756 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11757 so that the tests still work even if POSIXLY_CORRECT is set.
11758 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 11759
1318e37d
PE
11760 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11761 for portability to K&R hosts. Fix typo: signed char is guaranteed
11762 only to 127, not to 128.
11763 * data/glr.c (yysigned_char): New type.
11764 * data/yacc.c (yysigned_char): Likewise.
11765 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11766
cc0f0794
PE
117672002-10-13 Paul Eggert <eggert@twinsun.com>
11768
5038f418
PE
11769 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11770 true due to limited range of data type" warning from GCC.
11771
cc0f0794
PE
11772 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11773 by wrapping enum yytokentype's definition inside #ifndef
11774 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11775
6fed0802
AD
117762002-10-13 Akim Demaille <akim@epita.fr>
11777
11778 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11779 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11780
32f0598d
AD
117812002-10-13 Akim Demaille <akim@epita.fr>
11782
11783 * Makefile.maint: Update from Autoconf 2.54.
11784 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11785
7ea9a33f
AD
117862002-10-13 Akim Demaille <akim@epita.fr>
11787
11788 * src/print.c (print_state): Separate the list of solved conflicts
11789 from the other items.
11790 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11791
ea99527d
AD
117922002-10-13 Akim Demaille <akim@epita.fr>
11793
11794 Let nondeterministic skeletons be usable with deterministic
11795 tables.
11796
11797 With the patch, GAWK compiled by GCC without -O2 passes its test
11798 suite using a GLR parser driven by LALR tables. It fails with -O2
11799 because `struct stat' gives two different answers on my machine:
11800 88 (definition of an auto var) and later 96 (memset on this var).
11801 Hence the stack is badly corrumpted. The headers inclusion is to
11802 blame: if I move the awk.h inclusion before GLR's system header
11803 inclusion, the two struct stat have the same size.
11804
11805 * src/tables.c (pack_table): Always create conflict_table.
11806 (token_actions): Always create conflict_list.
11807 * data/glr.c (YYFLAG): Remove, unused.
11808
f377f69f
AD
118092002-10-13 Akim Demaille <akim@epita.fr>
11810
11811 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11812 (O0FLAGS): New.
11813 (VALGRIND, GXX): New.
11814 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11815 * tests/bison.in: Run $PREBISON a pre-command.
11816 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
11817 (maintainer-check-g++): New.
11818 * Makefile.am (maintainer-check): New.
11819
2a1fe6ed
AD
118202002-10-13 Akim Demaille <akim@epita.fr>
11821
11822 * data/glr.c: Formatting changes.
11823 Tweak some trace messages to match yacc.c's.
11824
f50adbbd
AD
118252002-10-13 Akim Demaille <akim@epita.fr>
11826
11827 GLR parsers sometimes raise parse errors instead of performing the
11828 default reduction.
11829 Reported by Charles-Henry de Boysson.
11830
11831 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 11832 check the length of the traces when %glr.
f50adbbd
AD
11833 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
11834 GLR's traces.
11835 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
11836 Test GLR parsers.
11837 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
11838 (yyltype): Remove the yy prefix from the member names.
11839 (yytable): Complete its comment.
11840 (yygetLRActions): Map error action number from YYTABLE from
11841 YYTABLE_NINF to 0.
11842 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
11843 (which was a bug: it should have been YYTABEL_NINF, and yet it was
11844 not satisfying as we could compare an YYACTION computed from
11845 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
11846 only value for error actions.
11847 (yyreportParseError): In verbose parse error messages, don't issue
11848 `error' in the list of expected tokens.
11849 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
11850 next action to perform to match glr.c's decoding.
11851 (yytable): Complete its comment.
11852
bcbad5b9
PE
118532002-10-13 Paul Eggert <eggert@twinsun.com>
11854
11855 Fix problem reported by Henrik Grubbstroem in
161a71f3 11856 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
11857 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
11858 because the Bison parser reads the second action before reducing
11859 the first one.
11860 * src/scan-gram.l (rule_length): New static var.
11861 Use it to keep track of the rule length in the scanner, since
11862 we can't expect the parser to be in lock-step sync with the scanner.
11863 (handle_action_dollar, handle_action_at): Use this var.
11864 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 11865
14904b89
PE
118662002-10-12 Paul Eggert <eggert@twinsun.com>
11867
1fe611e5
PE
11868 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
11869 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
11870 Include <sys/time.h> when checking for clock_t and struct tms.
11871 Use same include order as source.
11872 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 11873 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 11874
1fe611e5
PE
11875 * lib/timevar.c: Update copyright date and clarify comments.
11876 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 11877
1fe611e5
PE
11878 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
11879 GCC version as of today, then merge Bison's changes.
11880 Change "GCC" to "Bison" in copyright notice. timevar.def's
11881 author is Akim, so change that too.
11882
98194095
PE
11883 * src/reader.c (grammar_current_rule_check):
11884 Don't worry about the default action if $$ is untyped.
11885 Prevents bogus warnings reported by Jim Gifford in
161a71f3 11886 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 11887
14904b89
PE
11888 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
11889 * data/glr.c, data/lalr1.cc, data/yacc.c:
11890 Output token definitions before the first part of user declarations.
11891 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 11892 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 11893
ff6dca18
PE
118942002-10-11 Paul Eggert <eggert@twinsun.com>
11895
11896 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
11897 (yyparse): here. This undoes some of the 2002-07-25 change.
11898 Compatibility problem reported by Ralf S. Engelschall with
11899 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
11900
eb714592
AD
119012002-10-11 Akim Demaille <akim@epita.fr>
11902
11903 * tests/regression.at Characters Escapes): New.
11904 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
11905 characters.
11906 Reported by Jan Nieuwenhuizen.
11907
b7195100
AD
119082002-10-11 Akim Demaille <akim@epita.fr>
11909
11910 * po/id.po: New.
11911
f28a0f2d
PE
119122002-10-10 Paul Eggert <eggert@twinsun.com>
11913
11914 Portability fixes for bitsets; this also avoids several GCC
11915 warnings.
11916
11917 * lib/abitset.c: Include <stddef.h>, for offsetof.
11918 * lib/lbitset.c: Likewise.
11919
11920 * lib/abitset.c (abitset_bytes): Return a size that is aligned
11921 properly for vectors of objects. Do not assume that adding a
11922 header size to a multiple of a word size yields a value that is
11923 properly aligned for the whole union.
11924 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11925
11926 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
11927 unique names for structures.
11928 * lib/ebitset.c (ebitset_bytes): Likewise.
11929 * lib/lbitset.c (lbitset_bytes): Likewise.
11930
11931 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
11932 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
11933 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
11934 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
11935 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
11936 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
11937 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
11938 to improve the type-checking that GCC can do.
11939 * lib/bitset.c (bitset_op4_cmp): Likewise.
11940 * lib/bitset_stats.c (bitset_stats_count,
11941 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
11942 bitset_stats_copy, bitset_stats_disjoint_p,
11943 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
11944 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
11945 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
11946 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
11947 bitset_stats_and_or_cmp, bitset_stats_andn_or,
11948 bitset_stats_andn_or_cmp, bitset_stats_or_and,
11949 bitset_stats_or_and_cmp): Likewise.
11950 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
11951 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
11952 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
11953 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
11954
11955 * lib/abitset.h: Include bitset.h, not bbitset.h.
11956 * lib/ebitset.h: Likewise.
11957 * lib/lbitset.h: Likewise.
11958
11959 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
11960 All instances of parameters of type enum bitset_opts are now of
11961 type enum_bitset_opts, to conform to the C Standard, and similarly
11962 for enum_bitset_type.
11963 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11964 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11965
11966 Do not use "struct bitset_struct" to mean different things in
11967 different modules. Not only is this confusing, it violates
11968 the C Standard, which requires that structure types in different
11969 modules must be compatible if one is to be passed to the other.
11970 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
11971 All instances of "struct bitset_struct *" replaced with "bitset".
11972 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
11973 (union bitset_union, struct abitset_struct, struct ebitset_struct,
11974 struct lbitset_struct, struct bitset_stats_struct): New types.
11975 All uses of struct bitset_struct changed to union bitset_union,
11976 etc.
ba0fe3c7 11977 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
11978 struct bitset_struct): Remove.
11979 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
11980 struct bitset_struct): Remove.
11981 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
11982 bitset_struct): Remove.
11983 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
11984 Likewise.
11985
11986 Do not call a function of type T using a call that assumes the
11987 function is of a different type U. Standard C requires that a
11988 function must be called with a type that is compatible with its
11989 definition.
11990 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11991 New decls.
11992 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11993 New functions.
11994 * lib/ebitset.c (PFV): Remove.
11995 * lib/lbitset.c (PFV): Likewise.
11996 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
11997 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
11998 decls.
11999 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
12000 (ebitset_vtable): Use them.
12001 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
12002 lbitset_xor): New functions.
12003 (lbitset_vtable): Use them.
12004
12005 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
12006 Declare.
12007
12008 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
12009 GCC warning.
12010 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
12011 Use offsetof, for simplicity.
12012
6fbe4984
PE
120132002-10-06 Paul Eggert <eggert@twinsun.com>
12014
12015 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
12016 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 12017 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
12018 which was inadvertently undone by the 2002-09-30 patch.
12019 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
12020 the same width as int.
12021
420f93c8
PE
120222002-10-04 Paul Eggert <eggert@twinsun.com>
12023
12024 Version 1.50.
12025
12026 * configure.ac (AC_INIT), NEWS: Increment version number.
12027
12028 * doc/bison.texinfo: Minor spelling, grammar, and white space
12029 fixes.
12030 (Symbols): Mention that any negative value returned from yylex
12031 signifies end-of-input. Warn about negative chars. Mention
12032 the portable Standard C character set.
12033
12034 The GNU coding standard says CFLAGS and YFLAGS are reserved
12035 for the installer to set.
12036 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
12037 * src/Makefile.am (AM_CFLAGS): Likewise.
12038 (AM_YFLAGS): Renamed from YFLAGS.
12039
12040 Fix some MAX and MIN problems.
12041 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
12042 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
12043 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
12044 * src/reader.c (reader): Use it.
12045
12046 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
12047 POSIX 1003.1-2001 has removed fgrep.
12048
120492002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
12050
12051 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
12052 interpreted as signed.
12053 * lib/ebitset.c (ebitset_list): Fix bug.
12054
ff68026d
PE
120552002-10-01 Paul Eggert <eggert@twinsun.com>
12056
12057 More fixes for 64-bit hosts and large bitsets.
12058
12059 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
12060 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
12061 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
12062 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
12063 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
12064 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
12065 bitset_count_): Likewise.
12066 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
12067 bitset_first, bitset_last): Likewise.
12068 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
12069 bitset_stats_list_reverse, bitset_stats_size,
12070 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
12071 Likewise.
12072 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12073 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12074 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12075 bitsetv_reflexive_transitive_closure): Likewise.
12076 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
12077 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
12078 Likewise.
12079 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
12080 Likewise.
420f93c8 12081
ff68026d
PE
12082 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
12083 Use size_t, not unsigned int, to count bytes.
12084 * lib/abitset.h (abitset_bytes): Likewise.
12085 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
12086 Likewise.
12087 * lib/bitset.h (bitset_bytes): Likewise.
12088 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
12089 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
12090 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12091 * lib/ebitset.c (ebitset_bytes): Likewise.
12092 * lib/ebitset.h (ebitset_bytes): Likewise.
12093 * lib/lbitset.c (lbitset_bytes): Likewise.
12094 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 12095
ff68026d
PE
12096 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
12097 abitset_subset_p, abitset_disjoint_p, abitset_and,
12098 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
12099 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
12100 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
12101 abitset_or_and, abitset_or_and_cmp):
12102 Use bitset_windex instead of unsigned int.
12103 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12104 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
12105 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
12106 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
12107 Likewise.
12108 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 12109
ff68026d
PE
12110 * lib/bitset.c (bitset_print):
12111 Use proper printf formats for widths of integer types.
12112 * lib/bitset_stats.c (bitset_percent_histogram_print,
12113 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
12114 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12115 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12116 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 12117
ff68026d
PE
12118 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
12119 BITSET_SIZE_MAX): New macros.
12120 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
12121 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
12122 to BITSET_WINDEX_MAX.
12123
12124 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
12125 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
12126 since we now return the bitset_bindex type (not int).
12127
12128 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
12129 when computing sizes.
12130 * lib/ebitset.c (ebitset_elts_grow): Likewise.
12131
12132 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
12133 and avoid cast to unsigned.
12134
6aa452a6
AD
121352002-09-30 Akim Demaille <akim@epita.fr>
12136
12137 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12138 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
12139 Updates from Michael Hayes.
12140
927f7817
AD
121412002-09-30 Art Haas <ahaas@neosoft.com>
12142
12143 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
12144 invocations.
12145 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
12146 defined.
12147
9738f41e
AD
121482002-09-27 Akim Demaille <akim@epita.fr>
12149
12150 Version 1.49c.
12151
a5c75d7f
AD
121522002-09-27 Akim Demaille <akim@epita.fr>
12153
12154 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
12155 (Because of AC_LIBSOURCE).
12156
8280e179
AD
121572002-09-27 Akim Demaille <akim@epita.fr>
12158
12159 Playing with Autoscan.
12160
12161 * configure.ac: Remove the old LIBOBJ tweaks.
12162 (AC_REPLACE_FUNCS): Add strrchr and strtol.
12163 * lib/strrchr.c: New.
12164 * lib/strtol.c: New, from the Coreutils 4.5.1.
12165
ae64af35
AD
121662002-09-27 Akim Demaille <akim@epita.fr>
12167
12168 Playing with Autoscan.
12169
12170 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
12171 * lib/Makefile.am (libbison_a_SOURCES): No longer include
12172 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
12173 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
12174 Coreutils 4.5.1.
12175
d1a1114f
AD
121762002-09-24 Akim Demaille <akim@epita.fr>
12177
12178 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
12179 (Frequently Asked Questions, Parser Stack Overflow): New.
12180
b906441c
AD
121812002-09-13 Akim Demaille <akim@epita.fr>
12182
12183 Playing with autoscan.
12184
12185 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
12186 * src/files.c (skeleton_find): Remove, unused.
12187 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
12188 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
12189
bd701811
AD
121902002-09-13 Akim Demaille <akim@epita.fr>
12191
12192 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
12193 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
12194
e0a13e7b
AD
121952002-09-13 Akim Demaille <akim@epita.fr>
12196
12197 * configure.ac: Require 2.54.
12198 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
12199 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
12200 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
12201 Remove, provided by Autoconf macros.
12202
c97011bf
AD
122032002-09-12 Akim Demaille <akim@epita.fr>
12204
12205 * m4/prereq.m4: Update, from Coreutils 4.5.1.
12206
d862b1be
AD
122072002-09-12 Akim Demaille <akim@epita.fr>
12208
12209 * m4/prereq.m4: Update, from Fileutils 4.1.5.
12210 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
12211 Reported by Martin Mokrejs.
12212
3d38c03a
AD
122132002-09-10 Akim Demaille <akim@epita.fr>
12214
12215 * src/parse-gram.y: Associate a human readable string to each
12216 token type.
12217 * tests/regression.at (Invalid inputs): Adjust.
12218
b6347355
AD
122192002-09-10 Gary V. Vaughan <gary@gnu.org>
12220
12221 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
12222 with an Autoconf-2.5x style configure.ac.
12223
09ba4ab2
PE
122242002-09-06 Paul Eggert <eggert@twinsun.com>
12225
12226 * doc/bison.texinfo (Conditions): Make explicit that the GPL
12227 exception applies only to yacc.c. This is a modification of a
12228 patch originally suggested by Akim Demaille.
12229
21846f69
AD
122302002-09-06 Akim Demaille <akim@epita.fr>
12231
09ba4ab2
PE
12232 * data/c.m4 (b4_copyright): Move the GPL exception comment from
12233 here to...
12234 * data/yacc.c: here.
12235
21846f69
AD
12236 * data/lalr1.cc (struct yyltype): Don't define it, since we use
12237 LocationType.
12238 (b4_ltype): Default to yy::Location from location.hh.
12239
c0ad8bf3
AD
122402002-09-04 Jim Meyering <jim@meyering.net>
12241
12242 * data/yacc.c: Guard the declaration of yytoknum also with
12243 `#ifdef YYPRINT', so it is declared only when used.
12244
3a93251e
AD
122452002-09-04 Akim Demaille <akim@epita.fr>
12246
12247 * configure.in: Rename as...
12248 * configure.ac: this.
12249 Bump to 1.49c.
12250
427c0dda
AD
122512002-09-04 Akim Demaille <akim@epita.fr>
12252
12253 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
12254 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
12255 translate maintainer only messages.
12256
6a254321
PE
122572002-08-12 Paul Eggert <eggert@twinsun.com>
12258
645e30d1
PE
12259 Version 1.49b.
12260
6a254321
PE
12261 * Makefile.am (SUBDIRS): Remove intl.
12262 (DISTCLEANFILES): Remove.
12263 * NEWS: Mention that GNU M4 is now required. Clarify what is
12264 meant by "larger grammars". Mention the pt_BR translation.
12265 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
12266 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
12267 Bump version from 0.11.2 to 0.11.5.
12268 (BISON_PREREQ_STAGE): Remove.
12269 (AM_GNU_GETTEXT): Use external gettext.
12270 (AC_OUTPUT): Remove intl/Makefile.
12271
12272 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
12273
12274 * data/glr.c: Include string.h, for strlen.
12275 (yyreportParseError): Use size_t for yysize.
12276 (yy_yypstack): No longer nested inside yypstates, as nested
12277 functions are not portable. Do not assume size_t is the
12278 same width as int.
12279 (yypstates): Do not assume that ptrdiff_t is the same width
12280 as int, and similarly for yyposn and YYINDEX.
12281
12282 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
12283
12284 * lib/Makefile.am (INCLUDES): Do not include from the intl
12285 directory, which has been removed.
12286 * src/Makefile.am (INCLUDES): Likewise.
12287
12288 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
12289 (bitsets_sources, additional_bitsets_sources, timevars_sources):
12290 New vars.
12291
12292 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
12293 * tests/Makefile.am (EXTRA_DIST): Likewise.
12294
12295 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
12296 Do not assume that bitset_windex is the same width as unsigned.
12297
12298 * lib/abitset.c (abitset_unused_clear): Do not assume that
12299 bitset_word is the same width as int.
12300 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
12301 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
12302 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
12303 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
12304 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
12305
12306 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
12307 portability to one's complement hosts!).
12308 * lib/ebitset.c (ebitset_op1): Likewise.
12309 * lib/lbitset.c (lbitset_op1): Likewise.
12310
12311 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
12312 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12313 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
12314 Sync with fileutils.
12315 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
12316 lib/gettext.h: Sync with diffutils.
12317
12318 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
12319 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
12320
12321 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
12322 PROTOTYPES to check for prototypes, and "defined __STDC__" to
12323 check for void *.
12324
12325 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
12326 size_t; the old version tried to do this but casted improperly.
12327 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
12328 (bitset_test): Now returns int, not unsigned long.
12329
12330 * lib/bitset_stats.c: Include "gettext.h".
12331 (_): New macro.
12332 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
12333 name locals "index", as it generates unnecessary warnings on some
12334 hosts that have an "index" function.
12335
12336 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
12337 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
12338 they need translation.
12339 * src/LR0.c (state_list_append, new_itemsets, get_state,
12340 append_states, generate_states): Likewise.
12341 * src/assoc.c (assoc_to_string): Likewise.
12342 * src/closure.c (print_closure, set_firsts, closure): Likewise.
12343 * src/gram.c (grammar_dump): Likewise.
12344 * src/injections.c (injections_compute): Likewise.
12345 * src/lalr.c (lookaheads_print): Likewise.
12346 * src/relation.c (relation_transpose): Likewise.
12347 * src/scan-gram.l: Likewise.
12348 * src/tables.c (table_grow, pack_vector): Likewise.
12349
12350 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
12351 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
12352 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
12353 * m4/mbstate_t.m4: Sync with fileutils.
12354 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
12355
12356 * po/LINGUAS: Add pt_BR.
12357 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
12358 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
12359 lib/timevar.c.
12360 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
12361 manual recommends.
12362 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
12363
12364 * src/complain.c (strerror_r): Remove decl; not needed.
12365 (strerror): Use same pattern as ../lib/error.c.
12366
12367 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
12368
12369 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
12370
12371 * src/main.c (main): Cast result of bindtextdomain and textdomain
12372 to void, to avoid a GCC warning when --disable-nls is in effect.
12373
12374 * src/scan-gram.l: Use strings rather than escapes when possible,
12375 to minimize the number of warnings from xgettext.
12376 (handle_action_dollar, handle_action_at): Don't use isdigit,
12377 as it mishandles negative chars and it may not work as expected
12378 outside the C locale.
12379
12380 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
12381 this is a GCC extension and is not portable to other compilers.
12382
12383 * src/system.h (alloca): Use same pattern as ../lib/error.c.
12384 Do not include <ctype.h>; no longer needed.
12385 Do not include <malloc.h>; no longer needed (and generates
12386 warnings on OpenBSD 3.0).
12387
12388 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
12389 it's not portable.
12390
12391 * tests/regression.at: Do not use 'cc -c input.c -o input';
12392 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
12393
12394 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
12395 exit status as failure, not just exit status 1. Sun C exits
12396 with status 2 sometimes.
12397
12398 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
12399 Use it for the two large tests.
12400
c8f002c7
AD
124012002-08-02 Akim Demaille <akim@epita.fr>
12402
12403 * src/conflicts.c (conflicts_output): Don't output rules never
12404 reduced here, since anyway that computation doesn't work.
12405 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
12406 (rule_useless_p, rule_never_reduced_p): New.
12407 (grammar_rules_partial_print): Use a filter instead of a range.
12408 Display the title only if needed.
12409 (grammar_rules_print): Adjust.
12410 (grammar_rules_never_reduced_report): New.
12411 * src/tables.c (action_row): Move the computation of rules never
12412 reduced to...
12413 (token_actions): here.
12414 * src/main.c (main): Make the parser before making the report, so
12415 that rules never reduced are computed.
12416 Call grammar_rules_never_reduced_report.
12417 * src/print.c (print_results): Report rules never reduced.
12418 * tests/conflicts.at, tests/reduce.at: Adjust.
12419
cd08e51e
AD
124202002-08-01 Akim Demaille <akim@epita.fr>
12421
12422 Instead of attaching lookaheads and duplicating the rules being
12423 reduced by a state, attach the lookaheads to the reductions.
12424
12425 * src/state.h (state_t): Remove the `lookaheads',
12426 `lookaheads_rule' member.
12427 (reductions_t): Add a `lookaheads' member.
12428 Use a regular array for the `rules'.
12429 * src/state.c (reductions_new): Initialize the lookaheads member
12430 to 0.
12431 (state_rule_lookaheads_print): Adjust.
12432 * src/state.h, src/state.c (state_reductions_find): New.
12433 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
12434 (count_rr_conflicts): Adjust.
12435 * src/lalr.c (LArule): Remove.
12436 (add_lookback_edge): Adjust.
12437 (state_lookaheads_count): New.
12438 (states_lookaheads_initialize): Merge into...
12439 (initialize_LA): this.
12440 (lalr_free): Adjust.
12441 * src/main.c (main): Don't free nullable and derives too early: it
12442 is used by --verbose.
12443 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
12444
bb0027a9
AD
124452002-08-01 Akim Demaille <akim@epita.fr>
12446
12447 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
12448 `rule_number_t**'.
12449 (set_derives, free_derives): Rename as...
12450 (derives_compute, derives_free): this.
12451 Adjust all dependencies.
12452 * src/nullable.c (set_nullable, free_nullable): Rename as...
12453 (nullable_compute, nullable_free): these.
12454 (rule_list_t): Store rule_t *, not rule_number_t.
12455 * src/state.c (state_rule_lookaheads_print): Directly compare rule
12456 pointers, instead of their numbers.
12457 * src/main.c (main): Call nullable_free, and derives_free earlier,
12458 as they were lo longer used.
12459
3325ddc4
AD
124602002-08-01 Akim Demaille <akim@epita.fr>
12461
12462 * lib/timevar.c (get_time): Include children time.
12463 * src/lalr.h (LA, LArule): Don't export them: used with the
12464 state_t.
12465 * src/lalr.c (LA, LArule): Static.
12466 * src/lalr.h, src/lalr.c (lalr_free): New.
12467 * src/main.c (main): Call it.
12468 * src/tables.c (pack_vector): Check whether loc is >= to the
12469 table_size, not >.
12470 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
12471 (tables_generate): do it, since that's also it which allocates
12472 them.
12473 Don't free LA and LArule, main does.
12474
c6f1a33c
AD
124752002-07-31 Akim Demaille <akim@epita.fr>
12476
12477 Separate parser tables computation and output.
12478
12479 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
12480 (conflict_list, conflict_list_cnt, table, check, table_ninf)
12481 (yydefgoto, yydefact, high): Move to...
12482 * src/tables.h, src/tables.c: here.
12483 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12484 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12485 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
12486 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
12487 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
12488 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
12489 (action_row, save_row, token_actions, save_column, default_goto)
12490 (goto_actions, sort_actions, matching_state, pack_vector)
12491 (table_ninf_remap, pack_table, prepare_actions): Move to...
12492 * src/tables.c: here.
12493 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
12494 * src/output.c (token_actions, output_base, output_conflicts)
12495 (output_check): Merge into...
12496 (prepare_actions): this.
12497 (actions_output): Rename as...
12498 (user_actions_output): this.
12499 * src/main.c (main): Call tables_generate and tables_free.
12500
1509d42f
AD
125012002-07-31 Akim Demaille <akim@epita.fr>
12502
12503 Steal GCC's --time-report support.
12504
12505 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
12506 stolen/adjusted from GCC.
12507 * m4/stage.m4: Remove time related checks.
12508 * m4/timevar.m4: New.
12509 * configure.in: Adjust.
12510 * src/system.h: Adjust to using timevar.h.
12511 * src/getargs.h, src/getargs.c: Support trace_time for
12512 --trace=time.
12513 * src/main.c (stage): Remove.
12514 (main): Replace `stage' invocations with timevar calls.
12515 * src/output.c: Insert pertinent timevar calls.
12516
273a74fa
AD
125172002-07-31 Akim Demaille <akim@epita.fr>
12518
12519 Let --trace have arguments.
12520
12521 * src/getargs.h (enum trace_e): New.
12522 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
12523 (long_options, short_options): --trace/-T takes an optional
12524 argument.
12525 Change all the uses of trace_flag to reflect the new flags.
12526 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
12527
12528 Strengthen `stage' portability.
12529
12530 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
12531 * configure.in: Use it.
12532 Don't check for malloc.h and sys/times.h.
12533 * src/system.h: Include them when appropriate.
12534 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
12535 times and struct tms are available.
12536
217598da
AD
125372002-07-30 Akim Demaille <akim@epita.fr>
12538
12539 In verbose parse error message, don't report `error' as an
12540 expected token.
12541 * tests/actions.at (Printers and Destructors): Adjust.
12542 * tests/calc.at (Calculator $1): Adjust.
12543 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
12544 error message, do not report the parser accepts the error token in
12545 that state.
12546
52489d44
AD
125472002-07-30 Akim Demaille <akim@epita.fr>
12548
12549 Normalize conflict related messages.
12550
12551 * src/complain.h, src/complain.c (warn, complain): New.
12552 * src/conflicts.c (conflicts_print): Use them.
12553 (conflict_report_yacc): New, extracted from...
12554 (conflicts_print): here.
12555 * tests/conflicts.at, tests/existing.at: Adjust.
12556
e8832397
AD
125572002-07-30 Akim Demaille <akim@epita.fr>
12558
12559 Report rules which are never reduced by the parser: those hidden
12560 by conflicts.
12561
12562 * src/LR0.c (save_reductions): Don't make the final state too
12563 different: save its reduction (accept) instead of having a state
12564 without any action (no shift or goto, no reduce).
12565 Note: the final state is now a ``regular'' state, i.e., the
12566 parsers now contain `reduce 0' as default reduction.
12567 Nevertheless, since they decide to `accept' when yystate =
12568 final_state, they still will not reduce rule 0.
12569 * src/print.c (print_actions, print_reduction): Adjust.
12570 * src/output.c (action_row): Track reduced rules.
12571 (token_actions): Report rules never reduced.
12572 * tests/conflicts.at, tests/regression.at: Adjust.
12573
caf23d24
AD
125742002-07-30 Akim Demaille <akim@epita.fr>
12575
12576 `stage' was accidently included in a previous patch.
12577 Initiate its autoconfiscation.
12578
12579 * configure.in: Look for malloc.h and sys/times.h.
12580 * src/main.c (stage): Adjust.
12581 Report only when trace_flag.
12582
640748ee
AD
125832002-07-29 Akim Demaille <akim@epita.fr>
12584
12585 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
12586 state_number_t.
12587 (errs_t): symbol_t*, not symbol_number_t.
12588 (reductions_t): rule_t*, not rule_number_t.
12589 (FOR_EACH_SHIFT): New.
12590 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
12591 * src/print.c, src/print_graph.c: Adjust.
12592
88bce5a2
AD
125932002-07-29 Akim Demaille <akim@epita.fr>
12594
12595 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
12596
12597 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
12598 (endtoken, accept): these.
12599 * src/reader.c (reader): Set endtoken's default tag to "$end".
12600 Set undeftoken's tag to "$undefined" instead of "$undefined.".
12601 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
12602 Adjust.
12603
1bfb97db
AD
126042002-07-29 Akim Demaille <akim@epita.fr>
12605
12606 * src/reduce.c (reduce_grammar): When the language is empty,
12607 complain about the start symbol, not the axiom.
12608 Use its location.
12609 * tests/reduce.at (Empty Language): New.
12610
fc5734fe
AD
126112002-07-26 Akim Demaille <akim@epita.fr>
12612
12613 * src/reader.h, src/reader.c (gram_error): ... can't get
12614 yycontrol without making too strong assumptions on the parser
12615 itself.
12616 * src/output.c (prepare_tokens): Use the real 0th value of
12617 token_translations instead of `0'.
12618 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
12619 visible here.
12620 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
12621 for the time being: %locations ought to provide it to yyerror.
12622
3650b4b8
AD
126232002-07-25 Akim Demaille <akim@epita.fr>
12624
12625 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
12626 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
12627 * tests/regression.at (Web2c Actions): Adjust.
12628
4b3d3a8e
AD
126292002-07-25 Akim Demaille <akim@epita.fr>
12630
12631 Stop storing rules from 1 to nrules + 1.
12632
12633 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12634 * src/nullable.c, src/output.c, src/print.c, src/reader.c
12635 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
12636 Iterate from 0 to nrules.
12637 Use rule_number_as_item_number and item_number_as_rule_number.
12638 Adjust to `derive' now containing possibly 0.
12639 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12640 Handle the `- 1' part in rule numbers from/to item numbers.
12641 * src/conflicts.c (log_resolution): Fix the message which reversed
12642 shift and reduce.
12643 * src/output.c (action_row): Initialize default_rule to -1.
12644 (token_actions): Adjust.
12645 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
12646 expected output.
12647 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12648
4a2a22f4
AD
126492002-07-25 Akim Demaille <akim@epita.fr>
12650
12651 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12652 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12653 (b4_c_knr_arg_decl): New.
12654 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12655 yyreport_parse_error.
12656
b8df3223
AD
126572002-07-25 Akim Demaille <akim@epita.fr>
12658
12659 * data/yacc.c (yyreport_parse_error): New, extracted from...
12660 (yyparse): here.
12661 (yydestruct, yysymprint): Move above yyparse.
12662 Be K&R compliant.
12663
a762e609
AD
126642002-07-25 Akim Demaille <akim@epita.fr>
12665
12666 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12667 replace...
12668 (b4_sint_type, b4_uint_type): these.
12669 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12670 * tests/regression.at (Web2c Actions): Adjust.
12671
12b0043a
AD
126722002-07-25 Akim Demaille <akim@epita.fr>
12673
12674 * src/gram.h (TIEM_NUMBER_MAX): New.
12675 (item_number_of_rule_number, rule_number_of_item_number): Rename
12676 as...
12677 (rule_number_as_item_number, item_number_as_rule_number): these.
12678 Adjust dependencies.
12679 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12680 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12681 (symbol_number_to_vector_number): New.
12682 (order): Of vector_number_t* type.
12683 (base_t, BASE_MAX, BASE_MIN): New.
12684 (froms, tos, width, pos, check): Of base_t type.
12685 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12686 (actrow): Of action_number_t type.
12687 (conflrow): Of unsigned int type.
12688 (table_ninf, base_ninf): New.
12689 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12690 (muscle_insert_int_table, muscle_insert_base_table)
12691 (muscle_insert_rule_number_table): New.
12692 (prepare_tokens): Output `toknum' as int_table.
12693 (action_row): Returns a rule_number_t.
12694 Use ACTION_MIN, not SHRT_MIN.
12695 (token_actions): yydefact is rule_number_t*.
12696 (table_ninf_remap): New.
12697 (pack_table): Use it for `base' and `table'.
12698 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12699 replaced with...
12700 (YYPACT_NINF, YYTABLE_NINF): these.
12701 (yypact, yytable): Compute their types instead of hard-coded
12702 `short'.
12703 * tests/regression.at (Web2c Actions): Adjust.
12704
5dde258a
AD
127052002-07-19 Akim Demaille <akim@epita.fr>
12706
12707 * src/scan-gram.l (id): Can start with an underscore.
12708
a945ec39
AD
127092002-07-16 Akim Demaille <akim@epita.fr>
12710
12711 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12712 Adjust all former `associativity' dependencies.
12713 * src/symtab.c (symbol_new): Default associativity is `undef', not
12714 `right'.
12715 (symbol_check_alias_consistence): Adjust.
12716
fae437e8
AD
127172002-07-09 Akim Demaille <akim@epita.fr>
12718
12719 * doc/bison.texinfo: Properly set the ``header'' part.
12720 Use @dircategory ``GNU programming tools'' as per Texinfo's
12721 documentation.
12722 Use @copying.
12723
1a715ef2
AD
127242002-07-09 Akim Demaille <akim@epita.fr>
12725
12726 * lib/quotearg.h: Protect against multiple inclusions.
12727 * src/location.h (location_t): Add a `file' member.
12728 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12729 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12730 `error_one_per_line' support.
12731
a5d50994
AD
127322002-07-09 Akim Demaille <akim@epita.fr>
12733
12734 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12735 * src/reader.c (lineno): Remove.
12736 Adjust all dependencies.
12737 (get_merge_function): Take a location and use complain_at.
12738 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12739 * tests/regression.at (Invalid inputs, Mixing %token styles):
12740 Adjust.
12741
b275314e
AD
127422002-07-09 Akim Demaille <akim@epita.fr>
12743
12744 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12745 recovery rule, and forbid extensions when --yacc.
12746 (gram_error): Use complain_at.
12747 * src/reader.c (reader): Exit if there were parse errors.
12748
865b9df1
AD
127492002-07-09 Akim Demaille <akim@epita.fr>
12750
12751 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12752 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12753 Reported by R Blake <blakers@mac.com>.
12754
c76e14da
AD
127552002-07-09 Akim Demaille <akim@epita.fr>
12756
12757 * data/yacc.c: Output the copyright notive in the header.
12758
7db2ed2d
AD
127592002-07-03 Akim Demaille <akim@epita.fr>
12760
12761 * src/output.c (froms, tos): Are state_number_t.
12762 (save_column): sp, sp1, and sp2 are state_number_t.
12763 (prepare): Rename `final' as `final_state_number', `nnts' as
12764 `nterms_number', `nrules' as `rules_number', `nstates' as
12765 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12766 unused.
12767 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12768 * data/lalr1.cc (nsym_): Remove, unused.
12769
e68e0410
AD
127702002-07-03 Akim Demaille <akim@epita.fr>
12771
12772 * src/lalr.h, src/lalr.c (goto_number_t): New.
12773 * src/lalr.c (goto_list_t): New.
12774 Propagate them.
12775 * src/nullable.c (rule_list_t): New.
12776 Propagate.
12777 * src/types.h: Remove.
12778
e1a4f3a4
AD
127792002-07-03 Akim Demaille <akim@epita.fr>
12780
12781 * src/closure.c (print_fderives): Use rule_rhs_print.
12782 * src/derives.c (print_derives): Use rule_rhs_print.
12783 (rule_list_t): New, replaces `shorts'.
12784 (set_derives): Add comments.
12785 * tests/sets.at (Nullable, Firsts): Adjust.
12786
536545f3
AD
127872002-07-03 Akim Demaille <akim@epita.fr>
12788
12789 * src/output.c (prepare_actions): Free `tally' and `width'.
12790 (prepare_actions): Allocate and free `order'.
12791 * src/symtab.c (symbols_free): Free `symbols'.
12792 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12793 * src/output.c (m4_invoke): Move to...
12794 * src/scan-skel.l: here.
12795 (<<EOF>>): Close yyout, and free its name.
12796
8b752b00
AD
127972002-07-03 Akim Demaille <akim@epita.fr>
12798
12799 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12800
12801 * src/LR0.c (new_state): Merge into...
12802 (state_list_append): this.
12803 (new_states): Merge into...
12804 (generate_states): here.
12805 (set_states): Don't ensure a proper `errs' state member here, do it...
12806 * src/conflicts.c (conflicts_solve): here.
12807 * src/state.h, src/state.c: Comment changes.
12808 (state_t): Rename member `shifts' as `transitions'.
12809 Adjust all dependencies.
12810 (errs_new): For consistency, also take the values as argument.
12811 (errs_dup): Remove.
12812 (state_errs_set): New.
12813 (state_reductions_set, state_transitions_set): Assert that no
12814 previous value was assigned.
12815 (state_free): New.
12816 (states_free): Use it.
12817 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
12818 temporary storage: use `errs' and `nerrs' as elsewhere.
12819 (set_conflicts): Allocate and free this `errs'.
12820
613f5e1a
AD
128212002-07-02 Akim Demaille <akim@epita.fr>
12822
12823 * lib/libiberty.h: New.
12824 * lib: Update the bitset implementation from upstream.
12825 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
12826 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
12827 * src/main.c: Adjust bitset stats calls.
12828
26e0cadc
PE
128292002-07-01 Paul Eggert <eggert@twinsun.com>
12830
12831 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
12832 char, so that negative chars don't collide with $.
12833
1154cced
AD
128342002-06-30 Akim Demaille <akim@epita.fr>
12835
12836 Have the GLR tests be `warning' checked, and fix the warnings.
12837
12838 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
12839 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
12840 (yyremoveDeletes): `yyi' and `yyj' are size_t.
12841 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
12842 (yyaddDeferredAction): static.
12843 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
12844 (yyreportParseError): yyprefix is const.
12845 yytokenp is used only when verbose.
12846 (yy__GNUC__): Replace with __GNUC__.
12847 (yypdumpstack): yyi is size_t.
12848 (yypreference): Un-yy local variables and arguments, to avoid
12849 clashes with `yyr1'. Anyway, we are not in the user name space.
12850 (yytname_size): be an int, as is compared with ints.
12851 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
12852 Use them.
12853 * tests/cxx-gram.at: Use quotation to protect $1.
12854 Use AT_COMPILE to enable warnings hunts.
12855 Prototype yylex and yyerror.
12856 `Use' argc.
12857 Include `string.h', not `strings.h'.
12858 Produce and prototype stmtMerge only when used.
12859 yylex takes a location.
12860
97650f4e
AD
128612002-06-30 Akim Demaille <akim@epita.fr>
12862
12863 We spend a lot of time in quotearg, in particular when --verbose.
12864
12865 * src/symtab.c (symbol_get): Store a quoted version of the key.
12866 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
12867 Adjust all callers.
12868
d2576365
AD
128692002-06-30 Akim Demaille <akim@epita.fr>
12870
12871 * src/state.h (reductions_t): Rename member `nreds' as num.
12872 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
12873 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
12874
ccaf65bc
AD
128752002-06-30 Akim Demaille <akim@epita.fr>
12876
12877 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
12878 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
12879 (shifts_to): Rename as...
12880 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
12881 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
12882 (TRANSITION_IS_DISABLED, transitions_to): these.
12883
87675353
AD
128842002-06-30 Akim Demaille <akim@epita.fr>
12885
12886 * src/print.c (print_shifts, print_gotos): Merge into...
12887 (print_transitions): this.
12888 (print_transitions, print_errs, print_reductions): Align the
12889 lookaheads columns.
12890 (print_core, print_transitions, print_errs, print_state,
12891 print_grammar): Output empty lines separator before, not after.
12892 (state_default_rule_compute): Rename as...
12893 (state_default_rule): this.
12894 * tests/conflicts.at (Defaulted Conflicted Reduction),
12895 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
12896 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
12897
ce4ccb4b
AD
128982002-06-30 Akim Demaille <akim@epita.fr>
12899
12900 Display items as we display rules.
12901
12902 * src/gram.h, src/gram.c (rule_lhs_print): New.
12903 * src/gram.c (grammar_rules_partial_print): Use it.
12904 * src/print.c (print_core): Likewise.
12905 * tests/conflicts.at (Defaulted Conflicted Reduction),
12906 (Unresolved SR Conflicts): Adjust.
12907 (Unresolved SR Conflicts): Adjust and rename as...
12908 (Resolved SR Conflicts): this, as was meant.
12909 * tests/regression.at (Web2c Report): Adjust.
12910
bc933ef1
AD
129112002-06-30 Akim Demaille <akim@epita.fr>
12912
12913 * src/print.c (state_default_rule_compute): New, extracted from...
12914 (print_reductions): here.
12915 Pessimize, but clarify the code.
12916 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
12917
53d4308d
AD
129182002-06-30 Akim Demaille <akim@epita.fr>
12919
12920 * src/output.c (action_row): Let default_rule be always a rule
12921 number.
12922
574fb2d5
AD
129232002-06-30 Akim Demaille <akim@epita.fr>
12924
12925 * src/closure.c (print_firsts, print_fderives, closure):
12926 Use BITSET_EXECUTE.
12927 * src/lalr.c (lookaheads_print): Likewise.
12928 * src/state.c (state_rule_lookaheads_print): Likewise.
12929 * src/print_graph.c (print_core): Likewise.
12930 * src/print.c (print_reductions): Likewise.
12931 * src/output.c (action_row): Likewise.
12932 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
12933
05811fd7
AD
129342002-06-30 Akim Demaille <akim@epita.fr>
12935
12936 * src/print_graph.c: Use report_flag.
12937
0e4d5753
AD
129382002-06-30 Akim Demaille <akim@epita.fr>
12939
12940 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
12941 to...
12942 * src/relation.h, src/relation.c (traverse, relation_digraph)
12943 (relation_print, relation_transpose): New.
12944
24c7d800
AD
129452002-06-30 Akim Demaille <akim@epita.fr>
12946
12947 * src/state.h, src/state.c (shifts_to): New.
12948 * src/lalr.c (build_relations): Use it.
12949
9222837b
AD
129502002-06-30 Akim Demaille <akim@epita.fr>
12951
12952 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
12953 (item_number_of_rule_number, rule_number_of_item_number): New.
12954 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
12955 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12956 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
12957 Propagate their use.
12958 Much remains to be done, in particular wrt `shorts' from types.h.
12959
260008e5
AD
129602002-06-30 Akim Demaille <akim@epita.fr>
12961
12962 * src/symtab.c (symbol_new): Initialize the `printer' member.
12963
8a731ca8
AD
129642002-06-30 Akim Demaille <akim@epita.fr>
12965
12966 * src/LR0.c (save_reductions): Remove, replaced by...
12967 * src/state.h, src/state.c (state_reductions_set): New.
12968 (reductions, errs): Rename as...
12969 (reductions_t, errs_t): these.
12970 Adjust all dependencies.
12971
32e1e0a4
AD
129722002-06-30 Akim Demaille <akim@epita.fr>
12973
12974 * src/LR0.c (state_list_t, state_list_append): New.
12975 (first_state, last_state): Now symbol_list_t.
12976 (this_state): Remove.
12977 (new_itemsets, append_states, save_reductions): Take a state_t as
12978 argument.
12979 (set_states, generate_states): Adjust.
12980 (save_shifts): Remove, replaced by...
12981 * src/state.h, src/state.c (state_shifts_set): New.
12982 (shifts): Rename as...
12983 (shifts_t): this.
12984 Adjust all dependencies.
12985 * src/state.h (state_t): Remove the `next' member.
12986
e5fb6710
AD
129872002-06-30 Akim Demaille <akim@epita.fr>
12988
12989 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
12990 escaped in slot 0.
12991
c7ca99d4
AD
129922002-06-30 Akim Demaille <akim@epita.fr>
12993
12994 Use hash.h for the state hash table.
12995
12996 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
12997 (allocate_storage): Use state_hash_new.
12998 (free_storage): Use state_hash_free.
12999 (new_state, get_state): Adjust.
13000 * src/lalr.h, src/lalr.c (states): Move to...
13001 * src/states.h (state_t): Remove the `link' member, no longer
13002 used.
13003 * src/states.h, src/states.c: here.
13004 (state_hash_new, state_hash_free, state_hash_lookup)
13005 (state_hash_insert, states_free): New.
13006 * src/states.c (state_table, state_compare, state_hash): New.
13007 * src/output.c (output_actions): Do not free states now, since we
13008 still need to know the final_state number in `prepare', called
13009 afterwards. Do it...
13010 * src/main.c (main): here: call states_free after `output'.
13011
df0e7316
AD
130122002-06-30 Akim Demaille <akim@epita.fr>
13013
13014 * src/state.h, src/state.c (state_new): New, extracted from...
13015 * src/LR0.c (new_state): here.
13016 * src/state.h (STATE_ALLOC): Move to...
13017 * src/state.c: here.
13018 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
13019 * src/state.h, src/state.c: here.
13020
39f41916
AD
130212002-06-30 Akim Demaille <akim@epita.fr>
13022
13023 * src/reader.c (gensym): Rename as...
13024 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
13025 (getsym): Rename as...
13026 (symbol_get): this.
13027
d57650a5
AD
130282002-06-30 Akim Demaille <akim@epita.fr>
13029
13030 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
13031 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
13032 * src/output.c, src/print.c, src/print_graph.c: Propagate.
13033 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
13034
5a08f1ce
AD
130352002-06-30 Akim Demaille <akim@epita.fr>
13036
13037 Make the test suite pass with warnings checked.
13038
13039 * tests/actions.at (Printers and Destructors): Improve.
13040 Avoid unsigned vs. signed issues.
13041 * tests/calc.at: Don't exercise the scanner here, do it...
13042 * tests/input.at (Torturing the Scanner): here.
13043
720623af
PH
130442002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13045
88e7e941 13046 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
13047 reorganize first lines parallel to yacc.c.
13048
fb8135fa
AD
130492002-06-28 Akim Demaille <akim@epita.fr>
13050
13051 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
13052 (b4_token_enum, b4_token_defines): New, factored from...
13053 * data/lalr1.cc, data/yacc.c, glr.c: here.
13054
41442480
AD
130552002-06-28 Akim Demaille <akim@epita.fr>
13056
13057 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
13058 unused variables.
13059 * src/output.c (merger_output): static.
13060
e0e5bf84
AD
130612002-06-28 Akim Demaille <akim@epita.fr>
13062
ba0fe3c7 13063 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
13064 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
13065 pacify GCC.
13066 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 13067
676385e2
PH
130682002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13069
13070 Accumulated changelog for new GLR parsing features.
13071
6a254321 13072 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
13073 conflicts_total_count.
13074 * src/conflicts.h: Ditto.
13075 * src/output.c (token_actions): Use the new name.
13076 (output_conflicts): Change conflp => conflict_list_heads, and
13077 confl => conflict_list for better readability.
13078 * data/glr.c: Use the new names.
13079 * NEWS: Add self to GLR announcement.
e0e5bf84 13080
676385e2
PH
13081 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
13082
13083 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
13084 Akim Demaille.
13085
13086 * data/bison.glr: Change name to glr.c
13087 * data/glr.c: Renamed from bison.glr.
13088 * data/Makefile.am: Add glr.c
e0e5bf84
AD
13089
13090 * src/getargs.c:
13091
676385e2 13092 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 13093 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 13094
676385e2
PH
13095 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13096
13097 * data/bison.glr: Be sure to restore the
13098 current #line when returning to the skeleton contents after having
13099 exposed the input file's #line.
13100
13101 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13102
13103 * data/bison.glr: Bring up to date with changes to bison.simple.
13104
13105 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13106
13107 * data/bison.glr: Correct definitions that use b4_prefix.
13108 Various reformatting.
13109 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
13110 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
13111 yytokenp argument; now part of stack.
13112 (yychar): Define to behave as documented.
13113 (yyclearin): Ditto.
e0e5bf84 13114
676385e2
PH
13115 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13116
13117 * src/reader.h: Add declaration for free_merger_functions.
13118
13119 * src/reader.c (merge_functions): New variable.
13120 (get_merge_function): New function.
13121 (free_merger_functions): New function.
13122 (readgram): Check for %prec that is not followed by a symbol.
13123 Handle %dprec and %merge declarations.
13124 (packgram): Initialize dprec and merger fields in rules array.
13125
13126 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
13127 conflict_list_cnt, conflict_list_free): New variables.
13128 (table_grow): Also grow conflict_table.
e0e5bf84 13129 (prepare_rules): Output dprec and merger tables.
676385e2 13130 (conflict_row): New function.
e0e5bf84 13131 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
13132 default reduction in conflicted states for GLR parser so that there
13133 are spaces for the conflict lists.
13134 (save_row): Also save conflict information.
13135 (token_actions): Allocate conflict list.
13136 (merger_output): New function.
13137 (pack_vector): Pack conflict table, too.
13138 (output_conflicts): New function to output yyconflp and yyconfl.
13139 (output_check): Allocate conflict_tos.
13140 (output_actions): Output conflict tables, also.
13141 (output_skeleton): Output b4_mergers definition.
13142 (prepare): Output b4_max_rhs_length definition.
13143 Use 'bison.glr' as default skeleton for GLR parsers.
13144
13145 * src/gram.c (glr_parser): New flag.
13146 (grammar_free): Call free_merger_functions.
13147
13148 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
13149 all pairs of conflicting reductions, rather than just all tokens
13150 causing conflicts. Needed to size conflict tables.
e0e5bf84 13151 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
13152 interface.
13153 (conflicts_print): Ditto.
13154 (count_total_conflicts): New function.
13155
13156 * src/reader.h (merger_list): New type.
13157 (merge_functions): New variable.
13158
13159 * src/lex.h (tok_dprec, tok_merge): New token types.
13160
13161 * src/gram.h (rule_s): Add dprec and merger fields.
13162 (glr_parser): New flag.
13163
13164 * src/conflicts.h (count_total_conflicts): New function.
13165
13166 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
13167
13168 * doc/bison.texinfo (Generalized LR Parsing): New section.
13169 (GLR Parsers): New section.
13170 (Language and Grammar): Mention GLR parsing.
13171 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
13172 Correct typo ("tge" -> "the").
13173
13174 * data/bison.glr: New skeleton for GLR parsing.
13175
13176 * tests/cxx-gram.at: New tests for GLR parsing.
13177
13178 * tests/testsuite.at: Include cxx-gram.at.
13179
13180 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 13181
676385e2
PH
13182 * src/parse-gram.y:
13183
13184 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
13185
13186 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 13187
b5480d74 131882002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
13189
13190 * src/options.h, src/options.c: Remove.
13191 * src/getargs.c (short_options, long_options): New.
13192
60491a94
AD
131932002-06-27 Akim Demaille <akim@epita.fr>
13194
13195 * data/bison.simple, data/bison.c++: Rename as...
13196 * data/yacc.c, data/lalr1.cc: these.
13197 * doc/bison.texinfo (Environment Variables): Remove.
13198
9be0c25b
AD
131992002-06-25 Raja R Harinath <harinath@cs.umn.edu>
13200
13201 * src/getargs.c (report_argmatch): Initialize strtok().
13202
1ae72863
AD
132032002-06-20 Akim Demaille <akim@epita.fr>
13204
13205 * data/bison.simple (b4_symbol_actions): New, replaces...
13206 (b4_symbol_destructor, b4_symbol_printer): these.
13207 (yysymprint): Be sure to call YYPRINT only for tokens, and using
13208 user token numbers.
13209
87542d29
AD
132102002-06-20 Akim Demaille <akim@epita.fr>
13211
13212 * data/bison.simple (yydestructor): Rename as...
13213 (yydestruct): this.
13214
1a31ed21
AD
132152002-06-20 Akim Demaille <akim@epita.fr>
13216
13217 * src/symtab.h, src/symtab.c (symbol_type_set)
13218 (symbol_destructor_set, symbol_precedence_set): The location is
13219 the last argument.
13220 Adjust all callers.
13221
e776192e
AD
132222002-06-20 Akim Demaille <akim@epita.fr>
13223
13224 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
13225 internals.
13226 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
13227 Takes a location.
13228 * src/symtab.h, src/symtab.c (symbol_class_set)
13229 (symbol_user_token_number_set): Likewise.
13230 Adjust all callers.
13231 Promote complain_at.
13232 * tests/input.at (Type Clashes): Adjust.
13233
5c1180b3
AD
132342002-06-20 Akim Demaille <akim@epita.fr>
13235
13236 * data/bison.simple (YYLEX): Fix the declaration when
13237 %pure-parser.
13238
e3170060
AD
132392002-06-20 Akim Demaille <akim@epita.fr>
13240
13241 * data/bison.simple (yysymprint): Don't print the token number,
13242 just its name.
13243 * tests/actions.at (Destructors): Rename as...
13244 (Printers and Destructors): this.
13245 Also exercise %printer.
13246
253862fd
AD
132472002-06-20 Akim Demaille <akim@epita.fr>
13248
13249 * data/bison.simple (YYDSYMPRINT): New.
13250 Use it to remove many of the #if YYDEBUG/if (yydebug).
13251
366eea36
AD
132522002-06-20 Akim Demaille <akim@epita.fr>
13253
13254 * src/symtab.h, src/symtab.c (symbol_t): printer and
13255 printer_location are new members.
13256 (symbol_printer_set): New.
13257 * src/parse-gram.y (PERCENT_PRINTER): New token.
13258 Handle its associated rule.
13259 * src/scan-gram.l: Adjust.
13260 (handle_destructor_at, handle_destructor_dollar): Rename as...
13261 (handle_symbol_code_at, handle_symbol_code_dollar): these.
13262 * src/output.c (symbol_printers_output): New.
13263 (output_skeleton): Call it.
13264 * data/bison.simple (yysymprint): New. Cannot be named yyprint
13265 since there are already many grammar files with a user `yyprint'.
13266 Replace the calls to YYPRINT to calls to yysymprint.
13267 * tests/calc.at: Adjust.
13268 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
13269 taking advantage of parser very internal details (stack size!).
13270
4f25ebb0
AD
132712002-06-20 Akim Demaille <akim@epita.fr>
13272
13273 * src/scan-gram.l: Complete the scanner with the missing patterns
13274 to pacify Flex.
13275 Use `quote' and `symbol_tag_get' where appropriate.
13276
93b68a0e
AD
132772002-06-19 Akim Demaille <akim@epita.fr>
13278
13279 * tests/actions.at (Destructors): Augment to test locations.
13280 * data/bison.simple (yydestructor): Pass it the current location
13281 if locations are enabled.
13282 Prototype only when __STDC__ or C++.
13283 Change the argument names to move into the yy name space: there is
13284 user code here.
13285
58612f1d
AD
132862002-06-19 Akim Demaille <akim@epita.fr>
13287
74310291
AD
13288 * data/bison.simple (b4_pure_if): New.
13289 Use it instead of #ifdef YYPURE.
13290
132912002-06-19 Akim Demaille <akim@epita.fr>
13292
13293 * data/bison.simple (b4_location_if): New.
58612f1d
AD
13294 Use it instead of #ifdef YYLSP_NEEDED.
13295
f25bfb75
AD
132962002-06-19 Akim Demaille <akim@epita.fr>
13297
13298 Prepare @$ in %destructor, but currently don't bind it in the
13299 skeleton, as %location use is not cleaned up yet.
13300
13301 * src/scan-gram.l (handle_dollar, handle_destructor_at)
13302 (handle_action_at): New.
13303 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
13304 a braced_code_t and a location as additional arguments.
13305 (handle_destructor_dollar): Instead of requiring `b4_eval', just
13306 unquote one when outputting `b4_dollar_dollar'.
13307 Adjust callers.
13308 * data/bison.simple (b4_eval): Remove.
13309 (b4_symbol_destructor): Adjust.
13310 * tests/input.at (Invalid @n): Adjust.
13311
c732d2c6
AD
133122002-06-19 Zack Weinberg <zack@codesourcery.com>
13313
13314 * doc/bison.texinfo: Document ability to have multiple
13315 prologue sections.
13316
8c165d89
AD
133172002-06-18 Akim Demaille <akim@epita.fr>
13318
13319 * src/files.c (compute_base_names): When computing the output file
13320 names from the input file name, strip the directory part.
13321
ca98bf57
AD
133222002-06-18 Akim Demaille <akim@epita.fr>
13323
13324 * data/bison.simple.new: Comment changes.
13325 Reported by Andreas Schwab.
13326
0bfb02ff
AD
133272002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
13328
13329 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
13330 there are no `label `yyoverflowlab' defined but not used' warnings
13331 when yyoverflow is defined.
13332
24c0aad7
AD
133332002-06-18 Akim Demaille <akim@epita.fr>
13334
13335 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
13336 new member.
13337 (symbol_destructor_set): Adjust.
13338 * src/output.c (symbol_destructors_output): Output the destructor
13339 locations.
13340 Output the symbol name.
13341 * data/bison.simple (b4_symbol_destructor): Adjust.
13342
5719c109
AD
133432002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
13344 and Akim Demaille <akim@epita.fr>
13345
13346 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
13347 what's left on the stack when the error recovery hits EOF.
13348 * tests/actions.at (Destructors): Complete to exercise this case.
13349
9280d3ef
AD
133502002-06-17 Akim Demaille <akim@epita.fr>
13351
13352 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
13353 arguments is really empty, not only equal to `[]'.
13354 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
13355 member.
13356 (symbol_destructor_set): New.
13357 * src/output.c (symbol_destructors_output): New.
13358 * src/reader.h (brace_code_t, current_braced_code): New.
13359 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
13360 (handle_dollar): Rename as...
13361 (handle_action_dollar): this.
13362 (handle_destructor_dollar): New.
13363 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
13364 (grammar_declaration): Use it.
13365 * data/bison.simple (yystos): Is always defined.
13366 (yydestructor): New.
13367 * tests/actions.at (Destructors): New.
13368 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
13369
dafdc66f
AD
133702002-06-17 Akim Demaille <akim@epita.fr>
13371
13372 * src/symlist.h, src/symlist.c (symbol_list_length): New.
13373 * src/scan-gram.l (handle_dollar, handle_at): Compute the
13374 rule_length only when needed.
13375 * src/output.c (actions_output, token_definitions_output): Output
13376 the full M4 block.
13377 * src/symtab.c: Don't access directly to the symbol tag, use
13378 symbol_tag_get.
13379 * src/parse-gram.y: Use symbol_list_free.
13380
56c47203
AD
133812002-06-17 Akim Demaille <akim@epita.fr>
13382
13383 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
13384 (symbol_list_prepend, get_type_name): Move to...
13385 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
13386 (symbol_list_prepend, symbol_list_n_type_name_get): here.
13387 Adjust all callers.
13388 (symbol_list_free): New.
13389 * src/scan-gram.l (handle_dollar): Takes a location.
13390 * tests/input.at (Invalid $n): Adjust.
13391
1e0bab92
AD
133922002-06-17 Akim Demaille <akim@epita.fr>
13393
13394 * src/reader.h, src/reader.c (symbol_list_new): Export it.
13395 (symbol_list_prepend): New.
13396 * src/parse-gram.y (%union): `list' is a new member.
13397 (symbols.1): New, replaces...
13398 (terms_to_prec.1, nterms_to_type.1): these.
13399 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
13400 Take a location as additional argument.
13401 Adjust all callers.
13402
04e60654
AD
134032002-06-15 Akim Demaille <akim@epita.fr>
13404
13405 * src/parse-gram.y: Move %token in the declaration section so that
13406 we don't depend upon CVS Bison.
13407
10e5b8bd
AD
134082002-06-15 Akim Demaille <akim@epita.fr>
13409
13410 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
13411 * src/print.c (print_core): Use it.
13412
9801d40c
AD
134132002-06-15 Akim Demaille <akim@epita.fr>
13414
13415 * src/conflicts.c (log_resolution): Accept the rule involved in
13416 the sr conflicts instead of the lookahead number that points to
13417 that rule.
13418 (flush_reduce): Accept the current lookahead vector as argument,
13419 instead of the index in LA.
13420 (resolve_sr_conflict): Accept the current number of lookahead
13421 bitset to consider for the STATE, instead of the index in LA.
13422 (set_conflicts): Adjust.
13423 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
13424
c0263492
AD
134252002-06-15 Akim Demaille <akim@epita.fr>
13426
13427 * src/state.h (state_t): Replace the `lookaheadsp' member, a
13428 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
13429 Adjust all dependencies.
13430 * src/lalr.c (initialize_lookaheads): Split into...
13431 (states_lookaheads_count, states_lookaheads_initialize): these.
13432 (lalr): Adjust.
13433
9757c359
AD
134342002-06-15 Akim Demaille <akim@epita.fr>
13435
13436 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
13437 out of...
13438 (grammar_rules_print): here.
13439 * src/reduce.c (reduce_output): Use it.
13440 * tests/reduce.at (Useless Rules, Reduced Automaton)
13441 (Underivable Rules): Adjust.
13442
6b98e4b5
AD
134432002-06-15 Akim Demaille <akim@epita.fr>
13444
13445 Copy BYacc's nice way to report the grammar.
13446
13447 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
13448 New.
13449 Don't print the rules' location, it is confusing and useless.
13450 (rule_print): Use grammar_rhs_print.
13451 * src/print.c (print_grammar): Use grammar_rules_print.
13452
6b98e4b5
AD
134532002-06-15 Akim Demaille <akim@epita.fr>
13454
13455 Complete and rationalize `useless thing' warnings.
13456
13457 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
13458 (symbol_tag_print): New.
13459 Use them everywhere in place of accessing directly the tag member.
13460 * src/gram.h, src/gram.c (rule_print): New.
13461 Use it where a rule used to be printed `by hand'.
13462 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
13463 (reduce_grammar_tables): Report the useless rules.
13464 (reduce_print): Useless things are a warning, not an error.
13465 Report it as such.
13466 * tests/reduce.at (Useless Nonterminals, Useless Rules):
13467 (Reduced Automaton, Underivable Rules): Adjust.
13468 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
13469 * tests/conflicts.at (Unresolved SR Conflicts)
13470 (Solved SR Conflicts): Adjust.
13471
ee000ba4
AD
134722002-06-15 Akim Demaille <akim@epita.fr>
13473
13474 Let symbols have a location.
13475
13476 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
13477 (getsym): Adjust.
13478 Adjust all callers.
13479 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
13480 Use location_t, not int.
13481 * src/symtab.c (symbol_check_defined): Take advantage of the
13482 location.
13483 * tests/regression.at (Invalid inputs): Adjust.
13484
8efe435c
AD
134852002-06-15 Akim Demaille <akim@epita.fr>
13486
13487 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
13488 (input): Don't try to initialize yylloc here, do it in the
13489 scanner.
13490 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
13491 * src/gram.h (rule_t): Change line and action_line into location
13492 and action_location, of location_t type.
13493 Adjust all dependencies.
13494 * src/location.h, src/location.c (empty_location): New.
13495 * src/reader.h, src/reader.c (grammar_start_symbol_set)
13496 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
13497 (grammar_current_rule_symbol_append)
13498 (grammar_current_rule_action_append): Expect a location as argument.
13499 * src/reader.c (grammar_midrule_action): Adjust to attach an
13500 action's location as dummy symbol location.
13501 * src/symtab.h, src/symtab.c (startsymbol_location): New.
13502 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
13503 the line numbers.
13504
1921f1d7
AD
135052002-06-14 Akim Demaille <akim@epita.fr>
13506
13507 Grammar declarations may be found in the grammar section.
13508
13509 * src/parse-gram.y (rules_or_grammar_declaration): New.
13510 (declarations): Each declaration may end with a semicolon, not
13511 just...
13512 (grammar_declaration): `"%union"'.
13513 (grammar): Branch to rules_or_grammar_declaration.
13514
4515534c
AD
135152002-06-14 Akim Demaille <akim@epita.fr>
13516
13517 * src/main.c (main): Invoke scanner_free.
13518
f958596b
AD
135192002-06-14 Akim Demaille <akim@epita.fr>
13520
13521 * src/output.c (m4_invoke): Extracted from...
13522 (output_skeleton): here.
13523 Free tempfile.
13524
2c569025
AD
135252002-06-14 Akim Demaille <akim@epita.fr>
13526
13527 * src/parse-gram.y (directives, directive, gram)
13528 (grammar_directives, precedence_directives, precedence_directive):
13529 Rename as...
13530 (declarations, declaration, grammar, grammar_declaration)
13531 (precedence_declaration, precedence_declarator): these.
13532 (symbol_declaration): New.
13533
592e8d4d
AD
135342002-06-14 Akim Demaille <akim@epita.fr>
13535
13536 * src/files.c (action_obstack): Remove, unused.
13537 (output_obstack): Remove it, and all its dependencies, as it is no
13538 longer needed.
13539 * src/reader.c (epilogue_set): Build the epilogue in the
13540 muscle_obstack.
13541 * src/output.h, src/output.c (muscle_obstack): Move to...
13542 * src/muscle_tab.h, src/muscle_tab.h: here.
13543 (muscle_init): Initialize muscle_obstack.
13544 (muscle_free): New.
13545 * src/main.c (main): Call it.
13546
0c15323d
AD
135472002-06-14 Akim Demaille <akim@epita.fr>
13548
13549 * src/location.h: New, extracted from...
13550 * src/reader.h: here.
13551 * src/Makefile.am (noinst_HEADERS): Merge into
13552 (bison_SOURCES): this.
13553 Add location.h.
13554 * src/parse-gram.y: Use location_t instead of Bison's.
13555 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
13556 Use location_t instead of ints.
13557
e96c9728
AD
135582002-06-14 Akim Demaille <akim@epita.fr>
13559
13560 * data/bison.simple, data/bison.c++: Be sure to restore the
13561 current #line when returning to the skeleton contents after having
13562 exposed the input file's #line.
13563
75d1fe16
AD
135642002-06-12 Akim Demaille <akim@epita.fr>
13565
13566 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
13567 eager.
13568 * tests/actions.at (Exotic Dollars): New.
13569
6c35d22c
AD
135702002-06-12 Akim Demaille <akim@epita.fr>
13571
13572 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
13573 ['"/] too eagerly.
13574 * tests/input.at (Torturing the Scanner): New.
13575
1d6412ad
AD
135762002-06-11 Akim Demaille <akim@epita.fr>
13577
13578 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
13579 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
13580 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
13581 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
13582 * src/reader.c (reader): Use it.
13583
4cdb01db
AD
135842002-06-11 Akim Demaille <akim@epita.fr>
13585
13586 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
13587 Adjust all callers.
13588 (scanner_last_string_free): New.
13589
44995b2e
AD
135902002-06-11 Akim Demaille <akim@epita.fr>
13591
13592 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
13593 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
13594 (last_string, YY_OBS_FREE): New.
13595 Use them when returning an ID.
13596
e9955c83
AD
135972002-06-11 Akim Demaille <akim@epita.fr>
13598
13599 Have Bison grammars parsed by a Bison grammar.
13600
13601 * src/reader.c, src/reader.h (prologue_augment): New.
13602 * src/reader.c (copy_definition): Remove.
13603
13604 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
13605 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
13606 (grammar_current_rule_prec_set, grammar_current_rule_check)
13607 (grammar_current_rule_symbol_append)
13608 (grammar_current_rule_action_append): Export.
13609 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
13610 (symbol_list_action_append): Remove.
13611 Hook the routines from reader.
13612 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
13613 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
13614
13615 * src/reader.c (read_declarations): Remove, unused.
13616
13617 * src/parse-gram.y: Handle the epilogue.
13618 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
13619 (grammar_start_symbol_set): this.
13620 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
13621 * src/reader.c (readgram): Remove, unused.
13622 (reader): Adjust to insert eoftoken and axiom where appropriate.
13623
13624 * src/reader.c (copy_dollar): Replace with...
13625 * src/scan-gram.h (handle_dollar): this.
13626 * src/parse-gram.y: Remove `%thong'.
13627
13628 * src/reader.c (copy_at): Replace with...
13629 * src/scan-gram.h (handle_at): this.
13630
13631 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
13632 New.
13633
13634 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
13635 time being.
13636
13637 * src/reader.h, src/reader.c (grammar_rule_end): New.
13638
13639 * src/parse.y (current_type, current_class): New.
13640 Implement `%nterm', `%token' support.
13641 Merge `%term' into `%token'.
13642 (string_as_id): New.
13643 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
13644 type name.
13645
13646 * src/parse-gram.y: Be sure to handle properly the beginning of
13647 rules.
13648
13649 * src/parse-gram.y: Handle %type.
13650 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13651
13652 * src/parse-gram.y: More directives support.
13653 * src/options.c: No longer handle source directives.
13654
13655 * src/parse-gram.y: Fix %output.
13656
13657 * src/parse-gram.y: Handle %union.
13658 Use the prologue locations.
13659 * src/reader.c (parse_union_decl): Remove.
13660
13661 * src/reader.h, src/reader.c (epilogue_set): New.
13662 * src/parse-gram.y: Use it.
13663
13664 * data/bison.simple, data/bison.c++: b4_stype is now either not
13665 defined, then default to int, or to the contents of %union,
13666 without `union' itself.
13667 Adjust.
13668 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13669
13670 * src/output.c (actions_output): Don't output braces, as they are
13671 already handled by the scanner.
13672
13673 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13674 characters to themselves.
13675
13676 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13677 that the epilogue has a proper #line.
13678
13679 * src/parse-gram.y: Handle precedence/associativity.
13680
13681 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13682 a terminal.
13683 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13684 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13685 at all to define terminals that cannot be emitted.
13686
13687 * src/scan-gram.l: Escape M4 characters.
13688
13689 * src/scan-gram.l: Working properly with escapes in user
13690 strings/characters.
13691
13692 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13693 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13694 grammar.
13695 Use more modest sizes, as for the time being the parser does not
13696 release memory, and therefore the process swallows a huge amount
13697 of memory.
13698
13699 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13700 stricter %token grammar.
13701
13702 * src/symtab.h (associativity): Add `undef_assoc'.
13703 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13704 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13705
13706 * tests/regression.at (Invalid %directive): Remove, as it is now
13707 meaningless.
13708 (Invalid inputs): Adjust to the new error messages.
13709 (Token definitions): The new grammar doesn't allow too many
13710 eccentricities.
13711
13712 * src/lex.h, src/lex.c: Remove.
13713 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13714 (copy_character, copy_string2, copy_string, copy_identifier)
13715 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13716 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13717 (parse_action): Remove.
13718 * po/POTFILES.in: Adjust.
13719
2e047461
AD
137202002-06-11 Akim Demaille <akim@epita.fr>
13721
cd05d13c 13722 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
13723 rule's action member: return the action as a string.
13724 Don't require `rule_length' as an argument: compute it.
13725 (grammar_current_rule_symbol_append)
13726 (grammar_current_rule_action_append): New, eved out from
13727 (readgram): here.
13728 Remove `action_flag', `rulelength', unused now.
13729
9af3fbce
AD
137302002-06-11 Akim Demaille <akim@epita.fr>
13731
13732 * src/reader.c (grammar_current_rule_prec_set).
13733 (grammar_current_rule_check): New, eved out from...
13734 (readgram): here.
13735 Remove `xaction', `first_rhs': useless.
13736 * tests/input.at (Type clashes): New.
13737 * tests/existing.at (GNU Cim Grammar): Adjust.
13738
1485e106
AD
137392002-06-11 Akim Demaille <akim@epita.fr>
13740
13741 * src/reader.c (grammar_midrule_action): New, Eved out from
13742 (readgram): here.
13743
da4160c3
AD
137442002-06-11 Akim Demaille <akim@epita.fr>
13745
13746 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13747 New.
13748 (readgram): Use them as replacement of inlined code, crule and
13749 crule1.
13750
f6d0f937
AD
137512002-06-11 Akim Demaille <akim@epita.fr>
13752
13753 * src/reader.c (grammar_end, grammar_symbol_append): New.
13754 (readgram): Use them.
13755 Make the use of `p' as local as possible.
13756
69078d4b
AD
137572002-06-10 Akim Demaille <akim@epita.fr>
13758
13759 GCJ's parser requires the tokens to be defined before the prologue.
13760
13761 * data/bison.simple: Output the token definition before the user's
13762 prologue.
13763 * tests/regression.at (Braces parsing, Duplicate string)
13764 (Mixing %token styles): Check the output from bison.
13765 (Early token definitions): New.
13766
5e424082
AD
137672002-06-10 Akim Demaille <akim@epita.fr>
13768
13769 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13770 assigning twice the same user number to a token, so that we can
13771 use it in...
13772 * src/lex.c (lex): here.
13773 Also use `symbol_class_set' instead of hand written code.
13774 * src/reader.c (parse_assoc_decl): Likewise.
13775
44536b35
AD
137762002-06-10 Akim Demaille <akim@epita.fr>
13777
13778 * src/symtab.c, src/symtab.c (symbol_class_set)
13779 (symbol_user_token_number_set): New.
13780 * src/reader.c (parse_token_decl): Use them.
13781 Use a switch instead of ifs.
13782 Use a single argument.
13783
8b9f2372
AD
137842002-06-10 Akim Demaille <akim@epita.fr>
13785
13786 Remove `%thong' support as it is undocumented, unused, duplicates
13787 `%token's job, and creates useless e-mail traffic with people who
13788 want to know what it is, why it is undocumented, unused, and
13789 duplicates `%token's job.
13790
13791 * src/reader.c (parse_thong_decl): Remove.
13792 * src/options.c (option_table): Remove "thong".
13793 * src/lex.h (tok_thong): Remove.
13794
3ae2b51f
AD
137952002-06-10 Akim Demaille <akim@epita.fr>
13796
13797 * src/symtab.c, src/symtab.c (symbol_type_set)
13798 (symbol_precedence_set): New.
13799 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13800 (value_components_used): Remove, unused.
13801
2f1afb73
AD
138022002-06-09 Akim Demaille <akim@epita.fr>
13803
13804 Move symbols handling code out of the reader.
13805
13806 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13807 (axiom): Move to...
13808 * src/symtab.h, src/symtab.c: here.
13809
13810 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13811 * src/reader.c (startval): Rename as...
13812 * src/symtab.h, src/symtab.c (startsymbol): this.
13813 * src/reader.c: Adjust.
13814
13815 * src/reader.c (symbol_check_defined, symbol_make_alias)
13816 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13817 (token_translations_init)
13818 Move to...
13819 * src/symtab.c: here.
13820 * src/reader.c (packsymbols): Move to...
13821 * src/symtab.h, src/symtab.c (symbols_pack): here.
13822 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
13823 argument.
13824
e9bca3ad
AD
138252002-06-03 Akim Demaille <akim@epita.fr>
13826
13827 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
13828 then statements.
13829
86eff183
AD
138302002-06-03 Akim Demaille <akim@epita.fr>
13831
13832 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
13833 structs with non literals.
13834 * src/scan-skel.l: never-interactive.
13835 * src/conflicts.c (enum conflict_resolution_e): No trailing
13836 comma.
13837 * src/getargs.c (usage): Split long literal strings.
13838 Reported by Hans Aberg.
13839
717be197
AD
138402002-05-28 Akim Demaille <akim@epita.fr>
13841
13842 * data/bison.c++: Use C++ ostreams.
13843 (cdebug_): New member.
13844
670ddffd
AD
138452002-05-28 Akim Demaille <akim@epita.fr>
13846
13847 * src/output.c (output_skeleton): Be sure to allocate enough room
13848 for `/' _and_ for `\0' in full_skeleton.
13849
769b430f
AD
138502002-05-28 Akim Demaille <akim@epita.fr>
13851
13852 * data/bison.c++: Catch up with bison.simple:
13853 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13854 and Paul Eggert <eggert@twinsun.com>: `error' handing.
13855 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
13856 and popping traces.
13857
7067cb36
PH
138582002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13859
13860 * src/output.c (output_skeleton): Put an explicit path in front of
13861 the skeleton file name, rather than relying on the -I directory,
13862 to partially alleviate effects of having a skeleton file lying around
13863 in the current directory.
769b430f 13864
4a713ec2
PH
138652002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13866
769b430f 13867 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
13868 obstack_printf should be obstack_fgrow1.
13869
b408954b
AD
138702002-05-26 Akim Demaille <akim@epita.fr>
13871
13872 * src/state.h (state_t): `solved_conflicts' is a new member.
13873 * src/LR0.c (new_state): Set it to 0.
13874 * src/conflicts.h, src/conflicts.c (print_conflicts)
13875 (free_conflicts, solve_conflicts): Rename as...
13876 (conflicts_print, conflicts_free, conflicts_solve): these.
13877 Adjust callers.
13878 * src/conflicts.c (enum conflict_resolution_e)
13879 (solved_conflicts_obstack): New, used by...
13880 (log_resolution): this.
13881 Adjust to attach the conflict resolution to each state.
13882 Complete the description with the precedence/associativity
13883 information.
13884 (resolve_sr_conflict): Adjust.
13885 * src/print.c (print_state): Output its solved_conflicts.
13886 * tests/conflicts.at (Unresolved SR Conflicts)
13887 (Solved SR Conflicts): Exercise --report=all.
13888
a49aecd5
AD
138892002-05-26 Akim Demaille <akim@epita.fr>
13890
13891 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13892 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13893 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
13894 (token_number_t, item_number_as_token_number)
13895 (token_number_as_item_number, muscle_insert_token_number_table):
13896 Rename as...
13897 (symbol_number_t, item_number_as_symbol_number)
13898 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
13899 these, since it is more appropriate.
13900
5504898e
AD
139012002-05-26 Akim Demaille <akim@epita.fr>
13902
13903 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
13904 `Error:' lines.
13905 * data/bison.simple (yystos) [YYDEBUG]: New.
13906 (yyparse) [YYDEBUG]: Display the symbols which are popped during
13907 error recovery.
13908 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
13909
ec3bc396
AD
139102002-05-25 Akim Demaille <akim@epita.fr>
13911
13912 * doc/bison.texinfo (Debugging): Split into...
13913 (Tracing): this new section, its former contents, and...
13914 (Understanding): this new section.
13915 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
13916 by...
13917 (report_flag): this.
13918 Adjust all dependencies.
13919 (report_args, report_types, report_argmatch): New.
13920 (usage, getargs): Report/support -r, --report.
13921 * src/options.h
13922 (struct option_table_struct): Rename as..,
13923 (struct option_table_s): this.
13924 Rename the `set_flag' member to `flag' to match with getopt_long's
13925 struct.
13926 * src/options.c (option_table): Split verbose into an entry for
13927 %verbose, and another for --verbose.
13928 Support --report/-r, so remove -r from the obsolete --raw.
13929 * src/print.c: Attach full item sets and lookaheads reports to
13930 report_flag instead of trace_flag.
13931 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
13932
78df8250
PE
139332002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13934 and Paul Eggert <eggert@twinsun.com>
769b430f 13935
78df8250
PE
13936 * data/bison.simple (yyparse): Correct error handling to conform to
13937 POSIX and yacc. Specifically, after syntax error is discovered,
13938 do not reduce further before shifting the error token.
13939 Clean up the code a bit by removing the labels yyerrdefault,
13940 yyerrhandle, yyerrpop.
13941 * NEWS: Document the above.
13942
c0c9ea05
PH
139432002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13944
13945 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
13946 type; it isn't always big enough, since it doesn't necessarily
13947 include non-terminals.
769b430f 13948 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
13949 the latter can be removed.
13950 (yy_token_number_type): Remove, only one use.
13951 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
13952 don't use TokenNumberType as element type.
769b430f 13953
c0c9ea05
PH
13954 * tests/regression.at: Modify expected output to agree with change
13955 to yyr1 and yytranslate.
769b430f 13956
6390a83f
FK
139572002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
13958
13959 * src/reader.c (parse_action): Use copy_character instead of
13960 obstack_1grow.
13961
db7c8e9a
AD
139622002-05-13 Akim Demaille <akim@epita.fr>
13963
13964 * tests/regression.at (Token definitions): Prototype yylex and
13965 yyerror.
13966
fcc61800
PH
139672002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13968
158c687b 13969 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
13970 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
13971 32-bit arithmetic.
13972 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
13973
5683e9b2
AD
139742002-05-07 Akim Demaille <akim@epita.fr>
13975
13976 * tests/synclines.at: Be sure to prototype yylex and yyerror to
13977 avoid GCC warnings.
13978
0c2d3f4c
AD
139792002-05-07 Akim Demaille <akim@epita.fr>
13980
13981 Kill GCC warnings.
13982
13983 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
13984 over the RHS of each rule.
13985 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
13986 * src/state.h (state_t): Member `nitems' is unsigned short.
13987 * src/LR0.c (get_state): Adjust.
13988 * src/reader.c (packgram): Likewise.
13989 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
13990 `Type'.
13991 (muscle_insert_int_table): Remove, unused.
13992 (prepare_rules): Remove `max'.
13993
1565b720
AD
139942002-05-06 Akim Demaille <akim@epita.fr>
13995
13996 * src/closure.c (print_firsts): Display of the symbol tags.
13997 (bitmatrix_print): Move to...
13998 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
13999 here.
14000 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
14001
cfaee611
AD
140022002-05-06 Akim Demaille <akim@epita.fr>
14003
14004 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
14005 hash_do_for_each.
14006
458be8e0
AD
140072002-05-06 Akim Demaille <akim@epita.fr>
14008
14009 * src/LR0.c (new_state, get_state): Instead of using the global
14010 `kernel_size' and `kernel_base', have two new arguments:
14011 `core_size' and `core'.
14012 Adjust callers.
14013
a900a624
AD
140142002-05-06 Akim Demaille <akim@epita.fr>
14015
14016 * src/reader.c (packgram): No longer end `ritem' with a 0
14017 sentinel: it is not used.
14018
d4e7d3a1
AD
140192002-05-05 Akim Demaille <akim@epita.fr>
14020
14021 New experimental feature: display the lookaheads in the report and
14022 graph.
14023
14024 * src/print (print_core): When --trace-flag, display the rules
14025 lookaheads.
14026 * src/print_graph.c (print_core): Likewise.
14027 Swap the arguments.
14028 Adjust caller.
14029
39ceb25b
AD
140302002-05-05 Akim Demaille <akim@epita.fr>
14031
14032 * tests/torture.at (Many lookaheads): New test.
14033
5372019f
AD
140342002-05-05 Akim Demaille <akim@epita.fr>
14035
14036 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
14037 (GENERATE_MUSCLE_INSERT_TABLE): this.
14038 (output_int_table, output_unsigned_int_table, output_short_table)
14039 (output_token_number_table, output_item_number_table): Replace with...
14040 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
14041 (muscle_insert_short_table, muscle_insert_token_number_table)
14042 (muscle_insert_item_number_table): these.
14043 Adjust all callers.
14044 (prepare_tokens): Don't free `translations', since...
14045 * src/reader.h, src/reader.c (grammar_free): do it.
14046 Move to...
14047 * src/gram.h, src/gram.c (grammar_free): here.
14048 * data/bison.simple, data/bison.c++: b4_token_number_max is now
14049 b4_translate_max.
14050
5df5f6d5
AD
140512002-05-05 Akim Demaille <akim@epita.fr>
14052
14053 * src/output.c (output_unsigned_int_table): New.
14054 (prepare_rules): `i' is unsigned.
14055 `prhs', `rline', `r2' are unsigned int.
14056 Rename muscle `rhs_number_max' as `rhs_max'.
14057 Output muscles `prhs_max', `rline_max', and `r2_max'.
14058 Free rline and r1.
14059 * data/bison.simple, data/bison.c++: Adjust to use these muscles
14060 to compute types instead of constant types.
14061 * tests/regression.at (Web2c Actions): Adjust.
14062
b87f8b21
AD
140632002-05-04 Akim Demaille <akim@epita.fr>
14064
14065 * src/symtab.h (SALIAS, SUNDEF): Rename as...
14066 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
14067 Adjust dependencies.
14068 * src/output.c (token_definitions_output): Be sure not to output a
14069 `#define 'a'' when fed with `%token 'a' "a"'.
14070 * tests/regression.at (Token definitions): New.
14071
8bb936e4
PE
140722002-05-03 Paul Eggert <eggert@twinsun.com>
14073
14074 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
14075 for K&R C.
14076
140772002-05-03 gettextize <bug-gnu-gettext@gnu.org>
14078
14079 * Makefile.am (SUBDIRS): Remove intl.
14080 (EXTRA_DIST): Add config/config.rpath.
14081
53c71a12
AD
140822002-05-03 Akim Demaille <akim@epita.fr>
14083
14084 * data/bison.simple (m4_if): Don't output empty enums.
14085 And actually, output valid enum definitions :(.
14086
289dd0cf
AD
140872002-05-03 Akim Demaille <akim@epita.fr>
14088
14089 * configure.bat: Remove, completely obsolete.
14090 * Makefile.am (EXTRA_DIST): Adjust.
14091 Don't distribute config.rpath...
14092 * config/Makefile.am (EXTRA_DIST): Do it.
14093
db85e524
AD
140942002-05-03 Akim Demaille <akim@epita.fr>
14095
14096 * configure.in (GETTEXT_VERSION): New.
14097 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
14098
83ccf991
AD
140992002-05-03 Akim Demaille <akim@epita.fr>
14100
14101 * data/bison.simple (b4_token_enum): New.
14102 (b4_token_defines): Use it to output tokens both as #define and
14103 enums.
14104 Suggested by Paul Eggert.
14105 * src/output.c (token_definitions_output): Don't output spurious
14106 white spaces.
14107
1f418995
AD
141082002-05-03 Akim Demaille <akim@epita.fr>
14109
14110 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14111
45119f04
RA
141122002-05-02 Robert Anisko <robert@lrde.epita.fr>
14113
14114 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
14115 Update the stack class, give a try to deque as the default container.
14116
b2d52318
AD
141172002-05-02 Akim Demaille <akim@epita.fr>
14118
14119 * data/bison.simple (yyparse): Do not implement @$ = @1.
14120 (YYLLOC_DEFAULT): Adjust to do it.
14121 * doc/bison.texinfo (Location Default Action): Fix.
14122
3a8b4109
AD
141232002-05-02 Akim Demaille <akim@epita.fr>
14124
14125 * src/reader.c (parse_braces): Merge into...
14126 (parse_action): this.
14127
84614e13
AD
141282002-05-02 Akim Demaille <akim@epita.fr>
14129
14130 * configure.in (ALL_LINGUAS): Remove.
14131 * po/LINGUAS, hr.po: New.
14132
fdbcd8e2
AD
141332002-05-02 Akim Demaille <akim@epita.fr>
14134
14135 Remove the so called hairy (semantic) parsers.
14136
14137 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
14138 * src/gram.h, src/gram.c (semantic_parser): Remove.
14139 (rule_t): Remove the guard and guard_line members.
14140 * src/lex.h (token_t): remove tok_guard.
14141 * src/options.c (option_table): Remove %guard and %semantic_parser
14142 support.
14143 * src/output.c, src/output.h (guards_output): Remove.
14144 (prepare): Adjust.
14145 (token_definitions_output): Don't output the `T'
14146 tokens (???).
14147 (output_skeleton): Don't output the guards.
14148 * src/files.c, src/files.c (attrsfile): Remove.
14149 * src/reader.c (symbol_list): Remove the guard and guard_line
14150 members.
14151 Adjust dependencies.
14152 (parse_guard): Remove.
14153 * data/bison.hairy: Remove.
14154 * doc/bison.texinfo (Environment Variables): Remove occurrences of
14155 BISON_HAIRY.
14156
82b6cb3f
AD
141572002-05-02 Akim Demaille <akim@epita.fr>
14158
14159 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
14160 (parse_guard): Rename the formal argument `stack_offset' as
14161 `rule_length', which is more readable.
14162 Adjust callers.
14163 (copy_at, copy_dollar): Instead of outputting the hard coded
14164 values of $$, $n and so forth, output invocation to b4_lhs_value,
14165 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
14166 Note: this patch partially drops `semantic-parser' support: it
14167 always does `rule_length - n', where semantic parsers ought to
14168 always use `-n'.
82b6cb3f
AD
14169 * data/bison.simple, data/bison.c++ (b4_lhs_value)
14170 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
14171
6cbfbcc5
AD
141722002-05-02 Akim Demaille <akim@epita.fr>
14173
14174 * configure.in (AC_INIT): Bump to 1.49b.
14175 (AM_INIT_AUTOMAKE): Short invocation.
14176
b8548114
AD
141772002-05-02 Akim Demaille <akim@epita.fr>
14178
14179 Version 1.49a.
14180
c20cd1fa
AD
141812002-05-01 Akim Demaille <akim@epita.fr>
14182
14183 * src/skeleton.h: Remove.
14184
8a9566d4
AD
141852002-05-01 Akim Demaille <akim@epita.fr>
14186
14187 * src/skeleton.h: Fix the #endif.
14188 Reported by Magnus Fromreide.
14189
8c6d399a
PE
141902002-04-26 Paul Eggert <eggert@twinsun.com>
14191
14192 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
14193 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 14194 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 14195
2b7ed18a
RA
141962002-04-25 Robert Anisko <robert@lrde.epita.fr>
14197
14198 * src/scan-skel.l: Postprocess quadrigraphs.
14199
14200 * src/reader.c (copy_character): New function, used to output
14201 single characters while replacing `[' and `]' with quadrigraphs, to
14202 avoid troubles with M4 quotes.
14203 (copy_comment): Output characters with copy_character.
14204 (read_additionnal_code): Likewise.
14205 (copy_string2): Likewise.
14206 (copy_definition): Likewise.
14207
14208 * tests/calc.at: Exercise M4 quoting.
14209
34a89c50
AD
142102002-04-25 Akim Demaille <akim@epita.fr>
14211
14212 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
14213 between `!' and the command.
14214 Reported by Paul Eggert.
14215
0dd1580a
RA
142162002-04-24 Robert Anisko <robert@lrde.epita.fr>
14217
14218 * tests/calc.at: Exercise prologue splitting.
14219
14220 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
14221 `b4_post_prologue' instead of `b4_prologue'.
14222
14223 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
14224 muscles.
14225 (output): Free pre_prologue_obstack and post_prologue_obstack.
14226 * src/files.h, src/files.c (attrs_obstack): Remove.
14227 (pre_prologue_obstack, post_prologue_obstack): New.
14228 * src/reader.c (copy_definition): Add a parameter to specify the
14229 obstack to fill, instead of using attrs_obstack unconditionally.
14230 (read_declarations): Pass pre_prologue_obstack to copy_definition if
14231 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
14232
83c1796f
PE
142332002-04-23 Paul Eggert <eggert@twinsun.com>
14234
14235 * data/bison.simple: Remove unnecessary commentary and white
14236 space differences from 1_29-branch.
14237 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
14238
14239 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
14240 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
14241 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
14242 constructors or destructors.
14243
14244 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
14245
1207eeac
AD
142462002-04-23 Akim Demaille <akim@epita.fr>
14247
14248 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
14249 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
14250 location with columns.
14251 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
14252 All reported by Paul Eggert.
14253
78ab8f67
AD
142542002-04-22 Akim Demaille <akim@epita.fr>
14255
14256 * src/reduce.c (dump_grammar): Move to...
14257 * src/gram.h, src/gram.c (grammar_dump): here.
14258 Be sure to separate long item numbers.
14259 Don't read the members of a rule's prec if its nil.
14260
133c20e2
AD
142612002-04-22 Akim Demaille <akim@epita.fr>
14262
14263 * src/output.c (table_size, table_grow): New.
14264 (MAXTABLE): Remove, replace uses with table_size.
14265 (pack_vector): Instead of dying when the table is too big, grow it.
14266
9515e8a7
AD
142672002-04-22 Akim Demaille <akim@epita.fr>
14268
14269 * data/bison.simple (yyr1): Its type is that of a token number.
14270 * data/bison.c++ (r1_): Likewise.
14271 * tests/regression.at (Web2c Actions): Adjust.
14272
23c5a174
AD
142732002-04-22 Akim Demaille <akim@epita.fr>
14274
14275 * src/reader.c (token_translations_init): 256 is now the default
14276 value for the error token, i.e., it will be assigned another
14277 number if the user assigned 256 to one of her tokens.
14278 (reader): Don't force 256 to error.
14279 * doc/bison.texinfo (Symbols): Adjust.
14280 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
14281 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
14282 etc. instead of 10, 20, 30 (which was used to `jump' over error
14283 (256) and undefined (2)).
14284
5fbb0954
AD
142852002-04-22 Akim Demaille <akim@epita.fr>
14286
14287 Propagate more token_number_t.
14288
14289 * src/gram.h (token_number_as_item_number)
14290 (item_number_as_token_number): New.
14291 * src/output.c (GENERATE_OUTPUT_TABLE): New.
14292 Use it to create output_item_number_table and
14293 output_token_number_table.
14294 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14295 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
14296 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
14297 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
14298
4f940944
AD
142992002-04-22 Akim Demaille <akim@epita.fr>
14300
14301 * src/output.h, src/output.c (get_lines_number): Remove.
14302
3ded9a63
AD
143032002-04-19 Akim Demaille <akim@epita.fr>
14304
14305 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
14306 as Lex/Flex'.
14307 (Debugging): More details about enabling the debugging features.
14308 (Table of Symbols): Describe $$, $n, @$, and @n.
14309 Suggested by Tim Josling.
14310
e0c471a9
AD
143112002-04-19 Akim Demaille <akim@epita.fr>
14312
14313 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
14314
fecc10cd
AD
143152002-04-10 Akim Demaille <akim@epita.fr>
14316
14317 * src/system.h: Rely on HAVE_LIMITS_H.
14318 Suggested by Paul Eggert.
14319
51dec47b
AD
143202002-04-09 Akim Demaille <akim@epita.fr>
14321
14322 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
14323 full stderr, and strip it according to the bison options, instead
14324 of composing the error message from different bits.
14325 This makes it easier to check for several error messages.
14326 Adjust all the invocations.
14327 Add an invocation exercising the error token.
14328 Add an invocation demonstrating a stupid error message.
14329 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
14330 Adjust the tests.
14331 Error message are for stderr, not stdout.
14332
007a50a4
AD
143332002-04-09 Akim Demaille <akim@epita.fr>
14334
14335 * src/gram.h, src/gram.c (error_token_number): Remove, use
14336 errtoken->number.
14337 * src/reader.c (reader): Don't specify the user token number (2)
14338 for $undefined, as it uselessly prevents using it.
14339 * src/gram.h (token_number_t): Move to...
14340 * src/symtab.h: here.
14341 (state_t.number): Is a token_number_t.
14342 * src/print.c, src/reader.c: Use undeftoken->number instead of
14343 hard coded 2.
14344 (Even though this 2 is not the same as above: the number of the
14345 undeftoken remains being 2, it is its user token number which
14346 might not be 2).
14347 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
14348 `user_token_number_max'.
14349 Output `undef_token_number'.
14350 * data/bison.simple, data/bison.c++: Use them.
14351 Be sure to map invalid yylex return values to
14352 `undef_token_number'. This saves us from gratuitous SEGV.
14353
14354 * tests/conflicts.at (Solved SR Conflicts)
14355 (Unresolved SR Conflicts): Adjust.
14356 * tests/regression.at (Web2c Actions): Adjust.
14357
06446ccf
AD
143582002-04-08 Akim Demaille <akim@epita.fr>
14359
14360 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
14361 Adding #line.
14362 Remove the duplicate `typedefs'.
14363 (RhsNumberType): Fix the declaration and various other typos.
14364 Use __ofile__.
14365 * data/bison.simple: Use __ofile__.
14366 * src/scan-skel.l: Handle __ofile__.
14367
62a3e4f0
AD
143682002-04-08 Akim Demaille <akim@epita.fr>
14369
14370 * src/gram.h (item_number_t): New, the type of item numbers in
14371 RITEM. Note that it must be able to code symbol numbers as
14372 positive number, and the negation of rule numbers as negative
14373 numbers.
14374 Adjust all dependencies (pretty many).
14375 * src/reduce.c (rule): Remove this `short *' pointer: use
14376 item_number_t.
14377 * src/system.h (MINSHORT, MAXSHORT): Remove.
14378 Include `limits.h'.
14379 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
14380 (shortcpy): Remove.
14381 (MAXTABLE): Move to...
14382 * src/output.c (MAXTABLE): here.
14383 (prepare_rules): Use output_int_table to output rhs.
14384 * data/bison.simple, data/bison.c++: Adjust.
14385 * tests/torture.at (Big triangle): Move the limit from 254 to
14386 500.
14387 * tests/regression.at (Web2c Actions): Ajust.
14388
14389 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
14390 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
14391 passes, but produces negative #line number, once fixed, GCC is
14392 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
14393 C), it passes.
14394 * src/state.h (state_h): Code input lines on ints, not shorts.
14395
bb88b0fc
AD
143962002-04-08 Akim Demaille <akim@epita.fr>
14397
14398 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
14399 and then the grammar.
14400
9a636f47
AD
144012002-04-08 Akim Demaille <akim@epita.fr>
14402
14403 * src/system.h: No longer using strndup.
14404
680e8701
AD
144052002-04-07 Akim Demaille <akim@epita.fr>
14406
14407 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
14408 * src/output.c (output_table_data): Return the longest number.
14409 (prepare_tokens): Output `token_number_max').
14410 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
14411 New.
14412 Use them to define yy_token_number_type/TokenNumberType.
14413 Use this type for yytranslate.
14414 * tests/torture.at (Big triangle): Push the limit from 124 to
14415 253.
14416 * tests/regression.at (Web2c Actions): Adjust.
14417
817e9f41
AD
144182002-04-07 Akim Demaille <akim@epita.fr>
14419
14420 * tests/torture.at (Big triangle): New.
14421 (GNU AWK Grammar, GNU Cim Grammar): Move to...
14422 * tests/existing.at: here.
14423
5123689b
AD
144242002-04-07 Akim Demaille <akim@epita.fr>
14425
14426 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
14427 nritems.
14428 Adjust dependencies.
14429
f3849179
AD
144302002-04-07 Akim Demaille <akim@epita.fr>
14431
14432 * src/reader.c: Normalize increments to prefix form.
14433
bd02036a
AD
144342002-04-07 Akim Demaille <akim@epita.fr>
14435
14436 * src/reader.c, symtab.c: Remove debugging code.
14437
db8837cb
AD
144382002-04-07 Akim Demaille <akim@epita.fr>
14439
14440 Rename all the `bucket's as `symbol_t'.
14441
14442 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
14443 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
14444 * src/symtab.c, src/symtab.h (bucket): Rename as...
14445 (symbol_t): this.
14446 (symbol_list_new, bucket_check_defined, bucket_make_alias)
14447 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
14448 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14449 (buckets_new, buckets_free, buckets_do): Rename as...
14450 (symbol_list_new, symbol_check_defined, symbol_make_alias)
14451 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14452 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
14453 (symbols_new, symbols_free, symbols_do): these.
14454
72a23c97
AD
144552002-04-07 Akim Demaille <akim@epita.fr>
14456
14457 Use lib/hash for the symbol table.
14458
14459 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
14460 EOF.
14461 * src/lex.c (lex): Set the `number' member of new terminals.
14462 * src/reader.c (bucket_check_defined, bucket_make_alias)
14463 (bucket_check_alias_consistence, bucket_translation): New.
14464 (reader, grammar_free, readgram, token_translations_init)
14465 (packsymbols): Adjust.
14466 (reader): Number the predefined tokens.
14467 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
14468 for predefined tokens.
14469 * src/symtab.h (bucket): Remove all the hash table related
14470 members.
14471 * src/symtab.c (symtab): Replace by...
14472 (bucket_table): this.
14473 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14474 (buckets_new, buckets_do): New.
14475
280a38c3
AD
144762002-04-07 Akim Demaille <akim@epita.fr>
14477
14478 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
14479 (start_symbol, max_user_token_number, semantic_parser)
14480 (error_token_number): Initialize.
14481 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
14482 Initialize.
14483 (reader): Don't.
14484 (errtoken, eoftoken, undeftoken, axiom): Extern.
14485
03b31c0c
AD
144862002-04-07 Akim Demaille <akim@epita.fr>
14487
14488 * src/gram.h (rule_s): prec and precsym are now pointers
14489 to the bucket giving the priority/associativity.
14490 Member `associativity' removed: useless.
14491 * src/reduce.c, src/conflicts.c: Adjust.
14492
8b3df748
AD
144932002-04-07 Akim Demaille <akim@epita.fr>
14494
14495 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
14496 Properly escape the symbols' TAG when outputting them.
14497
e601aa1d
AD
144982002-04-07 Akim Demaille <akim@epita.fr>
14499
14500 * src/lalr.h (LA): Is a bitsetv, not bitset*.
14501
b0299a2e
AD
145022002-04-07 Akim Demaille <akim@epita.fr>
14503
14504 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
14505 (LArule): this, which is an array to rule_t*.
14506 * src/print.c, src/conflicts.c: Adjust.
14507
d7e1f00c
AD
145082002-04-07 Akim Demaille <akim@epita.fr>
14509
14510 * src/gram.h (rule_t): Rename `number' as `user_number'.
14511 `number' is a new member.
14512 Adjust dependencies.
14513 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
14514
cc9305dd
AD
145152002-04-07 Akim Demaille <akim@epita.fr>
14516
14517 As a result of the previous patch, it is no longer needed
14518 to reorder ritem itself.
14519
14520 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
14521
b0940840
AD
145222002-04-07 Akim Demaille <akim@epita.fr>
14523
14524 Be sure never to walk through RITEMS, but use only data related to
14525 the rules themselves. RITEMS should be banished.
14526
14527 * src/output.c (output_token_translations): Rename as...
14528 (prepare_tokens): this.
14529 In addition to `translate', prepare the muscles `tname' and
14530 `toknum', which were handled by...
14531 (output_rule_data): this.
14532 Remove, and move the remainder of its outputs into...
14533 (prepare_rules): this new routines, which also merges content from
14534 (output_gram): this.
14535 (prepare_rules): Be sure never to walk through RITEMS.
14536 (output_stos): Rename as...
14537 (prepare_stos): this.
14538 (output): Always invoke prepare_states, after all, just don't use it
14539 in the output if you don't need it.
14540
643a5994
AD
145412002-04-07 Akim Demaille <akim@epita.fr>
14542
14543 * src/LR0.c (new_state): Display `nstates' as the name of the
14544 newly created state.
14545 Adjust to initialize first_state and last_state if needed.
14546 Be sure to distinguish the initial from the final state.
14547 (new_states): Create the itemset of the initial state, and use
14548 new_state.
14549 * src/closure.c (closure): Now that the initial state has its
14550 items properly set, there is no need for a special case when
14551 creating `ruleset'.
14552
14553 As a result, now the rule 0, reducing to $axiom, is visible in the
14554 outputs. Adjust the test suite.
14555
14556 * tests/conflicts.at (Solved SR Conflicts)
14557 (Unresolved SR Conflicts): Adjust.
14558 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
14559 * tests/conflicts.at (S/R in initial): New.
14560
b4c4ccc2
AD
145612002-04-07 Akim Demaille <akim@epita.fr>
14562
14563 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
14564 the RHS of the rules.
14565 * src/output.c (output_gram): Likewise.
14566
bba97eb2
AD
145672002-04-07 Akim Demaille <akim@epita.fr>
14568
14569 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
14570 bucket.
14571 Adjust all dependencies.
14572 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
14573 `number' of the buckets too.
14574 * src/gram.h: Include `symtab.h'.
14575 (associativity): Move to...
14576 * src/symtab.h: here.
14577 No longer include `gram.h'.
14578
c3b407f4
AD
145792002-04-07 Akim Demaille <akim@epita.fr>
14580
14581 * src/gram.h, src/gram.c (rules_rhs_length): New.
14582 (ritem_longest_rhs): Use it.
14583 * src/gram.h (rule_t): `number' is a new member.
14584 * src/reader.c (packgram): Set it.
14585 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
14586 the end of `rules', and count them out of `nrules'.
14587 (reduce_output, dump_grammar): Adjust.
14588 * src/print.c (print_grammar): It is no longer needed to check for
14589 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
14590 * tests/reduce.at (Reduced Automaton): New test.
14591
11652ab3
AD
145922002-04-07 Akim Demaille <akim@epita.fr>
14593
14594 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
14595 lacking `+ 1' to nrules, Bison reported as useless a token if it
14596 was used solely to set the precedence of the last rule...
14597
26b23c1a
AD
145982002-04-07 Akim Demaille <akim@epita.fr>
14599
14600 * data/bison.c++, data/bison.simple: Don't output the current file
14601 name in #line, to avoid useless diffs between two identical
14602 outputs under different names.
14603
18bcecb0
AD
146042002-04-07 Akim Demaille <akim@epita.fr>
14605
14606 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
14607 Normalize loops to using `< nrules + 1', not `<= nrules'.
14608
fa770c86
AD
146092002-04-07 Akim Demaille <akim@epita.fr>
14610
14611 * TODO: Update.
14612
d9b739c3
AD
146132002-04-07 Akim Demaille <akim@epita.fr>
14614
14615 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
14616 bucket.value as bucket.number.
14617
99013900
AD
146182002-04-07 Akim Demaille <akim@epita.fr>
14619
14620 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
14621 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14622 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
14623 RHS, instead of being an index in RITEMS.
14624
e966383b
PE
146252002-04-04 Paul Eggert <eggert@twinsun.com>
14626
14627 * doc/bison.texinfo: Update copyright date.
14628 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
14629 (Symbols): Warn about running Bison in one character set,
14630 but compiling and/or running in an incompatible one.
14631 Warn about character code 256, too.
14632
146332002-04-03 Paul Eggert <eggert@twinsun.com>
14634
14635 * src/bison.data (YYSTACK_ALLOC): Depend on whether
14636 YYERROR_VERBOSE is nonzero, not whether it is defined.
14637
14638 Merge changes from bison-1_29-branch.
c307773e 14639
8d6c48b9
PE
146402002-03-20 Paul Eggert <eggert@twinsun.com>
14641
14642 Merge fixes from Debian bison_1.34-1.diff.
14643
14644 * configure.in (AC_PREREQ): 2.53.
14645
e53c6322
AD
146462002-03-20 Akim Demaille <akim@epita.fr>
14647
14648 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14649
9ffbeca7
PE
146502002-03-19 Paul Eggert <eggert@twinsun.com>
14651
21db0b2a
PE
14652 * src/bison.simple (YYCOPY): New macro.
14653 (YYSTACK_RELOCATE): Use it.
14654 Remove Type arg; no longer needed. All callers changed.
14655 (yymemcpy): Remove; no longer needed.
14656
9ffbeca7
PE
14657 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14658 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14659
642cb8f8
AD
146602002-03-19 Akim Demaille <akim@epita.fr>
14661
14662 Test and fix the #line outputs.
14663
14664 * tests/atlocal.at (GCC): New.
14665 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 14666 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
14667 (Action synch line, Epilogue synch line): New tests.
14668 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14669 * data/bison.simple, data/bison.c++: Use it.
14670
3c31a486
AD
146712002-03-19 Akim Demaille <akim@epita.fr>
14672
14673 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14674 (Solved SR Conflicts, %expect not enough, %expect right)
14675 (%expect too much): Move to...
14676 * tests/conflicts.at: this new file.
14677
0d8bed56
AD
146782002-03-19 Akim Demaille <akim@epita.fr>
14679
14680 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14681 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14682 that we can move to enums for instance.
14683 * src/output.c (token_definitions_output): Output a list of
14684 `token-name, token-number' instead of the #define.
14685 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14686
9208d17f
AD
146872002-03-14 Akim Demaille <akim@epita.fr>
14688
14689 Use Gettext 0.11.1.
14690
af27eacb
RA
146912002-03-09 Robert Anisko <robert@lrde.epita.fr>
14692
14693 * data/bison.c++: Make the user able to add members to the generated
14694 parser by subclassing.
14695
9101a310
RA
146962002-03-05 Robert Anisko <robert@lrde.epita.fr>
14697
14698 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14699 a character.
14700 Reported by Nicolas Tisserand and Nicolas Burrus.
14701
fff9bf0b
RA
147022002-03-04 Robert Anisko <robert@lrde.epita.fr>
14703
14704 * src/reader.c: Warn about lacking semi-colons, do not complain.
14705
64dba31e
RA
147062002-03-04 Robert Anisko <robert@lrde.epita.fr>
14707
14708 * data/bison.c++: Remove a debug line.
14709
374f5a14
RA
147102002-03-04 Robert Anisko <robert@lrde.epita.fr>
14711
14712 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14713 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14714 provide a default implementation.
14715
bfcf1f3a
AD
147162002-03-04 Akim Demaille <akim@epita.fr>
14717
14718 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14719 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14720 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14721 * tests/semantic.at (Parsing Guards): Similarly.
14722 * src/reader.at (readgram): Complain if the last rule is not ended
14723 with a semi-colon.
14724
65ccf9fc
AD
147252002-03-04 Akim Demaille <akim@epita.fr>
14726
14727 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14728 * src/closure.c: here.
14729 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14730 RTC.
14731 * src/warshall.h, src/warshall.c: Remove.
14732 * tests/sets.at (Broken Closure): Adjust.
14733
d0039cbc
AD
147342002-03-04 Akim Demaille <akim@epita.fr>
14735
14736 * src/output.c (output_skeleton): tempdir is const.
14737 bytes_read is unused.
14738
345cea78
AD
147392002-03-04 Akim Demaille <akim@epita.fr>
14740
14741 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14742 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14743 Update.
14744 From Michael Hayes.
14745
564801f7
AD
147462002-03-04 Akim Demaille <akim@epita.fr>
14747
14748 * src/closure.c (closure): `r' is unused.
14749
e5352bc7
AD
147502002-03-04 Akim Demaille <akim@epita.fr>
14751
14752 * tests/sets.at (Broken Closure): Add the ending `;'.
14753 * src/reader.at (readgram): Complain if a rule is not ended with a
14754 semi-colon.
14755
914feea9
AD
147562002-03-04 Akim Demaille <akim@epita.fr>
14757
14758 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14759 (count_sr_conflicts): Use bitset_count.
14760 * src/reduce.c (inaccessable_symbols): Ditto.
14761 (bits_size): Remove.
14762 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14763
f0250de6
AD
147642002-03-04 Akim Demaille <akim@epita.fr>
14765
14766 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14767 * src/reduce.c: Remove the `bitset_zero's following the
14768 `bitset_create's, as now it is performed by the latter.
14769
ef017502
AD
147702002-03-04 Akim Demaille <akim@epita.fr>
14771
14772 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14773 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14774 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14775 latest sources from Michael.
14776
76514394
AD
147772002-03-04 Akim Demaille <akim@epita.fr>
14778
14779 * src/output.c (output): Don't free the grammar.
14780 * src/reader.c (grammar_free): New.
14781 * src/main.c (main): Call it and don't free symtab here.
14782
55024580
AD
147832002-03-04 Akim Demaille <akim@epita.fr>
14784
14785 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14786 before returning.
14787 Reported by Benoit Perrot.
14788
f9abaa2c
AD
147892002-03-04 Akim Demaille <akim@epita.fr>
14790
14791 Use bitset operations when possible, not loops over bits.
14792
14793 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14794 bitset_or.
14795 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14796 * src/reduce.c (useless_nonterminals): Formatting changes.
14797 * src/warshall.c (TC): Use bitset_or.
14798
0e721e75
AD
147992002-03-04 Akim Demaille <akim@epita.fr>
14800
14801 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14802 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14803 Ditto.
14804
0fb1ffb1
AD
148052002-03-04 Akim Demaille <akim@epita.fr>
14806
14807 * src/lalr.c (F): Now a bitset*.
14808 Adjust all dependencies.
14809
b86796bf
AD
148102002-03-04 Akim Demaille <akim@epita.fr>
14811
14812 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14813 Adjust all dependencies.
14814
602bbf31
AD
148152002-03-04 Akim Demaille <akim@epita.fr>
14816
14817 * src/L0.c, src/LR0.h (nstates): Be size_t.
14818 Adjust comparisons (signed vs unsigned).
14819 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
14820 bitset*.
14821 Adjust all dependencies.
14822
d8a0245c
AD
148232002-03-04 Akim Demaille <akim@epita.fr>
14824
14825 * src/closure.c (firsts): Now, also a bitset.
14826 Adjust all dependencies.
14827 (varsetsize): Remove, now unused.
14828 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
14829
34ba9743
AD
148302002-03-04 Akim Demaille <akim@epita.fr>
14831
14832 * src/print.c: Convert to use bitset.h, not hand coded iterations
14833 over ints.
14834
ed86e78c
AD
148352002-03-04 Akim Demaille <akim@epita.fr>
14836
14837 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
14838
dfdb1797
AD
148392002-03-04 Akim Demaille <akim@epita.fr>
14840
14841 * src/closure.c (ruleset): Be a bitset.
14842 (rulesetsize): Remove.
14843
7086e707
AD
148442002-03-04 Akim Demaille <akim@epita.fr>
14845
14846 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14847 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
14848 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
14849 * src/closure.c (fderives): Be an array of bitsets.
14850
98254360
RA
148512002-02-28 Robert Anisko <robert@lrde.epita.fr>
14852
14853 * data/bison.c++: Merge the two generated headers. Insert a copyright
14854 notice in each output file.
14855
a75c057f
AD
148562002-02-28 Akim Demaille <akim@epita.fr>
14857
14858 * data/bison.c++: Copy the prologue of bison.simple to fetch
14859 useful M4 definitions, such as b4_header_guard.
14860
06b00abc
AD
148612002-02-25 Akim Demaille <akim@epita.fr>
14862
14863 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
14864 translator friendly scheme for the bgr
14865 copyright notice.
06b00abc 14866
70e7d534
AD
148672002-02-25 Akim Demaille <akim@epita.fr>
14868
14869 * src/output.c (header_output): Remove, now handled completely via
14870 M4.
14871
abe017f6
AD
148722002-02-25 Akim Demaille <akim@epita.fr>
14873
14874 * m4/m4.m4: New, from CVS Autoconf.
14875 * configure.in: Invoke it.
14876 * src/output.c (output_skeleton): Use its result instead of the
14877 hard coded name.
14878
381fb12e
AD
148792002-02-25 Akim Demaille <akim@epita.fr>
14880
14881 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
14882 Fileutils 4.1.5.
14883 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
14884 * src/output.c (output_skeleton): Use mkstemp to create a real
14885 temporary file.
14886 Move the filling of `skeleton' and its muscle to...
14887 (prepare): here.
14888 (output): Move the definition of the prologue muscle to...
14889 (prepare): here.
14890 * src/system.h (DEFAULT_TMPDIR): New.
14891
6f38107f
PE
148922002-02-14 Paul Eggert <eggert@twinsun.com>
14893
14894 Remove the support for C++ namespace cleanliness; it was
14895 causing more problems than it was curing, since it didn't work
14896 properly on some nonstandard C++ compilers. This can wait
14897 for a proper C++ parser.
14898
14899 * NEWS: Document this.
14900 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
14901 of C++, as it's treated like C now.
14902 * src/bison.simple (YYSTD): Remove.
14903 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
14904 Treat C++ just like Standard C instead of trying to support
14905 namespace cleanliness.
14906
80cce3da
AD
149072002-02-14 Akim Demaille <akim@epita.fr>
14908
14909 * tests/regression.at (else): Adjust to Andreas' change.
14910
842e8679
AD
149112002-02-14 Akim Demaille <akim@epita.fr>
14912
14913 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
14914
4bda3f10
AD
149152002-02-13 Andreas Schwab <schwab@suse.de>
14916
14917 * src/output.c (output_rule_data): Don't output NULL, it might
14918 not be defined yet.
14919
4162fa07 149202002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 14921
4162fa07
RA
14922 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
14923 (Copyright notice): Update.
b418ecd8 14924
bd16a5dc
AD
149252002-02-11 Akim Demaille <akim@epita.fr>
14926
14927 * tests/regression.at (%nonassoc and eof): Don't include
14928 nonportable headers.
14929
8d69a1a3
RA
149302002-02-08 Robert Anisko <robert@lrde.epita.fr>
14931
14932 * data/bison.c++: Correct error recovery. Make the user able to
14933 initialize the starting location.
14934
9b2d0677
AD
149352002-02-07 Akim Demaille <akim@epita.fr>
14936
14937 * tests/input.at: New.
14938
69e2658b
RA
149392002-02-07 Robert Anisko <robert@lrde.epita.fr>
14940
14941 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 14942 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
14943 directives around tables only needed for debugging.
14944
4aacc3a7
RA
149452002-02-07 Robert Anisko <robert@lrde.epita.fr>
14946
14947 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
14948 C++ parsers.
14949 (yy::b4_name::parse): Use print_.
14950
762a801e
RA
149512002-02-07 Robert Anisko <robert@lrde.epita.fr>
14952
14953 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
14954
4bb2bc3f
RA
149552002-02-07 Robert Anisko <robert@lrde.epita.fr>
14956
14957 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
14958 C++ parsers.
14959 (yy::b4_name::parse): Build verbose error messages, and use error_.
14960
6b45a3ca
RA
149612002-02-06 Robert Anisko <robert@lrde.epita.fr>
14962
14963 * data/bison.c++: Fix m4 quoting in comments.
14964
50997c6e
RA
149652002-02-06 Robert Anisko <robert@lrde.epita.fr>
14966
14967 * data/bison.c++: Adjust the parser code. Fix some muscles that were
14968 not expanded by m4.
14969
3f3eed27
AD
149702002-02-05 Akim Demaille <akim@epita.fr>
14971
14972 * data/bison.c++: Adjust to the M4 back end.
14973 More is certainly needed.
14974
be2a1a68
AD
149752002-02-05 Akim Demaille <akim@epita.fr>
14976
14977 Give a try to M4 as a back end.
14978
14979 * lib/readpipe.c: New, from wdiff.
14980 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
14981 BISON_HAIRY.
14982 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
14983 specific values. Now it is m4 that performs the lookup.
14984 * src/parse-skel.y: Remove.
14985 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
14986 * src/output.c (actions_output, guards_output)
14987 (token_definitions_output): No longer keeps track of the output
14988 line number, hence remove the second argument.
14989 (guards_output): Check against the guard member of a rule, not the
14990 action member.
14991 Adjust callers.
14992 (output_skeleton): Don't look for the skeleton location, let m4 do
14993 that.
14994 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
14995 file will be used.
14996 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
14997 (prepare): Given that for the time being changesyntax is not
14998 usable in M4, rename the muscles using `-' to `_'.
14999 Define `defines_flag', `output_parser_name' and `output_header_name'.
15000 * src/output.h (actions_output, guards_output)
15001 (token_definitions_output): Adjust prototypes.
15002 * src/scan-skel.l: Instead of scanning the skeletons, it now
15003 processes the output of m4: `__oline__' and `#output'.
15004 * data/bison.simple: Adjust to be used by M4(sugar).
15005 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
15006 to date.
15007 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
15008 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
15009 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
15010 shamelessly stolen from CVS Autoconf.
15011
beda758b
AD
150122002-02-05 Akim Demaille <akim@epita.fr>
15013
15014 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
15015 * configure.in: Check for the declarations of free and malloc.
15016 * src/muscle_tab.c: Adjust.
15017
5ece6d43
AD
150182002-02-05 Akim Demaille <akim@epita.fr>
15019
15020 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
15021 which have no values.
15022
5bb18f9a
AD
150232002-02-05 Akim Demaille <akim@epita.fr>
15024
15025 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
15026 * data/: here.
15027
894dd62e
PE
150282002-01-29 Paul Eggert <eggert@twinsun.com>
15029
15030 * src/bison.simple (YYSIZE_T): Do not define merely because
15031 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
15032 On some platforms, <alloca.h> does not declare YYSTD (size_t).
15033
82841af7
AD
150342002-01-27 Akim Demaille <akim@epita.fr>
15035
15036 Fix `%nonassoc and eof'.
15037
15038 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
15039 which were not properly copied! Replace
15040 memcpy (res->errs, src->errs, src->nerrs);
15041 with
15042 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
15043 !!!
15044 * tests/regression.at (%nonassoc and eof): Adjust to newest
15045 Autotest: `.' is not in the PATH.
15046
318b76e9
AD
150472002-01-27 Akim Demaille <akim@epita.fr>
15048
15049 * tests/sets.at (AT_EXTRACT_SETS): New.
15050 (Nullable): Use it.
15051 (Firsts): New.
15052
30d2f3d5
AD
150532002-01-26 Akim Demaille <akim@epita.fr>
15054
15055 * tests/actions.at, tests/calc.at, tests/headers.at,
15056 * tests/torture.at: Adjust to the newest Autotest which no longer
15057 forces `.' in the PATH.
15058
30f8c395
AD
150592002-01-25 Akim Demaille <akim@epita.fr>
15060
15061 * tests/regression.at (%nonassoc and eof): New.
15062 Suggested by Robert Anisko.
15063
29ae55f1
AD
150642002-01-24 Akim Demaille <akim@epita.fr>
15065
15066 Bison dumps core when trying to complain about broken input files.
15067 Reported by Cris van Pelt.
15068
15069 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
15070 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
15071 into...
15072 (Invalid inputs): Strengthen: exercise parse_percent_token.
15073
2b548aa6
RA
150742002-01-24 Robert Anisko <robert.anisko@epita.fr>
15075
15076 * src/Makefile.am: Add bison.c++.
15077 * src/bison.c++: New skeleton.
15078
bb0146c2
AD
150792002-01-21 Paolo Bonzini <bonzini@gnu.org>
15080
15081 * po/it.po: New.
15082
bec30531
AD
150832002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
15084
15085 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
15086
fc6edc45
MA
150872002-01-20 Marc Autret <marc@gnu.org>
15088
15089 * src/files.c (compute_output_file_names): Fix
15090
5e5d5415
MA
150912002-01-20 Marc Autret <marc@gnu.org>
15092
15093 * tests/output.at: New test.
15094 * src/files.c (compute_base_names): Don't map extensions when
15095 the YACC flag is set, use defaults.
15096 Reported by Evgeny Stambulchik.
15097
44ea3fbd
MA
150982002-01-20 Marc Autret <marc@gnu.org>
15099
ba0fe3c7
PE
15100 * src/system.h: Need to define __attribute__ away for non-GCC
15101 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
15102 Suggested by Albert Chin-A-Young.
15103
338963d1
TVH
151042002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
15105
15106 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
15107 canonical definition.
15108 * src/system.h: Use the canonical definition for PARAMS (avoids
15109 a conflict with the macro from lib/hash.h).
15110
c57b2479
AD
151112002-01-11 Akim Demaille <akim@epita.fr>
15112
15113 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 15114 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 15115
b85810ae
AD
151162002-01-09 Akim Demaille <akim@epita.fr>
15117
15118 * src/files.c, src/files.h (output_infix): New.
15119 (tab_extension): Remove.
15120 (compute_base_names): Compute the former, drop the latter.
15121 * src/output.c (prepare): Insert the muscles `output-infix', and
15122 `output-suffix'.
15123 * src/parse-skel.y (string, string.1): New.
15124 (section.header): Use it.
15125 (section.yacc): Remove.
15126 (prefix): Remove too.
15127 * src/scan-skel.l: Adjust.
15128 * src/bison.simple, src/bison.hairy: Adjust.
15129
cae60122
AD
151302002-01-09 Akim Demaille <akim@epita.fr>
15131
15132 * configure.in (WERROR_CFLAGS): Compute it.
15133 * src/Makefile.am (CFLAGS): Pass it.
15134 * tests/atlocal.in (CFLAGS): Idem.
15135 * src/files.c: Fix a few warnings.
15136 (get_extension_index): Remove, unused.
15137
ae404801
AD
151382002-01-08 Akim Demaille <akim@epita.fr>
15139
15140 * src/getargs.c (AS_FILE_NAME): New.
15141 (getargs): Use it to convert DOSish file names.
15142 * src/files.c (base_name): Rename as full_base_name to avoid
15143 clashes with `base_name ()'.
15144 (filename_split): New.
15145 (compute_base_names): N-th rewrite, using filename_split.
15146
22312b71
AD
151472002-01-08 Akim Demaille <akim@epita.fr>
15148
15149 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
15150 New, stolen from the Fileutils 4.1.
15151 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15152 * configure.in: Check for the presence of memrchr, and of its
15153 prototype.
15154
a67cef01
TVH
151552002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
15156
15157 * lib/hash.h (__P): Added definition for this macro.
15158 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
15159 BUILT_SOURCES, to ensure they are generated first.
15160 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
15161 %error-verbose to allow bootstrapping with bison 1.30x.
15162
2b25d624
AD
151632002-01-06 Akim Demaille <akim@epita.fr>
15164
15165 * src/reader.c (parse_braces): Don't fetch the next char, the
15166 convention is to fetch on entry.
15167 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
15168 'switch' without a following semicolon.
15169 * tests/regression.at (braces parsing): New.
15170
3460813b
AD
151712002-01-06 Akim Demaille <akim@epita.fr>
15172
15173 Bison is dead wrong in its RR conflict reports.
15174
15175 * tests/torture.at (GNU Cim Grammar): New.
15176 * src/conflicts.c (count_rr_conflicts): Fix.
15177
73784c64
AD
151782002-01-06 Akim Demaille <akim@epita.fr>
15179
15180 Creating package.m4 from configure.ac causes too many problems.
15181
15182 * tests/Makefile.am (package.m4): Create it by hand,
15183 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
15184
25d81090
AD
151852002-01-06 Akim Demaille <akim@epita.fr>
15186
15187 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
15188 skeleton.h.
15189
a9b8959e
PE
151902002-01-04 Paul Eggert <eggert@twinsun.com>
15191
15192 * doc/bison.texinfo (Debugging):
15193 Remove YYSTDERR; it's no longer defined or used.
15194 Also, s/cstdio.h/cstdio/.
15195
25d81090
AD
151962002-01-03 Akim Demaille <akim@epita.fr>
15197
15198 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
15199
1109455c
AD
152002002-01-03 Akim Demaille <akim@epita.fr>
15201
15202 * src/parse-skel.y (process_skeleton): Don't bind the parser's
15203 tracing code to --trace, wait for a better --trace option, with
15204 args.
15205
7ea5e977
AD
152062002-01-03 Akim Demaille <akim@epita.fr>
15207
15208 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
15209 The ISO C++ standard is extremely clear about it: stderr is
15210 considered a macro, not a regular symbol (see table 94 `Header
15211 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
15212 Therefore std:: does not apply to it. It still does with fprintf.
15213 Also, s/cstdio.h/cstdio/.
15214
fab5b110
AD
152152002-01-03 Akim Demaille <akim@epita.fr>
15216
15217 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
15218 for non system headers.
15219
aed7fd9b
AD
152202002-01-02 Akim Demaille <akim@epita.fr>
15221
15222 Equip the skeleton chain with location tracking, runtime trace,
15223 pure parser and scanner.
15224
15225 * src/parse-skel.y: Request a pure parser, locations, and prefix
15226 renaming.
15227 (%union): Having several members with the same type does not help
15228 type mismatches, simplify.
15229 (YYPRINT, yyprint): New.
15230 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
15231 (skel_error): this.
15232 Handle locations.
15233 * src/scan-skel.l: Adjust to these changes.
15234 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
15235 (LOCATION_PRINT, skel_control_t): New.
15236
24fad99e
AD
152372001-12-30 Akim Demaille <akim@epita.fr>
15238
15239 * src/parse-skel.y: Get rid of the shift/reduce conflict:
15240 replace `gb' with BLANKS.
15241 * src/scan-skel.l: Adjust.
15242
a4b36db4
AD
152432001-12-30 Akim Demaille <akim@epita.fr>
15244
15245 * src/system.h: We don't need nor want bcopy.
15246 Throw away MS-DOS crap: we don't need getpid.
15247 * configure.in: We don't need strndup. It was even causing
15248 problems: because Flex includes the headers *before* us,
15249 _GNU_SOURCE is not defined by config.h, and therefore strndup was
15250 not visible.
15251 * lib/xstrndup.c: New.
15252 * src/scan-skel.l: Use it.
15253 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
15254 * src/parse-skel.y: Use %directives instead of #defines.
15255
1239777d
AD
152562001-12-30 Akim Demaille <akim@epita.fr>
15257
15258 * src/skeleton.h: New.
15259 * src/output.c (output_parser, output_master_parser): Remove, dead
15260 code.
15261 * src/output.h (get_lines_number, actions_output, guards_output)
15262 (token_definitions_output): Prototype them.
15263 * src/parse-skel.y: Add the license notice.
15264 Include output.h and skeleton.h.
15265 (process_skeleton): Returns void, and takes a single parameter.
15266 * src/scan-skel.l: Add the license notice.
15267 Include skeleton.h.
15268 Don't use %option yylineno: it seems that then Flex imagines
15269 REJECT has been used, and therefore it won't reallocate its
15270 buffers (which makes no other sense to me than a bug). It results
15271 in warnings for `unused: yy_flex_realloc'.
15272
9b3add5b
RA
152732001-12-30 Robert Anisko <robert.anisko@epita.fr>
15274
15275 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15276 (MUSCLE_INSERT_PREFIX): ...to there.
15277 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15278 (MUSCLE_INSERT_PREFIX): Move from here...
15279
15280 * src/bison.hairy: Add a section directive. Put braces around muscle
15281 names. This parser skeleton is still broken, but Bison should not
15282 choke on a bad muscle 'syntax'.
15283 * src/bison.simple: Add a section directive. Put braces around muscle
15284 names.
15285
15286 * src/files.h (strsuffix, stringappend): Add declarations.
15287 (tab_extension): Add declaration.
15288 (short_base_name): Add declaration.
15289
15290 * src/files.c (strsuffix, stringappend): No longer static. These
15291 functions are used in the skeleton parser.
15292 (tab_extension): New.
15293 (compute_base_names): Use the computations done in this function
fab5b110 15294 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
15295 names.
15296 (short_base_name): No longer static.
15297
15298 * src/output.c (output_skeleton): New.
15299 (output): Disable call to output_master_parser, and give a try to
15300 a new skeleton handling system.
15301 (guards_output, actions_output): No longer static.
15302 (token_definitions_output, get_lines_number): No longer static.
15303
15304 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
15305
fab5b110 15306 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
15307 parse-skel.y.
15308
15309 * src/parse-skel.y: New file.
15310 * src/scan-skel.l: New file.
15311
b5b61c61
AD
153122001-12-29 Akim Demaille <akim@epita.fr>
15313
15314 %name-prefix is broken.
15315
15316 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
15317 Adjust all dependencies.
15318 * tests/headers.at (export YYLTYPE): Strengthen this test: use
15319 %name-prefix.
15320
15321 Renaming yylval but not yylloc is not consistent. Now we do.
15322
15323 * src/bison.simple: Prefix yylloc if used.
15324 * doc/bison.texinfo (Decl Summary): Document that.
15325
8c9a50be
AD
153262001-12-29 Akim Demaille <akim@epita.fr>
15327
15328 * doc/bison.texinfo: Promote `%long-directive' over
15329 `%long_directive'.
15330 Remove all references to fixed-output-files, yacc is enough.
15331
d99361e6
AD
153322001-12-29 Akim Demaille <akim@epita.fr>
15333
15334 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
15335 user prologue. These are defaults.
15336 * tests/actions.at (Mid-rule actions): Make sure the user can
15337 define YYDEBUG and YYERROR_VERBOSE.
15338
b9cecb91
AD
153392001-12-29 Akim Demaille <akim@epita.fr>
15340
15341 * src/output.c (header_output): Don't forget to export YYLTYPE and
15342 yylloc.
15343 * tests/headers.at (export YYLTYPE): New, make sure it does.
15344 * tests/regression.at (%union and --defines, Invalid CPP headers):
15345 Move to...
15346 * tests/headers.at: here.
15347
aea13e97
AD
153482001-12-29 Akim Demaille <akim@epita.fr>
15349
15350 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
15351
931394cb
AD
153522001-12-29 Akim Demaille <akim@epita.fr>
15353
15354 * tests/actions.at (Mid-rule actions): Output on a single line
15355 instead of several.
15356
704a47c4
AD
153572001-12-29 Akim Demaille <akim@epita.fr>
15358
15359 * doc/bison.texinfo: Formatting changes.
15360
091e20bb
AD
153612001-12-29 Akim Demaille <akim@epita.fr>
15362
15363 Don't store the token defs in a muscle, just be ready to output it
15364 on command. Now possible via `symbols'. Fixes a memory leak.
15365
15366 * src/output.c (token_definitions_output): New.
15367 (output_parser, header_output): Use it.
15368 * src/reader.c (symbols_save): Remove.
15369
cce71710
AD
153702001-12-29 Akim Demaille <akim@epita.fr>
15371
15372 * src/bison.simple: Do not provide a default for YYSTYPE and
15373 YYLTYPE before the user's prologue. Otherwise it's hardly... a
15374 default.
15375
82c035a8
AD
153762001-12-29 Akim Demaille <akim@epita.fr>
15377
15378 Mid-rule actions are simply... ignored!
15379
15380 * src/reader.c (readgram): Be sure to attach mid-rule actions to
15381 the empty-rule associated to the dummy symbol, not to the host
15382 rule.
15383 * tests/actions.at (Mid-rule actions): New.
15384
8419d367
AD
153852001-12-29 Akim Demaille <akim@epita.fr>
15386
15387 Memory leak.
15388
15389 * src/reader.c (reader): Free grammar.
15390
375d5806
AD
153912001-12-29 Akim Demaille <akim@epita.fr>
15392
15393 Memory leak.
15394
15395 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
15396 since it allocates it for each state, although only one is needed.
15397 (allocate_storage): Do it here.
15398
f51cb8ff
AD
153992001-12-29 Akim Demaille <akim@epita.fr>
15400
15401 * src/options.h, src/options.c (create_long_option_table): Rename
15402 as...
15403 (long_option_table_new): this, with a clearer prototype.
15404 (percent_table): Remove, unused,
15405 * src/getargs.c (getargs): Adjust.
15406
29e88316
AD
154072001-12-29 Akim Demaille <akim@epita.fr>
15408
15409 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
15410 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
15411 as states.
15412
b9f71f19
AD
154132001-12-29 Akim Demaille <akim@epita.fr>
15414
15415 * src/lalr.c (build_relations): Rename `states' as `states1'.
15416 Sorry, I don't understand exactly what it is, no better name...
15417
1a2b5d37
AD
154182001-12-29 Akim Demaille <akim@epita.fr>
15419
15420 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
15421 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
15422 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
15423 as rules.
15424
1cca533e
AD
154252001-12-29 Akim Demaille <akim@epita.fr>
15426
15427 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
15428 ago.
15429
c03ae966
AD
154302001-12-29 Akim Demaille <akim@epita.fr>
15431
15432 * src/reader.c, src/reader.h (user_toknums): Remove.
15433 Adjust all users to use symbols[i]->user_token_number.
15434
5a670b1e
AD
154352001-12-29 Akim Demaille <akim@epita.fr>
15436
15437 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
15438 Adjust all users to use symbols[i]->prec or ->assoc.
15439
ad949da9
AD
154402001-12-29 Akim Demaille <akim@epita.fr>
15441
15442 * src/reader.c, src/reader.h (tags): Remove.
15443 Adjust all users to use symbols[i]->tag.
15444
0e78e603
AD
154452001-12-29 Akim Demaille <akim@epita.fr>
15446
15447 * src/gram.h, src/gram.c (symbols): New, similar to state_table
15448 and rule_table.
15449 * src/reader.c (packsymbols): Fill this table.
15450 Drop sprec.
15451 * src/conflicts.c (resolve_sr_conflict): Adjust.
15452 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
15453 single table.
15454 Use symbols[i]->tag instead of tags[i].
15455
213e640e
AD
154562001-12-29 Akim Demaille <akim@epita.fr>
15457
15458 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
15459 In addition, put a comment in there, to replace...
15460 * tests/regression.at (%union and C comments): Remove.
15461
e7b8bef1
AD
154622001-12-29 Akim Demaille <akim@epita.fr>
15463
15464 * tests/regression.at (Web2c Actions): Blindly move the actual
15465 output as expected output. The contents *seem* right to me, but I
15466 can't pretend reading perfectly parser tables... Nonetheless, all
15467 the other tests pass correctly, the table look OK, even though the
15468 presence of `$axiom' is to be noted: AFAICS it is useless (but
15469 harmless).
15470
b68e7744
AD
154712001-12-29 Akim Demaille <akim@epita.fr>
15472
15473 * src/reader.c (readgram): Don't add the rule 0 if there were no
15474 rules read. In other words, add it _after_ having performed
15475 grammar sanity checks.
15476 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
15477
78d5bae9
AD
154782001-12-29 Akim Demaille <akim@epita.fr>
15479
15480 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
15481 visible, and some states have now a different number.
15482
ff442794
AD
154832001-12-29 Akim Demaille <akim@epita.fr>
15484
15485 * src/reader.c (readgram): Bind the initial rule's lineno to that
15486 of the first rule.
15487 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
15488 (Solved SR Conflicts): Adjust rule 0's line number.
15489
610ab194
AD
154902001-12-29 Akim Demaille <akim@epita.fr>
15491
15492 Fix the `GAWK Grammar' failure.
15493
15494 * src/LR0.c (final_state): Initialize to -1 so that we do compute
15495 the reductions of the first state which was mistakenly confused
15496 with the final state because precisely final_state was initialized
15497 to 0.
15498 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
15499 now noticed by Bison.
15500 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
15501 have a reduction on $default.
15502
29d29c8f
AD
155032001-12-29 Akim Demaille <akim@epita.fr>
15504
15505 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
15506 rule line numbers.
15507 * src/closure.c (print_closure): Likewise.
15508 * src/derives.c (print_derives): Likewise.
15509 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
15510 now.
15511
7c6b64d0
AD
155122001-12-29 Akim Demaille <akim@epita.fr>
15513
15514 * src/lalr.c (lookaheads_print): New.
15515 (lalr): Call it when --trace-flag.
15516 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
15517 are dumped.
15518
3d4daee3
AD
155192001-12-29 Akim Demaille <akim@epita.fr>
15520
15521 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
15522 when walking through ritem, even via rule->rhs.
15523 * src/reduce.c (dump_grammar, useful_production, reduce_output)
15524 (useful_production, useless_nonterminals): Likewise.
15525 (reduce_grammar_tables): Likewise, plus update nritems.
15526 * src/nullable.c (set_nullable): Likewise.
15527 * src/lalr.c (build_relations): Likewise.
15528 * tests/sets.at (Nullable): Adjust.
15529 Fortunately, now, the $axiom is no longer nullable.
15530
9e7f6bbd
AD
155312001-12-29 Akim Demaille <akim@epita.fr>
15532
15533 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
15534 the 0-sentinel.
15535 * src/gram.c (ritem_longest_rhs): Likewise.
15536 * src/reduce.c (nonterminals_reduce): Likewise.
15537 * src/print_graph.c (print_graph): Likewise.
15538 * src/output.c (output_rule_data): Likewise.
15539 * src/nullable.c (set_nullable): Likewise.
15540
255ef638
AD
155412001-12-29 Akim Demaille <akim@epita.fr>
15542
15543 * src/output.c: Comment changes.
15544
0d8a7363
AD
155452001-12-27 Paul Eggert <eggert@twinsun.com>
15546
15547 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
15548 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
15549 Sparc, as they were causing more porting problems than the
15550 (minor) performance improvement was worth.
15551
15552 Also, catch up with 1.31's YYSTD.
15553
3db472b9
AD
155542001-12-27 Akim Demaille <akim@epita.fr>
15555
15556 * src/output.c (output_gram): Rely on nritems, not the
15557 0-sentinel. See below.
15558 Use -1 as separator, not 0.
15559 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
15560 Rely on -1 as separator in yyrhs, instead of 0.
15561 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
15562 twice `Now at end of input', therefore there are two lines less to
15563 expect.
15564
b365aa05
AD
155652001-12-27 Akim Demaille <akim@epita.fr>
15566
15567 * tests/regression.at (Unresolved SR Conflicts):
15568 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
15569 below.
15570
30171f79
AD
155712001-12-27 Akim Demaille <akim@epita.fr>
15572
15573 * src/LR0.c (new_state): Recognize the final state by the fact it
15574 is reached by eoftoken.
15575 (insert_start_shifting_state, insert_eof_shifting_state)
15576 (insert_accepting_state, augment_automaton): Remove, since now
15577 these states are automatically computed from the initial state.
15578 (generate_states): Adjust.
15579 * src/print.c: When reporting a rule number to the user, substract
15580 1, so that the axiom rule is rule 0, and the first user rule is 1.
15581 * src/reduce.c: Likewise.
15582 * src/print_graph.c (print_core): For the time being, just as for
15583 the report, depend upon --trace-flags to dump the full set of
15584 items.
15585 * src/reader.c (readgram): Once the grammar read, insert the rule
15586 0: `$axiom: START-SYMBOL $'.
15587 * tests/set.at: Adjust: rule 0 is now displayed, and since the
15588 number of the states has changed (the final state is no longer
15589 necessarily the last), catch up.
15590
75142d45
AD
155912001-12-27 Akim Demaille <akim@epita.fr>
15592
15593 Try to make the use of the eoftoken valid. Given that its value
15594 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
15595 is used instead of > 0 where appropriate, (ii), depend upon nritems
15596 instead of the 0-sentinel.
15597
15598 * src/gram.h, src/gram.c (nritems): New.
15599 Expected to be duplication of nitems, but for the time being...
15600 * src/reader.c (packgram): Assert nritems and nitems are equal.
15601 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
15602 * src/closure.c (print_closure, print_fderives): Likewise.
15603 * src/gram.c (ritem_print): Likewise.
15604 * src/print.c (print_core, print_grammar): Likewise.
15605 * src/print_graph.c: Likewise.
15606
b7c49edf
AD
156072001-12-27 Akim Demaille <akim@epita.fr>
15608
15609 * src/main.c (main): If there are complains after grammar
15610 reductions, then output the report anyway if requested, then die.
15611 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
15612 * src/reader.c (eoftoken): New.
15613 (parse_token_decl): If the token being defined has value `0', it
15614 is the eoftoken.
15615 (packsymbols): No longer hack `tags' to insert `$' by hand.
15616 Be sure to preserve the value of the eoftoken.
15617 (reader): Make sure eoftoken is defined.
15618 Initialize nsyms to 0: now eoftoken is created just like the others.
15619 * src/print.c (print_grammar): Don't special case the eof token.
15620 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
15621 lie anyway, albeit pleasant.
15622 * tests/calc.at: Exercise error messages with eoftoken.
15623 Change the grammar so that empty input is invalid.
15624 Adjust expectations.
15625 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
15626
ec2da99f
AD
156272001-12-27 Akim Demaille <akim@epita.fr>
15628
15629 * configure.in: Check the protos of strchr ans strspn.
15630 Replace strchr if needed.
15631 * src/system.h: Provide the protos of strchr, strspn and memchr if
15632 missing.
15633 * lib/strchr.c: New.
15634 * src/reader.c (symbols_save): Use strchr.
15635
8adfa272
AD
156362001-12-27 Akim Demaille <akim@epita.fr>
15637
15638 * src/print.c, src/print_graph.c (escape): New.
15639 Use it to quote the TAGS outputs.
15640 * src/print_graph.c (print_state): Now errors are in red, and
15641 reductions in green.
15642 Prefer high to wide: output the state number on a line of its own.
15643
80dac38c
AD
156442001-12-27 Akim Demaille <akim@epita.fr>
15645
15646 * src/state.h, src/state.c (reductions_new): New.
15647 * src/LR0.c (set_state_table): Let all the states have a
15648 `reductions', even if reduced to 0.
15649 (save_reductions): Adjust.
15650 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15651 * src/print.c (print_reductions, print_actions): Adjust.
15652 * src/output.c (action_row): Adjust.
15653
2cec70b9
AD
156542001-12-27 Akim Demaille <akim@epita.fr>
15655
15656 * src/state.h, src/state.c (errs_new, errs_dup): New.
15657 * src/LR0.c (set_state_table): Let all the states have an errs,
15658 even if reduced to 0.
15659 * src/print.c (print_errs, print_reductions): Adjust.
15660 * src/output.c (output_actions, action_row): Adjust.
15661 * src/conflicts.c (resolve_sr_conflict): Adjust.
15662
13ca549a
AD
156632001-12-27 Akim Demaille <akim@epita.fr>
15664
15665 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15666
5092aba5
AD
156672001-12-27 Akim Demaille <akim@epita.fr>
15668
15669 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15670 * src/print.c: here.
15671 (lookaheadset, shiftset): New, used as additional storage by
15672 print_reductions.
15673 (print_results): Adjust.
15674 (print_shifts, print_gotos, print_errs): New, extracted from...
15675 (print_actions): here.
15676 * src/print_graph.c (print_actions): Remove dead code.
15677
11e2beca
AD
156782001-12-27 Akim Demaille <akim@epita.fr>
15679
15680 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15681 `$n' and `@n'.
15682
dac3c910
AD
156832001-12-27 Akim Demaille <akim@epita.fr>
15684
15685 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15686 (build_relations): Adjust.
15687
d0b0fefa
AD
156882001-12-27 Akim Demaille <akim@epita.fr>
15689
15690 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15691 duplication.
15692
adc8c848
AD
156932001-12-27 Akim Demaille <akim@epita.fr>
15694
15695 * src/reader.c (packgram): Catch nitems overflows.
15696
14d293ac
AD
156972001-12-27 Akim Demaille <akim@epita.fr>
15698
15699 * src/files.c, src/files.h (guard_obstack): Remove.
15700 * src/output.c (output): Adjust.
15701 * src/reader.c (parse_braces): New, factoring...
15702 (copy_action, copy_guard): these two which are renamed as...
15703 (parse_action, parse_guard): these.
15704 As a voluntary consequence, using braces around guards is now
15705 mandatory.
15706
f499b062
AD
157072001-12-27 Akim Demaille <akim@epita.fr>
15708
15709 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15710 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15711 members.
15712 (symbol_list_new): Adjust.
15713 (copy_action): action_line is the first line, not the last.
15714 (copy_guard): Just as for actions, store the `action' only, not
15715 the switch/case/break flesh.
15716 Don't parse the user action that might follow the guard, let...
15717 (readgram): do it, i.e., now, there can be an action after a
15718 guard.
15719 In other words the guard is just explicitly optional.
15720 (packgram): Adjust.
15721 * src/output.c (guards_output): New.
15722 (output_parser): Call it when needed.
15723 (output): Also free the guard and attrs obstacks.
15724 * src/files.c, src/files.h (obstack_save): Remove.
15725 (output_files): Remove.
15726 As a result, if one needs the former `.act' file, using an
15727 appropriate skeleton which requires actions and guards is now
15728 required.
15729 * src/main.c (main): Adjust.
15730 * tests/semantic.at: New.
15731 * tests/regression.at: Use `input.y' as input file name.
15732 Avoid 8+3 problems by requiring input.c when the test needs the
15733 parser.
15734
d945f5cd
AD
157352001-12-27 Akim Demaille <akim@epita.fr>
15736
15737 * src/reader.c (symbol_list_new): Be sure to initialize all the
15738 fields.
15739
d200e455
AD
157402001-12-27 Akim Demaille <akim@epita.fr>
15741
15742 All the hacks using a final pseudo state are now useless.
15743
15744 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15745 * src/lalr.c (nLA): New.
15746 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15747 instead of lookaheadsp from the pseudo state (nstate + 1).
15748
f9507c28
AD
157492001-12-27 Akim Demaille <akim@epita.fr>
15750
15751 * src/output.c (action_row, token_actions): Use a state_t instead
15752 of a integer, and nlookaheads instead of the following state's
15753 lookaheadsp.
15754
065fbd27
AD
157552001-12-27 Akim Demaille <akim@epita.fr>
15756
15757 * src/conflicts.c (log_resolution, flush_shift)
15758 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15759 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15760 (conflicts_print, print_reductions): Use a state_t instead of an
15761 integer when referring to a state.
15762 As much as possible, depend upon nlookaheads, instead of the
15763 `lookaheadsp' member of the following state (since lookaheads of
15764 successive states are successive, the difference between state n + 1
15765 and n served as the number of lookaheads for state n).
15766 * src/lalr.c (add_lookback_edge): Likewise.
15767 * src/print.c (print_core, print_actions, print_state)
15768 (print_results): Likewise.
15769 * src/print_graph.c (print_core, print_actions, print_state)
15770 (print_graph): Likewise.
15771 * src/conflicts.h: Adjust.
15772
1b177bd7
AD
157732001-12-27 Akim Demaille <akim@epita.fr>
15774
15775 * src/bison.hairy: Formatting/comment changes.
15776 ANSIfy.
15777 Remove `register' indications.
15778 Add plenty of `static'.
15779
7742ddeb
AD
157802001-12-27 Akim Demaille <akim@epita.fr>
15781
15782 * src/output.c (prepare): Drop the muscle `ntbase' which
15783 duplicates ntokens.
15784 * src/bison.simple: Formatting/comment changes.
15785 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15786 is an undocumented synonym.
15787
1fa14068
AD
157882001-12-22 Akim Demaille <akim@epita.fr>
15789
15790 * src/output.c (output_table_data): Change the prototype to use
15791 `int' for array ranges: some invocations do pass an int, not a
15792 short.
15793 Reported by Wayne Green.
15794
b9752825
AD
157952001-12-22 Akim Demaille <akim@epita.fr>
15796
15797 Some actions of web2c.y are improperly triggered.
15798 Reported by Mike Castle.
15799
15800 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15801 * tests/regression.at (Web2c): Rename as...
15802 (Web2c Report): this.
15803 (Web2c Actions): New.
15804
776209d6
AD
158052001-12-22 Akim Demaille <akim@epita.fr>
15806
15807 Reductions in web2c.y are improperly reported.
15808 Reported by Mike Castle.
15809
15810 * src/conflicts.c (print_reductions): Fix.
15811 * tests/regression.at (Web2c): New.
15812
275fc3ad
AD
158132001-12-18 Akim Demaille <akim@epita.fr>
15814
15815 Some host fail on `assert (!"foo")', which expands to
15816 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
15817 Reported by Nelson Beebee.
15818
15819 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
15820 `#define it_succeeded 0' and `assert (it_succeeded)'.
15821
897668ee
MA
158222001-12-17 Marc Autret <autret_m@epita.fr>
15823
15824 * src/bison.simple: Don't hard code the skeleton line and filename.
15825 * src/output.c (output_parser): Rename 'line' as 'output_line'.
15826 New line counter 'skeleton_line' (skeleton-line muscle).
15827
ab3399e0
PE
158282001-12-17 Paul Eggert <eggert@twinsun.com>
15829
15830 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
15831 YYDEBUG must be defined to a nonzero value.
15832
15833 * src/bison.simple (yytname): Do not assume that the user defines
15834 YYDEBUG to a properly parenthesized expression.
15835
3877f72b
AD
158362001-12-17 Akim Demaille <akim@epita.fr>
15837
15838 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
15839 nlookaheads is a new member.
15840 Adjust all users.
15841 * src/lalr.h (nlookaheads): Remove this orphan declaration.
15842 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
15843 state.
776209d6 15844
331dbc1b
AD
158452001-12-17 Akim Demaille <akim@epita.fr>
15846
15847 * src/files.h, src/files.c (open_files, close_files): Remove.
15848 * src/main.c (main): Don't open/close files, nor invoke lex_free,
15849 let...
15850 * src/reader.c (reader): Do it.
776209d6 15851
be750e4c
AD
158522001-12-17 Akim Demaille <akim@epita.fr>
15853
15854 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 15855
709ae8c6
AD
158562001-12-17 Akim Demaille <akim@epita.fr>
15857
15858 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
15859 (flush_reduce): New.
15860 (resolve_sr_conflict): Adjust.
776209d6 15861
f87685c3
AD
158622001-12-17 Akim Demaille <akim@epita.fr>
15863
15864 * src/output.c (output_obstack): Be static and rename as...
15865 (format_obstack): this, to avoid any confusion with files.c's
15866 output_obstack.
15867 * src/reader.h (muscle_obstack): Move to...
15868 * src/output.h: here, since it's defined in output.c.
15869
837491d8
AD
158702001-12-17 Akim Demaille <akim@epita.fr>
15871
15872 * src/output.c (action_row, save_column, default_goto)
15873 (sort_actions, matching_state, pack_vector): Better variable
15874 locality.
15875
796d61fb
AD
158762001-12-17 Akim Demaille <akim@epita.fr>
15877
15878 * src/output.c: Various formatting changes.
776209d6 15879
64d15509
AD
158802001-12-17 Akim Demaille <akim@epita.fr>
15881
15882 * src/files.c (output_files): Free the output_obstack.
15883 * src/main.c (main): Call print and print_graph conditionally.
15884 * src/print.c (print): Work unconditionally.
15885 * src/print_graph.c (print_graph): Work unconditionally.
15886 * src/conflicts.c (log_resolution): Output only if verbose_flag.
15887
fbc8ecb7
MA
158882001-12-16 Marc Autret <autret_m@epita.fr>
15889
15890 * src/output.c (actions_output): Fix. When we use %no-lines,
15891 there is one less line per action.
15892
f0440388
MA
158932001-12-16 Marc Autret <autret_m@epita.fr>
15894
15895 * src/bison.simple: Remove a useless #line directive.
15896 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
15897 * src/output.c (get_lines_number): New.
776209d6 15898 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
15899 output muscles.
15900 Fix line numbering.
15901 (actions_output): Computes the number of lines taken by actions.
15902 (output_master_parser): Insert new skeleton which is the name of
15903 the output parser file name.
15904
a79986b8
MA
159052001-12-15 Marc Autret <autret_m@epita.fr>
15906
15907 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
15908
4ec8e00f
MA
159092001-12-15 Marc Autret <autret_m@epita.fr>
15910
15911 * src/output.c (output_gram): Keep track of the hairy one.
15912
1a4648ff
AD
159132001-12-15 Akim Demaille <akim@epita.fr>
15914
15915 Make `make distcheck' work.
15916
15917 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
15918 system.h which uses libgettext.h.
15919
9c2c67e6
AD
159202001-12-15 Akim Demaille <akim@epita.fr>
15921
15922 * src/nullable.c (set_nullable): Useless rules must be skipped,
15923 otherwise, since we range over their symbols, we might look at a
15924 nonterminal which no longer ``exists'', i.e., it is not counted in
15925 `nvars', hence we overflow our arrays.
15926
93ede233
AD
159272001-12-15 Akim Demaille <akim@epita.fr>
15928
15929 The header can also be produced directly, without any obstack!
15930 Yahoo!
15931
15932 * src/files.c, src/files.h (defines_obstack): Remove.
15933 (compute_header_macro): Global.
15934 (defines_obstack_save): Remove.
15935 * src/reader.c (parse_union_decl): No longer output to
15936 defines_obstack: its content can be found in the `stype' muscle
15937 anyway.
15938 (output_token_translations): Merge into...
15939 (symbols_output): this.
15940 Rename as...
15941 (symbols_save): this.
15942 (reader): Adjust.
15943 * src/output.c (header_output): New.
15944 (output): Call it.
15945
2666f928
AD
159462001-12-15 Akim Demaille <akim@epita.fr>
15947
15948 * src/reader.c (parse_union_decl): Instead of handling two obstack
15949 simultaneously, use one to define the `stype' muscle, and use the
15950 value of the latter to fill defines_obstack.
15951 (copy_comment): Remove.
15952 (copy_comment2): Work for a single obstack.
15953 Rename as...
15954 (copy_comment): this.
15955
428046f8
AD
159562001-12-15 Akim Demaille <akim@epita.fr>
15957
15958 * src/lex.c, src/lex.h (xgetc): No longer static.
15959 * src/reader.c (parse_union_decl): Revamp.
15960
ea52d706
AD
159612001-12-15 Akim Demaille <akim@epita.fr>
15962
15963 Still making progress in separating Bison into (i) input, (ii)
15964 process, (iii) output: now we can directly output the parser file
15965 without using table_obstack at all.
15966
15967 * src/files.c, src/files.h (table_obstack): Bye bye.
15968 (parser_file_name): New.
15969 * src/files.c (compute_output_file_names): Compute it.
15970 * src/output.c (actions_output, output_parser)
15971 (output_master_parser): To a file instead of an obstack.
15972
3f96f4dc
AD
159732001-12-15 Akim Demaille <akim@epita.fr>
15974
15975 Attach actions to rules, instead of pre-outputting them to
15976 actions_obstack.
15977
15978 * src/gram.h (rule_t): action and action_line are new members.
15979 * src/reader.c (symbol_list): Likewise.
15980 (copy_action): Save the actions within the rule.
15981 (packgram): Save them in rule_table.
15982 * src/output.c (actions_output): New.
15983 (output_parser): Use it on `%%actions'.
15984 (output_rule_data): Don't free rule_table.
15985 (output): Do it.
15986 (prepare): Don't save the `action' muscle.
15987 * src/bison.simple: s/%%action/%%actions/.
15988
51576fb3
AD
159892001-12-15 Akim Demaille <akim@epita.fr>
15990
15991 * src/reader.c (copy_action): When --yacc, don't append a `;'
15992 to the user action: let it fail if lacking.
dee049eb 15993 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 15994
2648a72d
AD
159952001-12-14 Akim Demaille <akim@epita.fr>
15996
15997 * src/lex.c (literalchar): Simply return the char you decoded, non
15998 longer mess around with obstacks and int pointers.
15999 Adjust all callers.
16000
92790e5b
AD
160012001-12-14 Akim Demaille <akim@epita.fr>
16002
16003 * src/lex.c (literalchar): Don't escape the special characters,
16004 just decode them, and keep them as char (before, eol was output as
16005 the 2 char string `\n' etc.).
16006 * src/output.c (output_rule_data): Use quotearg to output the
16007 token strings.
16008
927c1557
PE
160092001-12-13 Paul Eggert <eggert@twinsun.com>
16010
16011 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
16012 Do not infringe on the global user namespace when using C++.
16013 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
16014 All uses of `fprintf' and `stderr' changed.
16015
16016 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
16017
ed8e1f68
AD
160182001-12-13 Akim Demaille <akim@epita.fr>
16019
16020 The computation of nullable is broken: it doesn't handle empty
16021 RHS's properly.
16022
16023 * tests/torture.at (GNU AWK Grammar): New.
16024 * tests/sets.at (Nullable): New.
16025 * src/nullable.c (set_nullable): Instead of blindly looping over
16026 `ritems', loop over the rules, and then over their rhs's.
16027
16028 Work around Autotest bugs.
16029
16030 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
16031 frame, because Autotest understand lines starting with a `+' as
16032 traces from the shell. Then, they are not processed properly.
16033 Admittedly an Autotest bug, but we don't have time to wait for
16034 Autotest to catch up.
16035 * tests/regression.at (Broken Closure): Adjust to the new table
16036 frames.
16037 Move to...
16038 * tests/sets.at: here.
16039
cb581495
AD
160402001-12-13 Akim Demaille <akim@epita.fr>
16041
16042 * src/closure.c (closure): Use nrules instead of playing tricks
16043 with BITS_PER_WORD.
16044
2e729273
AD
160452001-12-13 Akim Demaille <akim@epita.fr>
16046
16047 * src/print.c (print_actions): Output the handling of `$' as the
16048 traces do: shifting the token EOF. Before EOF was treated as a
16049 nonterminal.
16050 * tests/regression.at: Adjust some tests.
16051 * src/print_graph.c (print_core): Complete the set of items via
16052 closure. The next-to-final and final states are still unsatisfying,
16053 but that's to be addressed elsewhere.
16054 No longer output the rule numbers, but do output the state number.
16055 A single loop for the shifts + gotos is enough, but picked a
16056 distinct color for each.
16057 (print_graph): Initialize and finalize closure.
16058
107f7dfb
AD
160592001-12-13 Akim Demaille <akim@epita.fr>
16060
16061 * src/reader.c (readgram): Remove dead code, an strip useless
16062 braces.
16063 (get_type): Remove, unused.
16064
9b53a24f
AD
160652001-12-12 Akim Demaille <akim@epita.fr>
16066
16067 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
16068 on that of lib/error.c.
16069
dbfb6dcd
AD
160702001-12-12 Akim Demaille <akim@epita.fr>
16071
16072 Some hosts don't like `/' in includes.
16073
16074 * src/system.h: Include libgettext.h without qualifying the path.
16075 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
16076 $(top_srcdir).
16077
c25fb648
MA
160782001-12-11 Marc Autret <autret_m@epita.fr>
16079
16080 * src/output.c (output_parser): Remove useless muscle.
16081
710ddc4f
MA
160822001-12-11 Marc Autret <autret_m@epita.fr>
16083
16084 * src/bison.simple: Remove #line just before %%epilogue. It
16085 is now handled in ...
16086 * src/reader.c (read_additionnal_code): Add the output of a
16087 #line for the epilogue.
16088
e83d80b8
MA
160892001-12-10 Marc Autret <autret_m@epita.fr>
16090
927c1557 16091 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
16092 replace precedent remove.
16093 * src/bison.simple: Remove #line before %%prologue because
16094 %%input-line is wrong at this time.
16095
971d5158
MA
160962001-12-10 Marc Autret <autret_m@epita.fr>
16097
16098 * src/reader.c (symbols_output): Clean up.
927c1557 16099 * src/output.c (output_gram, output): Clean up.
971d5158 16100
5edafffd
AD
161012001-12-10 Akim Demaille <akim@epita.fr>
16102
16103 * src/lalr.c (initialize_lookaheads): New. Extracted from...
16104 * src/LR0.c (set_state_table): here.
16105 * src/lalr.c (lalr): Call it.
16106
0279f8e9
AD
161072001-12-10 Akim Demaille <akim@epita.fr>
16108
16109 * src/state.h (shifts): Remove the `number' member: shifts are
16110 attached to state, hence no longer need to be labelled with a
16111 state number.
16112
190c4f5f
AD
161132001-12-10 Akim Demaille <akim@epita.fr>
16114
16115 Now that states have a complete set of members, the linked list of
16116 shifts is useless: just fill directly the state's shifts member.
16117
16118 * src/state.h (shifts): Remove the `next' member.
16119 * src/LR0.c (first_state, last_state): Remove.
16120 Adjust the callers.
16121 (augment_automaton): Don't look for the shifts that must be added
16122 a shift on EOF: it is those of the state we looked for! But now,
16123 since shifts are attached, it is no longer needed to looking
16124 merely by its id: its number.
16125
2a73b93d
AD
161262001-12-10 Akim Demaille <akim@epita.fr>
16127
16128 * src/LR0.c (augment_automaton): Better variable locality.
16129 Remove an impossible branch: if there is a state corresponding to
16130 the start symbol being shifted, then there is shift for the start
16131 symbol from the initial state.
16132
74392f6a
AD
161332001-12-10 Akim Demaille <akim@epita.fr>
16134
16135 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
16136 only when appropriate: when insert_start_shifting_state' is not
16137 invoked.
16138 * tests/regression.at (Rule Line Numbers): Adjust.
16139
37c82725
AD
161402001-12-10 Akim Demaille <akim@epita.fr>
16141
16142 * src/LR0.c (augment_automaton): Now that all states have shifts,
16143 merge the two cases addition shifts to the initial state.
16144
6a164e0c
AD
161452001-12-10 Akim Demaille <akim@epita.fr>
16146
16147 * src/lalr.c (set_state_table): Move to...
16148 * src/LR0.c: here.
16149 * src/lalr.c (lalr): Don't call it...
16150 * src/LR0.c (generate_states): do it.
16151 * src/LR0.h (first_state): Remove, only the table is used.
16152
7215de24
AD
161532001-12-10 Akim Demaille <akim@epita.fr>
16154
16155 * src/LR0.h (first_shift, first_reduction): Remove.
16156 * src/lalr.c: Don't use first_shift: find shifts through the
16157 states.
16158
80e25d4d
AD
161592001-12-10 Akim Demaille <akim@epita.fr>
16160
16161 * src/LR0.c: Attach shifts to states as soon as they are
16162 computed.
16163 * src/lalr.c (set_state_table): Instead of assigning shifts to
16164 state, just assert that the mapping was properly done.
16165
0ab3728b
AD
161662001-12-10 Akim Demaille <akim@epita.fr>
16167
16168 * src/LR0.c (insert_start_shift): Rename as...
16169 (insert_start_shifting_state): this.
16170 (insert_eof_shifting_state, insert_accepting_state): New.
16171 (augment_automaton): Adjust.
16172 Better locality of the variables.
16173 When looking if the start_symbol is shifted from the initial
16174 state, using `while (... symbol != start_symbol ...)' sounds
16175 better than `while (... symbol < start_symbol ...)': If fail
16176 to see how the order between symbols could be relevant!
16177
78af9bbc
AD
161782001-12-10 Akim Demaille <akim@epita.fr>
16179
16180 * src/getargs.h: Don't declare `spec_name_prefix' and
16181 `spec_file_prefix', declared by src/files.h.
16182 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
16183 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
16184 * src/output.c (prepare): Adjust.
16185 * src/reader.c (symbols_output): Likewise.
16186 * src/vmsgetargs.c: Vaguely adjust, but who cares?
16187
bdef2a41
AD
161882001-12-10 Akim Demaille <akim@epita.fr>
16189
16190 * src/muscle_tab.c (muscle_init): NULL is a better default than
16191 `"0"'.
16192
3735969c
AD
161932001-12-10 Akim Demaille <akim@epita.fr>
16194
16195 * src/reader.c (reader): Calling symbols_output once is enough.
16196
49701457
AD
161972001-12-10 Akim Demaille <akim@epita.fr>
16198
16199 Now that states have a complete set of members, the linked list of
16200 reductions is useless: just fill directly the state's reductions
16201 member.
16202
16203 * src/state.h (struct reductions): Remove member `number' and
16204 `next'.
16205 * src/LR0.c (first_reduction, last_reduction): Remove.
16206 (save_reductions): Don't link the new reductions, store them in
16207 this_state.
16208 * src/lalr.c (set_state_table): No need to attach reductions to
16209 states, it's already done.
16210 * src/output.c (output_actions): No longer free the shifts, then
16211 the reductions, then the states: free all the states and their
16212 members.
16213
0edad749
AD
162142001-12-10 Akim Demaille <akim@epita.fr>
16215
16216 * src/options.c (OPTN, DRTV, BOTH): New.
16217 (option_table): Use them.
16218
0edad749
AD
16219 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
16220 the job of system.h.
16221 * src/options.c: Don't include stdio.h and xalloc.h for the same
16222 reasons.
16223
5449dd0f
AD
162242001-12-10 Akim Demaille <akim@epita.fr>
16225
16226 * src/output.c (output, prepare): Make sure the values of the
16227 muscles `action' and `prologue' are 0-terminated.
16228
a870c567
AD
162292001-12-10 Akim Demaille <akim@epita.fr>
16230
16231 Clean up GCC warnings.
16232
16233 * src/reader.c (copy_action): `buf' is not used.
16234 (parse_skel_decl): Be static.
16235 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
16236 * src/options.h (create_long_option_table): Have a real prototype.
16237 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
16238 (hash_delete_at): Return const void *.
16239 Adjust casts to preserve the const.
16240
80df8768
AD
162412001-12-10 Akim Demaille <akim@epita.fr>
16242
16243 * configure.in: Require 2.52g.
16244 M4 is not needed, but AUTOM4TE is.
16245 * m4/m4.m4: Remove.
16246 * tests/Makefile.am: Adjust.
16247
f693ad14
AD
162482001-12-10 Akim Demaille <akim@epita.fr>
16249
16250 One structure for states is enough, even though theoretically
16251 there are LR(0) states and LALR(1) states.
16252
16253 * src/lalr.h (state_t): Remove.
16254 (state_table): Be state_t **, not state_t *.
16255 * src/state.h (core, CORE_ALLOC): Rename as...
16256 (state_t, STATE_ALLOC): this.
16257 Add the LALR(1) members: shifts, reductions, errs.
16258 * src/LR0.c (state_table): Rename as...
16259 (state_hash): this, to avoid name clashes with the global
16260 `state_table'.
16261 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
16262 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
16263
74ffbcb6
AD
162642001-12-10 Akim Demaille <akim@epita.fr>
16265
16266 Bison dumps core on bash.y.
16267 Reported by Pascal Bart.
16268
16269 * src/warshall.c (bitmatrix_print): New.
16270 (TC): Use it.
ba0fe3c7 16271 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
16272 j must be the outer loop.
16273 * tests/regression.at (Broken Closure): New.
16274
07708e19
AD
162752001-12-05 Akim Demaille <akim@epita.fr>
16276
16277 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
16278 its argument.
ba1ecc07 16279 Reported by Peter Hamorsky.
07708e19 16280
92b16366
AD
162812001-12-05 Akim Demaille <akim@epita.fr>
16282
16283 * src/conflicts.c (err_table): Remove.
16284 (resolve_sr_conflict): Adjust.
16285 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
16286 Rename as...
16287 (state_t.reductions, state_t.shifts): this.
16288
076ab033
AD
162892001-12-05 Akim Demaille <akim@epita.fr>
16290
16291 * src/reduce.c (reduce_grammar_tables): No longer disable the
16292 removal of useless rules via CPP but via `if (0)', so that the
16293 compiler still check the code is valid.
16294 For instance, it should have noticed `rline' no longer exists: use
16295 the `line' member of rule_t.
16296 * src/gram.c (dummy, rline): Remove, unused.
16297
3843c413
AD
162982001-12-05 Akim Demaille <akim@epita.fr>
16299
16300 * src/output.c (pack_vector): Use assert, not berror.
16301 * src/main.c (berror): Remove, unused.
16302
43168960
AD
163032001-12-05 Akim Demaille <akim@epita.fr>
16304
16305 New experimental feature: if --verbose --trace output all the
16306 items of a state, not only its kernel.
16307
16308 * src/print.c (print_core): If `trace_flag', then invoke closure
16309 before outputting the items of the state (print_core is no longer
16310 a correct name them).
16311 (print_results): Invoke new_closure/free_closure if needed.
16312
b2872512
AD
163132001-12-05 Akim Demaille <akim@epita.fr>
16314
16315 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
16316 * src/closure.c, src/closure.h (itemsetsize): Rename as...
16317 (nitemset): for consistency with the rest of the project.
16318
23cbcc6c
AD
163192001-12-05 Akim Demaille <akim@epita.fr>
16320
16321 * src/closure.c (print_closure): Improve.
16322 (closure): Use it for printing input and output.
16323
03ec521c
AD
163242001-12-05 Akim Demaille <akim@epita.fr>
16325
16326 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
16327 indexed by nonterminals.
16328
3a7456dd
AD
163292001-12-05 Akim Demaille <akim@epita.fr>
16330
16331 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
16332 what it was!).
16333 * src/warshall.h: Remove accidental duplication of the content.
16334
1cbcf2e7
AD
163352001-12-05 Akim Demaille <akim@epita.fr>
16336
16337 * src/closure.c (set_fderives): De-obfuscate.
16338
84182270
AD
163392001-12-05 Akim Demaille <akim@epita.fr>
16340
16341 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
16342
3f6f053c
AD
163432001-12-05 Akim Demaille <akim@epita.fr>
16344
16345 * src/closure.c (set_firsts): De-obfuscate.
16346
7a5350ba
AD
163472001-12-05 Akim Demaille <akim@epita.fr>
16348
16349 * src/output.c (action_row): De-obfuscate
16350 using the good o' techniques: arrays not pointers, variable
16351 locality, BITISSET, RESETBIT etc.
16352
d954473d
AD
163532001-12-05 Akim Demaille <akim@epita.fr>
16354
16355 Pessimize the code to simplify it: from now on, all the states
16356 have a valid SHIFTS, which NSHIFTS is possibly 0.
16357
16358 * src/LR0.c (shifts_new): Be global and move to..
16359 * src/state.c, src/state.h: here.
16360 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
16361 * src/print_graph: Adjust.
16362
9839bbe5
AD
163632001-12-05 Akim Demaille <akim@epita.fr>
16364
16365 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
16366 * src/conflicts.c: Use it.
16367 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
16368 incorrectly ``simplified''.
16369
9f136c07
AD
163702001-12-05 Akim Demaille <akim@epita.fr>
16371
16372 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
16373 using the good o' techniques: arrays not pointers, variable
16374 locality, BITISSET, RESETBIT etc.
16375
b608206e
AD
163762001-12-05 Akim Demaille <akim@epita.fr>
16377
16378 * src/state.h (SHIFT_SYMBOL): New.
16379 * src/conflicts.c: Use it to deobfuscate.
16380
52afa962
AD
163812001-12-05 Akim Demaille <akim@epita.fr>
16382
16383 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
16384 (print_reductions): De-obfuscate using the good o' techniques:
16385 arrays not pointers, variable locality, BITISSET.
16386
e74dc321
AD
163872001-12-05 Akim Demaille <akim@epita.fr>
16388
16389 * src/conflicts.c (print_reductions): Arrays, not pointers.
16390 Use BITISSET.
16391
768fca83
AD
163922001-12-05 Akim Demaille <akim@epita.fr>
16393
16394 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16395
a17e599f
AD
163962001-12-05 Akim Demaille <akim@epita.fr>
16397
16398 * src/conflicts.c (print_reductions): Improve variable locality.
16399
a04bc341
AD
164002001-12-05 Akim Demaille <akim@epita.fr>
16401
16402 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16403
c8ea038e
AD
164042001-12-05 Akim Demaille <akim@epita.fr>
16405
16406 * src/conflicts.c (print_reductions): Improve variable locality.
16407
aa2aab3c
AD
164082001-12-05 Akim Demaille <akim@epita.fr>
16409
16410 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
16411 * src/lalr.c: Use them.
16412
b178c8cc
AD
164132001-12-05 Akim Demaille <akim@epita.fr>
16414
16415 * src/LR0.c (augment_automaton): Formatting changes.
16416 Better variable locality.
16417
f67d13aa
AD
164182001-12-05 Akim Demaille <akim@epita.fr>
16419
16420 * src/lalr.c (matrix_print): New.
16421 (transpose): Use it.
16422 Use arrays instead of pointers.
16423
c2713865
AD
164242001-12-05 Akim Demaille <akim@epita.fr>
16425
16426 * src/lalr.c (maxrhs): Move to...
16427 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
16428 * src/lalr.c (build_relations): Adjust.
16429
9887c18a
AD
164302001-12-05 Akim Demaille <akim@epita.fr>
16431
16432 * src/lalr.c (transpose): Free the memory allocated to the
16433 argument, as it is replaced by the results by the unique caller.
16434 (build_relations): Merely invoke transpose: it handles the memory
16435 deallocation.
16436 Improve variable locality.
16437 Avoid variables used as mere abbreviations.
16438 (compute_lookaheads): Use arrays instead of pointers.
16439
4d4f699c
AD
164402001-12-05 Akim Demaille <akim@epita.fr>
16441
16442 * src/lalr.c (initialize_F): Improve variable locality.
16443 Avoid variables used as mere abbreviations.
16444
80a69750
AD
164452001-12-05 Akim Demaille <akim@epita.fr>
16446
16447 * src/derives.c (print_derives): Display the ruleno.
16448 * src/lalr.c (initialize_F, transpose): Better variable locality
16449 to improve readability.
16450 Avoid variables used as mere abbreviations.
16451
fe961097
AD
164522001-12-05 Akim Demaille <akim@epita.fr>
16453
16454 * src/lalr.c (traverse): Use arrays instead of pointers.
16455
e3e4e814
AD
164562001-12-05 Akim Demaille <akim@epita.fr>
16457
16458 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
16459 the handling of squeue.
16460 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16461
630e182b
AD
164622001-12-05 Akim Demaille <akim@epita.fr>
16463
16464 Because useless nonterminals are now kept alive (instead of being
16465 `destroyed'), we now sometimes examine them, and store information
16466 related to them. Hence we need to know their number, and adjust
16467 memory allocations.
16468
16469 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
16470 static.
16471 * src/LR0.c (allocate_itemsets): The memory allocated to
16472 `symbol_count' was used for two different purpose: once to count
16473 the number of occurrences of each symbol, and later reassigned to
16474 `shift_symbol', containing the symbol that can be shifted from a
16475 given state.
16476 Deobfuscate, i.e., allocate, use and free `symbol_count' here
16477 only, and...
16478 (new_itemsets): Allocate `shift_symbol' here.
16479 (allocate_itemsets): symbol_count includes useless nonterminals.
16480 Make room for them.
16481 (free_storage): Use `free', not `XFREE', for pointers that cannot
16482 be null.
16483
81b51460
AD
164842001-12-05 Akim Demaille <akim@epita.fr>
16485
16486 * src/nullable.c (set_nullable): Deobfuscate the handling of
16487 ritem.
16488 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16489
3067fbef
AD
164902001-12-05 Akim Demaille <akim@epita.fr>
16491
16492 * src/gram.c, src/gram.h (ritem_print): New.
16493 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
16494 (This useless function was defined only to work around VMS linkers
16495 that can't handle compilation units with variables only).
16496 * src/reduce.c (dump_grammar): Use it to trace the construction of
16497 ritem.
16498
c2bea5f9
PE
164992001-12-04 Paul Eggert <eggert@twinsun.com>
16500
7d27c823
PE
16501 * src/bison.simple (union yyalloc): Change member names
16502 to be the same as the stack names.
16503 (yyparse): yyptr is now union yyalloc *, not char *.
16504 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
16505 and may generate better code on some machines.
c2bea5f9
PE
16506 (yystpcpy): Use prototype if __STDC__ is defined, not just
16507 if __cplusplus is defined.
35687a9d 16508
2c8a9dfa
AD
165092001-11-30 Akim Demaille <akim@epita.fr>
16510
16511 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
16512 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
16513 Gettext doesn't compile cleanly, and dies with -Werror.
16514 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
16515 Include WARNING_CFLAGS here.
16516 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
16517 before being defined.
16518
f4e421e6
AD
165192001-11-27 Paul Eggert <eggert@twinsun.com>
16520
16521 * lib/quotearg.h (quotearg_n, quotearg_n_style):
16522 First arg is int, not unsigned.
16523 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
16524 (SIZE_MAX, UINT_MAX): New macros.
16525 (quotearg_n_options): Abort if N is negative.
16526 Avoid overflow check on hosts where size_t is 64 bits and int
16527 is 32 bits, as overflow is impossible there.
16528 Fix off-by-one typo that caused unnecessary reallocation.
16529
7093d0f5
AD
165302001-11-29 Paul Eggert <eggert@twinsun.com>
16531
16532 Name space cleanup in generated parser.
16533
16534 * doc/bison.texinfo (Bison Parser): Discuss system headers
16535 and their effect on the user name space.
16536
16537 * src/bison.simple:
16538 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
16539 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
16540 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
16541
16542 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
16543 on user names when possible.
16544
16545 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
16546 Simplify test for whather <alloca.h> exists.
16547
16548 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
16549
16550 (<stdio.h>): Include if YYDEBUG.
16551
16552 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
16553 ! defined (yyoverflow) && ! defined (yymemcpy).
16554
16555 (yymemcpy, yyparse): Rename local variables as needed so that
16556 they all begin with 'yy'.
16557
16558 (yystrlen, yystpcpy): New functions.
16559
16560 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
16561 All uses changed.
16562
16563 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
16564 instead of relying on string.h functions. Use YYSTACK_ALLOC
16565 and YYSTACK_FREE instead of malloc and free.
16566
fd51e5ff
AD
165672001-11-30 Akim Demaille <akim@epita.fr>
16568
16569 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
16570 before their first uses.
16571 (YYBISON, YYPURE): Move to the top of the output.
16572
7d13ff5f
AD
165732001-11-30 Akim Demaille <akim@epita.fr>
16574
16575 * tests/reduce.at (Useless Nonterminals): Fix.
16576
892a3995
AD
165772001-11-30 Akim Demaille <akim@epita.fr>
16578
16579 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
16580 if body instead of `;' to pacify GCC's warnings.
16581
68f1e3ed
AD
165822001-11-30 Akim Demaille <akim@epita.fr>
16583
16584 Instead of mapping the LHS of unused rules to -1, keep the LHS
16585 valid, but flag the rules as invalid.
16586
16587 * src/gram.h (rule_t): `useful' is a new member.
16588 * src/print.c (print_grammar): Adjust.
16589 * src/derives.c (set_derives): Likewise.
16590 * src/reader.c (packgram, reduce_output): Likewise.
16591 * src/reduce.c (reduce_grammar_tables): Likewise.
16592 * tests/reduce.at (Underivable Rules, Useless Rules): New.
16593
d2d1b42b
AD
165942001-11-30 Akim Demaille <akim@epita.fr>
16595
16596 * src/reduce.c (reduce_output): Formatting changes.
16597 * src/print.c (print_results, print_grammar): Likewise.
16598 * tests/regression.at (Rule Line Numbers)
16599 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
16600
760b53a8
AD
166012001-11-30 Akim Demaille <akim@epita.fr>
16602
16603 * src/reduce.c (nonterminals_reduce): Instead of throwing away
16604 useless nonterminals, move them at the end of the symbol arrays.
16605 (reduce_output): Adjust.
16606 * tests/reduce.at (Useless Nonterminals): Adjust.
16607
00238958
AD
166082001-11-30 Akim Demaille <akim@epita.fr>
16609
16610 * src/reduce.c: Various comment/formatting changes.
16611 (nonterminals_reduce): New, extracted from...
16612 (reduce_grammar_tables): here.
16613 (reduce_grammar): Call nonterminals_reduce.
16614
396452de
PE
166152001-11-29 Paul Eggert <eggert@twinsun.com>
16616
16617 * src/bison.simple (YYSTACK_REALLOC): Remove.
16618 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
16619 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
16620 New macros.
16621 (union yyalloc): New type.
16622 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
16623 an arbitrary restriction on hosts where size_t is wider than int.
16624
16625 (yyparse): Don't dump core if alloca or malloc fails; instead, report
16626 a parser stack overflow. Allocate just one block of memory for all
16627 three stacks, instead of allocating three blocks; this typically is
16628 faster and reduces fragmentation.
16629
16630 Do not limit the number of items in the stack to a value that fits
16631 in 'int', as this is an arbitrary limit on hosts with 64-bit
16632 size_t and 32-bit int.
16633
147e184c
MA
166342001-11-29 Marc Autret <autret_m@epita.fr>
16635
16636 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
16637 of defining YYERROR_VERBOSE.
16638 [AT_DATA]: $4 is now out of C declarations in the prologue.
16639
426cf563
MA
166402001-11-28 Marc Autret <autret_m@epita.fr>
16641
16642 * src/reader.c (parse_dquoted_param): New.
16643 (parse_skel_decl): Use it.
16644 * src/lex.h: Add its prototype.
16645 * src/lex.c (literalchar): Become not static.
16646
c7925b99
MA
166472001-11-28 Marc Autret <autret_m@epita.fr>
16648
16649 * src/output.h: And put its extern declaration here.
16650 * src/output.c (error_verbose): Define here.
16651 (prepare): Echo name modification.
16652 * src/getargs.h: Clean its extern declaration.
16653 * src/getargs.c (error_verbose_flag): Remove.
16654 (getargs): Remove case 'e'.
16655 * src/options.c (option_table): 'error-verbose' is now seen as simple
16656 percent option.
16657 Include output.h.
16658
16659 * src/reader.c (read_declarations): Remove case tok_include.
16660 (parse_include_decl): Remove.
16661 * src/lex.h (token_t): Remove tok_include.
16662 * src/options.c (option_table): 'include' is now a simple command line
16663 option.
16664
5b5d1929
MA
166652001-11-28 Marc Autret <autret_m@epita.fr>
16666
16667 * src/bison.simple: Adjust muscle names.
16668 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16669 * src/output.c (prepare): s/_/-/ for the muscles names.
16670 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16671
8850be4b
MA
166722001-11-28 Marc Autret <autret_m@epita.fr>
16673
16674 * src/bison.simple: Fix debug.
16675 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16676
4a38e613
AD
166772001-11-28 Akim Demaille <akim@epita.fr>
16678
16679 * src/LR0.c (shifts_new): New.
16680 (save_shifts, insert_start_shift, augment_automaton): Use it.
16681
4b35e1c1
AD
166822001-11-28 Akim Demaille <akim@epita.fr>
16683
16684 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16685 keep ruleno only.
16686
d2b04478
AD
166872001-11-28 Akim Demaille <akim@epita.fr>
16688
16689 * src/closure.c (closure): Instead of looping over word in array
16690 then bits in words, loop over bits in array.
16691
2c4c30aa
AD
166922001-11-28 Akim Demaille <akim@epita.fr>
16693
16694 * src/closure.c (closure): No longer optimize the special case
16695 where all the bits of `ruleset[r]' are set to 0, to make the code
16696 clearer.
16697
576890b7
AD
166982001-11-28 Akim Demaille <akim@epita.fr>
16699
16700 * src/closure.c (closure): `r' and `c' are new variables, used to
16701 de-obfuscate accesses to RULESET and CORE.
16702
cb487d7d
AD
167032001-11-28 Akim Demaille <akim@epita.fr>
16704
16705 * src/reduce.c (reduce_print): Use ngettext.
16706 (dump_grammar): Improve the trace accuracy.
16707
6013d43f
AD
167082001-11-28 Akim Demaille <akim@epita.fr>
16709
16710 * src/reduce.c (dump_grammar): Don't translate trace messages.
16711
cb4956ee
AD
167122001-11-28 Akim Demaille <akim@epita.fr>
16713
16714 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16715 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16716 as all tags are free'ed afterwards.
16717 From Enrico Scholz.
16718
648185ab
PE
167192001-11-27 Paul Eggert <eggert@twinsun.com>
16720
16721 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16722 use alloca when we didn't want to, and vice versa.
16723
68254a03
MA
167242001-11-27 Marc Autret <autret_m@epita.fr>
16725
9113b58f
AD
16726 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16727 initialization.
68254a03
MA
16728 * src/output.c (prepare): Remove its update.
16729
04d843a2
MA
167302001-11-27 Marc Autret <autret_m@epita.fr>
16731
16732 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16733 Use %error-verbose.
16734
d2079671 167352001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
16736
16737 * src/bison.simple: Remove YYERROR_VERBOSE using.
16738 Use %%error_verbose.
16739 (yyparse): Likewise.
16740 * src/output.c (prepare): Give its final value.
16741 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16742 * src/getargs.h: Add its extern declaration.
16743 * src/getargs.c (error_verbose_flag): New int.
16744 (getargs): Update to catch new case.
16745 * src/options.c (option_table): 'error-verbose' is a new option.
16746 (shortopts): Update.
16747
e0327bc8
AD
167482001-11-27 Akim Demaille <akim@epita.fr>
16749
16750 * src/system.h: Use intl/libgettext.h.
16751 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16752
000f1a3c
AD
167532001-11-27 Akim Demaille <akim@epita.fr>
16754
16755 * tests/torture.at (Exploding the Stack Size with Malloc):
16756 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16757
26cfe0be
AD
167582001-11-27 Akim Demaille <akim@epita.fr>
16759
16760 * src/files.c: Include error.h.
16761 Reported by Hans Aberg.
16762
f6bd5427
MA
167632001-11-26 Marc Autret <autret_m@epita.fr>
16764
d2079671 16765 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
16766 (read_declarations): Add case tok_include.
16767 * src/getargs.h (include): Add its extern definition.
16768 * src/getargs.c (include): New const char *.
16769 (getargs): Add case '-I'.
16770 * src/options.c (option_table): Add include as command line and
16771 percent option.
16772 * src/lex.h (token_t): Add tok_include.
16773
2ca209c1
AD
167742001-11-26 Akim Demaille <akim@epita.fr>
16775
16776 * src/reader.c (readgram): Make sure rules for mid-rule actions
16777 have a lineno equal to that of their host rule.
16778 Reported by Hans Aberg.
16779 * tests/regression.at (Rule Line Numbers): New.
16780
0e41b407
AD
167812001-11-26 Akim Demaille <akim@epita.fr>
16782
16783 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16784 size_ts.
16785
167862001-11-26 Akim Demaille <akim@epita.fr>
16787
16788 * src/complain.c, src/complain.h (error): Remove, provided by
16789 lib/error.[ch].
16790
e0c40012
AD
167912001-11-26 Akim Demaille <akim@epita.fr>
16792
16793 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16794 issue an error message.
16795 * tests/regression.at (Invalid %directive): New.
16796 Reported by Hans Aberg.
16797
5e147124
AD
167982001-11-26 Akim Demaille <akim@epita.fr>
16799
16800 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16801 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16802
a034c8b8
AD
168032001-11-26 Akim Demaille <akim@epita.fr>
16804
16805 * src/conflicts.c (conflicts_print): Don't complain at all when
16806 there are no reduce/reduce conflicts, and as many shift/reduce
16807 conflicts as expected.
16808 * tests/regression.at (%expect right): Adjust.
16809
c64a20f3
AD
168102001-11-23 Akim Demaille <akim@epita.fr>
16811
16812 * lib/alloca.c: Update, from fileutils.
16813
5b0d29bb
AD
168142001-11-23 Akim Demaille <akim@epita.fr>
16815
16816 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
16817
722c4bfe
AD
168182001-11-23 Akim Demaille <akim@epita.fr>
16819
16820 * src/system.h: Include alloca.h.
16821 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
16822
6255b435
AD
168232001-11-23 Akim Demaille <akim@epita.fr>
16824
16825 * src/print_graph.c (print_actions): Remove `rule', unused.
16826 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
16827 pacify GCC's signed < unsigned warnings.
16828 * src/closure.c (itemsetsize): Likewise.
16829 * src/reader.c (symbol_list_new): Static.
16830
b29b2ed5
AD
168312001-11-23 Akim Demaille <akim@epita.fr>
16832
16833 Attaching lineno to buckets is stupid, since only one copy of each
16834 symbol is kept, only the line of the first occurrence is kept too.
16835
16836 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
16837 * src/reader.c (rline_allocated): Remove, unused.
16838 (symbol_list): Have a `line' member.
16839 (symbol_list_new): New.
16840 (readgram): Use it.
16841 * src/print.c (print_grammar): Output the rule line numbers.
16842 * tests/regression.at (Solved SR Conflicts)
16843 (Unresolved SR Conflicts): Adjust.
16844 Reported by Hans Aberg.
16845
a81b1d4a
MA
168462001-11-22 Marc Autret <autret_m@epita.fr>
16847
16848 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
16849
c1ecb3c1
MA
168502001-11-22 Marc Autret <autret_m@epita.fr>
16851
16852 * src/muscle_tab.c (muscle_init): Remove initialization of
16853 skeleton muscle.
16854 * src/output.c (output_master_parser): Do it here.
16855
fbe01355
AD
168562001-11-20 Akim Demaille <akim@epita.fr>
16857
16858 * po/sv.po: New.
16859 * configure.in (ALL_LINGUAS): Adjust.
16860 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
16861 longer contains strings to translate.
16862
81e895c0
AD
168632001-11-19 Akim Demaille <akim@epita.fr>
16864
16865 * src/conflicts.c (conflicts_print): Add a missing \n.
16866
6bb1878b
AD
168672001-11-19 Akim Demaille <akim@epita.fr>
16868
16869 * src/nullable.c (nullable_print): New.
16870 (set_nullable): Call it when tracing.
16871 Better locality of variables.
16872
d9ec2d07
AD
168732001-11-19 Akim Demaille <akim@epita.fr>
16874
16875 * src/print.c (print_actions): Better locality of variables.
16876
720e5c1b
AD
168772001-11-19 Akim Demaille <akim@epita.fr>
16878
16879 * src/derives.c (print_derives): Fix and enrich.
16880 * src/closure.c (print_fderives): Likewise.
16881
fb908786
AD
168822001-11-19 Akim Demaille <akim@epita.fr>
16883
16884 * src/closure.c (itemsetend): Remove, replaced with...
16885 (itemsetsize): new.
16886
125ecb56
AD
168872001-11-19 Akim Demaille <akim@epita.fr>
16888
16889 * src/LR0.c (kernel_end): Remove, replaced with...
16890 (kernel_size): new.
16891
d8cf039f
AD
168922001-11-19 Akim Demaille <akim@epita.fr>
16893
16894 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
16895 to clarify.
16896
7bec0760
AD
168972001-11-19 Akim Demaille <akim@epita.fr>
16898
16899 * src/closure.c (closure): Use arrays instead of pointers to clarify.
16900
c87d4863
AD
169012001-11-19 Akim Demaille <akim@epita.fr>
16902
16903 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
16904 trace messages.
16905 * src/LR0.c: Likewise.
16906 (allocate_itemsets): Use arrays instead of pointers to clarify.
16907
9bfe901c
AD
169082001-11-19 Akim Demaille <akim@epita.fr>
16909
16910 * src/getargs.c (statistics_flag): Replace with...
16911 (trace_flag): New.
16912 (longopts): Accept --trace instead of --statistics.
16913 * src/getargs.h, src/options.c: Adjust.
16914 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
16915 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
16916
97db7bd4
AD
169172001-11-19 Akim Demaille <akim@epita.fr>
16918
cc72668c 16919 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
16920 pointers to clarify the code.
16921 (save_reductions, save_shifts): Factor common parts of alternatives.
16922
2c5f66ed
AD
169232001-11-19 Akim Demaille <akim@epita.fr>
16924
16925 * src/LR0.c (new_state, get_state): Complete TRACE code.
16926 * src/closure.c: Include `reader.h' to get `tags', needed by the
16927 trace code.
16928 Rename the conditional DEBUG as TRACE.
16929 Output consistently TRACEs to stderr, not stdout.
16930 * src/derives.c: Likewise.
16931 * src/reduce.c: (inaccessable_symbols): Using if is better style
16932 than goto.
16933 Use `#if TRACE' instead of `#if 0' for tracing code.
16934
300f275f
AD
169352001-11-19 Akim Demaille <akim@epita.fr>
16936
16937 * src/system.h (LIST_FREE, shortcpy): New.
16938 * src/LR0.c: Use them.
16939 * src/output.c (free_itemsets, free_reductions, free_shifts):
16940 Remove, replaced by LIST_FREE.
16941
f59c437a
AD
169422001-11-19 Akim Demaille <akim@epita.fr>
16943
16944 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
16945 (REDUCTIONS_ALLOC): New.
16946 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
16947 allocation.
16948
6986fd9e
AD
169492001-11-19 Akim Demaille <akim@epita.fr>
16950
16951 * src/LR0.c (new_state): Complete trace code.
16952 * src/nullable.c (set_nullable): Don't translate traces.
16953
4bc30f78
AD
169542001-11-19 Akim Demaille <akim@epita.fr>
16955
16956 * src/print_graph.c (print_core): Better locality of variables.
16957 * src/print.c (print_core): Likewise.
16958
08a946e0
AD
169592001-11-19 Akim Demaille <akim@epita.fr>
16960
16961 * src/vcg.c: You do the output, so you are responsible of the
16962 handling of VCG syntax, in particular: use quotearg.
16963 * src/print_graph.c: Don't.
16964 (print_actions): Don't output the actions as part of the nodes,
16965 since that's the job of the edges.
16966 (print_state): Don't output by hand: fill the node description,
9bfe901c 16967 and ask for its output.
08a946e0 16968
f0473484
AD
169692001-11-19 Akim Demaille <akim@epita.fr>
16970
cc72668c
AD
16971 * src/bison.simple (yyparse): When verbosely reporting an error,
16972 no longer put additional quotes around token names.
f0473484
AD
16973 * tests/calc.at: Adjust.
16974
e41dc700
AD
169752001-11-19 Akim Demaille <akim@epita.fr>
16976
16977 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
16978 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
16979 * src/output.c: Adjust.
16980
652a871c
AD
169812001-11-19 Akim Demaille <akim@epita.fr>
16982
16983 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
16984 (rule_t): this.
16985 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
16986
b2ed6e58
AD
169872001-11-19 Akim Demaille <akim@epita.fr>
16988
16989 * src/gram.h (rule_t): New.
16990 (rule_table): New.
16991 (rrhs, rlhs): Remove, part of state_t.
16992 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
16993 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16994 * src/reader.c, src/reduce.c: Adjust.
16995
edad7067
AD
169962001-11-19 Akim Demaille <akim@epita.fr>
16997
16998 * src/reader.c (symbols_output): New, extracted from...
16999 (packsymbols): Here.
17000 (reader): Call it.
17001
3feec034
AD
170022001-11-19 Akim Demaille <akim@epita.fr>
17003
17004 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
17005 (maxrhs): this new function.
17006
ddcd5fdf
AD
170072001-11-19 Akim Demaille <akim@epita.fr>
17008
cc72668c 17009 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
17010 Adjust.
17011
bb527fc2
AD
170122001-11-19 Akim Demaille <akim@epita.fr>
17013
cc72668c 17014 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
17015 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17016 * src/lalr.c: Adjust.
17017
a845a697
AD
170182001-11-19 Akim Demaille <akim@epita.fr>
17019
17020 * src/lalr.c (initialize_LA): Only initialize LA. Let...
17021 (set_state_table): handle the `lookaheads' members.
17022
f004bf6a
AD
170232001-11-19 Akim Demaille <akim@epita.fr>
17024
cc72668c
AD
17025 * src/lalr.h (lookaheads): Removed array, whose contents is now
17026 a member of...
f004bf6a
AD
17027 (state_t): this structure.
17028 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17029 Adjust.
17030
de326cc0
AD
170312001-11-19 Akim Demaille <akim@epita.fr>
17032
cc72668c
AD
17033 * src/lalr.h (consistent): Removed array, whose contents is now
17034 a member of...
de326cc0
AD
17035 (state_t): this structure.
17036 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17037 Adjust.
17038
90b4416b
AD
170392001-11-19 Akim Demaille <akim@epita.fr>
17040
cc72668c
AD
17041 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
17042 contents are now members of...
90b4416b
AD
17043 (state_t): this structure.
17044 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17045 Adjust.
17046
9703cc49
AD
170472001-11-19 Akim Demaille <akim@epita.fr>
17048
17049 * src/lalr.h (state_t): New.
17050 (state_table): Be a state_t * instead of a core **.
17051 (accessing_symbol): Remove, part of state_t.
17052 * src/lalr.c: Adjust.
17053 (set_accessing_symbol): Merge into...
17054 (set_state_table): this.
17055 * src/print_graph.c, src/conflicts.c: Adjust.
17056
d803322e
AD
170572001-11-14 Akim Demaille <akim@epita.fr>
17058
17059 * tests/calc.at, tests/output.at, tests/regression.at,
17060 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
17061 now the tests are run in private dirs, therefore AC_CLEANUP and
17062 family can be simplified to 0-ary.
17063 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
17064 use abs. path to find config.h.
17065 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
17066 stderr, there can be way too much random noise.
17067 Instead pass -Werror to GCC and rely on the exit status.
17068 Reported by Wolfram Wagner.
17069
3d76b07d
AD
170702001-11-14 Akim Demaille <akim@epita.fr>
17071
17072 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
17073 defined only if yyoverflow is defined, to avoid `warning: unused
17074 variable `yyvs1''.
17075 Reported by The Test Suite.
17076
09b503c8
AD
170772001-11-14 Akim Demaille <akim@epita.fr>
17078
17079 * src/print.c: Include reduce.h.
17080 Reported by Hans Aberg.
17081
170822001-11-14 Akim Demaille <akim@epita.fr>
17083
17084 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
17085 Revert a previous patch: these are really const.
17086 * src/conflicts.c (conflict_report): Additional useless pair of
17087 braces to pacify GCC's warnings for `if () if () {} else {}'.
17088 * src/lex.c (parse_percent_token): Replace equal_offset with
17089 arg_offset.
17090 arg is const.
17091 Be sure to strdup `arg' when used, since there is no reason for
17092 token_buffer not to change.
17093
0f37a994
AD
170942001-11-14 Akim Demaille <akim@epita.fr>
17095
17096 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
17097 definition.
17098 * src/main.c (main): Use them.
17099 Suggested by Hans Aberg.
17100
d39d93b8
AD
171012001-11-12 Akim Demaille <akim@epita.fr>
17102
17103 * src/system.h (ngettext): Now that we use ngettext, be sure to
17104 provide a default definition when NLS are not used.
17105
9edcd895
AD
171062001-11-12 Akim Demaille <akim@epita.fr>
17107
17108 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
17109 Use @kbd to denote user input.
17110 (Language and Grammar): ANSIfy the example.
17111 Adjust its layout for info/notinfo.
17112 (Location Tracking Calc): Output error messages to stderr.
17113 Output locations in a more GNUtically correct way.
17114 Fix a couple of Englishos.
17115 Adjust @group/@end group pairs.
17116
7da99ede
AD
171172001-11-12 Akim Demaille <akim@epita.fr>
17118
e3aa65c5 17119 %expect was not functioning at all.
7da99ede
AD
17120
17121 * src/conflicts.c (expected_conflicts): Set to -1.
17122 (conflict_report): Use ngettext.
17123 (conflicts_print): Check %expect and make its violation an error.
17124 * doc/bison.texinfo (Expect Decl): Adjust.
17125 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
17126 * tests/regression.at (%expect not enough, %expect right)
17127 (%expect too much): New.
17128
ba9dda1a
AD
171292001-11-12 Akim Demaille <akim@epita.fr>
17130
17131 * tests/regression.at (Conflicts): Rename as...
17132 (Unresolved SR Conflicts): this.
17133 (Solved SR Conflicts): New.
17134
337c5bd1
AD
171352001-11-12 Akim Demaille <akim@epita.fr>
17136
17137 * src/reduce.c (print_results): Rename as...
17138 (reduce_output): This.
17139 Output to OUT, passed as argument, instead of output_obstack.
17140 (dump_grammar): Likewise.
17141 (reduce_free): New.
17142 Also free V1.
17143 (reduce_grammar): No longer call reduce_output, since...
17144 * src/print.c (print_results): do it.
17145 * src/main.c (main): Call reduce_free;
17146
c73a41af
AD
171472001-11-12 Akim Demaille <akim@epita.fr>
17148
17149 * src/conflicts.c (print_reductions): Accept OUT as argument.
17150 Output to it, not to output_obstack.
17151 * src/print.c (print_actions): Adjust.
17152
0df87bb6
AD
171532001-11-12 Akim Demaille <akim@epita.fr>
17154
17155 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
17156 the result instead of using...
17157 (src_total, rrc_total, src_count, rrc_count): Remove.
17158 (any_conflicts): Remove.
17159 (print_conflicts): Split into...
17160 (conflicts_print, conflicts_output): New.
17161 * src/conflicts.h: Adjust.
17162 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 17163 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
17164 * tests/regression.at (Conflicts): New.
17165 Reported by Tom Lane.
17166
e4d3d4de
AD
171672001-11-12 Akim Demaille <akim@epita.fr>
17168
17169 * tests/regression.at (Invalid input): Remove, duplicate with
17170 ``Invalid input: 1''.
17171
6d7d248e
AD
171722001-11-12 Akim Demaille <akim@epita.fr>
17173
17174 * tests/torture.at (AT_DATA_STACK_TORTURE)
17175 (Exploding the Stack Size with Alloca)
17176 (Exploding the Stack Size with Malloc): New.
17177
e9e4c321
AD
171782001-11-12 Akim Demaille <akim@epita.fr>
17179
17180 * src/bison.simple (YYSTACK_REALLOC): New.
17181 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 17182 Reported by Per Allansson.
e9e4c321 17183
5f7e0832
AD
171842001-11-12 Pascal Bart <pascal.bart@epita.fr>
17185
17186 * src/bison.simple: Define type yystype instead of YYSTYPE, and
17187 define CPP macro, which substitute YYSTYPE by yystype.
17188 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
17189 with yyltype/YYLTYPE. This allows inclusion of the generated
17190 header within the parser if the compiler, such as GGC, accepts
17191 multiple equivalent #defines.
17192 From Akim.
17193
e3f1699f
AD
171942001-11-05 Akim Demaille <akim@epita.fr>
17195
17196 * src/reader.c (symbols_output): New, extracted from...
17197 (packsymbols): here.
17198 (reader): Adjust.
17199
65be0866
AD
172002001-11-05 Akim Demaille <akim@epita.fr>
17201
17202 * src/lex.c (parse_percent_token): s/quotearg/quote/.
17203
e4d910bf
AD
172042001-11-05 Akim Demaille <akim@epita.fr>
17205
17206 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
17207 pattern.
17208
951366c1
AD
172092001-11-05 Akim Demaille <akim@epita.fr>
17210
17211 * src/options.h (struct option_table_struct): set_flags is void*.
17212 * src/options.c (longopts): Support `--output' and `%output'.
17213 (usage): Adjust.
17214 * src/lex.h (tok_setopt): Remove, replaced with...
17215 (tok_intopt, tok_stropt): these new guys.
17216 * src/lex.c (getopt.h): Not needed.
17217 (token_buffer, unlexed_token_buffer): Not const.
17218 (percent_table): Promote `-' over `_' in directive names.
17219 Active `%name-prefix', `file-prefix', and `output'.
17220 (parse_percent_token): Accept possible arguments to directives.
17221 Promote `-' over `_' in directive names.
17222
d8988b2f
AD
172232001-11-04 Akim Demaille <akim@epita.fr>
17224
17225 * doc/bison.texinfo (Decl Summary): Split the list into
17226 `directives for grammars' and `directives for bison'.
17227 Sort'em.
17228 Add description of `%name-prefix', `file-prefix', and `output'.
17229 Promote `-' over `_' in directive names.
17230 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
17231 Simplify the description of `--name-prefix'.
17232 Promote `-' over `_' in directive names.
17233 Promote `--output' over `--output-file'.
17234 Fix the description of `--defines'.
17235 * tests/output.at: Exercise %file-prefix and %output.
17236
6468d18e
AD
172372001-11-02 Akim Demaille <akim@epita.fr>
17238
17239 * doc/refcard.tex: Update.
17240
6b7e85b9
AD
172412001-11-02 Akim Demaille <akim@epita.fr>
17242
17243 * src/symtab.h (SUNDEF): New.
17244 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
17245 stand for `uninitialized', instead of 0.
17246 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
17247 * src/lex.c (lex): Adjust.
17248
17249 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
17250 Number it 0.
17251 Let yylex return it instead of a plain 0.
17252 Reported by Dick Streefland.
17253
cd5aafcf
AD
172542001-11-02 Akim Demaille <akim@epita.fr>
17255
17256 * tests/regression.at (Mixing %token styles): New test.
17257
037ca2f1
AD
172582001-11-02 Akim Demaille <akim@epita.fr>
17259
17260 * src/reader.c (parse_thong_decl): Formatting changes.
17261 (token_translations_init): New, extracted from...
17262 (packsymbols): Here.
17263 Adjust.
17264
270a173c
AD
172652001-11-01 Akim Demaille <akim@epita.fr>
17266
17267 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
17268 Check that `9foo.y' produces correct cpp guards.
17269 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
17270 guards.
17271 Reported by Wwp.
17272
561f9a30
AD
172732001-11-01 Akim Demaille <akim@epita.fr>
17274
17275 * tests/regression.at (Invalid input: 2): New.
17276 * src/lex.c (unlexed_token_buffer): New.
17277 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
17278 too.
17279 Reported by Wwp.
17280
f987e9d2
AD
172812001-11-01 Akim Demaille <akim@epita.fr>
17282
17283 * tests/calc.at: Catch up with 1.30.
17284 * configure.in: Bump to 1.49a.
17285 Adjust to newer Autotest.
17286
0846f581
PB
172872001-10-19 Pascal Bart <pascal.bart@epita.fr>
17288
17289 * src/conflicts.c: Move global variables rrc_total and src_total ...
17290 (print_conflicts): here.
17291 * src/output.c (output): Free global variable user_toknums.
17292 * src/lex.c (token_obstack): Become static.
17293
3c1a79b3
AD
172942001-10-18 Akim Demaille <akim@epita.fr>
17295
17296 * tests/atlocal.in (GCC): Add.
17297 * tests/calc.at: s/m4_match/m4_bmatch/.
17298 s/m4_patsubst/m4_bpatsubst/.
17299 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
17300 * configure.in: AC_SUBST(GCC).
17301
5d52e7d0
MA
173022001-10-14 Marc Autret <autret_m@epita.fr>
17303
17304 * src/options.c (create_long_option_table): Fix.
17305
631aa1d3
AD
173062001-10-10 Akim Demaille <akim@epita.fr>
17307
17308 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
17309
f6ec6d13
AD
173102001-10-04 Akim Demaille <akim@epita.fr>
17311
17312 * src/reader.c (parse_union_decl): Push the caracters in
17313 union_obstack, not attrs_obstack.
17314
342b8b6e
AD
173152001-10-04 Akim Demaille <akim@epita.fr>
17316
17317 Merge in the branch 1.29.
17318
17319 * src/reader.c (packsymbols): Use a temporary obstack for
17320 `%%tokendef', since output_stack is already used elsewhere.
17321
17322 2001-10-02 Akim Demaille <akim@epita.fr>
17323
17324 Bump 1.29d.
17325
17326 2001-10-02 Akim Demaille <akim@epita.fr>
17327
17328 Version 1.29c.
17329
17330 2001-10-02 Akim Demaille <akim@epita.fr>
17331
17332 * tests/regression.at (Invalid CPP headers): New.
17333 From Alexander Belopolsky.
17334 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
17335
17336 2001-10-02 Akim Demaille <akim@epita.fr>
17337
17338 * tests/regression.at (Invalid input): New.
17339 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
17340 Reported by Shura.
17341
17342 2001-10-02 Akim Demaille <akim@epita.fr>
17343
17344 * tests/calc.at: Now that --debug works, the tests must be adjusted.
17345
17346 2001-10-02 Akim Demaille <akim@epita.fr>
17347
17348 * src/output.c (output_parser): Assert `skeleton'.
17349 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
17350 systems.
17351 From Shura.
17352
17353 2001-10-01 Marc Autret <autret_m@epita.fr>
17354
17355 * src/lex.h: Echo modifications.
17356 * src/lex.c (unlex): Parameter is now token_t.
17357 From Hans Aberg.
17358
17359 2001-10-01 Marc Autret <autret_m@epita.fr>
17360
17361 * src/main.c: Include lex.h.
17362 From Hans Aberg.
17363
17364 2001-09-29 Akim Demaille <akim@epita.fr>
17365
17366 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
17367
17368 2001-09-28 Akim Demaille <akim@epita.fr>
17369
17370 * tests/testsuite.at: Update to newer Autotest.
17371 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
17372
17373 2001-09-27 Akim Demaille <akim@epita.fr>
17374
17375 Position independent wrapper.
17376
17377 * tests/bison: Remove.
17378 * tests/bison.in: New.
17379 * configure.in: Adjust.
17380
17381 2001-09-27 Paul Eggert <eggert@twinsun.com>
17382
17383 Port quotearg fixes from tar 1.13.24.
17384
17385 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
17386 tm to be declared.
17387 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
17388 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
17389
17390 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
17391 * m4/mbrtowc.m4: New file.
17392 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
17393 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
17394
17395 2001-09-27 Akim Demaille <akim@epita.fr>
17396
17397 Bump to 1.29c.
17398
17399 2001-09-27 Akim Demaille <akim@epita.fr>
17400
17401 Version 1.29b.
17402
17403 2001-09-25 Akim Demaille <akim@epita.fr>
17404
17405 * src/system.h: Include `xalloc.h'.
17406 Remove it from the C files.
17407 * src/files.c (output_files): Free the obstacks.
17408 * src/lex.c (init_lex): Rename as...
17409 (lex_init): this.
17410 (lex_free): New.
17411 * src/main.c (main): Use it.
17412
17413 2001-09-24 Marc Autret <autret_m@epita.fr>
17414
17415 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
17416 to output informations in fout (FILE*).
17417 (open_graph, close_graph): Likewise.
17418 (output_graph, output_edge, output_node): Likewise.
17419 * src/vcg.h: Update function prototypes.
17420 * src/print_graph.c (print_graph): Open output graph file.
17421 (print_actions): Adjust.
17422 * src/files.h: Remove extern declaration.
17423 * src/files.c: Remove graph_obstack declaration.
17424 (open_files): Remove graph_obstack initialization.
17425 (output_files): Remove graph_obstack saving.
17426
17427 2001-09-24 Marc Autret <autret_m@epita.fr>
17428
17429 * src/files.c (compute_output_file_names): Fix.
17430
17431 2001-09-24 Marc Autret <autret_m@epita.fr>,
17432 Akim Demaille <akim@epita.fr>
17433
17434 * src/reader.c (reader): Remove call to free_symtab ().
17435 * src/main.c (main): Call it here.
17436 Include symtab.h.
17437 * src/conflicts.c (initialize_conflicts): Rename as...
17438 (solve_conflicts): this.
17439 * src/print.c (print_core, print_actions, print_state)
17440 (print_grammar): Dump to a file instead a `output_obstack'.
17441 (print_results): Dump `output_obstack', and then proceed with the
17442 FILE *.
17443 * src/files.c (compute_output_file_names, close_files): New.
17444 (output_files): Adjust.
17445 * src/main.c (main): Adjust.
17446
17447 2001-09-23 Marc Autret <autret_m@epita.fr>
17448
17449 * src/files.c (compute_header_macro): Computes header macro name
17450 from spec_defines_file when given.
17451
17452 2001-09-23 Marc Autret <autret_m@epita.fr>
17453
17454 * src/files.c (output_files): Add default extensions.
17455
17456 2001-09-22 Akim Demaille <akim@epita.fr>
17457
17458 * src/conflicts.c (finalize_conflicts): Rename as...
17459 (free_conflicts): this.
17460
17461 2001-09-22 Akim Demaille <akim@epita.fr>
17462
17463 * src/gram.c (gram_free): Rename back as...
17464 (dummy): this.
17465 (output_token_translations): Free `token_translations'.
17466 * src/symtab.c (free_symtab): Free the tag field.
17467
17468 2001-09-22 Akim Demaille <akim@epita.fr>
17469
17470 Remove `translations' as it is always set to true.
17471
17472 * src/gram.h: Adjust.
17473 * src/reader.c (packsymbols, parse_token_decl): Adjust
17474 * src/print.c (print_grammar): Adjust.
17475 * src/output.c (output_token_translations): Adjust.
17476 * src/lex.c (lex): Adjust.
17477 * src/gram.c: Be sure the set pointers to NULL.
17478 (dummy): Rename as...
17479 (gram_free): this.
17480
17481 2001-09-22 Akim Demaille <akim@epita.fr>
17482
17483 * configure.in: Invoke AM_LIB_DMALLOC.
17484 * src/system.h: Use dmalloc.
17485 * src/LR0.c: Be sure to have pointers initialized to NULL.
17486 (allocate_itemsets): Allocate kernel_items only if needed.
17487
17488 2001-09-22 Akim Demaille <akim@epita.fr>
17489
17490 * configure.in: Bump to 1.29b.
17491 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
17492 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
17493 need xmalloc.c in calc.y.
17494 From Pascal Bart.
17495
17496 2001-09-21 Akim Demaille <akim@epita.fr>
17497
17498 Version 1.29a.
17499 * Makefile.maint, config/config.guess, config/config.sub,
17500 * config/missing: Update from masters.
17501 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
17502 upon package.m4.
17503 * configure.in (ALL_LINGUAS): Add `tr'.
17504
17505 2001-09-21 Akim Demaille <akim@epita.fr>
17506
17507 * tests/Makefile.am (package.m4): Move to...
17508 ($(srcdir)/$(TESTSUITE)): here.
17509
17510 2001-09-20 Akim Demaille <akim@epita.fr>
17511
17512 * src/complain.c: No longer try to be standalone: use system.h.
17513 Don't assume __STDC__ is defined to 1. Just test if it is defined.
17514 * src/complain.h: Likewise.
17515 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
17516 Remove the unused variable `n'.
17517 From Albert Chin-A-Young.
17518
17519 2001-09-18 Marc Autret <autret_m@epita.fr>
17520
17521 * doc/bison.1: Update.
17522 * doc/bison.texinfo (Bison Options): Update --defines and --graph
17523 descriptions.
17524 (Option Cross Key): Update.
17525 Add --graph.
17526
17527 2001-09-18 Marc Autret <autret_m@epita.fr>
17528
17529 * tests/regression.at: New test (comment in %union).
17530
17531 2001-09-18 Marc Autret <autret_m@epita.fr>
17532
17533 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
17534 do that.
17535 Reported by Keith Browne.
17536
17537 2001-09-18 Marc Autret <autret_m@epita.fr>
17538
17539 * tests/output.at: Add tests for --defines and --graph.
17540
17541 2001-09-18 Marc Autret <autret_m@epita.fr>
17542
17543 * tests/output.at: Removes tests of %{header,src}_extension features.
17544
17545 2001-09-18 Akim Demaille <akim@epita.fr>
17546
17547 * tests/Makefile.am (package.m4): New.
17548 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
17549 (_AT_CHECK_CALC_ERROR): Likewise.
17550 Factor the `, ' part of verbose error messages.
17551
17552 2001-09-18 Marc Autret <autret_m@epita.fr>
17553
17554 * src/getargs.c (longopts): Declare --defines and --graph as options
17555 with optional arguments.
17556 * src/files.h: Add extern declarations.
17557 * src/files.c (spec_graph_file, spec_defines_file): New.
17558 (output_files): Update.
17559 Remove CPP-outed code.
17560
17561 2001-09-18 Marc Autret <autret_m@epita.fr>
17562
17563 Turn off %{source,header}_extension feature.
17564
17565 * src/files.c (compute_exts_from_gf): Update.
17566 (compute_exts_from_src): Update.
17567 (output_files): CPP-out useless code.
17568 * src/files.h: Remove {header,source}_extension extern declarations.
17569 * src/reader.c (parse_dquoted_param): CPP-out.
17570 (parse_header_extension_decl): Remove.
17571 (parse_source_extension_decl): Remove.
17572 (read_declarations): Remove cases tok_{hdrext,srcext}.
17573 * src/lex.c (percent_table): Remove {header,source}_extension entries.
17574 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
17575
17576 2001-09-10 Akim Demaille <akim@epita.fr>
17577
17578 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
17579 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
17580 (AT_CHECK_OUTPUT): this.
17581 Merely check ls' exit status, its output is useless.
17582
17583 2001-09-10 Akim Demaille <akim@epita.fr>
17584
17585 * tests/calc.at: Use m4_match.
17586 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
17587
17588 2001-09-10 Marc Autret <autret_m@epita.fr>,
17589 Akim Demaille <akim@epita.fr>
17590
17591 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
17592 enum color_e.
17593 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
17594 to `normal'.
17595 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
17596 * src/lex.h: Adjust prototype.
17597 (token_t): Add `tok_undef'.
17598 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
17599 (parse_percent_token): Now returns token_t.
17600 Add default statement in switch.
17601 (lex): Separate `c' as an input variable, from the token_t result
17602 part.
17603 (unlexed): Is a token_t.
17604
17605 2001-09-10 Akim Demaille <akim@epita.fr>
17606
17607 * configure.in: Bump to 1.29a.
17608
17609 2001-09-07 Akim Demaille <akim@epita.fr>
17610
17611 Version 1.29.
17612
17613 2001-08-30 Akim Demaille <akim@epita.fr>
17614
17615 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
17616 * m4/atconfig.m4: Remove.
17617 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
17618 * tests/bison: New.
17619 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
17620 m4_if, m4_patsubst, and m4_regexp.
17621 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
17622 `input' file instead of echo.
17623
17624 2001-08-29 Akim Demaille <akim@epita.fr>
17625
17626 Bump to 1.28e.
17627
17628 2001-08-29 Akim Demaille <akim@epita.fr>
17629
17630 Version 1.28d.
17631
17632 2001-08-29 Paul Eggert <eggert@twinsun.com>
17633
17634 * src/bison.simple (yyparse): Don't take the address of an
17635 item before the start of an array, as that doesn't conform to
17636 the C Standard.
17637
17638 2001-08-29 Robert Anisko <anisko_r@epita.fr>
17639
17640 * doc/bison.texinfo (Location Tracking Calc): New node.
17641
17642 2001-08-29 Paul Eggert <eggert@twinsun.com>
17643
17644 * src/output.c (output): Do not define const, as this now
17645 causes more problems than it cures.
17646
17647 2001-08-29 Akim Demaille <akim@epita.fr>
17648
17649 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17650 the nodes.
17651 Be sure to tag the `detailmenu'.
17652
17653 2001-08-29 Akim Demaille <akim@epita.fr>
17654
17655 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17656 download in a tmp dir.
17657
17658 2001-08-28 Marc Autret <autret_m@epita.fr>
17659
17660 * config/depcomp: New file.
17661
17662 2001-08-28 Marc Autret <autret_m@epita.fr>
17663
17664 * doc/bison.1 (mandoc): Adjust.
17665 From Juan Manuel Guerrero.
17666
17667 2001-08-28 Marc Autret <autret_m@epita.fr>
17668
17669 * src/print_graph.c (print_state): Fix.
17670
17671 2001-08-27 Marc Autret <autret_m@epita.fr>
17672
17673 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17674 char * members.
17675 Echo modifications to the functions prototypes.
17676 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17677
17678 2001-08-27 Marc Autret <autret_m@epita.fr>
17679
17680 * src/vcg.c: Include `xalloc.h'.
17681 (add_colorentry): New.
17682 (add_classname): New.
17683 (add_infoname): New.
17684 * src/vcg.h: Add new prototypes.
17685
17686 2001-08-27 Akim Demaille <akim@epita.fr>
17687
17688 * Makefile.maint: Sync. again with CVS Autoconf.
17689
17690 2001-08-27 Akim Demaille <akim@epita.fr>
17691
17692 * Makefile.maint: Formatting changes.
17693 (po-update, cvs-update, update): New targets.
17694 (AMTAR): Remove.
17695
17696 2001-08-27 Akim Demaille <akim@epita.fr>
17697
17698 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17699 * Makefile.maint: Sync. with CVS Autoconf.
17700
17701 2001-08-27 Marc Autret <autret_m@epita.fr>
17702
17703 * src/vcg.h (struct infoname_s): New.
17704 (struct colorentry_s): New.
17705 (graph_s): New fields {vertical,horizontal}_order in structure.
17706 Add `infoname' field.
17707 Add `colorentry' field;
17708 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17709 (G_HORIZONTAL_ORDER): New.
17710 (G_INFONAME): New.
17711 (G_COLORENTRY): New.
17712 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17713 Add output of `infoname'.
17714 Add output of `colorentry'.
17715
17716 2001-08-27 Marc Autret <autret_m@epita.fr>
17717
17718 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17719 This one shadowed a global parameter.
17720
17721 2001-08-24 Marc Autret <autret_m@epita.fr>
17722
17723 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17724 instead of `unsigned'.
17725 (print_state): Do not call obstack_object_size () in obstack_grow ()
17726 to avoid macro variables shadowing.
17727
17728 2001-08-23 Marc Autret <autret_m@epita.fr>
17729
17730 * src/lex.c (percent_table): Typo: s/naem/name/.
17731 Add graph option.
17732 Normalize new options declarations.
17733
17734 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17735
17736 * tests/suite.at: Exercise %header_extension and %source_extension.
17737
17738 2001-08-16 Marc Autret <autret_m@epita.fr>
17739
17740 * src/reader.c (parse_dquoted_param): New.
17741 (parse_header_extension_decl): Use it.
17742 (parse_source_extension_decl): Likewise.
17743
17744 2001-08-16 Marc Autret <autret_m@epita.fr>
17745
17746 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17747 (get_xxxx_str): Use assert () instead of complain ().
17748 Remove return invokations in default cases.
17749 (get_decision_str): Modify default behaviour. Remove second argument.
17750 Echo modifications on calls.
17751 (output_graph): Fix.
17752
17753 2001-08-16 Marc Autret <autret_m@epita.fr>
17754
17755 * src/getargs.c (usage): Update with ``-g, --graph''.
17756
17757 2001-08-16 Marc Autret <autret_m@epita.fr>
17758
17759 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17760 (Option Cross Key): Likewise.
17761 * doc/bison.1: Update.
17762
1c8c2190
PB
177632001-09-25 Pascal Bart <pascal.bart@epita.fr>
17764
17765 * src/output.c (output_master_parser): Don't finish action_obstack.
17766 (output_parser): Don't care about the muscle action, here.
17767 (prepare): Copy the action_obstack in the action muscle.
17768 (output): Free action_obstack.
17769
180d45ba
PB
177702001-09-23 Pascal Bart <pascal.bart@epita.fr>
17771
17772 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17773 will contain `%union' declaration.
17774 (parse_union_decl): Delete #line directive output.
17775 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17776 informations about %union.
17777 (parse_union_decl): Copy the union_obstack in the muscle stype.
17778 * src/bison.simple: Add new #line directive.
17779 Add typdef %%stype YYSTYPE.
17780
c51d1a19
PB
177812001-09-23 Pascal Bart <pascal.bart@epita.fr>
17782
17783 * src/bison.simple: Add new `#line' directive.
17784
6f9344da
PB
177852001-09-22 Pascal Bart <pascal.bart@epita.fr>
17786
17787 * src/bison.simple: New `#line' directive.
17788 * src/output.c (output_parser): Support new dynamic muscle input_line.
17789
652def80
MA
177902001-09-22 Marc Autret <autret_m@epita.fr>
17791
17792 * src/output.c (output_master_parser): New.
17793 (output_parser): Be more re-entrant.
17794
25b222fa
MA
177952001-09-21 Marc Autret <autret_m@epita.fr>
17796
17797 * src/reader.c (copy_definition, parse_union_decl): Update and use
17798 `linef' muscle.
17799 (copy_action): Likewise.
17800 Use obstack_1grow ().
17801 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17802
6bc35ae5
MA
178032001-09-21 Marc Autret <autret_m@epita.fr>
17804
17805 * src/options.c (option_table): Adjust.
17806 * src/lex.c (parse_percent_token): Fix.
17807
c0629aa1
PB
178082001-09-20 Pascal Bart <pascal.bart@epita.fr>
17809
17810 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 17811
82b6d266
PB
178122001-09-20 Pascal Bart <pascal.bart@epita.fr>
17813
17814 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17815 is now an option_table_struct*.
17816 (option_strcmp): New function option_strcmp.
17817 (parse_percent_token): Call option_strcmp.
17818 * src/getargs.c (xalloc.h, options.h): Include it.
17819 (getargs): Call create_long_option_table.
17820 (getargs): Free longopts at the end of the function.
17821 (shortopts): Move in options.c.
17822 * src/options.c (create_long_option_table): New function. Convert
17823 information from option_table to option structure.
17824 * src/reader.c (options.h): Include it.
17825
17826 * src/Makefile.am: Adjust.
17827 * src/options.c (option_table): Create from longopts and percent_table.
17828 * src/getargs.c (longopts): Delete.
17829 * src/lex.c (struct percent_table_struct): Delete.
17830 (percent_table): Delete.
17831 (options.h): Include it.
17832 * src/options.c: Create.
17833 * src/options.h: Create.
17834 Declare enum opt_access_e.
17835 Define struct option_table_struct.
17836
75f5aaea
MA
178372001-09-20 Marc Autret <autret_m@epita.fr>
17838
17839 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
17840 sections of Bison.
17841
f508cb0a
PB
178422001-09-19 Pascal Bart <pascal.bart@epita.fr>
17843
17844 * src/bison.simple: s/%%filename/%%skeleton.
17845 * src/muscle_tab.c (getargs.h): Include it.
17846 (muscle_init): Insert new muscle skeleton.
17847
13105fc1
PB
178482001-09-18 Pascal Bart <pascal.bart@epita.fr>
17849
17850 * src/output.c (output_parser): Delete unused variable actions_dumped.
17851
b0c4483e
PB
178522001-09-07 Pascal Bart <pascal.bart@epita.fr>
17853
17854 * src/output.c (output): Delete call to reader_output_yylsp.
17855 * src/reader.c (reader): Likewise.
ba0fe3c7 17856 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 17857
11d82f03
MA
178582001-09-02 Marc Autret <autret_m@epita.fr>
17859
17860 * src/reader.c: Include muscle_tab.h.
17861 (parse_union_decl): Update.
17862 (parse_macro_decl): Rename parse_muscle_decl.
17863 Update to use renamed functions and variable.
17864 (read_declarations, copy_action, read_additionnal_code, : Updated
17865 with correct variables and functions names.
17866 (packsymbols, reader): Likewise.
342b8b6e 17867
11d82f03 17868 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 17869
11d82f03
MA
17870 * src/output.c: Include muscle_tab.h
17871 In all functions using macro_insert, change by using muscle_insert ().
17872 (macro_obstack): Rename muscle_obstack.
17873 Echo modifications in the whole file.
17874 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
17875 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
17876 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
17877
17878 * src/muscle_tab.h: Update double inclusion macros.
17879 (macro_entry_s): Rename muscle_entry_s.
17880 Update prototypes.
342b8b6e 17881
11d82f03
MA
17882 * src/muscle_tab.c: Include muscle_tab.h.
17883 Rename macro_tabble to muscle_table.
17884 (mhash1, mhash2, mcmp): Use muscle_entry.
17885 (macro_init): Rename muscle_init. Update.
17886 (macro_insert): Rename muscle_insert. Update.
17887 (macro_find): Rename muscle_find. Update.
17888
17889 * src/main.c: Include muscle_tab.h.
17890 (main): Call muscle_init ().
17891 * src/Makefile.am (bison_SOURCES): Echo modifications.
17892
93a37297
MA
178932001-09-02 Marc Autret <autret_m@epita.fr>
17894
f753cd62 17895 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 17896
f753cd62
MA
17897 * src/muscle_tab.c, src/muscle_tab.h: Add files.
17898
178992001-09-02 Marc Autret <autret_m@epita.fr>
17900
17901 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 17902
682d48cd
PB
179032001-09-01 Pascal Bart <pascal.bart@epita.fr>
17904
342b8b6e 17905 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
17906 filename.
17907
087c8fda
MA
179082001-09-01 Marc Autret <autret_m@epita.fr>
17909
17910 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
17911 to an explicit value to activate the feature. We do it here.
17912
dda680cb
PB
179132001-08-31 Pascal Bart <pascal.bart@epita.fr>
17914
17915 * src/output.c (prepare): Delete the `filename' muscule insertion.
17916 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
17917 (parse_union_decl): Likewise.
17918 * src/macrotab.c (macro_init): Initialize filename by infile.
17919
9e644e64
MA
179202001-08-31 Marc Autret <autret_m@epita.fr>
17921
17922 * src/bison.simple (YYLSP_NEEDED): New definition.
17923 * src/output.c (prepare): Add macro insertion of `locations_flag'
17924
17da6427
PB
179252001-08-31 Pascal Bart <pascal.bart@epita.fr>
17926
17927 * src/output.c (prepare): Delete insertion of previous muscles,
17928 and insert the `prefix' muscles.
17929 * src/macrotab.c (macro_init): Likewise.
17930 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 17931 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
17932 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
17933 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 17934 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
17935 name_prefix.
17936
e8cb70b9
PB
179372001-08-31 Pascal Bart <pascal.bart@epita.fr>
17938
17939 * src/main.c (main): Standardize.
17940 * src/output.c (output_table_data, output_parser): Likewise.
17941 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
17942
63c2d5de
MA
179432001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
17944
342b8b6e 17945 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
17946 %%epilogue.
17947 * src/output.c (output): Rename %%declarations to %%prologue.
17948 * src/bison.simple: Echo modifications.
342b8b6e 17949
d8cb5183
MA
179502001-08-31 Marc Autret <autret_m@epita.fr>
17951
17952 * src/reader.c (readgram): CleanUp.
17953 (output_token_defines): Likewise.
17954 (packsymbols): Likewise.
17955 (reader): Likewise.
17956 * src/output.c (output): CPP-out useless code.
17957
6c686258
PB
179582001-08-31 Pascal Bart <pascal.bart@epita.fr>
17959
342b8b6e 17960 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
17961 output_trailers and output_headers.
17962 * src/output.h: Remove obsolete functions prototypes of output_headers
17963 and output_trailers.
17964
8f451ef7
PB
179652001-08-30 Pascal Bart <pascal.bart@epita.fr>
17966
17967 * src/main.c: Include macrotab.h.
342b8b6e 17968 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
17969 Adjust functions prototypes.
17970 * src/macrotab.c (macro_insert): Constify key and value.
17971 (macro_find): Constify key.
17972 (macro_insert): Include 'xalloc.h'
17973 (macro_insert): Use XMALLOC.
17974 (macro_find): Constify return value.
17975 * src/output.c (output_table_data): Rename table to table_data.
17976 (output_parser): Constify macro_key, macro_value.
17977
997b6fd0 179782001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
17979
17980 * src/reader.c (parse_skel_decl): New.
342b8b6e 17981 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
17982 * src/lex.h (token_t): New token `tok_skel'.
17983 * src/lex.c (percent_table): Add skeleton option entry.
17984 Standardize.
17985
ff48177d
MA
179862001-08-29 Marc Autret <autret_m@epita.fr>
17987
17988 * src/bison.simple: Add %%user_code directive at the end.
17989 * src/reader.c (read_additionnal_code): New.
17990 (reader): Use it.
17991 * src/output.c (output_program): Remove.
17992 (output): Update.
17993
b33160bf
MA
179942001-08-28 Marc Autret <autret_m@epita.fr>
17995
17996 * src/output.c (output_actions): Clean up.
4e5caae2 17997 (output_gram): CPP-out useless code.
b33160bf
MA
17998 * src/reader.c (reader): Clean up, CPP-out useless code.
17999
d1a2daf7
PB
180002001-08-28 Pascal Bart <pascal.bart@epita.fr>
18001
342b8b6e 18002 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 18003 directive.
d1a2daf7
PB
18004 * src/bison.simple: Add `%%definitions'.
18005
2b763dfe
MA
180062001-08-28 Marc Autret <autret_m@epita.fr>
18007
18008 * config/depcomp: New file.
18009
f1a87ef6
PE
180102001-08-27 Paul Eggert <eggert@twinsun.com>
18011
18012 * src/bison.simple (yyparse): Don't take the address of an
18013 item before the start of an array, as that doesn't conform to
18014 the C Standard.
18015
82e236e2
RA
180162001-08-27 Robert Anisko <robert.anisko@epita.fr>
18017
f1a87ef6 18018 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
18019 obstack. It was done too late here.
18020
18021 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
18022 completely wrong.
18023 (reader): Initialize the macro obstack here, since we need it to grow
18024 '%define' directives.
18025
18026 * src/reader.h: Declare the macro obstack as extern.
18027
b0cfa28a
RA
180282001-08-27 Robert Anisko <robert.anisko@epita.fr>
18029
18030 * src/output.c (output_parser): Fix. Store single '%' characters in
18031 the output obstack instead of throwing them away.
18032
6fc74234
AD
180332001-08-27 Akim Demaille <akim@epita.fr>
18034
18035 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18036
9c76d118
RA
180372001-08-25 Robert Anisko <robert.anisko@epita.fr>
18038
18039 * lib/Makefile.am: Adjust.
18040
a8289c62
RA
180412001-08-25 Robert Anisko <robert.anisko@epita.fr>
18042
18043 * src/bison.simple: Update and add '%%' directives.
18044
b6610515
RA
180452001-08-25 Robert Anisko <robert.anisko@epita.fr>
18046
18047 * src/reader.c (reader): Remove calls to 'output_headers' and
18048 'output_trailers'. Remove some C output.
18049 (readgram): Disable a piece of code that was writing a default
18050 definition for 'YYSTYPE'.
18051 (reader_output_yylsp): Remove.
18052 (packsymbols): Output token defintions to a macro.
18053 (copy_definition): Disable C output.
6fc74234 18054
b6610515
RA
18055 * src/reader.c (parse_macro_decl): New function used to parse macro
18056 declarations.
18057 (copy_string2): Put the body of copy_string into this new function.
18058 Add a parameter to let the caller choose whether he wants to copy the
18059 string delimiters or not.
18060 (copy_string): Be a simple call to copy_string2 with the last argument
18061 bound to true.
18062 (read_declarations): Add case for macro definition.
18063 (copy_identifier): New.
6fc74234 18064 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
18065 rather than lex.
18066
26f609ff
RA
180672001-08-25 Robert Anisko <robert.anisko@epita.fr>
18068
18069 * src/output.c (prepare): Add prefixed names.
18070 (output_parser): Output semantic actions.
18071 (output_parser): Fix bug on '%%line' directives.
6fc74234 18072
26f609ff
RA
18073 * src/output.c (output_headers): Remove. The C code printed by this
18074 function should now be in the skeletons.
18075 (output_trailers): Remove.
18076 (output): Disable call to 'reader_output_yylsp'.
18077 (output_rule_data): Do not output tables to the table obstack.
18078
18079 * src/output.c: Remove some C dedicated output.
18080 Improve the use of macro and output obstacks.
18081 (output_defines): Remove.
6fc74234 18082
26f609ff
RA
18083 * src/output.c (output_token_translations): Associate 'translate'
18084 table with a macro. No output to the table obstack.
18085 (output_gram): Same for 'rhs' and 'prhs'.
18086 (output_stos): Same for 'stos'.
18087 (output_rule_data): Same for 'r1' and 'r2'.
18088 (token_actions): Same for 'defact'.
18089 (goto_actions): Same for 'defgoto'.
18090 (output_base): Same for 'pact' and 'pgoto'.
18091 (output_table): Same for 'table'.
18092 (output_check): Same for 'check'.
6fc74234 18093
26f609ff
RA
18094 * src/output.c (output_table_data): New function.
18095 (output_short_table): Remove.
18096 (output_short_or_char_table): Remove.
6fc74234 18097
26f609ff
RA
18098 * src/output.c (output_parser): Replace most of the skeleton copy code
18099 with something new. Skeletons are now processed character by character
18100 rather than line by line, and Bison looks for '%%' macros. This is the
18101 first step in making Bison's output process (a lot) more flexible.
18102 (output_parser): Use the macro table.
18103
6f43b113
RA
181042001-08-25 Robert Anisko <robert.anisko@epita.fr>
18105
18106 * src/main.c (main): Initialize the macro table.
18107
dd3127cf
RA
181082001-08-25 Robert Anisko <robert.anisko@epita.fr>
18109
18110 * src/lex.c (percent_table): Add tok_define.
18111 * src/lex.h: Add tok_define.
18112
aa321494
RA
181132001-08-25 Robert Anisko <robert.anisko@epita.fr>
18114
18115 * src/macrotab.c: New file.
18116 * src/macrotab.h: New file.
18117 * src/Makefile.am: Update.
18118
68bd3b6b
RA
181192001-08-25 Robert Anisko <robert.anisko@epita.fr>
18120
18121 * lib/hash.c: New file.
18122 * lib/hash.h: New file.
18123 * lib/Makefile.am: Update.
18124
45f8dd1e
AD
181252001-08-15 Akim Demaille <akim@epita.fr>
18126
18127 Version 1.28c.
18128
40a64a7a 181292001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
18130
18131 * src/reader.c (readgram): Indent output macro YYSTYPE.
18132 (packsymbols): Likewise.
18133 (output_token_defines): Likewise.
18134 * src/files.c: Standardize.
18135 (compute_header_macro): New.
18136 (defines_obstack_save): New. Use compute_header_macro.
18137 (output_files): Update. Use defines_obstack_save.
18138
f9a8293a
AD
181392001-08-15 Akim Demaille <akim@epita.fr>
18140
18141 * doc/bison.texinfo (Table of Symbols): Document
18142 YYSTACK_USE_ALLOCA.
18143
150ca7a7
AD
181442001-08-15 Akim Demaille <akim@epita.fr>
18145
18146 * missing: Update from CVS Automake.
18147 * config/config.guess, config/config.sub, config/texinfo.tex:
18148 Update from gnu.org.
18149
69b5cec4
AD
181502001-08-15 Akim Demaille <akim@epita.fr>
18151
18152 * Makefile.maint: Sync with CVS Autoconf.
18153
f2b5126e
PB
181542001-08-14 Pascal Bart <pascal.bart@epita.fr>
18155
69b5cec4 18156 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
18157 `fdl.texi'.
18158 * doc/fdl.texi: Add to package.
18159
4ecbf796
MA
181602001-08-14 Marc Autret <autret_m@epita.fr>
18161
18162 Turn on %{source,header}_extension features.
18163
69b5cec4 18164 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
18165 source_extension.
18166 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 18167 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
18168 between options.
18169
95fb5662
MA
181702001-08-14 Marc Autret <autret_m@epita.fr>
18171
18172 * src/files.c (compute_base_names): Add extensions computing when
18173 `--file-prefix' used.
18174 Standardize function calls.
18175
78d09da9
MA
181762001-08-13 Marc Autret <autret_m@epita.fr>
18177
69b5cec4 18178 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
18179 defining it (defined but null disables alloca).
18180
5a009f2c
MA
181812001-08-13 Marc Autret <autret_m@epita.fr>
18182
18183 * src/bison.simple (_yy_memcpy): CPP reformat.
18184
1e41465a
PB
181852001-08-13 Pascal Bart <pascal.bart@epita.fr>
18186
18187 * tests/atconfig.in (CPPFLAGS): Fix.
18188
c67a198d
PB
181892001-08-10 Pascal Bart <pascal.bart@epita.fr>
18190
79282c6c 18191 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
18192 `gpl.texi'.
18193 * doc/gpl.texi: Add to package.
18194
09a6de7e
MA
181952001-08-10 Marc Autret <autret_m@epita.fr>
18196
18197 * src/print_graph.h: Fix.
18198 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
18199
b77b9ee0
AD
182002001-08-10 Akim Demaille <akim@epita.fr>
18201
18202 * src/system.h: Provide default declarations for stpcpy, strndup,
18203 and strnlen.
18204
3e259915
MA
182052001-08-10 Robert Anisko <anisko_r@epita.fr>
18206
18207 * doc/bison.texinfo (Locations): Update @$ stuff.
18208
ca96bc2d
MA
182092001-08-09 Robert Anisko <anisko_r@epita.fr>
18210
18211 * src/bison.simple (YYLLOC_DEFAULT): Update.
18212 (yyparse): Adjust.
18213
fdc6758b
MA
182142001-08-08 Marc Autret <autret_m@epita.fr>
18215
b77b9ee0 18216 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
18217 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
18218 Reported by Fabrice Bauzac.
957d4dbf 18219
600cad3b
MA
182202001-08-08 Marc Autret <autret_m@epita.fr>
18221
18222 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
18223 * src/vcg.c (output_node): Fix.
18224 * src/vcg.h: Cleanup.
18225 * src/print_graph.c: Add comments.
b77b9ee0 18226 (node_output_size): New global variable. Simplify the formatting of
600cad3b 18227 the VCG graph output.
b77b9ee0 18228 (print_actions): Unused code is now used. It notifies the final state
600cad3b 18229 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 18230 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
18231 blue.
18232 Get the current node name and node_obstack by argument.
18233 (node_obstack): New variable.
18234 (print_state): Manage node_obstack.
18235 (print_core): Use node_obstack given by argument.
18236 A node is not only computed here but in print_actions also.
18237 (print_graph): CPP out useless code instead of commenting it.
18238
976e528f
AD
182392001-08-07 Pascal Bart <pascal.bart@epita.fr>
18240
18241 * tests/atconfig.in (CPPFLAGS): Fix.
18242
20e8e5ca
AD
182432001-08-07 Akim Demaille <akim@epita.fr>
18244
18245 * src/print_graph.c (quote): New.
18246 (print_core): Use it.
18247
957d4dbf 182482001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 18249
3e3da797
AD
18250 * src/vcg.c (complain.h): Include it.
18251 Unepitaize `return' invocations.
c4b66126 18252 [NDEBUG] (main): Remove.
79282c6c 18253 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
18254 * src/files.c (open_files): Initialize graph_obstack.
18255 * src/print_graph.c (print_actions): CPP out useless code.
18256 (print_core): Don't output the last `\n' in labels.
18257 Use `quote'.
18258 * src/files.c (output_files): Output the VCG file.
18259 * src/main.c (main): Invoke print_graph ();
3e3da797 18260
957d4dbf 182612001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
18262
18263 Automaton VCG graph output.
18264 Using option ``-g'' or long option ``--graph'', you can generate
18265 a gram_filename.vcg file containing a VCG description of the LALR (1)
18266 automaton of your grammar.
18267
18268 * src/main.c: Call to print_graph() function.
18269 * src/getargs.h: Update.
18270 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
18271 (graph_flag): New flag.
18272 (longopts): Update.
18273 (getargs): Add case `g'.
18274 * src/files.c (graph_obstack): New obstack struct.
18275 (open_files): Initialize new obstack.
18276 (output_files): Saves graph_obstack if required.
18277 * src/files.h (graph_obstack): New extern declaration.
18278 * src/Makefile.am: Add new source files.
18279
927c1557 182802001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
18281
18282 * src/print_graph.c, src/print_graph.h (graph): New.
18283 * src/vcg.h: New file.
18284 * src/vcg.c: New file, VCG graph handling.
18285
7333d403
AD
182862001-08-06 Marc Autret <autret_m@epita.fr>
18287
18288 Add of %source_extension and %header_extension which specify
18289 the source or/and the header output file extension.
18290
18291 * src/files.c (compute_base_names): Remove initialisation of
18292 src_extension and header_extension.
18293 (compute_exts_from_gf): Update.
18294 (compute_exts_from_src): Update.
18295 (output_files): Update.
18296 * src/reader.c (parse_header_extension_decl): New.
18297 (parse_source_extension_decl): New.
18298 (read_declarations): New case statements for the new tokens.
18299 * src/lex.c (percent_table): Add entries for %source_extension
18300 and %header_extension.
18301 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
18302
84163231
AD
183032001-08-06 Marc Autret <autret_m@epita.fr>
18304
18305 * configure.in: Bump to 1.28c.
18306 * doc/bison.texinfo: Texinfo thingies.
18307
8303fc42
AD
183082001-08-04 Pascal Bart <pascal.bart@epita.fr>
18309
18310 * tests/atconfig.in (CPPFLAGS): Add.
18311 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
18312
70a84437
AD
183132001-08-03 Akim Demaille <akim@epita.fr>
18314
18315 Version 1.28b.
18316
2ce10144
AD
183172001-08-03 Akim Demaille <akim@epita.fr>
18318
18319 * tests/Makefile.am (check-local): Ship testsuite.
18320 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
18321 Include `string.h'.
18322
1e3e4bc1
AD
183232001-08-03 Akim Demaille <akim@epita.fr>
18324
18325 * configure.in: Try using -Wformat when compiling.
18326
42b45b7f
AD
183272001-08-03 Akim Demaille <akim@epita.fr>
18328
18329 * configure.in: Bump to 1.28b.
18330
8f13fe33
AD
183312001-08-03 Akim Demaille <akim@epita.fr>
18332
18333 * src/complain.c: Adjust strerror_r portability issues.
18334
b37ba92c
AD
183352001-08-03 Akim Demaille <akim@epita.fr>
18336
18337 Version 1.28a.
18338
b0ce6046
AD
183392001-08-03 Akim Demaille <akim@epita.fr>
18340
18341 * src/getargs.c, src/getarg.h (skeleton)): Constify.
18342 * src/lex.c (literalchar): Avoid name clashes on `buf'.
18343 * src/getargs.c: Include complain.h.
18344 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
18345 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
18346
d01c415b
AD
183472001-08-03 Akim Demaille <akim@epita.fr>
18348
18349 * src/reader.c (readgram): Display hidden chars in error messages.
18350
459dd1a6
AD
183512001-08-03 Akim Demaille <akim@epita.fr>
18352
18353 Update to gettext 0.10.39.
18354
53b74c0c
AD
183552001-08-03 Akim Demaille <akim@epita.fr>
18356
18357 * lib/strspn.c: New.
18358
234a3be3
AD
183592001-08-01 Marc Autret <autret_m@epita.fr>
18360
18361 * doc/bison.texinfo: Update.
18362 * doc/bison.1 (mandoc): Update.
18363 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
18364 * src/files.c: Support output files extensions computing.
18365 (src_extension): New static variable.
18366 (header_extension): New static variable.
18367 (tr): New function.
18368 (get_extension_index): New function, gets the index of an extension
18369 filename in a string.
18370 (compute_exts_from_gf): New function, computes extensions from the
18371 grammar file extension.
18372 (compute_exts_from_src): New functions, computes extensions from the
18373 C source file extension, file given by ``-o'' option.
18374 (compute_base_names): Update.
18375 (output_files): Update.
18376
847bf1f5
AD
183772001-08-01 Robert Anisko <anisko_r@epita.fr>
18378
d995fee7 18379 * doc/bison.texi: Document @$.
847bf1f5
AD
18380 (Locations): New section.
18381
d074a105
AD
183822001-07-18 Akim Demaille <akim@epita.fr>
18383
18384 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
18385 * config/prev-version.txt, config/move-if-change: New.
18386 * Makefile.am: Adjust.
18387
3419715d
AD
183882001-07-08 Pascal Bart <pascal.bart@epita.fr>
18389
18390 * src/bison.simple (yyparse): Suppress warning `comparaison
18391 between signed and unsigned'.
18392
62ab6972
AD
183932001-07-05 Pascal Bart <pascal.bart@epita.fr>
18394
18395 * src/getargs.h (raw_flag): Remove.
18396 * src/getargs.c: Die on `-r'/`--raw'.
18397 * src/lex.c (parse_percent_token): Die on `%raw'.
18398 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
18399 * tests/calc.at: Suppress test with option `--raw'.
18400
1e24cc5b
AD
184012001-07-14 Akim Demaille <akim@epita.fr>
18402
18403 * config/: New.
18404 * configure.in: Require Autoconf 2.50.
18405 Update to gettext 0.10.38.
18406
32dfccf8
AD
184072001-03-16 Akim Demaille <akim@epita.fr>
18408
18409 * doc/bison.texinfo: ANSIfy the examples.
18410
cd5bd6ac
AD
184112001-03-16 Akim Demaille <akim@epita.fr>
18412
18413 * getargs.c (skeleton): New variable.
18414 (longopts): --skeleton is a new option.
18415 (shortopts, getargs): -S is a new option.
18416 * getargs.h: Declare skeleton.
18417 * output.c (output_parser): Use it.
18418
5141b016
AD
184192001-03-16 Akim Demaille <akim@epita.fr>
18420
18421 * m4/strerror_r.m4: New.
18422 * m4/error.m4: Run AC_FUNC_STRERROR_R.
18423 * lib/error.h, lib/error.c: Update.
18424
447992b9
AD
184252001-03-16 Akim Demaille <akim@epita.fr>
18426
18427 * src/getargs.c (longopts): Clean up.
18428
274d42ce
AD
184292001-02-21 Akim Demaille <akim@epita.fr>
18430
18431 * src/reader.c (gensym): `gensym_count' is your own.
18432 Use a static buf to create the symbol name, as token_buffer is no
18433 longer a buffer.
18434
22c821f3
AD
184352001-02-08 Akim Demaille <akim@epita.fr>
18436
18437 * src/conflicts.c (conflict_report): Be sure not to append to res
18438 between two calls, which could happen if both first sprintf were
18439 skipped, but not the first cp += strlen.
18440
18569462
AD
184412001-02-08 Akim Demaille <akim@epita.fr>
18442
18443 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
18444 New, from fileutils 4.0.37.
18445 * configure.in: Require Autoconf 2.49c. I took some time before
18446 making this decision. This is the only way out for portability
18447 issues in Bison, it would mean way too much duplicate effort to
18448 import in Bison features implemented in 2.49c since 2.13.
18449 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
18450
0d8f3c8a
AD
184512001-02-02 Akim Demaille <akim@epita.fr>
18452
18453 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 18454 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 18455
f17bcd1f
AD
184562001-01-19 Akim Demaille <akim@epita.fr>
18457
18458 Get rid of the ad hoc handling of token_buffer in the scanner: use
18459 the obstacks.
18460
18461 * src/lex.c (token_obstack): New.
18462 (init_lex): Initialize it. No longer call...
18463 (grow_token_buffer): this. Remove it.
18464 Adjust all the places which used it to use the obstack.
18465
511e79b3
AD
184662001-01-19 Akim Demaille <akim@epita.fr>
18467
18468 * src/lex.h: Rename all the tokens:
18469 s/\bENDFILE\b/tok_eof/g;
18470 s/\bIDENTIFIER\b/tok_identifier/g;
18471 etc.
18472 Let them be enums, not #define, to ease debugging.
18473 Adjust all the code.
18474
0d6508ef
AD
184752001-01-18 Akim Demaille <akim@epita.fr>
18476
18477 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
18478 * src/lex.c (maxtoken, grow_token_buffer): Static.
18479
6deb4447
AD
184802001-01-18 Akim Demaille <akim@epita.fr>
18481
18482 Since we now use obstacks, more % directives can be enabled.
18483
18484 * src/lex.c (percent_table): Also accept `%yacc',
18485 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
18486 `%debug'.
18487 Handle the actions for `%semantic_parser' and `%pure_parser' here,
18488 instead of returning a token.
18489 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
18490 * src/reader.c (read_declarations): Adjust.
18491 * src/files.c (open_files): Don't call `compute_base_names', don't
18492 compute `attrsfile' since they depend upon data which might be
18493 *in* the input file now.
18494 (output_files): Do it here.
18495 * src/output.c (output_headers): Document the fact that this patch
18496 introduces a guaranteed SEGV for semantic parsers.
18497 * doc/bison.texinfo: Document them.
18498 * tests/suite.at: Exercise these %options.
18499
ff4423cc
AD
185002000-12-20 Akim Demaille <akim@epita.fr>
18501
18502 Also handle the output file (--verbose) with obstacks.
18503
18504 * files.c (foutput): Remove.
18505 (output_obstack): New.
18506 Adjust all dependencies.
18507 * src/conflicts.c: Return a string.
18508 * src/system.h (obstack_grow_string): Rename as...
18509 (obstack_sgrow): this. Be ready to work with non literals.
18510 (obstack_fgrow4): New.
18511
956dba3a
AD
185122000-12-20 Akim Demaille <akim@epita.fr>
18513
18514 * src/files.c (open_files): Fix the computation of short_base_name
18515 in the case of `-o foo.tab.c'.
18516
337bab46
AD
185172000-12-20 Akim Demaille <akim@epita.fr>
18518
18519 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
18520 (copy_dollar): Now that everything uses obstacks, get rid of the
18521 FILE * parameters.
18522
5d3214b8
AD
185232000-12-20 Akim Demaille <akim@epita.fr>
18524
18525 * src/files.c (open_files): Actually the `.output' file is based
18526 on the short_base_name, not base_name.
18527 * tests/suite.at (Checking output file names): Adjust.
18528
29092a57
AD
185292000-12-20 Akim Demaille <akim@epita.fr>
18530
18531 * src/bison.s1: Remove, we now use directly...
18532 * src/bison.simple: this.
18533 * src/Makefile.am: Use pkgdata instead of data.
18534
ea5607fd
AD
185352000-12-20 Akim Demaille <akim@epita.fr>
18536
18537 * src/files.c (guard_obstack): New.
18538 (open_files): Initialize it.
18539 (output_files): Dump it...
18540 * src/files.h: Export it.
18541 * src/reader.c (copy_guard): Use it.
18542
27110317
AD
185432000-12-19 Akim Demaille <akim@epita.fr>
18544
18545 * src/files.c (outfile, defsfile, actfile): Removed as global
18546 vars.
18547 (open_files): Don't compute them.
18548 (output_files): Adjust.
18549 (base_name, short_base_name): Be global.
18550 Adjust dependencies.
18551
19c50364
AD
185522000-12-19 Akim Demaille <akim@epita.fr>
18553
18554 * src/files.c (strsuffix): New.
18555 (stringappend): Be just like strcat but allocate.
18556 (base_names): Eve out from open_files.
18557 Try to simplify the rather hairy computation of base_name and
18558 short_base_name.
18559 (open_files): Use it.
18560 * tests/suite.at (Checking output file names): New test.
18561
573c1d9f
AD
185622000-12-19 Akim Demaille <akim@epita.fr>
18563
18564 * src/system.h (obstack_grow_literal_string): Rename as...
18565 (obstack_grow_string): this.
18566 * src/output.c (output_parser): Recognize `%% actions' instead of
18567 `$'.
18568 * src/bison.s1: s/$/%% actions/.
18569 * src/bison.hairy: Likewise.
18570
ef7ddedd
AD
185712000-12-19 Akim Demaille <akim@epita.fr>
18572
18573 * src/output.c (output_parser): Compute the `#line' lines when
18574 there are.
18575 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
18576 Suggested by Hans Aberg.
18577
ff61dabd
AD
185782000-12-19 Akim Demaille <akim@epita.fr>
18579
18580 Let the handling of the skeleton files be local to the procedures
18581 that use it.
18582
18583 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
18584 longer static.
18585 (fparser, open_extra_files): Remove.
18586 (open_files, output_files): Don't take care of fparser.
18587 * src/files.h: Adjust.
18588 * src/output.c (output_parser): Open and close the file to the
18589 skeleton.
18590 * src/reader.c (read_declarations): When %semantic_parser, open
18591 fguard.
18592
55b96341
AD
185932000-12-19 Akim Demaille <akim@epita.fr>
18594
18595 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
18596 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
18597
358c15b7
AD
185982000-12-19 Akim Demaille <akim@epita.fr>
18599
18600 * src/files.c (open_files): Yipee! We no longer need all the code
18601 looking for `/tmp' since we have no tmp file.
18602
7de3329e
AD
186032000-12-19 Akim Demaille <akim@epita.fr>
18604
18605 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
18606 New macros.
18607 * src/files.c (open_files): Less dependency on MSDOS etc.
18608
3abcd459
AD
186092000-12-14 Akim Demaille <akim@epita.fr>
18610
18611 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
18612 Provide a default definition.
18613 Use it when executing the default @ action.
18614 * src/reader.c (reader_output_yylsp): No longer include
18615 `timestamp' and `text' in the default YYLTYPE.
18616
2a91a95e
AD
186172000-12-12 Akim Demaille <akim@epita.fr>
18618
18619 * src/reader.c (copy_definition, parse_union_decl, copy_action)
18620 (copy_guard): Quote the file names.
18621 Reported by Laurent Mascherpa.
18622
14d3eb9b
AD
186232000-12-12 Akim Demaille <akim@epita.fr>
18624
18625 * src/output.c (output_headers, output_program, output): Be sure
18626 to escape special characters when outputting filenames.
18627 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
18628 (output_headers): Don't depend on them, Use ACTSTR.
18629
d7045ec6
AD
186302000-11-17 Akim Demaille <akim@epita.fr>
18631
18632 * lib/obstack.h: Formatting changes.
18633 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
18634 prevents type checking.
18635 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
18636 cast the value to (void *): assigning a `foo *' to a `void *'
18637 variable is valid.
18638 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
18639 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
18640 append characters.
18641
6fd54b73
AD
186422000-11-17 Akim Demaille <akim@epita.fr>
18643
18644 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
18645 as...
18646 (suite.m4, regression.m4, calc.m4): these.
18647 * tests/atgeneral.m4: Update from CVS Autoconf.
18648
4c50eae6
AD
186492000-11-17 Akim Demaille <akim@epita.fr>
18650
18651 * tests/regression.m4 (%union and --defines): New test,
18652 demonstrating a current bug in the obstack implementation.
18653
a35f64ea
AD
186542000-11-17 Akim Demaille <akim@epita.fr>
18655
18656 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18657 macros.
18658 Use them to declare the variables which are global or local to
18659 `yyparse'.
18660
7de23534
AD
186612000-11-17 Akim Demaille <akim@epita.fr>
18662
18663 * acconfig.h: Remove, no longer used.
18664
aa7815f5
AD
186652000-11-07 Akim Demaille <akim@epita.fr>
18666
18667 * src: s/Copyright (C)/Copyright/g.
18668
5af1f549
AD
186692000-11-07 Akim Demaille <akim@epita.fr>
18670
18671 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18672 defining.
18673 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18674
553e2b22
AD
186752000-11-07 Akim Demaille <akim@epita.fr>
18676
18677 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18678 Merge in a single CPP if/else.
18679
8a4f41d6
AD
186802000-11-07 Akim Demaille <akim@epita.fr>
18681
18682 * src/output.c (output): Remove useless variables.
18683 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18684 argument `data' for consistency with the prototypes.
18685 Qualify it `const'.
18686 (obstack_copy, obstack_copy0): Rename the second argument as
18687 `address' for consistency. Qualify it `const'.
18688 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18689 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18690 `const' their input argument (`data' or `address').
18691 Adjust the corresponding macros to include `const' in casts.
18692
095a3fb5
AD
186932000-11-03 Akim Demaille <akim@epita.fr>
18694
18695 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18696 s/PFILE1/BISON_HAIRY/.
18697 Adjust dependencies.
18698
d1cdce7c
AD
186992000-11-03 Akim Demaille <akim@epita.fr>
18700
090c5ebf 18701 For some reason, this was not applied.
d1cdce7c
AD
18702
18703 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18704 `unlink': it's no longer used.
18705
9311529b
AD
187062000-11-03 Akim Demaille <akim@epita.fr>
18707
18708 * src/files.c (skeleton_find): New function, eved out of...
18709 (open_files, open_extra_files): here.
18710
d8880f69
AD
187112000-11-03 Akim Demaille <akim@epita.fr>
18712
18713 Don't use `atexit'.
18714
18715 * src/files.c (obstack_save): New function.
18716 (done): Rename as...
18717 (output_files): this.
18718 Use `obstack_save'.
18719 * src/main.c (main): Don't use `atexit' to register `done', since
18720 it no longer has to remove tmp files, just call `output_files'
18721 when there are no errors.
18722
0dbb648e
AD
187232000-11-02 Akim Demaille <akim@epita.fr>
18724
18725 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18726 `unlink': it's no longer used.
18727 * src/files.h: Formatting changes.
18728
896fe5c1
AD
187292000-11-02 Akim Demaille <akim@epita.fr>
18730
18731 Remove the last uses of mktemp and unlink/delete.
18732
18733 * src/files.c (fdefines, ftable): Removed.
18734 (defines_ostack, table_obstack): New.
18735 Adjust dependencies of the former into uses of the latter.
18736 * src/output.c (output_short_or_char_table, output_short_table):
18737 Convert to using obstacks.
18738 * src/reader.c (copy_comment2): Accept one FILE * and two
18739 obstacks.
18740 (output_token_defines, reader_output_yylsp): Use obstacks.
18741 * src/system.h (obstack_fgrow3): New.
1f65350a 18742 * po/POTFILES.in: Adjust.
896fe5c1 18743
dd60faec
AD
187442000-11-01 Akim Demaille <akim@epita.fr>
18745
18746 Change each use of `fattrs' into a use of `attrs_obstack'.
18747
18748 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18749 * src/files.c (fattrs): Remove.
18750 (attrs_obstack): New.
18751 Adjust all dependencies.
18752 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18753
8c7ebe49
AD
187542000-11-01 Akim Demaille <akim@epita.fr>
18755
18756 Introduce obstacks.
18757 Change each use of `faction' into a use of `action_obstack'.
18758
18759 * lib/obstack.h, lib/obstack.c: New files.
18760 * src/files.c (faction): Remove.
18761 (action_obstack): New.
18762 Adjust all dependencies.
18763
77aee789
AD
187642000-10-20 Akim Demaille <akim@epita.fr>
18765
18766 * lib/quote.h (PARAMS): New macro. Use it.
18767
43591cec
AD
187682000-10-16 Akim Demaille <akim@epita.fr>
18769
18770 * src/output.c (output_short_or_char_table): New function.
18771 (output_short_table, output_token_translations): Use it.
18772 (goto_actions): Use output_short_table.
18773
1e9798d5
AD
187742000-10-16 Akim Demaille <akim@epita.fr>
18775
18776 * src/symtab.c (bucket_new): New function.
18777 (getsym): Use it.
18778
18779 * src/output.c (output_short_table): New argument to display the
18780 comment associated with the table.
18781 Adjust dependencies.
18782 (output_gram): Use it.
18783 (output_rule_data): Nicer output layout for YYTNAME.
18784
f282676b
AD
187852000-10-16 Akim Demaille <akim@epita.fr>
18786
18787 * src/lex.c (read_typename): New function.
18788 (lex): Use it.
18789 * src/reader.c (copy_dollar): Likewise.
18790
550a72a3
AD
187912000-10-16 Akim Demaille <akim@epita.fr>
18792
18793 * src/reader.c (copy_comment2): Expect the input stream to be on
18794 the `/' which is suspected to open a comment, instead of being
18795 called after `//' or `/*' was read.
18796 (copy_comment, copy_definition, parse_union_decl, copy_action)
18797 (copy_guard): Adjust.
18798
131e2fef
AD
187992000-10-16 Akim Demaille <akim@epita.fr>
18800
18801 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18802 `read_signed_integer'.
18803
79282c5a
AD
188042000-10-16 Akim Demaille <akim@epita.fr>
18805
18806 * src/reader.c (copy_dollar): New function.
18807 (copy_guard, copy_action): Use it.
18808
ff4a34be
AD
188092000-10-16 Akim Demaille <akim@epita.fr>
18810
18811 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18812 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18813 New files, from Fileutils 4.0.27.
18814 * src/main.c (printable_version): Remove.
18815 * src/lex.c, src/reader.c: Use `quote'.
18816
188172000-10-04 Akim Demaille <akim@epita.fr>
18818
18819 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
18820
14ded682
AD
188212000-10-04 Akim Demaille <akim@epita.fr>
18822
18823 * doc/bison.texinfo: Various typos spotted by Neil Booth.
18824
8e03724b
AD
188252000-10-04 Akim Demaille <akim@epita.fr>
18826
18827 When a literal string is used to define two different tokens,
18828 `bison -v' segfaults.
18829 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
18830
18831 * tests/regression.m4: New file.
18832 Include the core of the sample provided by Piotr Gackiewicz.
18833 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
18834 properly.
18835
a9e64249
AD
188362000-10-04 Akim Demaille <akim@epita.fr>
18837
18838 * src/reader.c (parse_expect_decl): Keep `count' within the size
18839 of `buffer'.
18840 From Neil Booth.
18841
da9abf43
AD
188422000-10-02 Paul Eggert <eggert@twinsun.com>
18843
18844 * bison.s1 (yyparse): Assign the default value
18845 unconditionally, to avoid a GCC warning and make the parser a
18846 tad smaller.
18847
c33638bb
AD
188482000-10-02 Akim Demaille <akim@epita.fr>
18849
18850 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
18851 options.
18852
444c570a
AD
188532000-10-02 Akim Demaille <akim@epita.fr>
18854
18855 * src/derives.c, src/print.c, src/reduce.c: To ease the
18856 translation, move some `\n' out of the translated strings.
18857
89cab50d
AD
188582000-10-02 Akim Demaille <akim@epita.fr>
18859
18860 The location tracking mechanism is precious for parse error
18861 messages. Nevertheless, it is enabled only when `@n' is used in
18862 the grammar, which is a different issue (you can use it in error
18863 message, but not in the grammar per se). Therefore, there should
18864 be another means to enable it.
18865
18866 * src/getargs.c (getargs): Support `--locations'.
18867 (usage): Report it.
18868 * src/getargs.h (locationsflag): Export it.
18869 * src/lex.c (percent_table): Support `%locations'.
18870 * src/reader.c (yylsp_needed): Remove this variable, now replaced
18871 with `locationsflag'.
18872 * doc/bison.texinfo: Document `--locations' and `%locations'.
18873 Sort the options.
18874 * tests/calc.m4: Test it.
18875
18876 For regularity of the names, replace each
18877 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
18878 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
18879 In addition replace each `flag' with `_flag'.
18880
d6c2cba0
AD
188812000-10-02 Akim Demaille <akim@epita.fr>
18882
18883 Also test parse error messages, including with YYERROR_VERBOSE.
18884
18885 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
18886 associative).
18887 Use it to check the computations.
18888 Use it to check `nonassoc' is honored.
18889 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
18890 `--yyerror-verbose'.
18891 (_AT_CHECK_CALC): Adjust to this option.
18892 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
18893
5a35a6cb
AD
188942000-10-02 Akim Demaille <akim@epita.fr>
18895
18896 Test also `--verbose', `--defines' and `--name-prefix'. Testing
18897 the latter demonstrates a flaw in the handling of non debugging
18898 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
18899 was used in order to simplify:
18900
18901 #if YYDEBUG
18902 if (yydebug)
18903 {
18904 ...
18905 }
18906 #endif
18907
18908 into
18909
18910 if (yydebug)
18911 {
18912 ...
18913 }
18914
18915 unfortunately this leads to a CPP conflict when
18916 `--name-prefix=foo' is used since it produces `#define yydebug
18917 foodebug'.
18918
18919 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
18920 (YYDPRINTF): New macro.
18921 Spread its use.
18922 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
18923 the bison options.
18924 Also test `--verbose', `--defines' and `--name-prefix'.
18925
71da9eea
AD
189262000-10-02 Akim Demaille <akim@epita.fr>
18927
18928 Improve the readability of the produced parsers.
18929
18930 * src/bison.s1: Formatting changes.
18931 Improve the comment related to the `$' mark.
18932 (yydefault): Don't fall through to `yyresume': `goto' there.
18933 * src/output.c (output_parser): When the `$' is met, skip the end
18934 of its line.
18935 New variable, `number_of_dollar_signs', to check there's exactly
18936 one `$' in the parser skeleton.
18937
95e36146
AD
189382000-10-02 Akim Demaille <akim@epita.fr>
18939
18940 * lib/xstrdup.c: New file, from the fileutils.
18941 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
18942 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
18943 instead of strlen + xmalloc + strcpy.
18944 * src/symtab.c (copys): Remove, use xstrdup instead.
18945
d7020c20
AD
189462000-10-02 Akim Demaille <akim@epita.fr>
18947
18948 * src/gram.h (associativity): New enum type which replaces the
18949 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
18950 `right_assoc', `left_assoc' and `non_assoc'.
18951 Adjust all dependencies.
18952 * src/reader.c: Formatting changes.
18953 (LTYPESTR): Don't define it, use it as a literal in
18954 `reader_output_yylsp'.
18955 * src/symtab.h (symbol_class): New enum type which replaces the
18956 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
18957 `sunknown', `stoken and `snterm'.
18958
1916f98e
AD
189592000-10-02 Akim Demaille <akim@epita.fr>
18960
18961 * src/getargs.c (fixed_outfiles): Rename as...
18962 (yaccflag): for consistency and accuracy.
18963 Adjust dependencies.
18964
d7913476
AD
189652000-10-02 Akim Demaille <akim@epita.fr>
18966
18967 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
18968 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
18969 difficult and introduced a lot of core dump. It turns out that
18970 Bison used an implementation of `xmalloc' based on `calloc', and
18971 at various places it does depend upon the initialization to 0. I
18972 have not tried to isolate the pertinent places, and all the former
18973 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
18974 someone should address this issue.
18975
18976 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
18977 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
18978 files.
18979 Adjust dependencies.
18980 * src/warshall.h: New file.
18981 Propagate.
18982
340ef489
AD
189832000-10-02 Akim Demaille <akim@epita.fr>
18984
18985 Various anti-`extern in *.c' changes.
18986
18987 * src/system.h: Include `assert.h'.
18988
b2ca4022
AD
189892000-10-02 Akim Demaille <akim@epita.fr>
18990
18991 * src/state.h (nstates, final_state, first_state, first_shift)
18992 (first_reduction): Move their exportation from here...
18993 * src/LR0.h: to here.
18994 Adjust dependencies.
18995 * src/getargs.c (statisticsflag): New variable.
18996 Add support for `--statistics'.
18997 Adjust dependencies.
18998
18999 Remove a lot of now useless `extern' statements in most files.
19000
403b315b
AD
190012000-10-02 Akim Demaille <akim@epita.fr>
19002
19003 * src/LR0.h: New file.
19004 Propagate its use.
19005
07a58c13
AD
190062000-10-02 Akim Demaille <akim@epita.fr>
19007
19008 * src/print.h: New file.
19009 Propagate its use.
19010 * src/print.c: Formatting and ordering changes.
19011 (verbose, terse): Replace with...
19012 (print_results): this new function.
19013 Adjust dependencies.
19014
0619caf0
AD
190152000-10-02 Akim Demaille <akim@epita.fr>
19016
19017 * src/conflicts.c (conflict_report): New function.
19018 (conflict_log, verbose_conflict_log): Replace with...
19019 (print_conflicts): this function.
19020 Adjust dependencies.
19021 * src/conflicts.h: New file.
19022 Propagate its inclusion.
19023
3519ec76
AD
190242000-10-02 Akim Demaille <akim@epita.fr>
19025
19026 * src/nullable.h: New file.
19027 Propagate its inclusion.
19028 * src/nullable.c: Formatting changes.
19029
015acc48
AD
190302000-10-02 Akim Demaille <akim@epita.fr>
19031
19032 * src/reduce.h: New file.
19033 Propagate its inclusion.
19034 * src/reduce.c: Topological sort and other formatting changes.
19035 (bool, TRUE, FALSE): Move their definition to...
19036 * src/system.h: here.
19037
8963a27b
AD
190382000-10-02 Akim Demaille <akim@epita.fr>
19039
19040 * src/files.c: Formatting changes.
19041 (tryopen, tryclose, openfiles): Rename as...
19042 (xfopen, xfclose, open_files): this.
19043 (stringappend): static.
19044 * src/files.h: Complete the list of exported symbols.
19045 Propagate its use.
19046
a70083a3
AD
190472000-10-02 Akim Demaille <akim@epita.fr>
19048
19049 * src/reader.h: New file.
19050 Propagate its use instead of tedious list of `extern' and
19051 prototypes.
19052 * src/reader.c: Formatting changes, topological sort,
19053 s/register//.
19054
abadc117
AD
190552000-10-02 Akim Demaille <akim@epita.fr>
19056
19057 * src/lex.h: Prototype `lex.c' exported functions.
19058 * src/reader.c: Adjust.
19059 * src/lex.c: Formatting changes.
19060 (safegetc): Rename as...
19061 (xgetc): this.
19062
720d742f
AD
190632000-10-02 Akim Demaille <akim@epita.fr>
19064
19065 * src/lalr.h: New file.
19066 Propagate its inclusion instead of prototypes and `extern'.
19067 * src/lalr.c: Formatting changes, topological sorting etc.
19068
f2acea59
AD
190692000-10-02 Akim Demaille <akim@epita.fr>
19070
19071 * src/output.c (token_actions): Introduce a temporary array,
19072 YYDEFACT, that makes it possible for this function to use
19073 output_short_table.
19074
d019d655
AD
190752000-10-02 Akim Demaille <akim@epita.fr>
19076
19077 `user_toknums' is output as a `short[]' in `output.c', while it is
19078 defined as a `int[]' in `reader.c'. For consistency with the
19079 other output tables, `user_toknums' is now defined as a table of
19080 shorts.
19081
19082 * src/reader.c (user_toknums): Be a short table instead of an int
19083 table.
19084 Adjust dependencies.
19085
19086 Factor the short table outputs.
19087
19088 * src/output.c (output_short_table): New function.
19089 * src/output.c (output_gram, output_stos, output_rule_data)
19090 (output_base, output_table, output_check): Use it.
19091
6c89f1c1
AD
190922000-10-02 Akim Demaille <akim@epita.fr>
19093
19094 * src/output.c (output): Topological sort of the functions, in
19095 order to get rid of the `static' prototypes.
19096 No longer use `register'.
19097 * src/output.h: New file.
19098 Propagate its inclusion in files explicitly prototyping functions
19099 from output.c.
19100
d9efd181
AD
191012000-09-21 Akim Demaille <akim@epita.fr>
19102
19103 * src/atgeneral.m4: Update from Autoconf.
19104
c29240e7 191052000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
19106
19107 * src/closure.h: New file.
19108 * src/closure.c: Formatting changes, topological sort over the
19109 functions, use of closure.h.
19110 (initialize_closure, finalize_closure): Rename as...
19111 (new_closure, free_closure): these. Adjust dependencies.
19112 * src/LR0.c: Formatting changes, topological sort, use of
19113 cloture.h.
19114 (initialize_states): Rename as...
19115 (new_states): this.
19116 * src/Makefile.am (noinst_HEADERS): Adjust.
19117
499daa50
AD
191182000-09-20 Akim Demaille <akim@epita.fr>
19119
19120 * src/acconfig.h: Don't protect config.h against multiple
19121 inclusion.
19122 Don't define PARAMS.
19123 * src/system.h: Define PARAMS.
19124 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
19125 purpose of config.h. system.h must not try to fix wrong
19126 definitions in config.h.
19127
cc84fd5d
AD
191282000-09-20 Akim Demaille <akim@epita.fr>
19129
19130 * src/derives.h: New file.
19131 * src/main.c, src/derives.h: Use it.
19132 Formatting changes.
19133 * src/Makefile.am (noinst_HEADERS): Adjust.
19134
db5b3a89
AD
191352000-09-20 Akim Demaille <akim@epita.fr>
19136
19137 * tests/atgeneral.m4: Update from Autoconf.
19138 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
19139 (AT_CHECK_CALC): New macros.
19140 Use these macros to test bison with options `', `--raw',
19141 `--debug', `--yacc', `--yacc --debug'.
19142
ceed8467
AD
191432000-09-19 Akim Demaille <akim@epita.fr>
19144
19145 * src/output.c: Formatting changes.
19146 * src/machine.h: Remove, leaving its contents in...
19147 * src/system.h: here.
19148 Include stdio.h.
19149 Adjust all dependencies on stdio.h and machine.h.
19150 * src/getargs.h: New file.
19151 Let all `extern' declarations about getargs.c be replaced with
19152 inclusion of `getargs.h'.
19153 * src/Makefile.am (noinst_HEADERS): Adjust.
19154
19155 * tests/calc.m4 (yyin): Be initialized in main, not on the global
19156 scope.
19157 (yyerror): Returns void, not int.
19158 * doc/bison.texinfo: Formatting changes.
19159
05a1d24b
AD
191602000-09-19 Akim Demaille <akim@epita.fr>
19161
19162 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
19163 portable.
19164
cbd25751
AD
191652000-09-18 Akim Demaille <akim@epita.fr>
19166
19167 * configure.in: Append WARNING_CFLAGS to CFLAGS.
19168 * src/Makefile.am (INCLUDES): Don't.
19169 Be ready to fetch headers in lib/.
19170
13863333
AD
191712000-09-18 Akim Demaille <akim@epita.fr>
19172
19173 * doc/bison.texinfo: Update the copyright.
19174 ANSIfy and GNUify the examples.
19175 Remove the old menu.
19176
0d533154
AD
191772000-09-18 Akim Demaille <akim@epita.fr>
19178
19179 First set of tests: use the `calc' example from the documentation.
19180
19181 * src/bison.s1 (yyparse): Condition the code using `yytname' which
19182 is defined only when YYDEBUG is.
19183 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
19184 * src/files.c (tryopen, tryclose): Formatting changes.
19185 Move to the top and be static.
19186 * src/reader.c (read_signed_integer): Likewise.
19187 * tests/calc.m4: New file.
19188 * Makefile.am, suite.m4: Adjust.
19189 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
19190
e79137ac
AD
191912000-09-18 Akim Demaille <akim@epita.fr>
19192
19193 Add support for an Autotest test suite for Bison.
19194
19195 * m4/m4.m4, m4/atconfig.m4: New files.
19196 * m4/Makefile.am (EXTRA_DIST): Adjust.
19197 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
19198 files.
19199 * src/getargs.c: Display a more standard --version message.
19200 * src/reader.c (reader): Formatting changes.
19201 No longer depend upon VERSION_STRING.
19202 * configure.in: No longer use `dnl'.
19203 Set up the test suite and the new directory `tests/.
19204 (VERSION_STRING): Remove.
19205
27821bff
AD
192062000-04-14 Akim Demaille <akim@epita.fr>
19207
19208 * src/reader.c (copy_comment2): New function, same as former
19209 `copy_comment', but outputs into two FILE *.
19210 (copy_comment): Use it.
19211 (parse_union_decl): Use it.
19212 (get_type, parse_start_decl): Use the same `invalid' message.
19213 (parse_start_decl, parse_union_decl): Use the same `multiple'
19214 message.
19215 (parse_union_decl, copy_guard, copy_action): Use the same
19216 `unmatched' message.
19217 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
19218
cfe5fbc0
AD
192192000-03-31 Akim Demaille <akim@epita.fr>
19220
19221 * src/files.c (tryopen, tryclose): Move to the top.
19222 Be static.
19223
cb7db13e
AD
192242000-03-31 Akim Demaille <akim@epita.fr>
19225
19226 * src/main.c (main): Don't call `done', exit does it.
19227
a0f6b076
AD
192282000-03-31 Akim Demaille <akim@epita.fr>
19229
36281465
AD
19230 * allocate.c: s/return (foo)/return foo/.
19231 * lalr.c: Likewise.
19232 * LR0.c: Likewise.
19233 * output.c: Likewise.
19234 * reader.c: Likewise.
19235 * symtab.c: Likewise.
19236 * vmsgetargs.c: Likewise.
19237
192382000-03-31 Akim Demaille <akim@epita.fr>
19239
19240 Clean up the error reporting functions.
a0f6b076
AD
19241
19242 * src/report.c: New file.
19243 * src/report.h: Likewise.
19244 * src/Makefile.am: Adjust.
19245 * m4/error.m4: New file.
19246 * m4/Makefile.am: Adjust.
19247 * configure.in (jm_PREREQ_ERROR): Call it.
19248 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
19249 Remove.
19250 (fatal, fatals): Remove. All callers use complain.c::fatal.
19251 (warn, warni, warns, warnss, warnss): Remove. All callers use
19252 complain.c::complain.
19253 (toomany): Remove, use fatal instead.
19254 * src/files.c (done): No argument, use complain_message_count.
19255 * src/main.c (main): Register `done' to `atexit'.
19256
19257 * src/getargs.c (usage): More `fputs', less `fprintf'.
19258
18539825
AD
192592000-03-28 Akim Demaille <akim@epita.fr>
19260
19261 * lib/: New directory.
19262 * Makefile.am (SUBDIRS): Adjust.
19263 * configure.in: Adjust.
19264 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
19265 useless.
19266 * src/alloca.c: Moved to lib/.
19267 * src/getopt.c: Likewise.
19268 * src/getopt1.c: Likewise.
19269 * src/getopt.h: Likewise.
19270 * src/ansi2knr.c: Likewise.
19271 * src/ansi2knr.1: Likewise.
19272 * src/Makefile.am: Adjust.
19273 * lib/Makefile.am: New file.
19274
9f306f2a
AD
192752000-03-28 Akim Demaille <akim@epita.fr>
19276
19277 * src/getargs.c (usage): Refresh the help message.
19278
0ba347b6
AD
192792000-03-17 Akim Demaille <akim@epita.fr>
19280
19281 * src/getopt1.c: Updated from textutils 2.0e
19282 * src/getopt.c: Likewise.
19283 * src/getopt.h: Likewise.
19284
dbe7f271
AD
192852000-03-17 Akim Demaille <akim@epita.fr>
19286
19287 * src/Makefile.am (bison.simple): Fix the awk program: quote only
19288 the file name, not the whole `#line LINE FILE'.
19289
75bbe78d
AD
192902000-03-17 Akim Demaille <akim@epita.fr>
19291
19292 On syntax errors, report the token on which we choked.
19293
aa5fd0ee
AD
19294 * src/bison.s1 (yyparse): In the label yyerrlab, when
19295 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 19296
7b306f52
AD
192972000-03-17 Akim Demaille <akim@epita.fr>
19298
aa5fd0ee 19299 * src/reader.c (copy_at): New function.
7b306f52
AD
19300 (copy_guard): Use it.
19301 (copy_action): Use it.
19302
e87b5700
AD
193032000-03-17 Akim Demaille <akim@epita.fr>
19304
19305 Be kind to translators, save some useless translations.
19306
aa5fd0ee 19307 * src/main.c (banner): New function.
e87b5700
AD
19308 (fatal_banner): Use it.
19309 (warn_banner): Use it.
19310
ae3c3164
AD
193112000-03-17 Akim Demaille <akim@epita.fr>
19312
aa5fd0ee
AD
19313 * src/reader.c (copy_definition): Use copy_string and
19314 copy_comment. Removed now unused `match', `ended',
19315 `cplus_comment'.
ae3c3164
AD
19316 (copy_comment, copy_string): Moved, to be visible from
19317 copy_definition.
19318
4dc58e7c
AD
193192000-03-17 Akim Demaille <akim@epita.fr>
19320
aa5fd0ee
AD
19321 * src/reader.c (copy_string): Declare `static inline'. No
19322 problems with inline, since it is checked by configure.
4dc58e7c
AD
19323 (copy_comment): Likewise.
19324
0a6384c4
AD
193252000-03-17 Akim Demaille <akim@epita.fr>
19326
aa5fd0ee 19327 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 19328
3cef001a
AD
193292000-03-17 Akim Demaille <akim@epita.fr>
19330
aa5fd0ee 19331 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
19332 (copy_action): Use it. Removed now unused `match', `ended',
19333 `cplus_comment'.
19334 (copy_guard): Likewise.
19335
ca36d2ef
AD
193362000-03-17 Akim Demaille <akim@epita.fr>
19337
aa5fd0ee 19338 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
19339 (copy_action): Use it.
19340 (copy_guard): Likewise.
19341
6666f98f
AD
193422000-03-17 Akim Demaille <akim@epita.fr>
19343
19344 Change the handling of @s so that they behave exactly like $s.
19345 There is now a pseudo variable @$ (readble and writable), location
19346 of the lhs of the rule (by default ranging from the location of
19347 the first symbol of the rhs, to the location of the last symbol,
19348 or, if the rhs is empty, YYLLOC).
19349
19350 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
19351 yyval.
19352 (yyparse): When providing a default semantic action, provide a
19353 default location action.
19354 (after the $): No longer change `*YYLSP', just stack YYLOC the
19355 same way you stack YYVAL.
19356 * src/reader.c (read_declarations): Use warns.
19357 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
19358 (copy_action, case '@'): Likewise.
19359 Use a standard error message, to save useless work from
19360 translators.
19361
41aca2e0
AD
193622000-03-17 Akim Demaille <akim@epita.fr>
19363
aa5fd0ee
AD
19364 * src/bison.s1: Formatting and cosmetics changes.
19365 * src/reader.c: Likewise.
41aca2e0
AD
19366 Update the Copyright notice.
19367
dc08c1d5
AD
193682000-03-17 Akim Demaille <akim@epita.fr>
19369
aa5fd0ee
AD
19370 * src/bison.s1 (#line): All set to `#line' only, since the
19371 Makefile now handles them.
dc08c1d5 19372
9ee3c97b
AD
193732000-03-16 Akim Demaille <akim@epita.fr>
19374
19375 * src/output.c (output_rule_data): Output the documentation of
19376 some of the tables.
19377 (Copyright notice): Update.
19378 Formatting changes.
19379
0de741ca
AD
193802000-03-16 Akim Demaille <akim@epita.fr>
19381
19382 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
19383 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
19384 One `#if YYDEBUG' remains, since it uses variables which are
19385 defined only if `YYDEBUG != 0'.
19386
bb10be54
AD
193872000-03-16 Akim Demaille <akim@epita.fr>
19388
19389 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
19390 and related variables so that the similarities are highlighted.
19391
b07b484a
AD
193922000-03-16 Akim Demaille <akim@epita.fr>
19393
19394 * src/bison.s1: Properly indent CPP directives.
19395
361f60b3
AD
193962000-03-16 Akim Demaille <akim@epita.fr>
19397
19398 * src/bison.s1: Properly indent the `alloca' CPP section.
19399
8c44d3ec
AD
194002000-03-16 Akim Demaille <akim@epita.fr>
19401
19402 Do not hard code values of directories in `configure.in'.
19403 Update the `configure' tool chain.
19404
19405 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
19406 src/makefile.am.
19407 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
19408 (AC_OUTPUT): Add m4/Makefile.
19409 Bump to bison 1.28a, 1.29 has never been released.
19410 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
19411 handled via src/Makefile.am.
19412 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
19413 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
19414 autoheader.
19415 * Makefile.am (SUBDIRS): Add m4.
19416 (ACLOCAL_AM_FLAGS): New variable.
19417 (AUTOMAKE_OPTIONS): Add check-news.
19418 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
19419 the proper line number and file name.
19420 (DEFS): Propagate the location of bison library files and of the
19421 locale files.
19422 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
19423 builddir.
19424 * acinclude.m4: Remove, replaced by the directory m4.
19425 * m4/Makefile.am (EXTRA_DIST): New variable.
19426 * m4/gettext.m4: New file, from the fileutils.
19427 * m4/lcmessage.m4: Likewise
19428 * m4/progtest.m4: Likewise.
19429 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
19430
f95997e7
AD
194312000-03-10 Akim Demaille <akim@epita.fr>
19432
19433 * src/closure.c:
19434 Formatting changes of various comments.
19435 Respect the GNU coding standards at various places.
19436 Don't use `_()' when no translation is needed.
19437
194381999-12-13 Jesse Thilo <jthilo@gnu.org>
19439
19440 * src/files.c:
19441 OS/2 honors TMPDIR environment variable.
19442
194431999-12-13 Jesse Thilo <jthilo@gnu.org>
19444
19445 * doc/bison.texinfo: Tweaked spelling and grammar.
19446 Updated ISBN.
19447 Removed reference to price of printed copy.
19448 Mention BISON_SIMPLE and BISON_HAIRY.
19449
194501999-12-13 Jesse Thilo <jthilo@gnu.org>
19451
19452 * configure.in, NEWS:
19453 Bison 1.29 released.
19454
194551999-10-27 Jesse Thilo <jthilo@gnu.org>
19456
19457 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
19458 Added reference card.
19459
194601999-07-26 Jesse Thilo <jthilo@gnu.org>
19461
19462 * po/ru.po: Added Russian translation.
19463
194641999-07-26 Jesse Thilo <jthilo@gnu.org>
19465
19466 * configure.in: Added Russian translation.
19467
194681999-07-06 Jesse Thilo <jthilo@gnu.org>
19469
19470 * configure.in, NEWS, README:
19471 Released version 1.28.
19472
194731999-06-14 Jesse Thilo <jthilo@gnu.org>
19474
19475 * src/system.h:
19476 Squashed redefinition warning on some systems.
19477
19478 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
19479 Have configure build version string instead of relying on ANSI string
19480 concatentation.
19481
194821999-06-14 Jesse Thilo <jthilo@gnu.org>
19483
19484 * po/POTFILES.in: Got rid of version.c.
19485
194861999-06-14 Jesse Thilo <jthilo@gnu.org>
19487
19488 * acconfig.h, configure.in:
19489 Have configure build version string instead of relying on ANSI string
19490 concatentation.
19491
194921999-06-08 Jesse Thilo <jthilo@gnu.org>
19493
19494 * doc/bison.1:
19495 Dropped mention of `+' for long-named options.
19496
194971999-05-30 Jesse Thilo <jthilo@gnu.org>
19498
19499 * src/files.c: Added <unistd.h> for unlink().
19500
19501 * src/Makefile.am, src/system.h:
19502 I18n fixes.
19503
195041999-05-30 Jesse Thilo <jthilo@gnu.org>
19505
19506 * README: Added a FAQ list.
19507
19508 * configure.in, acconfig.h:
19509 I18n fixes.
19510
195111999-05-30 Jesse Thilo <jthilo@gnu.org>
19512
19513 * doc/FAQ, doc/Makefile.am:
19514 Added a FAQ list.
19515
195161999-05-19 Jesse Thilo <jthilo@gnu.org>
19517
19518 * src/alloc.h, src/symtab.h, src/version.c:
19519 Protected inclusion of "config.h" with HAVE_CONFIG_H.
19520
195211999-04-18 Jesse Thilo <jthilo@gnu.org>
19522
19523 * src/.cvsignore, src/Makefile.am:
19524 Reorganized: sources in `src', documentation in `doc'.
19525
19526 * src/lex.c (literalchar):
19527 fixed the code for escaping double quotes (thanks
19528 Jonathan Czisny.)
19529
195301999-04-18 Jesse Thilo <jthilo@gnu.org>
19531
19532 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
19533 Adjusted paths to reflect directory reorganization.
19534
195351999-04-18 Jesse Thilo <jthilo@gnu.org>
19536
19537 * doc/.cvsignore, doc/Makefile.am:
19538 Reorganized: sources in `src', documentation in `doc'.
19539
195401999-04-18 Jesse Thilo <jthilo@gnu.org>
19541
19542 * configure.in:
19543 Updated AC_INIT file to reflect directory reorganization.
19544
19545 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
19546 Reorganized: sources in `src', documentation in `doc'.
19547
195481999-04-13 Jesse Thilo <jthilo@gnu.org>
19549
19550 * src/allocate.c:
19551 Don't declare calloc() and realloc() if not necessary.
19552
195531999-04-13 Jesse Thilo <jthilo@gnu.org>
19554
19555 * configure.in, acconfig.h, acinclude.m4:
19556 Don't declare calloc() and realloc() if not necessary.
19557
195581999-03-23 Jesse Thilo <jthilo@gnu.org>
19559
19560 * po/.cvsignore: Added i18n support.
19561
195621999-03-23 Jesse Thilo <jthilo@gnu.org>
19563
19564 * acconfig.h, configure.in, Makefile.am:
19565 Added i18n support.
19566
195671999-03-22 Jesse Thilo <jthilo@gnu.org>
19568
19569 * src/bison.s1: Fixed #line numbers.
19570
195711999-03-15 Jesse Thilo <jthilo@gnu.org>
19572
19573 * po/es.po, po/fr.po, po/nl.po, po/de.po:
19574 Added PO files from Translation Project.
19575
195761999-03-03 Jesse Thilo <jthilo@gnu.org>
19577
19578 * Makefile.am:
19579 Added support for non-ANSI compilers (ansi2knr).
19580
195811999-02-16 Jesse Thilo <jthilo@gnu.org>
19582
19583 * configure.in: Bumped version number to 1.27.
19584
19585 * Makefile.am:
19586 Added `bison.simple' to list of files removed by `make distclean'.
19587
195881999-02-12 Jesse Thilo <jthilo@gnu.org>
19589
19590 * src/files.c, src/files.h:
19591 Defined locations of parser files in config.h instead of Makefile.
19592
195931999-02-12 Jesse Thilo <jthilo@gnu.org>
19594
19595 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
19596 Defined locations of parser files in config.h instead of Makefile.
19597
195981999-02-09 Jesse Thilo <jthilo@gnu.org>
19599
19600 * Makefile.am:
19601 Removed inappropriate use of $< macro.
19602
196031999-02-05 Jesse Thilo <jthilo@gnu.org>
19604
19605 * po/Makefile.in.in, po/POTFILES.in:
19606 Add `po' directory skeleton.
19607
196081999-01-27 Jesse Thilo <jthilo@gnu.org>
19609
19610 * README: Document help-bison list.
19611
19612 * configure.in: Add check for mkstemp().
19613
196141999-01-20 Jesse Thilo <jthilo@gnu.org>
19615
19616 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
19617 Hush a few compiler warnings.
19618
19619 * src/files.c:
19620 Add tryclose(), which verifies that fclose was successful.
19621 Hush a couple of compiler warnings.
19622
196231999-01-20 Jesse Thilo <jthilo@gnu.org>
19624
19625 * Makefile.am, OChangeLog:
19626 ChangeLog is now automatically generated. Include the old version as
19627 OChangeLog.
19628
196291999-01-14 Jesse Thilo <jthilo@gnu.org>
19630
19631 * 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:
19632 Update FSF address.
19633
196341999-01-14 Jesse Thilo <jthilo@gnu.org>
19635
19636 * doc/bison.texinfo: Fix formatting glitch.
19637
19638 * doc/bison.texinfo: Update FSF address.
19639
196401999-01-14 Jesse Thilo <jthilo@gnu.org>
19641
19642 * acconfig.h: Update FSF address.
19643
196441999-01-08 Jesse Thilo <jthilo@gnu.org>
19645
19646 * src/system.h:
19647 Don't define PACKAGE here, since config.h defines it.
19648
196491998-12-30 Jesse Thilo <jthilo@gnu.org>
19650
19651 * src/reader.c: Update copyright date.
19652
19653 * src/main.c:
19654 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19655 favor of output directly to stderr (avoids buffer overruns).
19656
19657 * src/reader.c: Some checks for premature EOF.
19658
19659 * 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:
19660 Use prototypes if the compiler understands them.
19661
19662 * src/files.c: Honor TMPDIR on Unix hosts.
19663 Use prototypes if the compiler understands them.
19664
19665 * src/reader.c:
19666 Fix a couple of buffer overrun bugs.
19667 Use prototypes if the compiler understands them.
19668
19669 * src/system.h: Include unistd.h and ctype.h.
19670 Use #ifdef instead of #if for NLS symbols.
19671
196721998-12-30 Jesse Thilo <jthilo@gnu.org>
19673
19674 * doc/bison.texinfo:
19675 Delete comment "consider using @set for edition number, etc..." since
19676 we now are doing so.
19677
196781998-12-30 Jesse Thilo <jthilo@gnu.org>
19679
19680 * configure.in:
19681 Use prototypes if the compiler understands them.
19682
19683 * NEWS: Document 1.26 highlights.
19684
19685 * Makefile.am: Require Automake 1.3 or later.
19686
19687 * acconfig.h:
19688 Use prototypes if the compiler understands them.
19689
196901998-12-29 Jesse Thilo <jthilo@gnu.org>
19691
19692 * src/version.c:
19693 Use VERSION symbol from automake for version number.
19694
196951998-12-29 Jesse Thilo <jthilo@gnu.org>
19696
19697 * acconfig.h, configure.in, version.cin:
19698 Use VERSION symbol from automake for version number.
19699
197001998-11-28 Jesse Thilo <jthilo@gnu.org>
19701
19702 * Makefile.am:
19703 Distribute original version of simple parser (bison.s1), not built
19704 version (bison.simple).
19705
197061998-11-28 Jesse Thilo <jthilo@gnu.org>
19707
19708 * doc/bison.texinfo: Add info dir entry.
19709
19710 * doc/bison.texinfo:
19711 Let automake put version number into documentation.
19712
197131998-11-26 Jesse Thilo <jthilo@gnu.org>
19714
19715 * src/bison.cld, src/build.com, src/vmshlp.mar:
19716 Add non-RCS files from /gd/gnu/bison.
19717
197181998-11-26 Jesse Thilo <jthilo@gnu.org>
19719
19720 * doc/bison.1:
19721 Document the BISON_HAIRY and BISON_SIMPLE variables.
19722
197231998-11-25 Jesse Thilo <jthilo@gnu.org>
19724
19725 * src/version.c: Build version.c automatically.
19726
19727 * src/reader.c:
19728 Fix token numbering (used to start at 258, not 257).
19729
19730 * src/system.h: Include config.h.
19731
19732 * src/getargs.c: Update bug report address.
19733
19734 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19735 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19736
197371998-11-25 Jesse Thilo <jthilo@gnu.org>
19738
19739 * Makefile.am:
19740 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19741
19742 * configure.in, version.cin:
19743 Build version.c automatically.
19744
19745 * AUTHORS: Add AUTHORS file.
19746
19747 * README: Update bug report address.
19748
19749 * bison.simple:
19750 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19751
19752 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19753 Add automake stuff.
19754
197551998-11-25 Jesse Thilo <jthilo@gnu.org>
19756
19757 * doc/bison.texinfo: Clean up some formatting.
19758
197591998-05-05 Richard Stallman <rms@gnu.org>
19760
19761 * doc/bison.texinfo:
19762 Explain better why to make a pure parser.
19763
197641998-01-05 Richard Stallman <rms@gnu.org>
19765
19766 * src/files.c (openfiles):
19767 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19768 find a temporary directory, if possible. Do not unlink files while
19769 they are open.
19770
197711997-08-25 Richard Stallman <rms@gnu.org>
19772
19773 * src/reader.c (stack_offset;):
19774 Change some warni to warns.
19775
19776 * src/lex.c (literalchar): Use warns, not warni.
19777
197781997-06-28 Richard Stallman <rms@gnu.org>
19779
19780 * src/bison.s1: Add a Bison version comment.
19781
19782 * src/main.c (fatal, warn, berror):
19783 Use program_name.
19784
197851997-06-28 Richard Stallman <rms@gnu.org>
19786
19787 * Makefile.in (bison_version): New variable.
19788 (dist): Use that variable.
19789 (bison.s1): Substitute the Bison version into bison.simple.
19790
19791 * bison.simple: Add a Bison version comment.
19792
197931997-06-18 Richard Stallman <rms@gnu.org>
19794
19795 * src/main.c (fatal, warn, berror):
19796 Make error messages standard.
19797 (toomany): Improve error message text.
19798
19799 * 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:
19800 new.h renamed to alloc.h.
19801
198021997-06-18 Richard Stallman <rms@gnu.org>
19803
19804 * Makefile.in: new.h renamed to alloc.h.
19805
198061997-05-24 Richard Stallman <rms@gnu.org>
19807
19808 * src/lex.c (literalchar):
19809 Fix the code for escaping \, " and '.
19810
19811 (lex): Avoid trouble when there are many chars
19812 to discard in a char literal with just several chars in it.
19813
198141997-05-17 Richard Stallman <rms@gnu.org>
19815
19816 * src/bison.s1:
19817 Use malloc, if using alloca is troublesome.
19818 (YYSTACK_USE_ALLOCA): New flag macro.
19819 Define it for some systems and compilers.
19820 (YYSTACK_ALLOC): New macro.
19821 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19822 If it was malloc'd, free it.
19823
198241997-05-17 Richard Stallman <rms@gnu.org>
19825
19826 * bison.simple:
19827 Use malloc, if using alloca is troublesome.
19828 (YYSTACK_USE_ALLOCA): New flag macro.
19829 Define it for some systems and compilers.
19830 (YYSTACK_ALLOC): New macro.
19831 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19832 If it was malloc'd, free it.
19833
198341997-04-23 Richard Stallman <rms@gnu.org>
19835
19836 * src/bison.s1:
19837 (alloca) [__hpux]: Always define as __builtin_alloca.
19838
198391997-04-23 Richard Stallman <rms@gnu.org>
19840
19841 * bison.simple:
19842 (alloca) [__hpux]: Always define as __builtin_alloca.
19843
198441997-04-22 Richard Stallman <rms@gnu.org>
19845
19846 * src/bison.s1:
19847 [__hpux]: Include alloca.h (right for HPUX 10)
19848 instead of declaring alloca (right for HPUX 9).
19849
19850 * src/bison.s1 (__yy_memcpy):
19851 Declare arg `count' as unsigned int.
19852 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19853
198541997-04-22 Richard Stallman <rms@gnu.org>
19855
19856 * bison.simple:
19857 [__hpux]: Include alloca.h (right for HPUX 10)
19858 instead of declaring alloca (right for HPUX 9).
19859
19860 * bison.simple (__yy_memcpy):
19861 Declare arg `count' as unsigned int.
19862 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19863
198641997-01-03 Richard Stallman <rms@gnu.org>
19865
19866 * src/allocate.c: [__STDC__ or _MSC_VER]:
19867 Declare calloc and realloc to return void *.
19868
198691997-01-02 Richard Stallman <rms@gnu.org>
19870
19871 * src/system.h:
19872 [_MSC_VER]: Include stdlib.h and process.h.
19873 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
19874
19875 * src/main.c (main): Return FAILURE as a value.
19876 (printable_version): Declare arg as int, not char.
19877
198781997-01-02 Richard Stallman <rms@gnu.org>
19879
19880 * Makefile.in (dist):
19881 Explicitly check for symlinks, and copy them.
19882
198831996-12-19 Richard Stallman <rms@gnu.org>
19884
19885 * src/files.c:
19886 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
19887
198881996-12-18 Paul Eggert <eggert@gnu.org>
19889
19890 * src/bison.s1 (yyparse):
19891 If __GNUC__ and YYPARSE_PARAM are both defined,
19892 declare yyparse to have a void * argument.
19893
198941996-12-18 Paul Eggert <eggert@gnu.org>
19895
19896 * bison.simple (yyparse):
19897 If __GNUC__ and YYPARSE_PARAM are both defined,
19898 declare yyparse to have a void * argument.
19899
199001996-12-17 Richard Stallman <rms@gnu.org>
19901
19902 * src/reduce.c (nbits): Add some casts.
19903
199041996-08-12 Richard Stallman <rms@gnu.org>
19905
19906 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
19907
199081996-08-12 Richard Stallman <rms@gnu.org>
19909
19910 * bison.simple: Test _MSDOS as well as _MSDOS_.
19911
199121996-07-31 Richard Stallman <rms@gnu.org>
19913
19914 * src/bison.s1:
19915 [__sun && __i386]: Include alloca.h.
19916
199171996-07-31 Richard Stallman <rms@gnu.org>
19918
19919 * bison.simple:
19920 [__sun && __i386]: Include alloca.h.
19921
199221996-07-30 Richard Stallman <rms@gnu.org>
19923
19924 * src/bison.s1: Comment change.
19925
19926 * src/bison.s1: Test _MSDOS_, not MSDOS.
19927
199281996-07-30 Richard Stallman <rms@gnu.org>
19929
19930 * bison.simple: Comment change.
19931
19932 * bison.simple: Test _MSDOS_, not MSDOS.
19933
199341996-06-01 Richard Stallman <rms@gnu.org>
19935
19936 * 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:
19937 Insert `_' macro around many string constants.
19938
19939 * src/main.c:
19940 Insert `_' macro around many string constants.
19941
19942 (main): Call setlocale, bindtextdomain and textdomain.
19943
19944 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
19945 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
19946 [ENABLE_NLS]: Include libintl.h.
19947 [ENABLE_NLS] (gettext): Define.
19948 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
19949 (N_, PACKAGE, LOCALEDIR): New macros.
19950
199511996-06-01 Richard Stallman <rms@gnu.org>
19952
19953 * POTFILES.in: New file.
19954
19955 * Makefile.in (allocate.o):
19956 Define target explicitly.
19957
19958 * Makefile.in (CFLAGS): Set to @CFLAGS@.
19959 (LDFLAGS): Set to @LDFLAGS@.
19960 (configure): Run autoconf only if preceding `cd' succeeds.
19961 (bison.s1): Redirect output to temporary file then move the
19962 temporary to the target, rather than redirecting directly to bison.s1.
19963 (clean): Remove config.status and config.log.
19964 (distclean): Don't remove config.status here.
19965
199661996-05-12 Richard Stallman <rms@gnu.org>
19967
19968 * src/bison.s1:
19969 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19970
199711996-05-12 Richard Stallman <rms@gnu.org>
19972
19973 * bison.simple:
19974 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19975
199761996-05-11 Richard Stallman <rms@gnu.org>
19977
19978 * src/bison.s1 (__yy_memcpy):
19979 Really reorder the args, as was supposedly done on Feb 14 1995.
19980 (yyparse): Calls changed accordingly.
19981
199821996-05-11 Richard Stallman <rms@gnu.org>
19983
19984 * Makefile.in (dist): Don't use $(srcdir).
19985
19986 * bison.simple (__yy_memcpy):
19987 Really reorder the args, as was supposedly done on Feb 14 1995.
19988 (yyparse): Calls changed accordingly.
19989
199901996-01-27 Richard Stallman <rms@gnu.org>
19991
19992 * src/output.c (output_rule_data):
19993 Test YYERROR_VERBOSE in the conditional
19994 around the definition of ttyname.
19995
199961995-12-29 Richard Stallman <rms@gnu.org>
19997
19998 * src/bison.s1:
19999 Fix line numbers in #line commands.
20000
200011995-12-29 Richard Stallman <rms@gnu.org>
20002
20003 * bison.simple:
20004 Fix line numbers in #line commands.
20005
200061995-12-27 Richard Stallman <rms@gnu.org>
20007
20008 * src/bison.s1 (YYPARSE_PARAM_DECL):
20009 In C++, make it always null.
20010 (YYPARSE_PARAM_ARG): New macro.
20011 (yyparse): Use YYPARSE_PARAM_ARG.
20012
200131995-12-27 Richard Stallman <rms@gnu.org>
20014
20015 * bison.simple (YYPARSE_PARAM_DECL):
20016 In C++, make it always null.
20017 (YYPARSE_PARAM_ARG): New macro.
20018 (yyparse): Use YYPARSE_PARAM_ARG.
20019
200201995-11-29 Richard Stallman <rms@gnu.org>
20021
20022 * doc/bison.texinfo:
20023 Describe literal string tokens, %raw, %no_lines, %token_table.
20024
200251995-11-29 Daniel Hagerty <hag@gnu.org>
20026
20027 * doc/bison.texinfo: Fixed update date
20028
200291995-10-16 Richard Stallman <rms@gnu.org>
20030
20031 * src/version.c: Version 1.25.
20032
200331995-10-16 Richard Stallman <rms@gnu.org>
20034
20035 * NEWS: *** empty log message ***
20036
200371995-10-16 Richard Stallman <rms@gnu.org>
20038
20039 * doc/bison.1, doc/bison.rnh:
20040 Add new options.
20041
200421995-10-15 Richard Stallman <rms@gnu.org>
20043
20044 * src/vmsgetargs.c, src/getargs.c:
20045 Added -n, -k, and -raw switches.
20046 (noparserflag, toknumflag, rawtoknumflag): New variables.
20047
20048 * src/symtab.h (SALIAS):
20049 New #define for adding aliases to %token.
20050 (struct bucket): Added `alias' field.
20051
20052 * src/reduce.c (reduce_grammar):
20053 Revise error message.
20054 (print_notices): Remove final `.' from error message.
20055
20056 * src/reader.c (reader_output_yylsp):
20057 New function.
20058 (readgram): Use `#if 0' around code that accepted %command
20059 inside grammar rules: The documentation doesn't allow it,
20060 and it will fail since the %command processors scan for the next %.
20061 (parse_token_decl): Extended the %token
20062 declaration to allow a multi-character symbol as an alias.
20063 (parse_thong_decl): New function.
20064 (read_declarations): Added %thong declarations.
20065 (read_declarations): Handle NOOP to deal with allowing
20066 % declarations as another means to specify the flags.
20067 (readgram): Allow %prec prior to semantics embedded in a rule.
20068 (skip_to_char, read_declarations, copy_definition)
20069 (parse_token_decl, parse_start_decl, parse_type_decl)
20070 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
20071 (get_type_name, copy_guard, copy_action, readgram)
20072 (get_type, packsymbols): Revised most error messages.
20073 Changed `fatal' to `warnxxx' to avoid aborting for error.
20074 Revised and use multiple warnxxx functions to avoid using VARARGS1.
20075 (read_declarations): Improve the error message for
20076 an invalid character. Do not abort.
20077 (read_declarations, copy_guard, copy_action): Use
20078 printable_version to avoid unprintable characters in printed output.
20079 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
20080 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
20081 Allow the type of a non-terminal can be given
20082 more than once, as long as all specifications give the same type.
20083
20084 * src/output.c:
20085 (output_headers, output_trailers, output, output_gram)
20086 (output_rule_data): Implement noparserflag variable.
20087 Implement toknumflag variable.
20088 (output): Call reader_output_yylsp to output LTYPESTR.
20089
20090 * src/main.c (main):
20091 If reader sees an error, don't process the grammar.
20092 (fatals): Updated to not use VARARGS1.
20093 (printable_version, int_to_string, warn, warni, warns, warnss)
20094 (warnsss): New error reporting functions. Avoid abort for error.
20095
20096 * src/lex.h:
20097 Added THONG and NOOP for alias processing.
20098 Added SETOPT for the new code that allows setting options with %flags.
20099
20100 * src/lex.c:
20101 Include getopt.h. Add some extern decls.
20102 (safegetc): New function to deal with EOF gracefully.
20103 (literalchar); new function to deal with reading \ escapes.
20104 (lex): Use literalchar.
20105 (lex): Implemented "..." tokens.
20106 (literalchar, lex, parse_percent_token): Made tokenbuffer
20107 always contain the token. This includes growing the token
20108 buffer while reading an integer.
20109 (parse_percent_token): Replaced if-else statement with percent_table.
20110 (parse_percent_token): Added % declarations as another
20111 way to specify the flags -n, -l, and -r. Also added hooks for
20112 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
20113 major changes to files.c.
20114 (lex) Retain in the incoming stream a character following
20115 an incorrect '/'.
20116 (skip_white_space, lex): Revised most error messages
20117 and changed fatal to warn to avoid aborting.
20118 (percent_table): Added %thong declarations.
20119
20120 * src/gram.h: Comment changes.
20121
20122 * src/files.c (openfiles, open_extra_files, done):
20123 Add faction flag
20124 and actfile file. Handle noparserflag. Both for -n switch.
20125
20126 * src/conflicts.c (resolve_sr_conflict):
20127 Remove use of alloca.
20128
201291995-06-01 Jim Meyering <meyering@gnu.org>
20130
20131 * doc/bison.texinfo: *** empty log message ***
20132
201331995-05-06 Richard Stallman <rms@gnu.org>
20134
20135 * src/bison.s1: Comment change.
20136
201371995-05-06 Richard Stallman <rms@gnu.org>
20138
20139 * bison.simple: Comment change.
20140
201411995-05-03 Richard Stallman <rms@gnu.org>
20142
20143 * src/version.c: Version now 1.24.
20144
20145 * src/bison.s1: Change distribution terms.
20146
20147 * src/version.c: Version now 1.23.
20148
201491995-05-03 Richard Stallman <rms@gnu.org>
20150
20151 * doc/bison.texinfo:
20152 Rewrite "Conditions for Using Bison".
20153 Update version to 1.24.
20154
201551995-05-03 Richard Stallman <rms@gnu.org>
20156
20157 * bison.simple: Change distribution terms.
20158
201591995-02-23 Richard Stallman <rms@gnu.org>
20160
20161 * src/files.c: Test __VMS_POSIX as well as VMS.
20162
201631995-02-14 Jim Meyering <meyering@gnu.org>
20164
20165 * src/bison.s1 (__yy_memcpy):
20166 Renamed from __yy_bcopy to avoid
20167 confusion. Reverse FROM and TO arguments to be consistent with
20168 those of memcpy.
20169
201701995-02-14 Jim Meyering <meyering@gnu.org>
20171
20172 * bison.simple (__yy_memcpy):
20173 Renamed from __yy_bcopy to avoid
20174 confusion. Reverse FROM and TO arguments to be consistent with
20175 those of memcpy.
20176
201771994-11-10 David J. MacKenzie <djm@gnu.org>
20178
20179 * NEWS: reformat
20180
20181 * NEWS: New file.
20182
20183 * Makefile.in (DISTFILES): Include NEWS.
20184
20185 * Makefile.in (DISTFILES):
20186 Include install-sh, not install.sh.
20187
20188 * configure.in: Update to Autoconf v2 macro names.
20189
201901994-10-05 David J. MacKenzie <djm@gnu.org>
20191
20192 * Makefile.in: fix typo
20193
20194 * Makefile.in (prefix, exec_prefix):
20195 Let configure set them.
20196
201971994-09-28 David J. MacKenzie <djm@gnu.org>
20198
20199 * Makefile.in: Set datadir to $(prefix)/share.
20200
202011994-09-15 Richard Stallman <rms@gnu.org>
20202
20203 * src/bison.s1:
20204 Update copyright notice and GPL version.
20205
202061994-09-15 Richard Stallman <rms@gnu.org>
20207
20208 * bison.simple:
20209 Update copyright notice and GPL version.
20210
202111994-07-12 Richard Stallman <rms@gnu.org>
20212
20213 * src/reduce.c, src/reader.c:
20214 entered into RCS
20215
202161994-05-05 David J. MacKenzie <djm@gnu.org>
20217
20218 * Makefile.in: entered into RCS
20219
202201994-03-26 Richard Stallman <rms@gnu.org>
20221
20222 * src/bison.s1: entered into RCS
20223
202241994-03-26 Richard Stallman <rms@gnu.org>
20225
20226 * bison.simple: entered into RCS
20227
202281994-03-25 Richard Stallman <rms@gnu.org>
20229
20230 * src/main.c: entered into RCS
20231
202321994-03-24 Richard Stallman <rms@gnu.org>
20233
20234 * src/conflicts.c: entered into RCS
20235
202361994-01-02 Richard Stallman <rms@gnu.org>
20237
20238 * Makefile.in: *** empty log message ***
20239
202401993-11-21 Richard Stallman <rms@gnu.org>
20241
20242 * src/bison.s1: *** empty log message ***
20243
202441993-11-21 Richard Stallman <rms@gnu.org>
20245
20246 * doc/bison.texinfo: entered into RCS
20247
20248 * doc/bison.texinfo: *** empty log message ***
20249
202501993-11-21 Richard Stallman <rms@gnu.org>
20251
20252 * bison.simple: *** empty log message ***
20253
202541993-10-25 David J. MacKenzie <djm@gnu.org>
20255
20256 * doc/bison.texinfo: *** empty log message ***
20257
202581993-10-19 Richard Stallman <rms@gnu.org>
20259
20260 * src/bison.s1: *** empty log message ***
20261
202621993-10-19 Richard Stallman <rms@gnu.org>
20263
20264 * bison.simple: *** empty log message ***
20265
202661993-10-14 Richard Stallman <rms@gnu.org>
20267
20268 * src/bison.s1: *** empty log message ***
20269
202701993-10-14 Richard Stallman <rms@gnu.org>
20271
20272 * bison.simple: *** empty log message ***
20273
202741993-09-14 David J. MacKenzie <djm@gnu.org>
20275
20276 * doc/bison.texinfo: *** empty log message ***
20277
202781993-09-13 Noah Friedman <friedman@gnu.org>
20279
20280 * Makefile.in: *** empty log message ***
20281
202821993-09-10 Richard Stallman <rms@gnu.org>
20283
20284 * src/conflicts.c: *** empty log message ***
20285
20286 * src/system.h: entered into RCS
20287
202881993-09-10 Richard Stallman <rms@gnu.org>
20289
20290 * doc/bison.1: entered into RCS
20291
202921993-09-06 Noah Friedman <friedman@gnu.org>
20293
20294 * src/version.c: entered into RCS
20295
202961993-09-06 Noah Friedman <friedman@gnu.org>
20297
20298 * Makefile.in: *** empty log message ***
20299
203001993-07-30 David J. MacKenzie <djm@gnu.org>
20301
20302 * Makefile.in: *** empty log message ***
20303
203041993-07-24 Richard Stallman <rms@gnu.org>
20305
20306 * src/bison.s1: *** empty log message ***
20307
203081993-07-24 Richard Stallman <rms@gnu.org>
20309
20310 * bison.simple: *** empty log message ***
20311
203121993-07-08 David J. MacKenzie <djm@gnu.org>
20313
20314 * Makefile.in: *** empty log message ***
20315
203161993-07-04 Richard Stallman <rms@gnu.org>
20317
20318 * src/bison.s1: *** empty log message ***
20319
203201993-07-04 Richard Stallman <rms@gnu.org>
20321
20322 * bison.simple: *** empty log message ***
20323
203241993-06-26 David J. MacKenzie <djm@gnu.org>
20325
20326 * src/getargs.c: entered into RCS
20327
203281993-06-26 David J. MacKenzie <djm@gnu.org>
20329
20330 * doc/bison.texinfo: *** empty log message ***
20331
20332 * doc/bison.1: New file.
20333
203341993-06-25 Richard Stallman <rms@gnu.org>
20335
20336 * src/getargs.c: New file.
20337
203381993-06-16 Richard Stallman <rms@gnu.org>
20339
20340 * src/bison.s1: *** empty log message ***
20341
203421993-06-16 Richard Stallman <rms@gnu.org>
20343
20344 * bison.simple: *** empty log message ***
20345
203461993-06-03 Richard Stallman <rms@gnu.org>
20347
20348 * src/bison.s1: New file.
20349
203501993-06-03 Richard Stallman <rms@gnu.org>
20351
20352 * doc/bison.texinfo: *** empty log message ***
20353
203541993-06-03 Richard Stallman <rms@gnu.org>
20355
20356 * bison.simple: New file.
20357
203581993-05-19 Richard Stallman <rms@gnu.org>
20359
20360 * doc/bison.texinfo: New file.
20361
203621993-05-07 Noah Friedman <friedman@gnu.org>
20363
20364 * Makefile.in: *** empty log message ***
20365
203661993-04-28 Noah Friedman <friedman@gnu.org>
20367
20368 * src/reader.c: *** empty log message ***
20369
203701993-04-23 Noah Friedman <friedman@gnu.org>
20371
20372 * src/alloc.h: entered into RCS
20373
203741993-04-20 David J. MacKenzie <djm@gnu.org>
20375
20376 * src/version.c: *** empty log message ***
20377
20378 * src/files.c, src/allocate.c:
20379 entered into RCS
20380
20381 * src/reader.c: *** empty log message ***
20382
20383 * src/lex.c: entered into RCS
20384
20385 * src/conflicts.c: New file.
20386
20387 * src/symtab.c: entered into RCS
20388
20389 * src/alloc.h: New file.
20390
20391 * src/LR0.c: entered into RCS
20392
203931993-04-18 Noah Friedman <friedman@gnu.org>
20394
20395 * src/reader.c: New file.
20396
20397 * src/version.c: *** empty log message ***
20398
203991993-04-18 Noah Friedman <friedman@gnu.org>
20400
20401 * Makefile.in: *** empty log message ***
20402
204031993-04-17 Noah Friedman <friedman@gnu.org>
20404
20405 * Makefile.in: *** empty log message ***
20406
204071993-04-15 Richard Stallman <rms@gnu.org>
20408
20409 * src/main.c, src/files.c:
20410 New file.
20411
204121993-04-15 Noah Friedman <friedman@gnu.org>
20413
20414 * configure.in: entered into RCS
20415
20416 * configure.in: *** empty log message ***
20417
20418 * configure.in: New file.
20419
204201993-04-14 Richard Stallman <rms@gnu.org>
20421
20422 * Makefile.in: New file.
20423
204241993-04-13 Richard Stallman <rms@gnu.org>
20425
20426 * src/version.c: New file.
20427
204281993-03-25 Richard Stallman <rms@gnu.org>
20429
20430 * src/output.c: entered into RCS
20431
204321992-09-25 Richard Stallman <rms@gnu.org>
20433
20434 * configure.bat: entered into RCS
20435
204361992-06-22 Richard Stallman <rms@gnu.org>
20437
20438 * src/vmsgetargs.c: entered into RCS
20439
204401992-06-22 Richard Stallman <rms@gnu.org>
20441
20442 * doc/bison.rnh: entered into RCS
20443
204441992-04-20 David J. MacKenzie <djm@gnu.org>
20445
20446 * README: entered into RCS
20447
204481992-01-22 Richard Stallman <rms@gnu.org>
20449
20450 * src/machine.h: entered into RCS
20451
204521991-12-21 Richard Stallman <rms@gnu.org>
20453
20454 * src/lalr.c, src/closure.c:
20455 entered into RCS
20456
204571991-12-20 Richard Stallman <rms@gnu.org>
20458
20459 * src/state.h: entered into RCS
20460
204611991-12-18 Richard Stallman <rms@gnu.org>
20462
20463 * src/print.c, src/nullable.c, src/derives.c:
20464 entered into RCS
20465
204661991-11-03 David J. MacKenzie <djm@gnu.org>
20467
20468 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
20469 entered into RCS
20470
204711988-09-09 Richard Stallman <rms@gnu.org>
20472
20473 * src/bison.hairy: entered into RCS
20474
204751987-12-16 Richard Stallman <rms@gnu.org>
20476
20477 * REFERENCES: entered into RCS
dc546b0f 20478
f294a2c2 20479
04098407 20480 -----
f294a2c2 20481
04098407 20482 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
95021767
JD
20483 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
20484 Free Software Foundation, Inc.
f294a2c2 20485
04098407
PE
20486 Copying and distribution of this file, with or without
20487 modification, are permitted provided the copyright notice and this
20488 notice are preserved.
e9071366
AD
20489
20490$Id$