]> git.saurik.com Git - bison.git/blame - ChangeLog
Use git-version-gen for version names between releases.
[bison.git] / ChangeLog
CommitLineData
8fa36911
JD
12008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Use git-version-gen for version names between releases.
4 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
5 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
6 * .prev-version: New.
7 * .version.in: Remove.
8 * ChangeLog: Remove the $Id$ previously used for capturing the CVS
9 revision.
10 * GNUmakefile: Remove, now copied from Gnulib.
11 * Makefile.am: Add code suggested by comments in
12 build-aux/git-version-gen.
13 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
14 .prev-version, and .version.
15 * NEWS (2.3b+): Rename to...
16 (?.?): ... this because we're dropping the "+" version naming scheme,
17 but, in general, we still can't be sure of our next release name.
18 * bootstrap: Add a quick hack to remove from .gitignore the
19 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
20 entry. This should really be fixed in gnulib instead.
21 * bootstrap.conf (gnulib_modules): Add gnumakefile.
22 * configure.ac (AC_INIT): Set version name by invoking
23 build-aux/git-version-gen.
24 (AC_CONFIG_FILES): Remove .version, now generated by
25 build-aux/git-version-gen.
26 * maint.mk: New, copied from coreutils.
27 * doc/.cvsignore (bison.1): Add.
28 * doc/.gitignore (/bison.1): Add.
29 * doc/bison.1: Remove, generated.
30 * src/.cvsignore (revision.c): Remove.
31 * src/.gitignore (/revision.c): Remove.
32 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
33 (BUILT_SOURCES): Remove revision.c.
34 (revision.c): Remove.
35 * src/getargs.c (version): Don't print revision after the VERSION.
36 * src/revision.h: Remove.
37
bcf07cb7
JD
382008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
39
40 Fix untranslatable composition of sentences. Reported by Goran
41 Uddeborg at
42 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
43 * THANKS (Goran Uddeborg): Add.
44 * src/reduce.c (reduce_print): Report the number of nonterminals and
45 rules useless in the grammar in separate sentences.
46 * tests/reduce.at (Useless Rules): Update output.
47 (Reduced Automaton): Likewise.
48 (Underivable Rules): Likewise.
49 (Empty Language): Likewise.
50
9aacab9a
JD
512008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
52
53 Fix some .gitignore and .cvsignore problems.
54 * bootstrap (insert_sorted_if_absent): Replace all uses with...
55 (insert_vc_ignore): ... this new function, which prepends `/' to all
56 .gitignore entries before passing them to insert_sorted_if_absent.
57 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
58 .cvsignore files are maintained even though Bison developers run
59 bootstrap while using Git.
60 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
61 unneeded by Bison.
62 (gnulib): Add.
63 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
64 unneeded. Reported by Eric Blake.
65 * lib/.gitignore (/*~): Add.
66 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
67 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
68 Blake.
69 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
70
a9fc7990
JD
712008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
72
73 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
74 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
75 * bootstrap.conf (gnulib_modules): Add unsetenv.
76 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
77 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
78 (/setenv.m4): Add.
79 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
80 the first argument because it may become position-dependent, and unset
81 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
82 Add comments explaining these issues in more detail.
83
0f1d6f10
JD
842008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
85
86 Add .gitignore everywhere based on .cvsignore.
87 * .gitignore: New.
88 * build-aux/.gitignore: New.
89 * data/.gitignore: New.
90 * doc/.gitignore: New.
91 * etc/.gitignore: New.
92 * examples/.gitignore: New.
93 * examples/calc++/.gitignore: New.
94 * lib/.gitignore: New.
95 * m4/.gitignore: New.
96 * po/.gitignore: New.
97 * runtime-po/.gitignore: New.
98 * src/.gitignore: New.
99 * tests/.gitignore: New.
100
7bd1665a
JD
1012008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
102
103 * NEWS (2.3b+): New section, empty for now.
104 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
105
72c5b982
JD
1062008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
107
108 * NEWS (2.3b): Update release date since there has been a delay in
109 getting the announcements and tarballs out.
110
bd02cd5d
JD
1112008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
112
113 * NEWS: Version 2.3b.
114 * configure.ac (AC_INIT): Likewise.
115 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
116
9126263e
JD
1172008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
118
119 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
120 been doing it for years.
121 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
122 (Release Procedure): Add FIXME about make alpha being unmaintained.
123
fa6aa7b3
JD
1242008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
125
126 * data/yacc.c: Reformat m4 a little for readability.
127 * src/lalr.c (build_relations): Correct comment.
128
d30b312d
JMG
1292008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
130
131 DJGPP specific issue.
132 * djgpp/config.sed: Fixes required to run configure scripts generated
133 by autoconf 2.62.
134
138d4cd9
JD
1352008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
136
137 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
138 coordinator@translationproject.org.
139
8f7e2e1f
JD
1402008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
141
142 * THANKS: Add Eric Blake.
143
f55efa38
JD
1442008-04-23 Eric Blake <ebb9@byu.net>
145
146 Revert prior patch, by working around autoconf regression.
147 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
148 ("Output file name: ("): Uncomment test.
149 ("Output file name: )"): Likewise.
150 Based on an idea from Noah Misch.
151
096c9f9d
JD
1522008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
153
154 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
155 2.61. Reported by Juan Manuel Guerrero at
156 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
157 * tests/output.at ("Output file name: ("): Comment out test case for
158 now.
159 ("Output file name: )"): Likewise.
160
0f664b89
JD
1612008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
162
163 * GNUmakefile: Update git-version-gen invocation so make dist
164 succeeds.
165
1cfe6375
JD
1662008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
167
168 Update to the current gnulib CVS repository, and fix trigraph handling
169 in Bison.
170 * bootstrap: Update gnulib CVS repository URL.
171 (symlink_to_dir): Encapsulate the code that guarantees the destination
172 directory exists into...
173 (check_dst_dir): ... this new function, and...
174 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
175 fail when copying files into lib/uniwidth/.
176 * src/output.c (prepare_symbols): When writing yytname muscles, where
177 symbol names will be encoded in C-string literals, tell quotearg to
178 escape trigraphs. This used to be the default in gnulib.
179 * tests/regression.at (Token definitions): Because of the change in
180 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
181 escapes trigraphs in symbol names. Thus, yytname no longer has
182 trigraphs unnecessarily doubly escaped. Update test case output.
183 Extend test case to be sure Bison's own error messages will no longer
184 have trigraphs in symbol names unnecessarily escaped once.
185
74c52fc8
JD
1862008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
187
188 Fix make dist infinite loop reported by Juan Manuel Guerrero at
189 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
190 * .cvsignore: Add .version.
191 * .version.in: New.
192 * bootstrap.conf (gnulib_modules): Add git-version-gen.
193 * configure.ac (AC_CONFIG_FILES): Add .version.
194 * build-aux/.cvsignore: Add git-version-gen.
195
8e55b3aa
JD
1962008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
197
198 * NEWS (2.3a+): Mention that -g now takes an argument.
199 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
200 consistency. Update the -g and -x entries now that they take
201 arguments. Use brackets to indicate optional arguments.
202 * src/getargs.c (usage): Explain the relationship between arguments of
203 long and short options more completely. Document --defines and -d
204 separately since the former takes an argument but, for POSIX Yacc, the
205 latter does not.
206 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 207 (getargs): Sort cases.
8e55b3aa 208
59c5ac72
AD
2092008-02-28 Akim Demaille <demaille@gostai.com>
210
211 * doc/bison.texinfo: Fix a few typos.
212
118d4978
AD
2132008-02-28 Akim Demaille <akim@epita.fr>
214
215 * doc/bison.texinfo (Bison Options): Document -W.
216 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
217
7020f1e9
AD
2182008-02-28 Akim Demaille <akim@epita.fr>
219
220 * src/getargs.c (short_options): Split and sort for readability.
221 -g and -x take optional arguments, just like their long options.
222 * build-aux/cross-options.pl: Use /x to make the regexp easier to
223 understand.
224 Fix the handling of $opt which resulted in all the argument to be
225 considered as optional.
226
59da312b
JD
2272008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
228
229 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
230 say its interface is experimental.
231 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
232 Java.
233 (Bison Options): In the -L and --language entry, mention Java.
234 (Java Bison Interface): Say the interface is experimental.
235 * src/getargs.c (usage): Mention -L and --language.
236
237 * NEWS (2.3a+): Say the push parsing interface is experimental.
238 * doc/bison.texinfo (Push Decl): Likewise.
239 (Decl Summary): Likewise in the "%define api.push_pull" entry.
240 (Push Parser Function): Likewise.
241 (Pull Parser Function): Likewise.
242 (Parser Create Function): Likewise.
243 (Parser Delete Function): Likewise.
244 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
245 yypull_parse, and yypush_parse entries.
246
247 * NEWS (2.3a+): Mention XML support, and say the schema is
248 experimental.
249 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
250 * src/getargs.c (usage): Say the XML schema is experimental.
251
252 * NEWS (2.3a+): Say option instead of flag.
253
2bb3ebec
WP
2542008-02-21 Wojciech Polak <polak@gnu.org>
255
256 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
257 text.
258
333e670c
JD
2592008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
260
261 Fix impure push parser compile error reported by Bob Rossi at
262 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
263 * data/yacc.c: Clean up whitespace in the output a little.
264 (yypstate_allocated): Define for impure push parsers regardless of
265 whether the pull interface is also requested.
266 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
267 check impure push parsers without the pull interface.
268
269 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
270 yyerror takes arguments specified by %parse-param while yypstate_new
271 does not.
272 * doc/bison.texinfo (Parser Create Function): Document that
273 yypstate_new returns 0 for multiple impure parser instances.
274 * tests/push.at (Push Parsing: Multiple impure instances): Update
275 expected stderr output.
276
798096e1
JD
2772008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
278
279 * runtime-po/POTFILES.in (push.c): Remove.
280
9ca7f077
JD
2812008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
282
283 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
284 * data/push.c: Rename to...
285 * data/yacc.c: ... this, overwriting it.
286 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
287 `%push-pull-parser' -> `%define api.push_pull "both"'.
288 Remove old yacc.c tests, and update push.c tests to yacc.c.
289
42ee26bb
JD
2902008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
291
292 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
293 `"%code top" blocks' instead of `%code "top" blocks'.
294 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
295 Clean up whitespace in the output a little.
296
b1cc23c4
JD
2972008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
298
299 Fix documentation problems reported by Tim Josling at
300 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
301 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
302 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
303 integers. Explain the effect of literal string aliases on error
304 messages. Copy token 0 documentation from the C++ skeleton
305 documentation.
306
ab7f29f8
JD
3072008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
308
309 Accept a token number in a %left, %right, or %nonassoc for POSIX
310 conformance. Reported by Tim Josling at
311 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
312 * NEWS (2.3a+): Mention.
313 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
314 and code numbers are treated by precedence declarations.
315 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
316 of symbols.1.
317 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
318 of symbol.
319 (symbol.prec): New, just like symbol but allows INT.
320 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
321 longer holds.
322 * tests/regression.at (Token number in precedence declaration): New
323 test case.
324
a924ef36
JMG
3252008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
326
327 DJGPP specific issues.
328 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
329 be changed. Copyright timestamp adjusted.
330 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
331 be changed. Copyright timestamp adjusted.
332 * djgpp/config.site: Copyright timestamp adjusted.
333 * djgpp/config_h.sed: Copyright timestamp adjusted.
334 * djgpp/djunpack.bat: Copyright timestamp adjusted.
335 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
336 filename translation list.
337 * djgpp/subpipe.c (init_subpipe): Check the environment variables
338 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
339 files shall be created. Before trying to use the temp dir where the
340 environment variable points to check that the dir really exists. If
341 not default to the cwd as temp dir. Copyright timestamp adjusted.
342 * djgpp/subpipe.h: Copyright timestamp adjusted.
343 * djgpp/testsuite.sed: Copyright timestamp adjusted.
344
389c8cfd
PE
3452008-01-30 Paul Eggert <eggert@cs.ucla.edu>
346
347 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
348
5d1cfef4
PE
3492008-01-09 Paul Eggert <eggert@cs.ucla.edu>
350
351 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
352 Problem reported by Claudio Saavedra in
353 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
354
e2dcf996
WP
3552008-01-05 Wojciech Polak <polak@gnu.org>
356
357 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
358 document's title with the input grammar file name.
359
da730230
JD
3602007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
361
362 Automate regression testing of the XML/XSLT implementation. Discussed
363 starting at
364 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
365 * configure.ac (XSLTPROC): New substitution.
366 * Makefile.am (maintainer-xml-check): New phony target invoking...
367 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
368 invoking make maintainer-check with BISON_TEST_XML=1.
369 * tests/atlocal.in (XSLTPROC): New.
370 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
371 not to report reachable memory when Bison is expected to have a
372 non-zero exit status and (2) to compare XML/XSLT output with --graph
373 and --report=all output for every working grammar when
374 BISON_TEST_XML=1.
375 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
376 (AT_BISON_CHECK_XML): New.
377 (AT_QUELL_VALGRIND): New.
378 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
379 (AT_CHECK): ... don't redefine this since this was the old way to
380 quell Valgrind.
381 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
382 AT_BISON_CHECK invocations.
383 * tests/c++.at: Likewise.
384 * tests/calc.at: Likewise.
385 * tests/conflicts.at: Likewise.
386 * tests/cxx-type.at: Likewise.
387 * tests/existing.at: Likewise.
388 * tests/glr-regression.at: Likewise.
389 * tests/headers.at: Likewise.
390 * tests/input.at: Likewise.
391 * tests/java.at: Likewise.
392 * tests/output.at: Likewise.
393 * tests/push.at: Likewise.
394 * tests/reduce.at: Likewise.
395 * tests/regression.at: Likewise.
396 * tests/sets.at: Likewise.
397 * tests/skeletons.at: Likewise.
398 * tests/synclines.at: Likewise.
399 * tests/torture.at: Likewise.
400 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
401 tends to hang xsltproc.
402 (Big horizontal): Likewise.
403
408476bc
JD
4042007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
405
406 In XML output, remove redundant class attribute on symbol element.
407 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
408 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
409 look up a symbol to determine whether it's a nonterminal or terminal.
410 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
411 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
412
413 Add prec/assoc information to XML output.
414 * src/gram.c (grammar_rules_print_xml): For each rule that has a
415 %prec, add a percent_prec attribute.
416 * src/print-xml.c (print_grammar): For each terminal that has a
417 precedence or associativity, add a prec or assoc attribute.
418 (xml_indent): New.
419 (xml_puts): Use xml_indent.
420 (xml_printf): Use xml_indent.
421 * src/print-xml.h (xml_indent): Prototype.
422
423 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
424 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
425
d4a26c48
JD
4262007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
427
428 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
429 (bison:ruleByNumber): ... this for clarity.
430 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
431 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
432 (xsl:template match="reduction"): Update.
433 (xsl:template match="item"): Update.
434 (xsl:template match="reduction"): Update.
435
436 In the XML output, don't print the list of rules where symbols appear.
437 Compute it in XSLT instead. Discussed at
438 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
439 * data/xslt/bison.xsl (bison:ruleByLhs): New.
440 (bison:ruleByRhs): New.
441 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
442 bison:ruleByRhs.
443 (xsl:template match="terminal/rule"): Remove.
444 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
445 bison:ruleByRhs.
446 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
447 Remove.
448 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
449 bison:ruleByRhs and mode="number-link" for rule template.
450 (xsl:template match="terminal/rule"): Remove.
451 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
452 bison:ruleByRhs and mode="number-link" for rule template.
453 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
454 Rewrite as...
455 (xsl:template match="rule" mode="number-link"): ... this.
456 * src/print-xml.c (print_grammar): Don't print the list of rules.
457
ef1b4273
JD
4582007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
459
460 Don't let --report affect XML output; always print all information.
461 Discussed at
462 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
463 * src/conflicts.c (log_resolution): Implement.
464 * src/print-xml.c (print_core): Implement.
465 (print_state): Implement.
466 (print_xml): Implement.
467
468 * NEWS (2.3a+): Fix quotes.
469 * src/parse-gram.y (prologue_declaration): For consistency with -v,
470 don't let %verbose clear the list specified by --report.
471
0f6cd9e3
AD
4722007-11-26 Akim Demaille <akim@epita.fr>
473
474 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
475
d80fb37a
JD
4762007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
477
478 In the XML output, list useless and unused symbols and rules with the
479 useful ones and add a "usefulness" attribute. Discussed starting at
480 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
481 * src/gram.c (grammar_rules_partial_print_xml): Remove.
482 (grammar_rules_print_xml): Print all rules instead of just those
483 useful in the grammar, and add a "usefulness" attribute.
484 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
485 * src/print-xml.c (print_rules_useless_in_parser): Remove.
486 (print_grammar): Print all nonterminals instead of just useful ones,
487 and add a "usefulness" attribute to nonterminals and terminals.
488 (print_xml): Don't print a separate "reductions" or
489 "rules-useless-in-parser" element.
490 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
491 (reduce_xml): Remove.
492 (reduce_token_unused_in_grammar): New.
493 (reduce_nonterminal_useless_in_grammar): New.
494 * src/reduce.h (reduce_xml): Remove prototype.
495 (reduce_token_unused_in_grammar): Add prototype.
496 (reduce_nonterminal_useless_in_grammar): Add prototype.
497 * data/xslt/xml2text.xsl: Update for XML changes.
498 * data/xslt/xml2xhtml.xsl: Update for XML changes.
499 * tests/reduce.at (Useless Terminals): Update output.
500 (Useless Rules): Update output.
501 (Reduced Automaton): Update output.
502
503 Say "Terminals unused in grammar" instead of "Unused terminals".
504 * NEWS (2.3a+): Update.
505 * doc/bison.texinfo (Understanding): Update example output.
506 * src/reduce.c (reduce_output): Implement.
507 * data/xslt/xml2text.xsl: Implement.
508 * data/xslt/xml2xhtml.xsl: Implement.
509
1bb2bd75
JD
5102007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
511
512 Accept --report-file=FILE to override the default `.output' filename.
513 * NEWS (2.3a+): Mention.
514 * doc/bison.texinfo (Bison Options): Add an entry.
515 * src/files.c (compute_output_file_names): Don't override
516 spec_verbose_file if already set.
517 * src/getargs.c (usage): Document --report-file.
518 (REPORT_FILE_OPTION): New anonymous enum member.
519 (long_options): Add entry for it.
520 (getargs): Add case for it setting spec_verbose_file.
521
522 * build-aux/cross-options.pl: Don't record a short option just because
523 there's an arg.
524 * doc/.cvsignore: Add yacc.1.
525
a005a9c4
AD
5262007-11-14 Akim Demaille <akim@epita.fr>
527
528 * doc/yacc.1.in: New.
529 * configure.ac, doc/Makefile.am: Adjust.
530 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
531 config.h symbol.
532 Use AC_SUBST for assignments too.
533 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
534
cff03fb2
JD
5352007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
536
537 * src/gram.c: Remove comments that duplicate comments in gram.h.
538
539 When reporting useless rules and nonterminals, say "useless in grammar"
540 instead of "useless", and say "useless in parser" instead of "never
541 reduced". Discussed starting at
542 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
543 * NEWS (2.3a+): Mention this change.
544 * data/xslt/xml2text.xsl: Update output text and expected input XML
545 element names to match changes below.
546 * data/xslt/xml2xhtml.xsl: Likewise.
547 (xsl:template match="bison-xml-report"): Add missing entry in Table of
548 Contents: "Rules useless in parser due to conflicts".
549 * doc/bison.texinfo (Decl Summary): Reword a little.
550 (Understanding): Update example output for changes below.
551 * src/gram.c: (rule_useful_p): Rename to...
552 (rule_useful_in_grammar_p): ... this.
553 (rule_useless_p): Rename to...
554 (rule_useless_in_grammar_p): ... this.
555 (rule_never_reduced_p): Rename to...
556 (rule_useless_in_parser_p): ... this.
557 (grammar_rules_print): Update for renames.
558 (grammar_rules_print_xml): Update for renames.
559 (grammar_rules_never_reduced_report): Rename to...
560 (grammar_rules_useless_report): ... this since it is used for either
561 kind of useless rule.
562 * src/gram.h: Reword comments and update function names in prototypes.
563 * src/main.c (main): Say "rule useless in parser due to conflicts".
564 * src/print-xml.c (print_rules_never_reduced): Rename to...
565 (print_rules_useless_in_parser): ... this, and rename output XML
566 element "rules-never-reduced" to "rules-useless-in-parser".
567 (print_xml): Update for rename.
568 * src/print.c (print_results): Say "Rules useless in parser due to
569 conflicts".
570 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
571 (nonterminals_reduce): Say "nonterminal useless in grammar".
572 (reduce_output): Say "Nonterminals useless in grammar".
573 Say "Rules useless in grammar".
574 (reduce_xml): Rename output XML element "useless" to
575 "useless-in-grammar".
576 (reduce_print): Don't report the count of grammatically useless rules
577 as "rules never reduced" just because %yacc is specified.
578 In the correct report of this count, say nonterminal(s) and rule(s)
579 "useless in grammar".
580 * tests/conflicts.at (S/R in initial): Update expected output.
581 (Defaulted Conflicted Reduction): Likewise.
582 (Unreachable States After Conflict Resolution): Likewise.
583 * tests/existing.at (GNU pic Grammar): Likewise.
584 * tests/reduce.at (Useless Nonterminals): Likewise.
585 (Useless Rules): Likewise.
586 (Reduced Automaton): Likewise.
587 (Underivable Rules): Likewise.
588 (Empty Language): Likewise.
589
66f0441d
JD
5902007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
591
592 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
593 here document and before the EOF so that BSD's implementation of Bourne
594 shell doesn't parse the delimiter as part of the here document.
595 * doc/.cvsignore: Add cross-options.texi.
596 * src/getargs.c (usage): Add a blank line after the warning categories.
597
d0ee4105
PB
5982007-11-08 Paolo Bonzini <bonzini@gnu.org>
599
600 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
601
e8b1fb9b
AD
6022007-11-05 Akim Demaille <akim@epita.fr>
603
604 Remove Id: from bison.1.
605 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
606 (perl -0777 -pi -e 's/\.PP\nId): New.
607 (.x.1): Use it to ignore the version control revision.
608
2f7a96b5
AD
6092007-11-05 Akim Demaille <demaille@gostai.com>
610
611 * build-aux/Makefile.am: Ship cross-options.pl.
612 * doc/Makefile.am: Always refer to cross-options.texi with
613 $(srcdir).
614 (MAINTAINERCLEANFILES): Add it.
615
f4101aa6
AD
6162007-11-04 Akim Demaille <demaille@gostai.com>
617
618 Generate the long/short option cross-table.
619 * build-aux/cross-options.pl: New.
620 * doc/Makefile.am (cross-options.texi): New.
621 * doc/bison.texinfo: Use it.
622
727a1401
AD
6232007-11-04 Akim Demaille <demaille@gostai.com>
624
625 Generate bison.1 using help2man.
626 * doc/common.x, doc/bison.x: New.
627 * doc/Makefile.am (bison.1, .x.1): New.
628 The code is taken from autoconf-2.61/man/Makefile.am.
629 * configure.ac: Look for help2man.
630
6aeb9c57
AD
6312007-11-04 Akim Demaille <demaille@gostai.com>
632
633 Complete --help.
634 * src/getargs.c (usage): Document -W, make it clear that -d,
635 -g and -x have optional arguments.
636
d7be4085
AD
6372007-11-04 Akim Demaille <demaille@gostai.com>
638
639 Find sha1sum when named gsha1sum.
640 * bootstrap (find_tool): New.
641 ($SHA1SUM): New.
642
d9df47b6
JD
6432007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
644
645 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
646 at
647 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
648 * NEWS (2.3a+): Mention.
649 * data/bison.m4 (b4_pure_if): Don't define it here.
650 * data/c.m4 (b4_identification): Depend on individual skeletons to
651 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
652 values of the %define variables api.pure or api.push_pull. Define
653 YYPURE, YYPUSH, and YYPULL accordingly.
654 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
655 glr.cc has already defined b4_pure_flag.
656 * data/push.c: Define b4_pure_if based on `%define api.pure'.
657 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 658 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
659 * doc/bison.texinfo (Pure Decl): Update.
660 (Push Decl): Update.
661 (Decl Summary): Add api.pure to %define entry.
662 In %pure-parser entry, say it's deprecated and reference %define.
663 (Pure Calling): Update.
664 (Error Reporting): Update.
665 (C++ Scanner Interface): Update.
666 (How Can I Reset the Parser): Update.
667 (Table of Symbols): In %pure-parser entry, say it's deprecated and
668 reference %define.
669 * src/getargs.c (pure_parser): Remove global variable.
670 * src/getargs.h (pure_parser): Remove extern.
671 * src/output.c (prepare): Don't define pure_flag muscle.
672 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
673 wrapper around `%define api.pure'.
674 * tests/calc.at (Simple LALR Calculator): Update.
675 (Simple GLR Calculator): Update.
676 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
677 Update.
678 (GLR: Resolve ambiguity, pure, locations): Update.
679 (GLR: Merge conflicting parses, pure, no locations): Update.
680 (GLR: Merge conflicting parses, pure, locations): Update.
681 * tests/glr-regression.at (Uninitialized location when reporting
682 ambiguity): Update
683 * tests/input.at (Unused %define api.pure): New test case.
684 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
685 AT_PURE_IF and AT_PURE_AND_LOC_IF.
686 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
687
c373bf8b
JD
6882007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
689
690 %define push_pull -> %define api.push_pull. Discussed starting at
691 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
692 * data/push.c: Expect the new name.
693 * data/yacc.c: Likewise.
694 * doc/bison.texinfo (Push Decl): Update.
695 (Decl Summary): Update %define entry.
696 (Push Parser Function): Update.
697 (Pull Parser Function): Update.
698 (Parser Create Function): Update.
699 (Parser Delete Function): Update.
700 * tests/calc.at (Simple LALR Calculator): Update.
701 * tests/input.at (%define enum variables): Update.
702 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
703 (Push Parsing: Multiple impure instances): Update.
704 (Push Parsing: Unsupported Skeletons): Update.
705 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
706 (Exploding the Stack Size with Malloc): Update.
707
708 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
709 other entries some.
710
32f19b6b
JD
7112007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
712
713 For the XML output's terminal element, rename @number to @token-number,
714 and add @symbol-number. In the nonterminal element, rename @number to
715 @symbol-number. Discussed starting at
716 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
717 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
718 renames.
719 (xsl:template match="nonterminal"): Likewise.
720 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
721 (xsl:template match="nonterminal"): Likewise.
722 * src/print-xml.c (print_grammar): Implement.
723
255a6b90
JD
7242007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
725
726 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
727 2007-10-11 change, the child elements here are items not rules.
408476bc 728 (xsl:template match="item"): New.
255a6b90
JD
729 (xsl:template match="rule"): Update for new reduced itemset.
730 (xsl:template match="point"): Remove.
731 (xsl:template match="empty"): For consistency with --graph, don't
732 output "/* empty */".
733 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
734 line-wrap, don't pass a negative value as first-line-length since this
735 won't work with the following changes.
736 (xsl:template name="line-wrap"): Simplify slightly.
737 (xsl:template name="ws-search"): Eliminate recursion.
738 * src/print_graph.c (print_core): Don't print a reduction's lookahead
739 set next to an item whose dot is not at the end of the RHS even if it
740 happens to be associated with the same rule.
741
88c78747
JD
7422007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
743
31984206
JD
744 Add %define lr.keep_unreachable_states.
745 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
746 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
747 * src/main.c (main): Implement it.
748 * tests/conflicts.at (Unreachable States After Conflict Resolution):
749 Extend to test it, and fix a typo.
750
7512007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
752
753 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
754 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
755 the example .output text.
756 * tests/regression.at (Extra lookahead sets in report): Improve wording
757 of comments.
758
b7a70162
WP
7592007-10-17 Wojciech Polak <polak@gnu.org>
760
761 * src/print-xml.c (print_grammar): Renamed
762 <terminal> and <nonterminal> attributes:
763 "type" to "number" and "symbol" to "name".
764 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
765 Use new attribute names.
766 (xsl:template match="nonterminal"): Likewise.
767 * data/xslt/xml2xhtml.xsl: Likewise.
768
a0de5091
JD
7692007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
770
771 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
772 (Option Cross Key): Likewise.
773
774 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
775 next to an item whose dot is not at the end of the RHS even if it
776 happens to be associated with the same rule.
777 * src/print.c (print_core): Likewise.
778 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
779 (Resolved SR Conflicts): Update output.
780 * tests/regression.at (Extra lookahead sets in report): New test case.
781
4c20d18d
WP
7822007-10-11 Wojciech Polak <polak@gnu.org>
783
784 * src/print-xml.c (print_core): Remove item set
785 redundancy.
786 * data/xslt/bison.xsl (bison:ruleNumber): New key.
787 Improve processing time. Suggested by Joel E. Denny.
788 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
789 Write xsl:param "required" attribute as comment.
790 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
791 (xsl:template match="rule"): Support new reduced itemset.
792 (xsl:template match="point"): Remove.
793 * data/xslt/xml2xhtml.xsl: Likewise.
794
f506ad1c
JD
7952007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
796
797 * src/getargs.c (version): Update copyright year.
798
21f1b063
JD
7992007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
800
801 Make xml2dot.xsl and --graph produce the same output.
802 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
803 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
804 escaped later.
805 (xsl:template name="output-node"): Use the new escape template instead
806 of the string-replace template directly.
807 (xsl:template name="output-edge"): Likewise.
808 (xsl:template name="escape"): New, escapes backslashes and newlines in
809 addition to quotation marks.
810 * src/graphviz.c (start_graph, output_node, output_edge): Add
811 whitespace to output for legibility.
812
813 Make xml2text.xsl and --report produce the same output, and remove the
814 XML "conflicts" element since a conflict summary is easily extracted
815 from the automaton.
816 * data/xslt/bison.xsl: New.
817 (xsl:template match="state" mode="bison:count-conflicts): New.
818 * data/xslt/xml2text.xsl: Import bison.xsl.
819 (xsl:template match="bison-xml-report"): Instead of styling the
820 "conflicts" element, style the "automaton" element with mode
821 "conflicts". Unlike the former, the latter lists S/R and R/R
822 conflicts for a state on the same line.
823 (xsl:template match="conflicts"): Remove.
824 (xsl:template match="conflict"): Remove.
825 (xsl:template match="terminal"): Line-wrap the list of rules in which
826 the terminal is used.
827 (xsl:template match="nonterminal"): Likewise for nonterminals.
828 (xsl:template match="automaton" mode="conflicts"): New.
829 (xsl:template match="state" mode="conflicts"): New.
830 (xsl:template name="line-wrap"): New.
831 (xsl:template name="ws-search"): New.
832 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
833 (xsl:template match="bison-xml-report"): Instead of styling the
834 "conflicts" element, style the "automaton" element with mode
835 "conflicts."
836 (xsl:template match="conflicts"): Remove.
837 (xsl:template match="conflict"): Remove.
838 (xsl:template match="automaton" mode="conflicts"): New.
839 (xsl:template match="state" mode="conflicts): New.
840 * src/conflicts.c (conflicts_output_xml): Remove.
841 * src/conflicts.h (conflicts_output_xml): Remove prototype.
842 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
843 * src/print.c (print_grammar): Consistently wrap at the 66th column so
844 the corresponding XSLT is easier. Also, never wrap between a word and
845 the comma that follows it.
846
793fbca5
JD
8472007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
848
849 Improve C++ namespace support. Discussed starting at
850 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
851 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
852 b4_namespace_close): New macros that interpret the %define variable
853 "namespace" so its value can contain "::" to indicate nested
854 namespaces.
855 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
856 the above macros.
857 * data/lalr1.cc (b4_namespace): Likewise.
858 * data/location.cc (b4_namespace): Likewise.
859 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
860 inside a new table in the general %define entry. Document `%define
861 namespace' there as well. Point the %name-prefix entry to it since it
862 explains it more completely in the case of C++.
863 (C++ Bison Interface): Mention `%define namespace' instead of
864 %name-prefix.
865 (Table of Symbols): Remove the `%define push_pull' entry. The %define
866 entry suffices.
867 * tests/c++.at (Relative namespace references): New test case.
868 (Absolute namespace references): New test case.
869 (Syntactically invalid namespace references): New test case.
870 * tests/input.at (C++ namespace reference errors): New test case.
871
35b8730d
JD
8722007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
873
874 Add syncline support and location accessor to internal %define
875 interfaces.
876 * data/bison.m4 (b4_percent_define_get_loc): New.
877 (b4_percent_define_get_syncline): New.
878 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
879 (b4_percent_define_default): Record defining location as line 1 rather
880 than 0 for the sake of synchronizing #line's, and define
881 b4_percent_define_syncline(VARIABLE).
882 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
883 * src/muscle_tab.c (muscle_syncline_grow): New.
884 (muscle_code_grow): Use muscle_syncline_grow.
885 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
886 define b4_percent_define_syncline(VARIABLE).
887 (muscle_percent_define_get_loc): New.
888 (muscle_percent_define_get_syncline): New.
889 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
890 remove some unused variables.
891 (muscle_percent_define_default): Record defining location as line 1
892 rather than 0 for the sake of synchronizing #line's, and define
893 b4_percent_define_syncline(VARIABLE).
894 (muscle_percent_define_check_values): Use
895 muscle_percent_define_get_loc.
896 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
897 (muscle_percent_define_get_syncline): Prototype.
898 * tests/skeletons.at (%define Boolean variables: invalid skeleton
899 defaults): Update output for location change.
900 (Complaining during macro argument expansion): Extend to test
901 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
902
7dc4a694
JD
9032007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
904
905 Fix some error-reporting macro bugs.
906 * data/bison.m4 (b4_cat): New.
907 (b4_error, b4_error_at): Use b4_cat to send error directives directly
908 to stdout so they don't become arguments to other macros. Update
909 comments and add examples.
910 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
911 add examples.
912 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
913 after printing the error directive so that M4 doesn't report subsequent
914 problems that are induced by this problem.
915 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
916 instead of just in them. Recognize @\n in both places. Both expand to
917 the empty string. Needed by b4_cat.
918 * tests/skeletons.at (Complaining during macro argument expansion):
919 New test case.
920 (Fatal errors make M4 exit immediately): New test case.
921
d4bd2295
JD
9222007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
923
924 Implement --print-datadir.
925 * src/getargs.c (usage): Mention.
926 (PRINT_DATADIR_OPTION): New anonymous enum member.
927 (long_options): Add entry for it.
928 (getargs): Add case for it calling compute_pkgdatadir.
929 * src/output.c (output_skeleton): Encapsulate data directory
930 computation from here...
931 (prepare): ... and from here...
932 (compute_pkgdatadir): ... into this new function.
933 * src/output.h (compute_pkgdatadir): Prototype.
934
34cdeddf
JD
9352007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
936
937 * src/print-xml.c (escape_bufs): New static global variable
938 replacing...
939 (xml_escape_n): ... the static local variable buf here.
940 (print_xml): Free memory for escape_bufs.
941 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
942
d782395d
JD
9432007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
944
945 Replace `%push-parser' and `%push-pull-parser' with
946 `%define push_pull "push"' and `%define push_pull "both"'.
947 `%define push_pull "pull"' is the default.
948 * doc/bison.texinfo (Push Decl, Push Parser Function,
949 Pull Parser Function, Parser Create Function, Parser Delete Function):
950 Update declarations.
951 (Decl Summary, Table of Symbols): Replace %push-parser and
952 %push-pull-parser entries with a %define push_pull entry.
953 * data/bison.m4 (b4_percent_define_check_values): New macro.
954 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
955 definitions...
956 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
957 definitions...
958 * data/push.c: ... to here and compute them from the value of the
959 %define variable push_pull.
960 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
961 parsing requests here...
962 * data/yacc.c: ... hack this to switch to push.c any time
963 b4_use_push_pull_flag or the %define variable push_pull is set. This
964 will go away when we mv push.c yacc.c.
965 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
966 push parsing is not supported since unused %define variables are
967 reported anyway.
968 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
969 * src/muscle_tab.h (muscle_percent_define_check_values): Update
970 comments for consistency with b4_percent_define_check_values.
971 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
972 muscles.
973 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
974 Remove.
975 (prologue_declaration): Remove %push-parser and %push-pull-parser
976 rules.
977 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
978 * tests/calc.at: Update declarations.
979 * tests/input.at (%define enum variables): New test case.
980 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
981 declaration.
982 (Push Parsing: Multiple impure instances): Update declaration.
983 (Push Parsing: Unsupported Skeletons): New test case.
984 * tests/torture.at (Exploding the Stack Size with Alloca): Update
985 declaration.
986 (Exploding the Stack Size with Malloc): Update declaration.
987
3f999f78
WP
9882007-09-24 Wojciech Polak <polak@gnu.org>
989
990 Add XSLT transformations.
991
992 * data/xslt/xml2dot.xsl: Transform XML into DOT.
993 * data/xslt/xml2text.xsl: Transform XML into plain text.
994 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
995 * data/Makefile.am (xsltdir): New variable.
996 (dist_xslt_DATA): Add xslt/*.xsl files.
997
a4f75309
PE
9982007-09-23 Paul Eggert <eggert@cs.ucla.edu>
999
1000 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
1001 Problem reported by Wojciech Polak.
1002 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
1003 (xml_printf): Undo change I made on 21 September; that is,
1004 indent 2 spaces, not 1.
1005
ad5feac4
JD
10062007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
1007
1008 Pacify ./configure --enable-gcc-warnings.
1009 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
1010 `char const *' instead of `char *'.
1011 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
1012 local variable `sep'.
1013
41d7a5f2
PE
10142007-09-21 Paul Eggert <eggert@cs.ucla.edu>
1015
1016 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
1017 elsewhere.
1018 * src/print-xml.c: Prefer "const" after types; that's more consistent.
1019 (xml_printf): Indent just 1 space for level.
1020 (e_char, xlate_char): Remove.
1021 (xml_escape_string): Rewrite to avoid undefined behavior (used
1022 storage that was freed from the stack).
1023 (xml_escape_n): Don't bother checking for subscript error.
1024
3f999f78
WP
10252007-09-21 Wojciech Polak <polak@gnu.org>
1026
1027 Add Bison XML Automaton Report.
41d7a5f2
PE
1028
1029 Add support for an -x option to generate an XML report.
1030 It is not documented yet.
1031 * src/print-xml.c: New file.
1032 * src/print-xml.h: Likewise.
1033 * lib/timevar.def (TV_XML): New var.
1034 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
1035 * src/conflicts.c: Include print-xml.h.
1036 (solved_conflicts_xml_obstack): New var.
1037 (log_resolution, conflicts_solve, conflicts_free):
1038 Add support for XML report.
1039 (conflicts_output_val): New function.
1040 * src/conflicts.h (conflicts_output_val): New decl.
1041 * src/files.c (spec_xml_file): New var.
1042 (compute_output_file_names, output_file_names_free): Add XML support.
1043 * src/files.h (spec_xml_file): New decl.
1044 * src/getargs.c (xml_flag): New var.
1045 (usage, short_options, long_options, getargs): Add XML support.
1046 * src/getargs.h (xml_flag): New decl.
1047 * src/gram.c: Include print-xml.h.
1048 (rule_lhs_print_xml, rule_rhs_print_xml):
1049 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
1050 New functions.
1051 * src/gram.h: Declare external ones.
1052 * src/main.c: Include print-xml.h.
1053 (main): Add XML support.
1054 * src/reduce.c: Include print-xml.h.
1055 (reduce_xml): New function.
1056 * src/reduce.h: Declare it.
1057 * src/state.c: Include print-xml.h.
1058 (state_new): Add XML support.
1059 (state_rule_lookahead_tokens_print_xml): New function.
1060 * src/state.h: Declare it.
1061 (struct state): New member solved_conflicts_xml.
1062 * src/symtab.c (symbol_class_get_string): New function.
1063 * src/symtab.h: Declare it.
1064
6d8e724d
PE
10652007-09-21 Paul Eggert <eggert@cs.ucla.edu>
1066
1067 * GNUmakefile: Switch to coreutils's version.
1068 * bootstrap: Likewise.
1069 * Makefile.cfg: Adjust to new GNUmakefile.
1070 * README-hacking: Likewise.
1071
1072 Import from gnulib:
1073
1074 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
1075 Bruno Haible <bruno@clisp.org>
1076
1077 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
1078 and is a script that invokes bison. Tighten the code. Add comments.
1079
922bdd7f
JD
10802007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
1081
1082 Spell "boolean" as "Boolean". Reported by Akim Demaille.
1083 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
1084 * doc/bison.texinfo (Decl Summary): Fix.
1085 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
1086 * tests/input.at (Boolean %define variables): Update output.
1087 * tests/skeletons.at (%define boolean variables: invalid skeleton
1088 defaults): Rename to...
1089 (%define Boolean variables: invalid skeleton defaults): ... this and
1090 update output.
1091
1b17b01d
JD
10922007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
1093
1094 In impure push mode, don't allow more than one yypstate to be allocated
1095 since multiple impure parsers would corrupt yynerrs.
1096 * data/push.c (yypstate_allocated): New static global variable
1097 initialized to 0.
1098 (yypull_parse): If yypstate_new returns 0, don't report it as memory
1099 exhaustion if yypstate_allocated is 1, but still return 2.
1100 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
1101 already 1. Otherwise, set it to 1.
1102 (yypstate_delete): Set it to 0.
1103 * tests/push.at (Push Parsing: Multiple impure instances): New test
1104 case.
1105
9987d1b3
JD
11062007-08-17 Bob Rossi <bob@brasko.net>
1107
1108 * doc/bison.texinfo (Push Decl): Document the push parser.
1109 (Table of Symbols): Ditto.
1110 (Pure Decl): Ditto.
1111 (Decl Summary): Ditto.
1112 (Multiple Parsers, Push Parser Function, Pull Parser Function,
1113 Parser Create Function, Parser Delete Function):
1114 Add new push parser symbols.
1115 (Table of Symbols): Document push-parser, push-pull-parser,
1116 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
1117
f16b0819
PE
11182007-08-15 Paul Eggert <eggert@cs.ucla.edu>
1119
1120 Update to GPLv3.
1121 * doc/gpl-3.0.texi: New file.
1122 * doc/gpl.texi: Remove.
1123 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
1124 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
1125 * README-hacking, TODO, bootstrap, bootstrap.conf:
1126 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
1127 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
1128 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
1129 * data/lalr1.cc, data/lalr1.java, data/location.cc:
1130 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
1131 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
1132 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
1133 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
1134 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
1135 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
1136 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
1137 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
1138 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
1139 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
1140 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
1141 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
1142 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
1143 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
1144 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
1145 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
1146 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
1147 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
1148 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
1149 * src/complain.c, src/complain.h, src/conflicts.c:
1150 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
1151 * src/files.h, src/flex-scanner.h, src/getargs.c:
1152 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
1153 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
1154 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
1155 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
1156 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
1157 * src/print.c, src/print.h, src/print_graph.c:
1158 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
1159 * src/reduce.h, src/relation.c, src/relation.h:
1160 * src/revision.h, src/scan-code.h, src/scan-code.l:
1161 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
1162 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
1163 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
1164 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
1165 * tests/Makefile.am, tests/actions.at, tests/c++.at:
1166 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
1167 * tests/existing.at, tests/glr-regression.at:
1168 * tests/headers.at, tests/input.at, tests/java.at:
1169 * tests/local.at, tests/output.at, tests/push.at:
1170 * tests/reduce.at, tests/regression.at, tests/sets.at:
1171 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
1172 * tests/torture.at:
1173 Update to GPLv3.
1174
728c4be2
JD
11752007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1176
1177 Get rid of broken %no-parser, -n, and --no-parser implementation and
1178 documentation.
1179 * TODO: Don't mention them.
1180 * doc/bison.1: Likewise.
1181 * doc/bison.texinfo (Decl Summary): Likewise.
1182 (Bison Options): Likewise.
1183 (Option Cross Key): Likewise.
1184 * src/getargs.c (no_parser_flag): Remove global variable.
1185 (usage): Don't print description of -n and --no-parser.
1186 (long_options): Remove --no-parser entry here.
1187 (getargs): Remove -n case in the switch here.
1188 * src/getargs.h (no_parser_flag): Remove extern.
1189 * tests/regression.at (Web2c Actions): Remove comment that mentions
1190 --no-parser.
1191
5d31a216
JD
11922007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1193
1194 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
1195 name user variables starting with `yy'. Just pass NULL instead of a
1196 dummy local &yylval to yypush_parse.
1197 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
1198 starting with `yy'.
1199
a2ea208d
JD
12002007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
1201
1202 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
1203 true since it's then always used regardless of whether yyoverflow is
1204 defined. Reported by Christian Burger at
1205 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
1206 * THANKS: Add Christian Burger.
1207
91661ebb
JD
1208 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1209 node names: say "Decl Summary" not "Bison Declaration Summary".
1210
cbd50549
JD
12112007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
1212
1213 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
1214 determine whether this function has already complained about an invalid
1215 value for a %define boolean variable, don't check whether Bison has
1216 ever examined the value. As written, the check was a tautology.
1217 Instead, record and check for this complaint using a separate muscle.
1218
eb1b0740
JD
12192007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1220
1221 Fix push parsing memory leak reported by Brandon Lucia at
1222 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
1223 * THANKS: Add Brandon Lucia.
1224 * data/push.c (yypstate_delete): Free the stack if it was reallocated
1225 but the parse never completed and thus freed it.
1226 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
1227 * tests/testsuite.at: Include push.at.
1228 * test/push.at: New.
1229 (Push Parsing: Memory Leak for Early Deletion): New test case.
1230
9d774aff
JD
12312007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
1232
1233 Improve handling of multiple S/R conflicts in the same state and of S/R
1234 conflicts involving multiple reductions.
1235 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
1236 set for a state here or Bison will abort if it is reassigned on a
1237 later conflicted reduction in the same state.
1238 Similarly, don't finalize and assign the solved conflicts report here
1239 or it will be lost if it is reassigned on a later conflicted reduction
1240 in the same state.
1241 (set_conflicts): Instead, assign them both here after all S/R conflicts
1242 in the state have been fully examined.
1243 * src/print.c (shift_set): Rename to...
1244 (no_reduce_set): ... this.
1245 (print_reductions): Update for rename, and add %nonassoc error action
1246 tokens to no_reduce_set so that, when printing the first remaining
1247 reduction on an error action token, the reduction is enclosed in
1248 brackets.
1249 (print_results): Update for rename.
1250 * tests/conflicts.at (Solved conflicts report for multiple reductions
1251 in a state): New test case.
1252 (%nonassoc error actions for multiple reductions in a state): New test
1253 case.
1254
1255 * src/main.c (main): Don't depend on C99 features.
1256
10159d2a
JD
12572007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1258
1259 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
1260 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
1261 uniwidth.
10159d2a 1262
953b3935
JD
12632007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
1264
1265 * bootstrap (slurp): Create target directories that don't exist.
1266 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
1267
6ce2d93a
JD
12682007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1269
1270 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
1271 than item number.
1272 * closure.c (closure): Likewise.
1273 * state.h (reductions): Comment sorting of rules.
1274 (state): Comment sorting of items.
1275
ce3448d5
JD
12762007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
1277
1278 Fix C++ test cases after recent Gnulib changes. Discussed starting at
1279 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
1280 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
1281 definition in order to avoid Gnulib headers since we don't use config.h
1282 here.
1283 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
1284 rather than AT_DATA so that config.h is included.
1285
8a86eef0
JD
12862007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
1287
1288 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
1289 instead of fprintf. Guard these functions with #if YYDEBUG instead of
1290 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
1291 and so that YYFPRINTF is guaranteed to be defined here.
1292
b1a81613
JD
12932007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1294
1295 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
1296 with...
1297 (muscle_percent_define_check_values): ... this more helpful function.
1298 Again, it's not used yet, but it will be.
1299 * src/muscle_tab.h: Likewise.
1300
71b61d4d
JD
1301 Improve some comments in parser table construction.
1302 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
1303 (generate_states): Don't mention ruleset, which is internal to closure.
1304 * src/closure.c (closure): Explain sorting of core and itemset, which
1305 is required for this function to behave correctly.
1306 * src/closure.h (closure): Mention sorting.
1307
2a6b783d
JD
13082007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
1309
1310 * src/lalr.c (state_lookahead_tokens_count): For code readability,
1311 move the check for disabled transitions to an aver since conflict
1312 resolution hasn't happened yet.
1313
1314 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
1315 labels a state as inconsistent just because it has error transitions.
1316 The original form of this check appeared in revision 1.1 of lalr.c,
1317 which was committed on 1991-12-21. Now (at least), changing the
1318 consistency label on such a state appears to have no useful effect in
1319 any of the places it is examined, which I enumerate below. The key
1320 point to understanding each item in this enumeration is that a state
1321 with an error transition is labelled consistent in the first place only
1322 if it has no rules, so the check cannot matter for states that have
1323 rules. (1) Labelling a state as inconsistent will cause set_conflicts
1324 to try to identify its conflicts, and a state must have *rules* to have
1325 conflicts. (2) Labelling a state as inconsistent will affect how
1326 action_row sets the default *rule* for the state. (3) Labelling a
1327 state as inconsistent will cause build_relations to add lookback edges
1328 to *rules* in that state.
1329 * src/state.h (struct state): Word the comment for member consistent
1330 more carefully.
1331
14462c2b
JD
13322007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1333
1334 Don't depend on C99 features.
1335 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
1336 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
1337 * src/reader.c (check_and_convert_grammar): Fix for-loop.
1338 * src/state.c (state_mark_reachable_states): Fix for-loop.
1339 (state_remove_unreachable_states): Fix for-loop.
1340
1341 Don't widen struct state with member reachable just to temporarily
1342 record reachability. Instead, use a local bitset.
1343 * src/state.h (struct state): Remove member.
1344 * src/state.c (state_new): Don't initialize it.
1345 (state_mark_reachable_states): Rename to...
1346 (state_record_reachable_states): ... this, and use bitset.
1347 (state_remove_unreachable_states): Use bitset.
1348
5a43d418
JD
13492007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
1350
1351 * src/Makefile.am (yacc): Quote target action commands properly so
1352 that the yacc script isn't corrupt. Reported by Hans Aberg at
1353 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
1354
0c650a20
JD
1355 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
1356 the case of pure parsers. Reported by Frans Englich at
1357 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
1358 * THANKS: Add Frans Englich.
1359
61fee93e
JD
1360 * NEWS (2.3a+): In the %code entry, reference section `Bison
1361 Declaration Summary' from the manual now since the %code summary has
1362 moved there.
1363 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
1364 in the rules section must be terminated by semicolons.
1365
f124d423
JD
13662007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1367
1368 Extend the front-end API for %define variables to more completely
1369 mirror the back-end. This will be useful in the future.
1370 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
1371 Update comments to mention the new front-end counterparts of these
1372 macros.
1373 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
1374 for muscle_string_decode and muscle_location_decode.
1375 (muscle_string_decode): New static function.
1376 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
1377 (muscle_percent_define_get, muscle_percent_define_ifdef): New
1378 functions.
1379 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
1380 muscle_percent_define_get to mimic the b4_percent_define_flag_if
1381 implementation more closely.
1382 (muscle_percent_define_invalid_value): New function.
1383 * src/muscle_tab.h (muscle_percent_define_get,
1384 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
1385 Prototype.
1386
75ad86ee
JD
13872007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1388
1389 * NEWS (2.3a+): Mention yesterday's state-removal change.
1390 (2.3a): Remove the %language entry, which was added after 2.3a.
1391 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
1392 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
1393 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
1394 tests/existing.at: Update copyright date.
1395
5967f0cf
JD
13962007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1397
1398 If conflict resolution makes states unreachable, remove those states,
1399 report rules that are then unused, and don't report conflicts in those
1400 states.
1401 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
1402 New global function.
1403 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
1404 function.
1405 * src/main.c (main): After conflict resolution, remove the unreachable
1406 states and update all data structures that reference states by number.
1407 * src/state.c (state_new): Initialize each state's reachable member to
1408 false.
1409 (state_mark_reachable_states): New static function.
1410 (state_remove_unreachable_states): New global function.
1411 * src/state.h (struct state): Add member bool reachable.
1412 (state_remove_unreachable_states): Prototype.
1413 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1414 New test case.
1415 * tests/existing.at (GNU pic Grammar): Update test case output now that
1416 an unused rule is discovered.
1417
b09f4f48
JD
14182007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1419
1420 Minor code cleanup in parser table construction.
1421 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
1422 (new_itemsets, save_reductions): Update for rename to nitemset.
1423 * src/closure.c (nritemset): Rename to...
1424 (nitemset): ... this since the "r" appears to meaningless and isn't
1425 used in the comments.
1426 (closure): Update for rename.
1427 * src/closure.h (nritemset): Update extern to...
1428 (nitemset): ... this.
1429 * src/lalr.c (LA): Fix a typo in comments.
1430 * src/print.c (print_core): Update for rename to nitemset.
1431 * src/print_graph.c (print_graph): Likewise.
1432 * src/state.h: Fix some typos in header comments.
1433
bbb44d83
PE
14342007-04-04 Paul Eggert <eggert@cs.ucla.edu>
1435
9b33de72
PE
1436 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
1437 still sticks to ASCII. Sorry!
1438
bbb44d83
PE
1439 * README-hacking: New file, taken mostly from coreutils, with changes
1440 for Bison. Contains much of the contents of:
1441 * README-cvs: Remove.
1442 * bootstrap: Sync from gnulib.
1443 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
1444 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
1445
29553547
JD
14462007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
1447
1448 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
1449 Setzer.
1450 (Java Differences): Fix some typos.
1451 * THANKS: Add Sebastian Setzer.
1452
01b477c6
PB
14532007-03-07 Paolo Bonzini <bonzini@gnu.org>
1454
730739e4
AD
1455 * data/java.m4 (b4_single_class_if): Remove.
1456 (b4_abstract_if): Look at "%define abstract".
1457 (b4_lexer_if): New.
1458 (b4_union_name): Rename...
1459 (b4_yystype): ... to this. Map to "%define stype".
1460 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
1461 b4_maybe_throws): Fix quoting.
1462 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
1463 * data/lalr1.java (Lexer interface): Always define.
1464 (Lexer interface within parser class): Remove.
1465 (YYLexer class): New, used when "%code lexer" is present.
1466 (constructor): When "%code lexer" is used, pass %lex-param
1467 to the lexer constructor.
1468 (yylex, yyparse): Remove %lex-param from method invocations
1469 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
1470
1471 * doc/bison.texinfo (Java Bison Interface): Mention "%define
1472 abstract". Rename "%define union_name" to "%define stype".
1473 Rename method names according to previous patch.
1474 (Java Scanner Interface): Describe "%code lexer" instead of
1475 "%pure-parser" and "%define single_class".
1476 (Java Differences): Mention "%code lexer".
1477
1478 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
1479 Include scanner here, using macros from tests/local.at.
1480 (AT_DATA_CALC_Y): Remove final argument.
1481 (_AT_CHECK_JAVA_CALC): Likewise.
1482 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
1483 of %locations and %error-verbose.
1484 (main): Test with and without %lex-param.
1485 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
1486 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 1487
122bea3a
JMG
14882007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1489
1490 DJGPP spefic issue. Inhibit the use of disallowed characters for
1491 file name genertion on Win98, WinXP, etc. These are |<>":?*\
1492 and concern testsuite case 46.
1493 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
1494 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
1495 * djgpp/config.bat: Inhibit the use of disallowed characters.
1496
9611cfa2
JD
14972007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1498
1499 Miscellaneous %define and %code cleanup.
1500 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
1501 values are interpreted.
1502 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
1503 documentation a little more.
1504 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
1505 muscle_percent_define_insert, muscle_percent_code_grow): New
1506 functions/macros.
1507 * src/muscle_tab.h (muscle_percent_define_insert,
1508 muscle_percent_code_grow): Prototype.
1509 * src/parse-gram.y (prologue_declaration): Use
1510 muscle_percent_define_insert and muscle_percent_code_grow when parsing
1511 %define and %code directives.
1512
1513 Make it easy to share %define boolean variables between the front-end
1514 and back-end. Though not used yet, this will be useful in the future.
1515 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
1516 Bison uses of names rather than just skeleton uses of names.
1517 (b4_percent_define_get, b4_percent_define_ifdef): Rename
1518 b4_percent_define_skeleton_variables(VARIABLE) to
1519 b4_percent_define_bison_variables(VARIABLE).
1520 (b4_percent_code_get, b4_percent_code_ifdef): Rename
1521 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
1522 b4_percent_code_bison_qualifiers(QUALIFIER).
1523 (b4_check_user_names_wrap): Update for renames.
1524 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
1525 muscle_percent_define_default): New functions mimicking
1526 b4_percent_define_flag_if and b4_percent_define_default.
1527
1528 For %define variables, report locations for invalid values and
bbb44d83 1529 redefinitions.
9611cfa2
JD
1530 * data/bison.m4 (b4_percent_define_flag_if): Read
1531 b4_percent_define_loc(VARIABLE) to report the location of an invalid
1532 value for VARIABLE.
1533 (b4_percent_define_default): Save a special location in
1534 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
1535 must later be reported as invalid.
1536 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
1537 functions.
1538 (muscle_percent_define_insert): Record the location of VARIABLE in
1539 muscle percent_define_loc(VARIABLE), and use it to report the previous
1540 location for a redefinition.
1541 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
1542 (muscle_percent_define_default): Update like b4_percent_define_default.
1543 (muscle_grow_user_name_list): Rename to...
1544 (muscle_user_name_list_grow): ... this for consistency and use
1545 muscle_location_grow.
1546 * src/muscle_tab.h (muscle_location_grow): Prototype.
1547 * tests/input.at (%define errors): Update expected output.
1548 * tests/skeletons.at (%define boolean variables: invalid skeleton
1549 defaults): New test case.
1550
0bf92491
JD
15512007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
1552
1553 * src/print.c (lookahead_set, state_default_rule): Remove.
1554 (print_reductions): Replace state_default_rule invocation with
1555 equivalent use of yydefact, which was computed in token_actions in
1556 tables.c.
1557 (print_results): Don't allocate lookahead_set.
1558
d3b12988
PB
15592007-02-27 Paolo Bonzini <bonzini@gnu.org>
1560
1561 * data/lalr1.java: Prefix all private members with yy.
1562
f57a7536
JD
15632007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
1564
1565 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 1566 Sebastien Fricker at
f57a7536 1567 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 1568 * THANKS: Add Sebastien Fricker.
f57a7536
JD
1569 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
1570 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
1571 accept a variable number of arguments.
1572
6404a5bf
JD
15732007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1574
1575 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
1576
e4e09639
JMG
15772007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1578
1579 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
1580 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
1581 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
1582
d7e0a1a7
PE
15832007-02-11 Paul Eggert <eggert@cs.ucla.edu>
1584
1585 Undo my 2007-02-07 change, switching back to the c-strcase module
1586 introduced in the 2007-02-03 change. Bruno Haible reported that
1587 the 2007-02-07 change would be dangerous in Turkish if we add a
1588 language whose name contains "i", since "i" is not lowercase "I"
1589 in Turkish.
1590 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
1591 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
1592 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
1593 * m4/.cvsignore: Remove strcase.m4.
1594 * src/getargs.c: Revert 2007-02-07 change, as follows.
1595 Include c-strcase.h.
1596 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
1597
deee93a1
JD
15982007-02-11 Bruno Haible <bruno@clisp.org>
1599
1600 Enable the Java related testsuite tests when the only Java compiler
1601 found is a gcj < 4.3. Discussed at
1602 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
1603 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
1604
574add85
JD
16052007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
1606
1607 * data/Makefile.am: Update copyright date.
1608 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
1609 yypstate_new returns NULL.
1610 (yypstate_new): Return NULL if malloc does.
1611 * src/reader.c (packgram): Move translation of rule actions from the
1612 beginning of packgram to...
1613 (check_and_convert_grammar): ... here right before packgram is invoked
1614 so it's easier to write more complete comments, and remove redundant
1615 code.
1616
e785ccf7
JD
16172007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
1618
1619 As in semantic actions, make @$ in %initial-action, %destructor, and
1620 %printer imply %locations.
1621 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
1622 scanning @$.
1623 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
1624 (@$ in %initial-action implies %locations,
1625 @$ in %destructor implies %locations,
1626 @$ in %printer implies %locations): ... these new test cases.
1627
1cfe1ed7
PE
16282007-02-07 Paul Eggert <eggert@cs.ucla.edu>
1629
1630 Undo most of the 2007-02-03 change, switching to the strcase module
1631 now that gnulib strcase has been fixed.
1632 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
1633 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
1634 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
1635 * m4/.cvsignore: Add strcase.m4.
1636 * src/getargs.c: Revert 2007-02-03 change, as follows.
1637 Don't include c-strcase.h.
1638 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
1639 strcasecmp has "unspecified behavior" outside the POSIX locale,
1640 but it works fine in practice if at least one argument is ASCII,
1641 as is the case in Bison.
1642
0049ec86
PB
16432007-02-07 Paolo Bonzini <bonzini@gnu.org>
1644
1645 * tests/java.at: Skip tests if only one of javac/java is present.
1646 Reported by Joel E. Denny.
1647 * tests/atlocal.in: Adjust copyright years.
1648
16492007-02-05 Paolo Bonzini <bonzini@gnu.org>
1650
1651 * data/lalr1.java (Stack): Work around old verifiers that disallow
1652 access to the private fields of an inner class, from the outer class.
1653 We can make Stack's fields public because user code doesn't have access
1654 to the instance of Stack used by parse(). Reported by Paul Eggert.
1655
2c2b7220
PE
16562007-02-03 Paul Eggert <eggert@cs.ucla.edu>
1657
1658 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
1659 the right spot for these files?
1660 * bootstrap.conf (gnulib_modules): Add c-strcase.
1661 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
1662 c-strncasecmp.c.
1663 * src/getargs.c: Include c-strcase.h.
1664 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
1665 to avoid unspecified behavior.
1666
b2b81dae
JD
16672007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
1668
1669 * doc/bison.texinfo (Decl Summary): Correct typo.
1670
c1d19e10
PB
16712007-01-30 Paolo Bonzini <bonzini@gnu.org>
1672
1673 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
1674 Complain if the value does not match empty, "true" or "false".
1675 * data/c++.m4: Adjust default definitions of %define variables.
1676 * data/java.m4: Adjust default definitions of %define variables.
1677 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
1678 to above behavior.
1679 * tests/input.at (Boolean %define variables): Test new behavior.
1680
8405b70c
PB
16812007-01-29 Paolo Bonzini <bonzini@gnu.org>
1682
1683 * NEWS: Mention java.
1684 * TODO: Remove things that are done.
1685 * bootstrap.conf: Add javacomp-script and javaexec-script.
1686 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
1687
1688 * data/Makefile.am: Add new files.
1689 * data/java-skel.m4: New.
1690 * data/java.m4: New.
1691 * data/lalr1.java: New.
1692
1693 * doc/bison.texinfo: Put "A Complete C++ Example" under
1694 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
1695 under Other Languages.
1696
1697 * src/getargs.c (valid_languages): Add Java.
1698 * src/getargs.h (struct bison_language): Update size of string fields.
1699
1700 * tests/Makefile.am: Add java.at.
1701 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
1702 * tests/java.at: New.
1703 * tests/testsuite.at: Include it.
1704
3eb82471
JD
17052007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
1706
1707 Clean up.
1708 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
1709 at_directive_argv arguments so these no longer have to be global
1710 variables. Also, update the implementation for the following changes.
1711 (fail_for_at_directive_too_many_args,
1712 fail_for_at_directive_too_few_args): Add at_directive_name argument.
1713 (at_directive_name): Remove as at_directive_argv[0] will be used for
1714 this now.
1715 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
1716 for the directive name.
1717 (at_directive_argc, at_directive_argv): Make these local within
1718 skel_lex instead of global.
1719 (INITIAL): Update directive start action for above changes.
1720 (SC_AT_DIRECTIVE_ARG): Rename to...
1721 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
1722 (SC_AT_DIRECTIVE_SKIP_WS): Update.
1723 (scan_skel): Move yylex_destroy to...
1724 (skel_scanner_free): ... here.
1725 * tests/skeletons.at (installed skeleton file name): Rename to...
1726 (installed skeleton file names): ... this.
1727
148d66d8
JD
17282007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
1729
1730 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1731 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
1732 Summary" not "Directives".
1733 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
1734 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
1735 since the former is now the more complete one.
1736 (Prologue Alternatives): Likewise and do the same for %defines.
1737 (Table of Symbols): Add summary of %code, add summary of %define, and
1738 move full %code documentation to...
1739 (Decl Summary): ... here for consistency with other entries in these
1740 sections.
1741 Move %define entry in order to keep this list alphabetized.
1742 Reword %define entry a little to put less emphasis on the skeleton
1743 concept, which most users shouldn't have to think about.
1744
665f0c24
PE
17452007-01-26 Paul Eggert <eggert@cs.ucla.edu>
1746
1747 Adjust to recent gnulib changes.
1748 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
1749 Add string.h, string_.h, unistd_.h, wchar_.h.
1750 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
1751 * src/system.h: Don't include <stpcpy.h>; this is now done by
1752 <string.h>.
1753
592d0b1e
PB
17542007-01-23 Paolo Bonzini <bonzini@gnu.org>
1755
1756 Simplify implementation of unqualified %code, implement macros for
1757 uniform treatment of boolean %define flags. Document %define.
1758 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
1759 b4_percent_code_ifdef): New.
1760 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
1761 * data/c++.m4: Define default value for global_tokens_and_yystype.
1762 * data/glr.cc: Likewise.
1763 * data/location.cc: Use b4_percent_define_flag_if.
1764
148d66d8 1765 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
1766
1767 * src/parse-gram.y (Unqualified %code): Change muscle name to
1768 b4_percent_code().
1769 (content.opt): Default to empty.
1770
a7867f53
JD
17712007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1772
1773 Implement support for relative and absolute skeleton file names.
1774 Discussed starting at
1775 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
1776 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
1777 (Bison Options): Document in --skeleton entry.
1778 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
1779 full_skeleton can't necessarily hold all of pkgdatadir.
1780 If the specified skeleton file name contains a `/', don't prepend
1781 pkgdatadir.
1782 * src/parse-gram.y (prologue_declaration): If the specified skeleton
1783 file name contains a `/', prepend the grammar file directory.
1784 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
1785 * skeletons.at: New file.
1786 (relative skeleton file names): New test case.
1787 (installed skeleton file names): New test case.
1788 * tests/testsuite.at: Include skeletons.at.
1789
1790 * bootstrap: Update copyright to 2007.
1791
830c9b18
PB
17922007-01-17 Paolo Bonzini <bonzini@gnu.org>
1793
1794 * bootstrap: Remove occurrences of .#bootmp from the files.
1795
a8c2e813
AD
17962007-01-17 Akim Demaille <akim@epita.fr>
1797
1798 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1799 nonterminals.
1800 Use per-type %printer.
1801
279cabb6
JD
18022007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1803
1804 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1805 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1806 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1807 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1808 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1809 tests/glr-regression.at, tests/input.at, tests/local.at,
1810 tests/output.at, tests/torture.at: Update copyright to 2007.
1811
bb32f4f2
AD
18122007-01-16 Akim Demaille <akim@epita.fr>
1813
1814 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1815 error code.
1816 (Calc++ Scanner): Exit with failure if we can't open the input
1817 file.
1818 Accept "-" standing for stdin.
1819 (Calc++ Top Level): Print the result only if the parsing was
1820 successful.
1821
7cff04b5
AD
18222007-01-16 Akim Demaille <akim@epita.fr>
1823
1824 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1825
a4e25e1d
JD
18262007-01-15 Paolo Bonzini <bonzini@gnu.org>
1827 and Joel E. Denny <jdenny@ces.clemson.edu>
1828
1829 Clean up %define and %code implementation in M4 some. Most
1830 importantly, rename all related macros to be in the b4_percent_define
1831 and b4_percent_code namespaces. Also, complete support for `.' in
1832 %define variable names and %code qualifiers.
1833 * data/bison.m4 (b4_check_user_names): Check for special
1834 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1835 m4_foreach loops.
1836 (b4_get_percent_define, b4_get_percent_code): Rename to...
1837 (b4_percent_define_get, b4_percent_code_get): ... these.
1838 Extend documentation with examples.
1839 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1840 b4_percent_define_skeleton_variables and
1841 b4_percent_code_skeleton_qualifiers.
1842 Expect any value for the %define variable `foo' to be stored in the
1843 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1844 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1845 expect any unqualified %code blocks to be stored in a macro named
1846 `b4_percent_code_unqualified'.
1847 Use m4_indir so that %define variable names and %code qualifiers can
1848 contain `.', which is allowed by the grammar parser.
1849 (b4_percent_define_default): New macro to set a default value for a
1850 %define variable.
1851 (m4_wrap): Update wrapped code, and fix some underquoting.
1852 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1853 Expect grammar uses of %define variables and %code qualifiers to be
1854 defined in b4_percent_define_user_variables and
1855 b4_percent_code_user_qualifiers.
1856 * data/c++.m4: Use b4_percent_define_default rather than
1857 m4_define_default. Fix some underquoting. Skeleton usage of %define
1858 variable define_location_comparison now implies skeleton usage of
1859 %define variable filename_type.
1860 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1861 data/push.c, data/yacc.c: Update macro names.
1862 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1863 muscle names.
1864
e37c665c
JMG
18652007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1866
1867 DJGPP specific issues.
1868
1869 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1870 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1871
7d2d521f
JD
18722007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1873
1874 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1875 run parsers in all tests so that Valgrind is invoked during
1876 maintainer-check-valgrind.
1877 (Duplicate representation of merged trees): Free all semantic values.
1878 (Duplicated user destructor for lookahead): Likewise.
1879
e0ac9b4b
JD
18802007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1881
1882 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1883 command-line prefix.
1884 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1885 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1886 miss Valgrind messages.
1887 (Exploding the Stack Size with Malloc): Likewise.
1888
78143faa
JD
18892007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1890
1891 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1892 locals. Reported by Juan Manuel Guerrero at
1893 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1894 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1895 Fix some indentation also.
1896 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1897 explaining this issue.
1898
7ecec4dd
JD
18992007-01-09 Paolo Bonzini <bonzini@gnu.org>
1900 and Joel E. Denny <jdenny@ces.clemson.edu>
1901
1902 Simplify union and prologue handling, and escape union and lex/parse
1903 params with digraphs.
1904 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1905 values to the empty string since these are no longer guaranteed
1906 initialized by the front-end.
1907 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1908 braces around b4_user_stype since this is no longer done by the
1909 front-end.
1910 * src/files.c, src/files.h (pre_prologue_obstack,
1911 post_prologue_obstack): Remove.
1912 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1913 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1914 with digraphs. This fixes lex params and parse params.
1915 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1916 * src/output.c (prepare): Remove muscle insertion of the prologues.
1917 (output): Remove freeing of pre_prologue_obstack and
1918 post_prologue_obstack.
1919 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1920 than prologue_augment for prologue parsing so you don't need prologue
1921 obstacks.
5c80250c
JD
1922 (grammar_declaration): For %union RHS, use `braceless' instead of
1923 "{...}" so that braces are already stripped and code is escaped with
1924 digraphs.
7ecec4dd
JD
1925 * src/reader.c (prologue_augment): Remove.
1926 (reader): Remove initialization of pre_prologue_obstack and
1927 post_prologue_obstack.
1928 * src/reader.h (prologue_augment): Remove.
1929
1930 * data/c.m4: Remove stray parenthesis.
1931
16dc6a9e
JD
19322007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1933
1934 Remove quotes from variables names in %define directives and from
1935 qualifiers in %code directives, and restrict the characters that are
1936 allowed in them to M4-friendly ones. For %define, continue to support
1937 the quoted form as a deprecated feature. Discussed starting at
1938 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1939 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1940 %code.
1941 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
1942 (Decl Summary): In %defines entry, update mention of `%code requires'
1943 and `%code provides'.
16dc6a9e
JD
1944 (C++ Location Values): Update %define uses.
1945 (Calc++ Parser Interface): Likewise.
1946 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 1947 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
1948 * src/parse-gram.y (prologue_declaration): For %define variables, use
1949 `variable' instead of `STRING'.
1950 (grammar_declaration): For %code qualifiers, use `ID' instead of
1951 `STRING'.
1952 (variable): New nonterminal that takes an `ID' or a `STRING'.
1953 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1954 and %define uses.
1955 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1956 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1957 (%define errors): Update %define uses.
1958
e9813cd4
JD
19592007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1960
1961 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1962 instead of muscle_insert for %define values so that M4-special
1963 characters are replaced with digraphs.
1964 * tests/input.at (%define errors): Extend to check weird values.
1965
6afc30cc
JD
19662007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1967
1968 Instead of having skeletons declare all valid %define variables and
1969 %code qualifiers, provide macros that retrieve the associated values
1970 and build these lists automatically. Thus Bison will now warn when a
1971 variable or qualifier is not used by the skeleton in the current
1972 invocation regardless of whether it might sometimes be used by that
1973 skeleton in other invocations. Also, move all %define value macros to
1974 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
1975 form, which is replaced by %code.
1976 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
1977 (b4_check_user_names): ... this, and change the series of valid name
1978 arguments to a single list argument for names used in the skeleton
1979 similar to the existing list argument for names used in the grammar.
1980 Warn instead of complaining.
1981 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
1982 values and %code code, to format %code code properly, and to build
1983 lists of all %define variables and %code qualifiers used in the
1984 skeleton: b4_skeleton_percent_define_variables and
1985 b4_skeleton_percent_code_qualifiers.
1986 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
1987 Remove, and...
1988 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
1989 the skeleton names lists can finish building first. In place of
1990 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
1991 expect the lists b4_user_percent_define_variables and
1992 b4_user_percent_code_qualifiers.
1993 * data/c++.m4: Where setting default values for b4_parser_class_name,
1994 b4_location_type, b4_filename_type, b4_namespace, and
1995 b4_define_location_comparison, update their names to the
1996 b4_percent_define_ namespace.
1997 * data/glr.c: Don't use b4_check_percent_define_variables and
1998 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1999 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
2000 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 2001 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
2002 * data/location.cc: Use b4_get_percent_define.
2003 * data/push.c: Don't use b4_check_percent_define_variables and
2004 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
2005 * data/yacc.c: Likewise, and don't call m4_exit in
2006 b4_use_push_for_pull_if or m4_wrap code will never execute.
2007 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
2008 Rename to...
2009 (muscle_grow_user_name_list): ... this for consistency with the
2010 terminology used in bison.m4.
2011 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
2012 %define variable names, and rename muscle used_percent_define_variables
2013 to user_percent_define_variables.
2014 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
2015 user_percent_code_qualifiers.
2016 (content): Remove.
2017 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
2018 {CODE} form is no longer accepted.
2019 * tests/input.at (Reject bad %code qualifiers): Rename to...
2020 (Reject unused %code qualifiers): ... this, and update test output.
2021 (%define error): Update test output.
2022
7eb8a0bc
JD
20232007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
2024
2025 Check for unrecognized %define variables similar to checking for
2026 unrecognized %code qualifiers. Check for redefined %define variables.
2027 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
2028 generalizes...
2029 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
2030 (b4_check_percent_define_variables): New, also wraps it.
2031 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
2032 variables using b4_check_percent_define_variables.
2033 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
2034 all those exercised in the test suite and all those listed in the
2035 `Default values' section of c++.m4. Are there others?
2036 * data/push.c, data/yacc.c: Declare no valid %define variables.
2037 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
2038 similar to muscle_find, but it works even when the muscle stores a
2039 const value.
2040 (muscle_grow_used_name_list): New function for constructing the used
2041 name list muscles that b4_check_for_unrecognized_names requires.
2042 * src/parse-gram.y (prologue_declaration): Warn if a variable is
2043 %define'd more than once. Define the b4_used_percent_define_variables
2044 muscle with muscle_grow_used_name_list.
2045 (grammar_declaration): Abbreviate %code code with
2046 muscle_grow_used_name_list.
2047 * tests/input.at (%define errors): New.
2048
3fc65ead
JD
20492007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2050
2051 Provide warn_at, complain_at, and fatal_at function callbacks to the
2052 skeletons, and use this for %code qualifier complaints.
2053 * data/bison.m4 (b4_error_at): New, invoked by...
2054 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
2055 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
2056 @fatal_at(...@) directives.
2057 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
2058 qualifiers in b4_used_percent_code_qualifiers and to use
2059 b4_complain_at.
2060 * src/location.c, src/location.h (boundary_set_from_string): New global
2061 function.
2062 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
2063 function.
2064 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
2065 to b4_used_percent_code_qualifiers.
2066 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
2067 function.
2068 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
2069 (lineno): Rename to...
2070 (out_lineno): ... this so I don't misunderstand it again.
2071 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
2072 here; these newlines are in the input but not the output file.
2073 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
2074 (at_directive_perform): ... this new static function, and add handling
2075 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
2076 directives.
2077 * tests/input.at (Reject bad %code qualifiers): Update test output with
2078 locations and extend.
2079
2080 * tests/output.at (Output file name: [, Output file name: ]): Remove
2081 bogus comment about these tests failing.
2082
1c7b7e1d
JD
20832007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2084
2085 Clean up b4_check_percent_code_qualifiers a little.
2086 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
2087 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
2088 documentation and add examples.
2089 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
2090 qualifiers here.
2091
08af01c2
JD
20922007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2093
2094 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
2095 unreliable -- especially when they're hidden inside another macro.
2096 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
2097 data/c.m4: Remove m4_divert(-1).
2098 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2099 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
2100 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 2101 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
2102 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
2103 pushed and popped by m4sugar, should be first on the stack.
2104
2105 Provide warn, complain, and fatal function callbacks to the skeletons.
2106 This provides more flexibility than m4_fatal, improves the error
2107 message format, and captures messages for translation. Discussed
2108 starting at
2109 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
2110 * data/bison.m4 (b4_error): New, invoked by...
2111 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
2112 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
2113 directives. Because these M4 macros might be called when the current
2114 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
2115 the previous removal of uses of m4_divert, which caused trouble.
2116 (b4_check_percent_code_qualifiers): Use b4_complain instead of
2117 m4_fatal to report unrecognized %code qualifiers.
2118 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
2119 push parser requests.
2120 * data/glr.c: Use b4_complain instead of m4_fatal to report
2121 non-deterministic push parser requests.
2122 Update @output usage to @output(...@) form.
2123 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
2124 report missing %defines. Update @output usage to @output(...@) form.
2125 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
2126 @output(...@) form.
2127 * src/main.c (main): Invoke skel_scanner_free.
2128 * src/scan-skel.h (skel_scanner_free): Prototype new function.
2129 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
2130 obstack_for_string from flex-scanner.h.
2131 (YY_DECL): Use to declare skel_lex static.
2132 (decode_at_digraphs): Remove; now handled in the new
2133 SC_AT_DIRECTIVE_ARG start condition.
2134 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
2135 functions.
2136 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
2137 at_directive_argv): New static globals.
2138 (INITIAL): Use fail_for_invalid_at.
2139 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
2140 recognize the start of a generalized `@directive(...@)' form and
2141 start...
2142 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
2143 directive args (using the new obstack_for_string), to decode the
2144 contained @ diagraphs, and to perform the directive. It recognizes
2145 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
2146 @output(...@).
2147 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
2148 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
2149 `@,'.
2150 (scan_skel): Initialize obstack_for_string on the first call.
2151 (skel_scanner_free): New function to free obstack_for_string.
2152 * tests/input.at (Reject bad %code qualifiers): Update test output.
2153
8e0a5e9e
JD
21542007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
2155
2156 Consolidate the 4 prologue alternative directives (%code, %requires,
2157 %provides, and %code-top) into a single %code directive with an
2158 optional qualifier field. Discussed at
2159 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
2160 * NEWS (2.3a+): Rewrite the existing entry for the prologue
2161 alternatives.
2162 * doc/bison.texinfo (Prologue Alternatives): Update.
2163 (Decl Summary): Update to %code "requires" and %code "provides".
2164 (Calc++ Parser): Update to %code "requires".
148d66d8 2165 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
2166 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
2167 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
2168 are replaced by b4_percent_code_provides and b4_percent_code_requires,
2169 which are skeleton-specific.
2170 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
2171 declare what %code qualifiers it supports and to complain if any other
2172 qualifiers were used in the grammar.
2173 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
2174 and b4_user_code([b4_percent_code_provides]) in place of
2175 b4_user_requires and b4_user_provides.
2176 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
2177 Add b4_user_code([b4_percent_code_top]) and
2178 b4_user_code([b4_percent_code]).
2179 Invoke b4_check_percent_code_qualifiers.
2180 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2181 PERCENT_REQUIRES): Remove.
2182 (grammar_declaration): Remove RHS's for %code-top, %provides, and
2183 %requires. Rewrite the %code RHS as the unqualified form defining the
2184 muscle b4_percent_code. Add another RHS for the qualified %code form,
2185 which defines muscles of the form b4_percent_code_QUALIFIER and the
2186 b4_used_percent_code_qualifiers muscle.
2187 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2188 PERCENT_REQUIRES): Remove.
2189 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
2190 %code "requires" and %code "provides".
2191 * tests/input.at (Reject bad %code qualifiers): New.
2192
95021767
JD
21932007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2194
2195 Use the new code_props interface for destructors and printers.
2196 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
2197 printer_location members, and change the type of the destructor and
2198 printer members to code_props.
2199 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
2200 symbol_printer_get, semantic_type_destructor_set,
2201 semantic_type_printer_set, default_tagged_destructor_set,
2202 default_tagless_destructor_set, default_tagged_printer_set,
2203 default_tagless_printer_set): Use code_props in arguments and return
2204 types in place of char const * and location.
2205 (symbol_destructor_location_get, symbol_printer_location_get): Remove
2206 since the locations are now contained in the return of
2207 symbol_destructor_get and symbol_printer_get.
2208 * src/output.c (symbol_destructors_output, symbol_printers_output):
2209 Replace with...
2210 (symbol_code_props_output): ... this to eliminate duplicate code.
2211 (output_skeleton): Update to use symbol_code_props_output.
2212 * src/reader.c (symbol_should_be_used): Update use of
2213 symbol_destructor_get.
2214 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2215 Update uses of the various _destructor_set and _printer_set functions.
2216 * src/symtab.c: (default_tagged_destructor_location,
2217 default_tagless_destructor_location, default_tagged_printer_location,
2218 default_tagless_printer_location): Remove since we...
2219 (default_tagged_destructor, default_tagless_destructor,
2220 default_tagged_printer, default_tagless_printer): ... change the type
2221 of these to code_props.
2222 (symbol_new, semantic_type_new, symbol_destructor_set,
2223 semantic_type_destructor_set, symbol_destructor_get,
2224 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
2225 symbol_check_alias_consistency, default_tagged_destructor_set,
2226 default_tagless_destructor_set, default_tagged_printer_set,
2227 default_tagless_printer_set): Update.
2228 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
2229 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
2230 code_props members.
2231 (symbol_print): Use SYMBOL_CODE_PRINT.
2232
f6857bbf
JD
22332007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2234
2235 Use the new code_props interface for rule actions.
2236 * src/symlist.h (symbol_list): Replace action, action_location, and
2237 used members with a code_props action_props member.
2238 * src/reader.c (symbol_should_be_used, grammar_rule_check,
2239 grammar_midrule_action, grammar_current_rule_merge_set,
2240 grammar_current_rule_symbol_append, packgram): Update.
2241 * src/scan-code.h (translate_rule_action): Remove, no longer used.
2242 * src/scan-code.l (handle_action_dollar): Update.
2243 (translate_rule_action): Remove, no longer used.
2244 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
2245
7c0c6181
JD
22462007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2247
2248 Use the new code_props interface in parse-gram.y.
2249 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
2250 Update all uses of translate_* functions to use the new code_props
2251 interface and to use gram_scanner_last_string_free and
2252 code_scanner_last_string_free where possible.
2253 (grammar_declaration): symbol_list_destructor_set and
2254 symbol_list_printer_set now perform the translation, so don't do it
2255 here. Use gram_scanner_last_string_free where possible.
2256 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
2257 translate_code): Remove, no longer used.
2258 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
2259 symbol_list_printer_set): Perform code translation here rather than
2260 depending on the caller to do so.
2261
2262 * src/symlist.h (struct symbol_list): Correct some documentation typos.
2263 * src/scan-gram.h (gram_last_string): Remove declaration.
2264 * src/scan-gram.l (last_string): Declare it static.
2265
28e52c0d
JD
22662007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2267
2268 Encapsulate code properties and related functionality for the various
2269 destructors, printers, and actions into a code_props structure and
2270 interface. This patch merely implements code_props in scan-code.h and
2271 scan-code.l. Future patches will rewrite other modules to use it.
2272 Discussed starting at
2273 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
2274 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
2275 consistently initialize const structs that have an empty location
2276 field.
2277 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
2278 to ensure consistency.
2279 * src/scan-code.h (code_props): New structure.
2280 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
2281 function, macro, and const global variable for initializing a
2282 code_props with no code.
2283 (code_props_plain_init, code_props_symbol_action_init,
2284 code_props_rule_action_init, code_props_translate_code): The rest of
2285 the new code_props functional interface. Among other things, the init
2286 functions set the code_props kind field so that
2287 code_props_translate_code will know whether to behave like
2288 translate_symbol_action, translate_rule_action, or translate_code.
2289 These old translate functions must remain until all other modules are
2290 updated to use the new code_props interface.
2291 (code_scanner_last_string_free): New function similar to
2292 gram_scanner_last_string_free.
2293 (code_scanner_free): Add documentation.
2294 * src/scan-code.l: Implement the new interface.
2295 (code_lex): Make it static, add a code_props* argument, and remove the
2296 rule argument.
2297 (last_string): New static global similar to the one in scan-gram.l.
2298 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
2299 instead of rule.
2300 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
2301 code_props since Bison may one day use this information for destructors
2302 and printers.
2303 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
2304 (handle_action_dollar): Use symbol_list_n_get and set used flag
2305 directly since symbol_list_n_used_set is removed.
2306 (translate_action): Add a code_props* argument and remove the rule,
2307 action, and location arguments. Pass the code_props* on to code_lex.
2308 (translate_rule_action, translate_symbol_action, translate_code):
2309 Rewrite as wrappers around the new code_props interface.
2310 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
2311 it would eventually need to break the encapsulation of code_props.
2312
96034983
JD
23132007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2314
2315 * etc/.cvsignore: New.
2316
945e396c
JD
23172007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2318
2319 Add maintainer-push-check to run maintainer-check using push parsing in
2320 place of pull parsing where available.
2321 * Makefile.am (maintainer-push-check): New.
2322 * data/bison.m4 (b4_use_push_for_pull_if): New.
2323 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
2324 appropriately based on their existing values.
2325 (yypush_parse): Don't print push-parser-specific diagnostics if push
2326 parsing is being used in place of pull parsing.
2327 * data/yacc.c: If push parsing should replace pull parsing, redirect to
2328 push.c.
2329 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
2330 variable, and insert b4_use_push_for_pull_flag into muscles.
2331 * tests/Makefile.am (maintainer-push-check): New.
2332
7d596384
JD
23332006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2334
2335 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
2336 (whether successful or failed) so that yypush_parse can be invoked
2337 again to start a new parse using the same yypstate.
2338 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
2339 check multiple yypull_parse invocations on the same yypstate. For pull
2340 mode, extend to check multiple yyparse invocations.
2341 (Exploding the Stack Size with Alloca): Extend to try with
2342 %push-pull-parser.
2343 (Exploding the Stack Size with Malloc): Likewise.
2344
2345 * tests/calc.at (Simple LALR Calculator): Don't specify
2346 %skeleton "push.c" since %push-pull-parser implies that now.
2347 * tests/headers.at (export YYLTYPE): Don't check for the push
2348 declarations. Otherwise, this test case can't be used to see if push
2349 mode can truly emulate pull mode.
2350 * tests/input.at (Torturing the Scanner): Likewise.
2351 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
2352 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
2353 AT_YACC_IF, which now includes the case of push mode since %skeleton
2354 need not be used for push mode. This will be more intuitive once
2355 push.c is renamed to yacc.c.
2356
7172e23e
JD
23572006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2358
2359 For push mode, convert yyparse from a macro to a function, invoke yylex
2360 instead of passing a yylexp argument to yypull_parse, and don't
2361 generate yypull_parse or yyparse unless %push-pull-parser is declared.
2362 Discussed starting at
2363 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
2364 * data/bison.m4 (b4_pull_if): New.
2365 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
2366 * data/push.c: Improve M4 quoting a little.
2367 (b4_generate_macro_args, b4_parenthesize): Remove.
2368 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
2369 any time a pull parser is requested.
2370 Don't #define this as a wrapper around yypull_parse. Instead, when
2371 both push and pull are requested, make it a function that does that
2372 same thing.
2373 (yypull_parse): If there's a b4_prefix, #define this to
2374 b4_prefix[pull_parse] when both push and pull are requested.
2375 Don't define this as a function unless both push and pull are
2376 requested.
2377 Remove the yylexp argument and hard-code yylex invocation instead.
2378 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
2379 %push-parser.
2380 * src/getargs.c (pull_parser): New global initialized to true.
2381 * getargs.h (pull_parser): extern it.
2382 * src/output.c (prepare): Insert pull_flag muscle.
2383 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
2384 (prologue_declaration): Set both push_parser and pull_parser = true for
2385 %push-pull-parser. Set push_parser = true and pull_parser = false for
2386 %push-parser.
2387 * src/scan-gram.l: Don't accept %push_parser as an alternative to
2388 %push-parser since there's no backward-compatibility concern here.
2389 Scan %push-pull-parser.
2390 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
2391 instead of %push-parser.
2392 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
2393 prototype it in the module that calls yyparse.
2394 * tests/input.at (Torturing the Scanner): Likewise.
2395 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
2396
2e7944cb
JD
23972006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
2398
2399 Update etc/bench.pl. Optimize push mode a little (the yyn change
2400 deserves most of the credit).
2401 * Makefile.am (SUBDIRS): Add etc subdirectory.
2402 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
2403 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
2404 yytoken, yyval, and yyloc declarations to...
2405 (yyparse or yypush_parse): ... here to improve performance. For
2406 yypush_parse invocations after the first, be sure to assign yyn its old
2407 value again.
2408 (yypstate_new): Don't bother initializing the yyresult field since the
2409 initial value isn't used.
2410 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
2411 remove the #define that, in push mode, set it to yyps->NAME.
2412 * etc/Makefile.am: New.
2413 * etc/bench.pl: Remove and build it instead from...
2414 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
2415 "tests/bison" from the build directory by default rather than just
2416 invoking "bison" from $PATH.
2417 (calc_grammar): Update push parser code: don't declare yylval globally,
2418 don't define yyparse_wrapper, and don't #define yyparse.
2419 (bench_grammar): Update to check all working combinations of yacc.c,
2420 push.c, impure, pure, pull, and push.
2421
c3d50342
JD
24222006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2423
2424 For push mode, add pull wrappers around yypush_parse.
2425 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
2426 (yypull_parse): New function wrapping yypush_parse.
2427 (yyparse): New #define wrapping yypull_parse.
2428 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
2429 is declared.
2430 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
2431 prototype yylex in the module that calls yyparse, and don't prototype
2432 yyparse there. Otherwise, the yyparse expansion won't compile.
2433 * tests/input.at (Torturing the Scanner): Likewise.
2434
94ebeba5
JD
24352006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2436
2437 Enable push parsers to operate in impure mode. Thus, %push-parser no
2438 longer implies %pure-parser. The point of this change is to move
2439 towards being able to test the push parser code by running the entire
2440 test suite as if %push-parser had been declared.
2441 * data/push.c (yypush_parse): For impure mode, remove the
2442 yypushed_char, yypushed_val, and yypushed_loc arguments.
2443 Instead, declare these as local variables initialized to the global
2444 yychar, yylval, and yylloc.
2445 For the first yypush_parse invocation only, restore the initial values
2446 of these global variables when it's time to read a token since they
2447 have been overwritten.
2448 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
2449 %push-parser.
2450 * tests/calc.at (Simple LALR(1) Calculator): Always declare
2451 %pure-parser along with %push-parser since this test case was designed
2452 for pure push parsers.
2453 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
2454 (AT_YACC_OR_PUSH_IF): New.
2455 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
2456 add a note that it's still wrong for some cases (as it has been for a
2457 while).
2458 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
2459 %push-parser no longer implies %pure-parser.
2460
a0633178
JD
24612006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2462
2463 Remove some unnecessary differences between the pull parser code and
2464 the push parser code. This patch enables yynerrs in push mode.
2465 * data/push.c: Reformat M4 a little.
2466 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
2467 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
2468 because push mode is on. Instead, if pure mode is on, move yynerrs
2469 to...
2470 (b4_declare_parser_state_variables): ... here.
2471 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
2472 to yyps->NAME so it can be used in yypush_parse.
2473 (yypush_parse): Don't omit uses of yynerrs in push mode.
2474
8646b6a3
JD
24752006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2476
2477 Fix bug such that the first pushed token's value and location are
2478 sometimes overwritten (sometimes by %initial-action) before being used.
2479 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
2480 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
2481 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
2482 more closely mimic the pull parser logic.
2483 Don't copy the pushed token to yychar, yylval, and yylloc until it's
2484 time to read a token, which is after any initialization of yylval and
2485 yylloc.
2486 (gottoken): Rename label to...
2487 (yyread_pushed_token): ... for clarity and to avoid infringing on the
2488 user namespace.
2489
9baf4d74
JD
24902006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2491
2492 Rearrange initialization of the parser state variables so that the
2493 skeleton doesn't have to have a copy for pull mode and another for push
2494 mode. This patch also fixes at least a bug such that yylloc was not
2495 initialized (with b4_location_initial_line and
2496 b4_location_initial_column) upon calling yypush_parse. However, that
2497 initialization now overwrites the first token's location;
2498 %initial-action assigning @$ already did the same thing, and both bugs
2499 will be fixed in a later patch.
2500 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
2501 (b4_declare_parser_state_variables): Remove initialization of yytoken,
2502 yyss, yyvs, yyls, and yystacksize.
2503 (yypstate_new): Remove initialization of some yypstate fields: yystate,
2504 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
2505 yylsp.
2506 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
2507 yyps->NAME so it can be used in yypush_parse.
2508 (yyparse or yypush_parse): For yypush_parse, don't print the
2509 "Starting parse" diagnostic for invocations after the first.
2510 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
2511 yypush_parse, only do it for the first invocation.
2512 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
2513 initialization to occur in yypush_parse but only on the first
2514 invocation.
2515
23522164
JD
25162006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2517
2518 * data/push.c: Add CPP guards around push parser declarations in both
2519 the header and the code file.
2520 In the code file, move the push parser declarations to the same place
2521 they appear in the header file.
2522 Clean up the M4 some, especially the inconsistent underquoting in
2523 some b4_c_function_def and b4_c_function_decl uses.
2524
bb010fe5
JD
25252006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2526
2527 Encapsulate the push parser state variables into an M4 macro so the
2528 push skeleton doesn't have to list them again for pull mode's yyparse.
2529 For push mode, remove yypush_parse's local equivalents of these
2530 variables to eliminate unnecessary copying between the two sets at
2531 run-time. This patch also fixes at least a bug related to multiple
2532 %initial-action invocations in push mode.
2533 * data/push.c (b4_declare_parser_variables): Rename to...
2534 (b4_declare_scanner_communication_variables): ... this for clarity and
2535 update both uses.
2536 (b4_declare_yyparse_variables): Remove and move its contents to the one
2537 spot where it was invoked.
2538 (b4_declare_parser_state_variables): New macro containing the parser
2539 state variables required by push mode.
2540 (struct yypstate): Replace all fields but yynew with
2541 b4_declare_parser_state_variables.
2542 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
2543 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
2544 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
2545 (yyparse or yypush_parse): For yyparse in pull mode, replace local
2546 parser state variable declarations with
2547 b4_declare_parser_state_variables.
2548 Don't initialize parser state variables when calling yypush_parse since
2549 yypstate_new already does that.
2550 Invoke the user's initial action only upon the first yypush_parse
2551 invocation.
2552 Remove all code that copies between the local parser state variables
2553 and the yypstate.
2554
2d212f8c
JD
25552006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2556
2557 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
2558 prevent a name collision in a future patch where these names will
2559 sometimes be #define'd.
2560 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
2561 since it no longer has the same name as the existing argument.
2562 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
2563
e6e704dc
JD
25642006-12-19 Paolo Bonzini <bonzini@gnu.org>
2565 and Joel E. Denny <jdenny@ces.clemson.edu>
2566
2567 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2568 that the argument is case-insensitive, and there's no `=' here.
2569 For the %skeleton entry, mention that %language is better.
2570 (Bison Options): Likewise for --language and --skeleton. Move the
2571 --skeleton entry so that the `Tuning the parser' section is sorted
2572 alphabetically on long options.
2573 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
2574 %language directive in detail here; cross-reference the %language
2575 documentation instead.
2576 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
2577 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 2578 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
2579 * examples/extexi (normalize): Instead of replacing every %require
2580 argument with the current Bison version, just substitute for
2581 `@value{VERSION}'. This guarantees that we're testing what actually
2582 appears in the documentation.
2583 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
2584 rather than `@VERSION@'.
2585
0e021770
PE
25862006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2587
fd575f05
PE
2588 * NEWS: Reword the %language news a bit, and put it earlier.
2589
0e021770
PE
2590 * src/getargs.c (skeleton_arg): Last arg is now location const *.
2591 Rewrite to simplify the logic.
2592 (language_argmatch): Likewise.
fd575f05
PE
2593 (program_name): We now own this var.
2594 * src/getargs.h (struct bison_language): Use char[] rather than
2595 const char *.
0e021770
PE
2596
2597 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
2598 Java is supported.
2599 * src/complain.c (program_name): Remove decl; no longer needed.
2600 * src/main.c (program_name): Remove; now belongs to getargs.
2601
26022006-12-18 Paolo Bonzini <bonzini@gnu.org>
2603
2604 * NEWS: Document %language.
2605
2606 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
2607
2608 * data/c-skel.m4, data/c++-skel.m4: New files.
2609 * data/glr.c: Complain on push parsers.
2610
2611 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
2612 over %skeleton.
148d66d8 2613 (Decl Summary): Document %language and %skeleton.
0e021770
PE
2614 (Command line): Document -L.
2615
2616 * examples/extexi: Rewrite %require directive.
2617 * examples/calc++/Makefile.am: Pass VERSION to extexi.
2618
2619 * src/files.c (compute_exts_from_gc): Look in language structure
2620 for .y extension.
2621 (compute_file_name_parts): Check whether .tab should be added.
2622 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
2623 (language, skeleton_arg, language_argmatch): New.
2624 (long_options): Add --language.
2625 (getargs): Use skeleton_arg, add -L/--language.
2626 * src/getargs.h: Include location.h.
2627 (struct bison_language, language, skeleton_arg, language_argmatch): New.
2628 * src/output.c (prepare): Pick default skeleton from struct language.
2629 Don't dispatch C skeletons here.
2630 * src/parse-gram.y (PERCENT_LANGUAGE): New.
2631 (prologue_declaration): Add "%language" rule, use skeleton_arg.
2632 * src/scan-gram.l ("%language"): New rule.
2633
2634 * tests/calc.at: Test %skeleton and %language.
2635 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
2636 (AT_GLR_IF): Look for %skeleton "glr.cc".
2637 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
2638 (AT_YACC_IF): Reject %language.
2639
5691bf57
PE
26402006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2641
db06f0ce
PE
2642 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
2643 since it wasn't used; only the typedef name 'semantic_type' is needed.
2644 Also, omit trailing white space.
2645
5691bf57
PE
2646 * bootstrap: Sync from coreutils.
2647 (gnulib_extra_files): Add build-aux/announce.gen.
2648 (slurp): Adjust .gitignore files like .cvsignore files.
2649 * build-aux/announce-gen: Remove from CVS, since bootstrap
2650 now creates this.
2651
791934e4
JD
26522006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
2653
2654 Make %push-parser imply %pure-parser. This fixes several bugs; see
2655 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
2656 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
2657 pure_parser = true.
2658 * data/push.c: Don't bother testing b4_push_if when deciding whether
2659 to expand b4_declare_parser_variables globally.
2660 (yypush_parse): Likewise in here.
2661
2662 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
2663 (yy_reduce_print): Reformat M4 for readability.
2664
ee5abb37
JD
26652006-12-15 Bob Rossi <bob@brasko.net>
2666 and Joel Denny <jdenny@ces.clemson.edu>
2667
2668 * data/push.c (yypstate): Add typedef, and update all uses of
2669 struct yypstate to just yypstate.
2670 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
2671
16ca01f9
JD
26722006-12-14 Bob Rossi <bob@brasko.net>
2673
2674 * data/push.c (yypush_parse): Declare prototype regardless of
2675 %locations option.
2676
ab8e7e1a
JD
26772006-12-14 Bob Rossi <bob@brasko.net>
2678
2679 * data/push.c (yyparse): Remove the prototype and the #define when in
2680 push-parser mode.
2681
9bf32be3
JD
26822006-12-13 Bob Rossi <bob@brasko.net>
2683
2684 * data/push.c (yypstate_init): Rename to...
2685 (yypstate_new): ... this and use b4_c_function_def.
2686 (yypstate_delete): New.
2687 (yypush_parse): Change parameters yynval and yynlloc to be const.
2688 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
2689 yypstate_delete functions.
2690
f02e2948
JD
26912006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
2692
2693 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
2694 strange test case titles. Reported by Bob Rossi.
2695
38eb7751
PE
26962006-12-13 Paul Eggert <eggert@cs.ucla.edu>
2697
2698 * TODO: Add pointer to Sylvain Schmitz's work on static detection
2699 of potential ambiguities in GLR grammers.
2700
bd9d212b
JD
27012006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
2702
2703 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
2704 `bison ', use m4_index instead of m4_substr since chopping up a string
2705 containing M4-special characters causes problems here.
2706
2707 Fix a couple of bugs related to special characters in user-specified
2708 file names, and make it easier for skeletons to compute output file
2709 names with the same file name prefix as Bison-computed output file
2710 names.
2711 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
2712 b4_parser_file_name and b4_spec_defines_file instead of
2713 @output_parser_name@ and @output_header_name@, which are now redundant.
2714 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
2715 b4_parser_file_name, b4_spec_defines_file, and the new
2716 @basename(FILENAME@) instead of @output_parser_name@ and
2717 @output_header_name@, which inappropriately escaped the file names as
2718 C string literals.
2719 * src/files.c (all_but_ext): Remove static qualifier.
2720 (compute_output_file_names): Move `free (all_but_ext)' to...
2721 (output_file_names_free): ... here since all_but_ext is needed later.
2722 * src/files.h (all_but_ext): Extern.
2723 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
2724 exactly what MUSCLE_INSERT_STRING used to do.
2725 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
2726 characters are escaped properly.
2727 * src/output.c (prepare): Define muscle file_name_all_but_ext as
2728 all_but_ext.
2729 For pkgdatadir muscle, maintain previous functionality by using
2730 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
2731 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
2732 digraphs would never be expanded. Hopefully no one has M4-special
2733 characters in his Bison installation path.
2734 * src/scan-skel.l: Don't parse @output_header_name@ and
2735 @output_parser_name@ anymore since they're now redundant.
2736 In @output, use decode_at_digraphs.
2737 Parse a new @basename command that invokes last_component.
2738 (decode_at_digraphs): New.
2739 (BASE_QPUTS): Remove unused.
2740 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
2741 (Output file name): New tests.
2742
3f7ca628
JD
27432006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
2744
2745 Warn about output files that are generated by the skeletons and that
2746 conflict with other output files.
2747 * data/glr.c: Don't generate the header file here when glr.cc does.
2748 * src/files.c (file_names, file_names_count): New static globals.
2749 (compute_output_file_names): Invoke output_file_name_check for files
2750 not generated by the skeletons and remove existing checks.
2751 (output_file_name_check): New function that warns about conflicting
2752 output file names.
2753 (output_file_names_free): Free file_names.
2754 * src/files.h (output_file_name_check): Declare.
2755 * src/scan-skel.l: Invoke output_file_name_check for files generated by
2756 the skeletons.
2757 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
2758 (Conflicting output files): New tests.
2759
178e123e
PE
27602006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2761
2762 * doc/bison.texinfo: Fix a couple of typos.
2763
27642006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
2765
2766 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
2767 Rename to...
2768 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
2769 update all uses.
2770 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
2771 (yypush_parse): Rename yypvars argument to yyps and remove redundant
2772 local pv.
2773 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
2774 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
2775
ea17f233
JD
27762006-12-07 Bob Rossi <bob@brasko.net>
2777 and Joel Denny <jdenny@ces.clemson.edu>
2778
2779 * data/push.c (yypvarsinit): Change return type from void* to struct
2780 yypvars*. No longer cast to void* on return.
2781 (struct yypvars): Remove yylen since it need not be remembered between
2782 yypushparse invocations.
2783 (yypushparse): Don't copy between yylen and pv->yylen.
2784
55a30bda
JD
27852006-12-05 Bob Rossi <bob@brasko.net>
2786
2787 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
2788 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
2789 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
2790 (struct yypvars): Remove b4_declare_parser_variables.
2791 (yypvarsinit): Remove init code for removed variables.
2792 (global scope): Do not declare b4_declare_parser_variables if
2793 push or pure mode.
2794 (yypushparse): Add b4_declare_parser_variables.
2795 Init new local variables, and remove init code for removed
2796 yypvars variables.
2797 (yyparse): Delete.
2798 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2799 and yyparse for other modes.
2800 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2801 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2802 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2803 (AT_PURE_LEX_IF): True if pure or push parser.
2804
85894313
JD
28052006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2806
2807 Document Yacc prologue alternatives and default %destructor's and
2808 %printer's as experimental. Don't mention Java yet. Discussed at
2809 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2810 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2811 (2.3a): Annotate this entry to say the old forms of these features were
2812 also experimental.
2813 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 2814 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
2815 of Java (we'll want this back eventually).
2816
02975b9a
JD
28172006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2818
2819 Support a file name argument to %defines. Deprecate `=' in
2820 %file-prefix, %name-prefix, and %output. Discussed at
2821 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2822 * NEWS (2.3a+): Mention.
148d66d8 2823 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
2824 form of %defines, and remove `=' from entries for %file-prefix,
2825 %name-prefix, and %output.
2826 * src/parse-gram.y (prologue_declaration): Implement.
2827 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2828 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2829 all but one occurrence of %name-prefix.
2830 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2831 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2832 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2833 occurrence of each of %file-prefix and %output. Add check for %defines
2834 with argument.
2835 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2836 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2837 Remove the `=' from %output.
2838
287b314e
JD
28392006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2840
2841 Don't escape $ in test case titles since Autoconf 2.61 now does that
2842 correctly.
2843 * tests/actions.at (Default %printer and %destructor are not for error
2844 or $undefined): Here.
2845 (Default %printer and %destructor are not for $accept): Here.
2846 * tests/input.at (Invalid $n and @n): Here.
2847
3ebecc24
JD
28482006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2849
2850 Rename <!> to <>. Discussed starting at
2851 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2852 * NEWS (2.3a+): Update.
148d66d8 2853 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
2854 Update.
2855 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2856 * src/scan-gram.l (INITIAL): Implement.
2857 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2858 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2859 comment.
2860 * tests/actions.at (Default tagless %printer and %destructor,
2861 Default tagged and per-type %printer and %destructor,
2862 Default %printer and %destructor are not for error or $undefined,
2863 Default %printer and %destructor are not for $accept,
2864 Default %printer and %destructor for mid-rule values): Update.
2865 * tests/input.at (Default %printer and %destructor redeclared,
2866 Unused values with default %destructor): Update.
2867
26b8a438
JD
28682006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2869
2870 Don't let %prec take a nonterminal.
2871 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2872 token.
2873 * tests/input.at (%prec takes a token): New test checking that %prec
2874 won't take a nonterminal.
2875
07c39ae9
JD
28762006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2877
405d53b7
JD
2878 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2879 it was double-quoted.
07c39ae9
JD
2880 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2881 grammar is maintained with Bison's highest standards.
2882 * src/getargs.c: Fix some typos in Doxygen comments.
2883
580b8926
JD
28842006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2885
2886 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2887 later. Reported by Paul Eggert in
2888 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2889 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2890 * src/scan-code.l (translate_action): Don't bother invoking
2891 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2892 (code_scanner_free): Instead of invoking
2893 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2894 which frees more.
2895 * src/scan-gram.l (gram_scanner_free): Likewise.
2896 * src/scan-skel.l (scan_skel): Likewise.
2897
4502eadc
JD
28982006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2899
2900 * src/files.c (tr): Change return type to void.
2901 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2902 has been called previously for the same key.
2903 (muscle_find): Return storage instead of value so that
2904 --enable-gcc-warnings doesn't produce warnings that the return discards
2905 const. aver that the value and storage are the same since storage
2906 could potentially be NULL when value is not.
2907 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2908 same as 0.
2909
7746c8f6
PE
29102006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2911
2912 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2913 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2914 us a slightly cleaner distribution, and also works.
2915 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2916 gnulib changes.
2917
eb095650
PE
29182006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2919 and Paul Eggert <eggert@cs.ucla.edu>
2920
2921 Don't let Bison leak memory except when it complains.
2922 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2923 (spec_defines_file, dir_prefix): Now char *, not const char *,
2924 since they are freed.
2925 * src/files.c: Likewise.
2926 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2927 Likewise.
2928 (tr): Now operates in-place. All uses changed.
2929 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2930 values.
2931 (compute_file_name_parts, compute_output_file_names): Don't store
2932 read-only data in variables that will be freed.
2933 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2934 src_extension, and header_extension.
2935 (output_file_names_free): New public function to free
2936 spec_verbose_file, spec_graph_file, spec_defines_file,
2937 parser_file_name, and dir_prefix.
2938 * src/getargs.c (getargs): Don't store read-only data in variables that
2939 will be freed.
2940 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2941 (which previously existed but was unused), and quotearg_free.
2942 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2943 * src/muscle_tab.c: Likewise.
2944 (muscle_entry): Make the value char const *,
2945 and add a new storage member that is char * and can be freed.
2946 (muscle_entry_free): New private function.
2947 (muscle_init): Use it instead of free.
2948 (muscle_insert, muscle_grow): Update and use new storage member.
2949 (muscle_code_grow): Free the string passed to muscle_grow
2950 since it's not needed anymore.
2951 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2952 add a new `char *code' member.
2953 ("{...}"): Declare semantic type as code.
2954 * src/scan-code.h (translate_rule_action):
2955 (translate_symbol_action, translate_code, translate_action): Return
2956 `char const *' rather than `char *' since external code should not free
2957 these strings.
2958 * src/scan-code.l: Likewise.
2959 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2960 which is "{...}" in the parser.
2961 * tests/Makefile.am (maintainer-check-valgrind): Set
2962 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2963 Valgrind.
2964 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2965 complain.
2966 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2967 expecting a non-zero exit status sets --leak-check=summary and
2968 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
2969 this case, and we don't want to hear about it.
2970
ac564be4
PE
29712006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2972
2973 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
2974 instead of from the template, to simplify configuration a bit.
2975 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
2976 and m4/wint_t.m4, as they are needed with the latest gnulib.
2977
17bd8a73
JD
29782006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2979
2980 Disable unset/unused mid-rule value warnings by default, and recognize
2981 --warnings=midrule-values to enable them. Discussed starting at
2982 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
2983 * NEWS (2.3a+): Mention.
2984 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
2985 warnings): Add entry for midrule-values subargument.
2986 * src/reader.c (symbol_should_be_used): Don't return true just because
2987 the value is a set/used mid-rule value unless
2988 --warnings=midrule-values was specified.
2989 * tests/input.at (Unused values, Unused values before symbol
2990 declarations): Run tests with and without --warnings=midrule-values.
2991
2992 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
2993 than LIST_FREE directly.
2994
89eb3c76
JD
29952006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2996
2997 Finish implementing --warnings=error, which should not be implied by
2998 --warnings=all (or by its synonyms -W and --warnings without
2999 subarguments).
3000 * src/complain.c (set_warning_issued): New function to report that
3001 warnings are being treated as errors and to record an error if so.
3002 Invoke...
3003 (warn_at, warn): ... here.
3004 * src/getargs.c (warnings_args, warnings_types): Reorder so that
3005 "error - warnings are errors" does not appear above "all - all of the
3006 above".
3007 (getargs): For -W and --warnings without subarguments, don't let
3008 FLAGS_ARGMATCH set warnings_error in warnings_flag.
3009 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
3010
ba7560e2
JD
30112006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3012
3013 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
3014 empty subargument list. For example: `bison --warnings= parser.y'.
3015
31283fc3
JD
30162006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3017
3018 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
3019 the parser header file so that gcc doesn't warn.
3020
12e35840
JD
30212006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3022
3023 Split the default %destructor/%printer into two kinds: <*> and <!>.
3024 Discussed starting at
3025 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
3026 * NEWS (2.3a+): Mention.
3027 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
3028 previous change today related to mid-rules.
148d66d8 3029 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 3030 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
3031 (TYPE_TAG_ANY): Add as <*>.
3032 (TYPE_TAG_NONE): Add as <!>.
3033 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
3034 for <*> and <!>.
3035 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
3036 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
3037 * src/symlist.c (symbol_list_default_new): Split into tagged and
3038 tagless versions.
3039 (symbol_list_destructor_set, symbol_list_printer_set): Split
3040 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
3041 SYMLIST_DEFAULT_TAGLESS.
3042 * src/symlist.h: Update symbol_list_default*_new prototypes.
3043 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
3044 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
3045 * src/symtab.c (default_destructor, default_destructor_location,
3046 default_printer, default_printer_location): Split each into tagged and
3047 tagless versions.
3048 (symbol_destructor_get, symbol_destructor_location_get,
3049 symbol_printer_get, symbol_printer_location_get): Implement tagged
3050 default and tagless default cases.
3051 (default_destructor_set, default_printer_set): Split each into tagged
3052 and tagless versions.
3053 * src/symtab.h: Update prototypes.
3054 * tests/actions.at (Default %printer and %destructor): Rename to...
3055 (Default tagless %printer and %destructor): ... this, and extend.
3056 (Per-type %printer and %destructor): Rename to...
3057 (Default tagged and per-type %printer and %destructor): ... this, and
3058 extend.
3059 (Default %printer and %destructor for user-defined end token): Extend.
3060 (Default %printer and %destructor are not for error or $undefined):
3061 Update.
3062 (Default %printer and %destructor are not for $accept): Update.
3063 (Default %printer and %destructor for mid-rule values): Extend.
3064 * tests/input.at (Default %printer and %destructor redeclared): Extend.
3065 (Unused values with default %destructor): Extend.
3066
f91b1629
JD
30672006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3068
3069 Don't apply the default %destructor/%printer to an unreferenced midrule
3070 value. Mentioned at
3071 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
3072 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
3073 like $@n instead of just @n so that the default %destructor/%printer
3074 logic doesn't see them as user-defined symbols.
3075 (symbol_is_dummy): Check for both forms of the name.
3076 * src/reader.c (packgram): Remove the `$' from each midrule symbol
3077 name for which the midrule value is referenced in any action.
3078 * tests/actions.at (Default %printer and %destructor for mid-rule
3079 values): New test.
3080 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
3081 for change to dummy symbol names.
3082
519d0004
JD
30832006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
3084
3085 Warn about unset midrule $$ if the corresponding $n is used.
3086 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
3087 $n usage.
3088 (packgram): Before invoking grammar_rule_check on any rule, make sure
3089 all actions have already been scanned in order to set `used' flags.
3090 Otherwise, checking that a midrule's $$ is set will not always work
3091 properly because the midrule check must forward-reference the midrule's
3092 parent rule.
3093 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
3094 warning.
3095
a501eca9
JD
30962006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
3097
3098 More improvements to the documentation of the prologue alternatives:
3099 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
3100 Bison manual.
3101 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
3102 some text to clarify the relative importance of the new directives and
3103 to show how these directives may be viewed as code labels.
3104
2cbe6b7f
JD
31052006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
3106
3107 Similar to the recently removed %before-header, add %code-top as the
3108 alternative to the pre-prologue. Mentioned at
3109 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
3110 Also, let the prologue alternatives appear in the grammar section.
3111 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
3112 (prologue_declaration): Move the existing prologue alternatives to...
3113 (grammar_declaration): ... here and add %code-top.
3114 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
3115
3116 Clean up and extend documentation for the prologue alternatives.
3117 * NEWS (2.3a+): Describe prologue alternatives.
3118 * doc/bison.texinfo (Prologue): Move discussion of prologue
3119 alternatives to...
3120 (Prologue Alternatives): ... this new section, and extend it to discuss
3121 all 4 directives in detail.
148d66d8
JD
3122 (Table of Symbols): Clean up discussion of prologue alternatives and
3123 add %code-top.
2cbe6b7f 3124
e557d3ea
JMG
31252006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3126
3127 DJGPP specific issues.
3128
3129 * djgpp/config.bat: config.hin has been moved to lib. Adjust
3130 config.bat accordingly.
3131 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
3132 * djgpp/config.site: Likewise.
3133
136a0f76
PB
31342006-10-16 Paolo Bonzini <bonzini@gnu.org>
3135
27bd5d67
PB
3136 Replace %*-header with %provides, %requires, %code. See discussion at
3137 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
3138
136a0f76
PB
3139 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
3140 (b4_user_start_header): Remove.
3141 * data/glr.c: Use new macros instead of b4_*start_header
3142 and b4_*end_header.
3143 * data/glr.cc: Likewise.
3144 * data/lalr1.cc: Likewise.
3145 * data/push.c: Likewise.
3146 * data/yacc.c: Likewise.
3147
3148 * doc/bison.texinfo: Remove %before-header, rename
3149 %{start,end,after}-header to %requires, %provides, %code.
3150
3151 * src/parse-gram.y: Likewise (also rename token names accordingly).
3152 * src/scan-gram.l: Likewise.
3153 * tests/actions.at: Likewise.
3154
10f429ef
PE
31552006-10-14 Paul Eggert <eggert@cs.ucla.edu>
3156
3157 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
3158 Problem reported by Joel E. Denny.
3159
31602006-10-14 Jim Meyering <jim@meyering.net>
3161
3162 (Sync from coreutils.)
3163 Work also when the working directory (with e.g. coreutils sources)
3164 is version controlled with git, rather than CVS.
3165 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
3166 rather than CVS.
3167 In messages and comments, say e.g., "checked-out sources",
3168 rather than "CVS sources".
3169 (version_controlled_file): New function. Work for git as well as
3170 for CVS. Don't use grep's -q option.
3171 (slurp): Call it here, in place of CVS-specific code.
3172
c4bd5bf7
JD
31732006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
3174
3175 Fix testsuite for ./configure --enable-gcc-warnings:
3176 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
3177 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
3178 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
3179 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
3180 * test/regression.at (Diagnostic that expects two alternatives):
3181 Likewise.
3182
46356ea4
PE
31832006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3184
231ed89a
PE
3185 * bootstrap.conf (gnulib_modules): Add config-h.
3186 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
3187 worry about HAVE_CONFIG_H.
3188 * lib/abitset.c: Likewise.
3189 * lib/bitset.c: Likewise.
3190 * lib/bitset_stats.c: Likewise.
3191 * lib/bitsetv-print.c: Likewise.
3192 * lib/bitsetv.c: Likewise.
3193 * lib/ebitset.c: Likewise.
3194 * lib/get-errno.c: Likewise.
3195 * lib/lbitset.c: Likewise.
3196 * lib/subpipe.c: Likewise.
3197 * lib/timevar.c: Likewise.
3198 * lib/vbitset.c: Likewise.
3199 * lib/bitset.c: Include "bitset.h" first, to test interface.
3200 * lib/bitset_stats.c: Include "bitset_stats.h" first.
3201 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
3202 * lib/bitsetv.c: Include "bitsetv.h" first.
3203 * lib/get-errno.c: Include "get-errno.h" first.
3204 * m4/.cvsignore: Add config-h.m4.
3205 * tests/actions.at (Default %printer and %destructor for ...):
3206 Adjust expected line numbers in output to reflect removal of #if
3207 HAVE_CONFIG_H lines.
3208 * tests/glr-regression.at (Missed %merge type warnings when ...):
3209 Likewise.
3210 * tests/regression.at (Braced code in declaration in rules section):
3211 Likewise.
3212 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
3213 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
3214 Include <config.h> unconditionally.
3215
46356ea4
PE
3216 * bootstrap: Sync from coreutils, as follows:
3217
3218 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3219
3220 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
3221 variable was sometimes used without being initialized. This
3222 messed up the installation of the INSTALL file in some cases.
3223
3224 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3225
3226 * bootstrap (usage, main program, symlink_to_gnulib): Add option
3227 --copy. Inspired by a suggestion from Bruno Haible.
3228
3229 2006-10-03 Jim Meyering <jim@meyering.net>
3230
3231 * bootstrap: Undo last change to this file, since now gnulib-tool
3232 sticks with the automake default in generating dependencies.
3233
dd4bf078
PE
32342006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3235
cf2a5f7c
PE
3236 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
3237 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
3238
3239 * doc/bison.1: Add copyright notice.
3240
3241 * data/glr.c: Don't include <stdarg.h>; not used.
3242
35fe0834
PE
3243 * NEWS: The -g and --graph options now output graphs in Graphviz
3244 DOT format, not VCG format.
3245 * doc/bison.1: Likewise.
3246 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
3247 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
3248 of this change in
3249 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
3250 * TODO: Remove Graphviz entry.
3251 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
3252 remove vcg.c, vcg.h, vcg_defaults.h.
3253 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
3254 * src/graphviz.c, src/graphviz.h: New files.
3255 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
3256 * src/files.h: Make comment more generic.
3257 * src/main.c (main): Likewise.
3258 * src/print_graph.h: Likewise.
3259 * src/getargs.c (usage): Make usage description more generic.
3260 * src/print_graph.c: Include graphviz.h rather than vcg.h.
3261 (static_graph, fgraph): Remove. All uses changed to pass
3262 arguments instead of sharing a static var.
3263 (print_core, print_actions, print_state, print_graph):
3264 Output graphviz format rather than VCG format.
3265 * tests/.cvsignore: Remove *.vcg; add *.dot.
3266 * tests/output.at: Expect *.dot files, not *.vcg files.
3267
dd4bf078
PE
3268 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
3269 accommodates the 2006-10-08 change.
3270
efdd7421
PE
32712006-10-11 Bob Rossi <bob@brasko.net>
3272
3273 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
3274 (b4_yyssa, b4_yyerror_range): New macros.
3275 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
3276 (yypvarsinit): Remove init of removed fields.
3277 (yypushparse): Remove use of removed fields; use new macros instead.
3278
96a1981a
PE
32792006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3280
3281 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
3282 in a push parser. Reindent slightly to match yacc.c better.
3283
32842006-10-11 Bob Rossi <bob@brasko.net>
3285
46356ea4
PE
3286 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
3287 yymsg_alloc fields.
3288 (yypvarsinit, yypushparse): Remove init of removed fields.
3289 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 3290
c1630a8b
PE
32912006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3292
3293 * THANKS: Add Paolo Bonzini and Bob Rossi.
3294
90b9908d
PB
32952006-10-08 Paolo Bonzini <bonzini@gnu.org>
3296
3297 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
3298 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
3299 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
3300 b4_define_user_cde and uses): Remove.
3301 (b4_comment, b4_prefix, b4_sync_start): New.
3302 * data/bison.m4: New file, with most of the content removed from c.m4.
3303 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
3304 * src/output.c (output_skeleton): Pass bison.m4.
3305 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
3306 only if specified.
3307
cf806753
PE
33082006-10-05 Paul Eggert <eggert@cs.ucla.edu>
3309
3310 Fix test failure reported by Tom Lane in
3311 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
3312 and try to make such failures easier to catch in the future.
3313 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
3314 that's now the caller's responsibility.
3315 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
3316 Set yychar = YYEOF if it's negative.
3317 * tests/actions.at (yylex): Abort if asked to read past EOF.
3318 * tests/conflicts.at (yylex): Likewise.
3319 * tests/cxx-type.at (yylex): Likewise.
3320 * tests/glr-regression.at (yylex): Likewise.
3321 * tests/input.at (yylex): Likewise.
3322 * tests/regression.at (yylex): Likewise.
3323 * tests/torture.at (yylex): Likewise.
3324
0e2f006a
PE
33252006-10-01 Paul Eggert <eggert@cs.ucla.edu>
3326
3327 Fix problems with translating English-language diagnostics.
3328 * bootstrap: Fix bug introduced in recent bootstrap changes, with
3329 respect to bison-runtime pot generation. The YY_ stuff
3330 wasn't being captured.
3331 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
3332 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
3333 * runtime-po/POTFILES.in: Add data/push.c.
3334
e3ddc1e3
PE
33352006-09-29 Paul Eggert <eggert@cs.ucla.edu>
3336
3337 Merge bootstrap changes from coreutils.
3338
3339 2006-09-28 Jim Meyering <jim@meyering.net>
3340
3341 Automatically generated dependencies are important even
3342 when all of the sources in a directory come from gnulib.
3343 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
3344 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
3345
3346 2006-09-23 Jim Meyering <jim@meyering.net>
3347
3348 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
3349
3350 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3351
3352 * bootstrap: Add support for --force.
3353 (usage): New function. Describe usage less tersely.
3354 (CVS_only_file): New var.
3355
01e972b3
PE
33562006-09-21 Paul Eggert <eggert@cs.ucla.edu>
3357
3358 * data/push.c (YYPUSH_MORE): Make it an enum instead.
3359 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
3360 Adjust white space and comments to match GNU style better.
3361
c63d3e90
PE
33622006-09-20 Bob Rossi <bob@brasko.net>
3363
3364 * data/push.c (yyresult_get): Remove function.
3365 (YYPUSH_MORE): Add #define.
3366 (yypushparse): Modify return value.
3367
e70f46d1
PE
33682006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3369
3370 * stamp-h.in: Remove; no longer needed.
3371 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
3372 Remove config.h, config.hin, intl (no longer created).
3373 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
3374 stamp-h1.
3375
3376 Sync bootstrap from coreutils, as follows:
3377
3378 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
3379
3380 * bootstrap (symlink_to_gnulib): New function.
3381 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
3382 to copies-of-gnulib.
3383 (cp_mark_as_generated, slurp, gnulib_files):
3384 Avoid making a copy if it's the same as the old version.
3385 (gnulib_files): Add support for this variable (used by Bison).
3386
a92be413
PE
33872006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3388
3389 * src/getargs.c (usage): Rework to use conventions similar to
3390 coreutils, to make translation a bit easier and the code a bit
3391 smaller. Problem reported by Tim Van Holder.
3392
4f82b42a
PE
33932006-09-15 Paul Eggert <eggert@cs.ucla.edu>
3394
3b2942e6
PE
3395 Use some of gnulib's new modules, taken from coreutils.
3396
3397 * bootstrap: Sync from coreutils, except add support for gnulib_files.
3398 * bootstrap.conf: New file.
3399 (gnulib_modules): Add configmake, inttypes, unistd.
3400 (XGETTEXT_OPTIONS): Add complain, complain_at,
3401 fatal, fatal_at, warn, warn_at, unexpected_end.
3402 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
3403 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
3404 (gl_EARLY): Add.
3405 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
3406 (gl_INIT): Add
3407 (GNULIB_AUTOCONF_SNIPPET): Remove.
3408 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
3409 the pickiest.
3410 * lib/.cvsignore: Add inttypes_.h.
3411 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
3412 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
3413 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
3414 no-longer-necessary initializations.
3415 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
3416 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
3417 use the unistd module.
3418 * src/system.h: Likewise.
3419 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
3420 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
3421 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
3422 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
3423 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
3424 * src/system.h: Include inttypes.h unconditionally, now that we
3425 use the inttypes module. Don't bother to include stdint.h, since
3426 inttypes.h now does that for us.
3427 (LOCALEDIR): Remove, now that we use the configmake module.
3428 * src/getargs.c: Include configmake.h.
3429 * src/main.c: Likewise.
3430 * src/output.c: Likewise.
3431 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
3432 not from $abs_top_builddir, since config.h moved.
3433
3434
4f82b42a
PE
3435 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
3436 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
3437
3438 * src/parse-gram.y (symbol_declaration): Don't put statements
3439 before declarations; it's not portable to C89.
3440 * src/scan-code.l (handle_action_at): Likewise.
3441
3442 * src/scan-code.l: Always initialize braces_level; the old code
3443 left it uninitialized and therefore had undefined behavior.
3444
3445 Don't attempt to redefine 'assert', since it runs afoul of
3446 systems where standard headers (mistakenly) include <assert.h>.
3447 Instead, define and use our own alternative, called 'aver'.
3448 * src/reader.c: Don't include assert.h, since we no longer
3449 use assert.
3450 * src/scan-code.l: Likewise.
3451 * src/system.h (assert): Remove, replacing with....
3452 (aver): New function, taking a bool arg. All uses changed.
3453 * src/tables.c (pack_vector): Ensure that aver arg is bool,
3454 not merely an integer.
3455
31c10e38
PE
34562006-09-15 Bob Rossi <bob@brasko.net>
3457
3458 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
3459 * data/c.m4 (YYPUSH): New.
3460 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
3461 * src/getargs.c (push_parser): New var.
3462 * src/getargs.h (push_parser): New declaration.
3463 * src/output.c (prepare): Add macro insertion of `push_flag'.
3464 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
3465 (prologue_declaration): Parse %push-parser.
3466 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
3467 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
3468 list of removed lines from the traces observed.
3469 (AT_CHECK_CALC_LALR): Added push parser tests.
3470
fa7b79c0
PE
34712006-09-13 Paul Eggert <eggert@cs.ucla.edu>
3472
21fe08ca
PE
3473 * NEWS: Version 2.3a.
3474 * configure.ac (AC_INIT): Likewise.
3475
e8ec4d9b
PE
3476 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
3477 "#define YYSTYPE int" that caused "make maintainer-check" to fail
3478 due to header ordering dependencies. I don't know why the #define
3479 was there.
3480
fa7b79c0
PE
3481 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
3482 runtime cost when YYDEBUG is not defined, and so that some tests
3483 that used to fail now work. Problem and initial suggestion by
3484 Paolo Bonzini.
3485 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
3486 * data/glr.cc (b4_parser_class_name):
3487 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
3488 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
3489 (yydebug_) [YYDEBUG]: New member.
3490 (yycdebug_): Now defined only if YYDEBUG.
3491 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
3492 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
3493 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
3494 if YYYDEBUG.
3495 (debug_stream, set_debug_stream, debug_level, set_debug_level):
3496 Define only if YYDEBUG.
3497 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
3498 set_debug_level.
3499 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
3500 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
3501 AT_CHECK_CALC_GLR_CC that are working now.
3502
4ec13d60
PE
35032006-09-12 Paul Eggert <eggert@cs.ucla.edu>
3504
3505 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
3506 We don't need them in glr.cc, and glr.c defines them.
3507 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
3508 assumes that defining it to anything is the same as defining
3509 it to 1. Problem reported by Paolo Bonzini.
3510
8e1687ae
PE
35112006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
3512
3513 * data/c.m4 (b4_null, b4_case): Define.
3514 * src/output.c (prepare_symbols): Use b4_null.
3515 (user_actions_output): Use b4_case.
3516
3dc5e96b
PE
35172006-09-11 Paul Eggert <eggert@cs.ucla.edu>
3518
aef3da86
PE
3519 * data/glr.c (b4_shared_declarations): Put start-header first,
3520 before any #includes that we generate, so that feature-test
3521 macros work. Problem reported by Michael Deutschmann in
3522 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
3523 * data/lalr1.cc: Likewise.
3524 * doc/bison.texinfo (Prologue): Document that feature-test macros
3525 should be defined before any Bison declarations.
3526 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
3527 that depend on location.hh after, not before, Bison decls, since
3528 we now include location.hh after the first user prologue.
3529
3dc5e96b
PE
3530 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
3531 Sander Brandenburg in
3532 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
3533 Also, fix minor white space and comment issues.
aef3da86
PE
3534 (Prologue): Mention that it's better to define feature-test macros
3535 before Bison declarations. Problem reported by Michael Deutschmann.
3536
3537 * README-cvs: Fix typo: "&" should be "&&". Problem reported
3538 by Jim Meyering.
3539 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
3540 This adjusts to recent gnulib changes.
3dc5e96b 3541
b2a0b7ca
JD
35422006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3543
3544 Finish implementation of per-type %destructor/%printer. Discussed
3545 starting at
3546 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
3547 and
3548 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
3549 * NEWS (2.3+): Add a description of this feature to the default
3550 %destructor/%printer description.
3551 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
3552 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3553 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
3554 list node contains a semantic type.
3555 * src/symtab.c, src/symtab.h: Extend with a table that associates
3556 semantic types with their %destructor's and %printer's.
3557 (semantic_type_from_uniqstr, semantic_type_get,
3558 semantic_type_destructor_set, semantic_type_printer_set): New functions
3559 composing the public interface of that table.
3560 (symbol_destructor_get, symbol_destructor_location_get,
3561 symbol_printer_get, symbol_printer_location_get): If there's no
3562 per-symbol %destructor/%printer, look up the per-type before trying
3563 the default.
3564 * tests/actions.at (Per-type %printer and %destructor): New test case.
3565 * tests/input.at (Default %printer and %destructor redeclared):
3566 Extend to check that multiple occurrences of %symbol-default in a
3567 single %destructor/%printer declaration is an error.
3568 (Per-type %printer and %destructor redeclared, Unused values with
3569 per-type %destructor): New test cases.
3570
3be03b13
JD
35712006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3572
3573 Require default %destructor/%printer to be declared using
3574 %symbol-default instead of an empty symbol list, and start working on
3575 new per-type %destructor/%printer. Discussed at
3576 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
3577 * NEWS (2.3+): Add %symbol-default to example.
3578 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 3579 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
3580 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
3581 (generic_symlist, generic_symlist_item): New nonterminals for creating
3582 a list in which each item is a symbol, semantic type, or
3583 %symbol-default.
3584 (grammar_declaration): Use generic_symlist in %destructor and %printer
3585 declarations instead of symbols.1 or an empty list.
3586 (symbol_declaration, precedence_declaration, symbols.1): Update actions
3587 for changes to symbol_list.
3588 * src/reader.c: Update for changes to symbol_list.
3589 * src/scan-code.l: Likewise.
3590 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
3591 * src/symlist.c, src/symlist.h: Extend such that a list node may
3592 represent a semantic type or a %symbol-default in addition to just an
3593 ordinary symbol. Add switched functions for setting %destructor's and
3594 %printer's.
3595 * tests/actions.at, tests/input.at: Add %symbol-default to all default
3596 %destructor/%printer declarations.
3597
3508ce36
JD
35982006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
3599
3600 Whether the default %destructor/%printer applies to a particular symbol
3601 isn't a question of whether the user *declares* that symbol (in %token,
3602 for example). It's a question of whether the user by any means
3603 *defines* the symbol at all (by simply using a char token, for
3604 example). $end is defined by Bison whereas any other token with token
3605 number 0 is defined by the user. The error token is always defined by
3606 Bison regardless of whether the user declares it with %token, but we
3607 may one day let the user define error as a nonterminal instead.
3608 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
3609 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
3610 the meaning of "user-defined".
3611 * tests/actions.at (Default %printer and %destructor for user-declared
3612 end token): Rename to...
3613 (Default %printer and %destructor for user-defined end token): ...
3614 this.
3615
3616 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
3617 computation of whether to apply the default, don't maintain a list of
3618 every Bison-defined symbol. Instead, just check for a first character
3619 of '$', which a user symbol cannot have, and check for the error token.
3620
9350499c
JD
36212006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
3622
3623 Don't apply the default %destructor or %printer to the error token,
3624 $undefined, or $accept. This change fits the general rule that the
3625 default %destructor and %printer are only for user-declared symbols,
3626 and it solves several difficulties that are described in the new test
3627 cases listed below.
3628 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
3629 * tests/actions.at (Default %printer and %destructor are not for error
3630 or $undefined, Default %printer and %destructor are not for $accept):
3631 New test cases.
3632
4d7370cb
JD
36332006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
3634
3635 Allow %start after the first rule.
3636 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
3637 when parsing the first rule.
3638 (check_and_convert_grammar): Search for it here after all grammar
3639 declarations have been parsed. Skip midrules, which have dummy LHS
3640 nonterminals.
3641 * src/symtab.c (symbol_is_dummy): New function.
3642 * src/symtab.h (symbol_is_dummy): Declare it.
3643 * tests/input.at (%start after first rule): New test.
3644
6d0ef4ec
JD
36452006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3646
3647 Redo some of the previous commit: add back the ability to use
3648 non-aliased/undeclared string literals since it might be useful to
3649 those declaring %token-table.
3650 * src/reader.c (check_and_convert_grammar): Undo changes in previous
3651 commit: don't worry about complaints from symbols_pack.
3652 * src/symtab.c (symbol_new, symbol_class_set,
3653 symbol_check_alias_consistency): Undo changes in previous commit: count
3654 each string literal as a new symbol and token, assign it a symbol
3655 number, and don't complain about non-aliased string literals.
3656 (symbols_pack): Since symbol_make_alias still does not decrement symbol
3657 and token counts but does still set aliased tokens to the same number,
3658 symbol_pack_processor now leaves empty slots in the symbols array.
3659 Remove those slots.
3660 * tests/regression.at (Undeclared string literal): Remove test case
3661 added in previous commit since non-aliased string literals are allowed
3662 again.
3663 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
3664 remove unnecessary string literal declarations.
3665 * tests/sets.at (Firsts): Likewise.
3666
965537bc
JD
36672006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3668
3669 Don't allow an undeclared string literal, but allow a string literal to
3670 be used before its declaration.
3671 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
3672 symbols_pack complained.
3673 * src/symtab.c (symbol_new): Don't count a string literal as a new
3674 symbol.
3675 (symbol_class_set): Don't count a string literal as a new token, and
3676 don't assign it a symbol number since symbol_make_alias does that.
3677 (symbol_make_alias): It's not necessary to decrement the symbol and
3678 token counts anymore. Don't assume that an alias declaration occurs
3679 before any uses of the identifier or string, and thus don't assert that
3680 one of them has the highest symbol number so far.
3681 (symbol_check_alias_consistency): Complain if there's a string literal
3682 that wasn't declared as an alias.
3683 (symbols_pack): Bail if symbol_check_alias_consistency failed since
3684 symbol_pack asserts that every token has been assigned a symbol number
3685 although undeclared string literals have not.
3686 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 3687 string literal): New test cases.
965537bc
JD
3688 (Characters Escapes, Web2c Actions): Declare string literals as
3689 aliases.
3690 * tests/sets.at (Firsts): Likewise.
3691
47aee066
JD
36922006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
3693
3694 In the grammar scanner, STRING_FINISH unclosed constructs and return
3695 them to the parser in order to improve error messages.
3696 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
3697 SC_BRACED_CODE, SC_PROLOGUE): Implement.
3698 * tests/input.at (Unclosed constructs): New test case.
3699 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
3700 seen.
3701
3702 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
3703 unused global.
3704
1f6b3679
JD
37052006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
3706
3707 Handle string aliases for character tokens correctly.
3708 * src/symtab.c (symbol_user_token_number_set): If the token has an
3709 alias, check and set its alias's user token number instead of its own,
3710 which is set to indicate the alias. Previously, every occurrence of
3711 the character token in the grammar overwrote that alias indicator with
3712 the character code.
3713 * tests/input.at (String aliases for character tokens): New test.
3714
219741d8
JD
37152006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
3716
3717 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
3718
11daa4e7
PE
37192006-08-11 Paul Eggert <eggert@cs.ucla.edu>
3720
3721 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
3722 to prevent failures when building on older platforms.
3723 Check for autopoint failure.
3724 Set XGETTEXT_OPTIONS to values that check for C format strings,
3725 so that translators are warned about them (this also helps
3726 prevent core dumps).
3727
3728 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
3729 function, since it simplifies our code a bit.
3730
3731 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
3732 rather than -W, so we don't get bogus warnings about sign comparisons.
3733 Add -Wpointer-arith, since that warning is useful (it reports code
3734 that does not conform to C89 and that some compilers reject).
3735 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
3736 since it's no longer needed.
3737
f9bfc42a
JD
37382006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
3739
3740 Clean up scanners a bit.
3741 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
3742 definitions so gcc won't warn when obstack_for_string is unused.
3743 * src/scan-code.l: config.h and system.h are already #include'd by
3744 scan-code-c.c, so get rid of them here.
3745 * src/scan-gram.l: Likewise.
3746 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
3747 definitions rather than duplicating the rest of it.
3748 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
3749
06e8700a
JD
37502006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
3751
3752 Suppress signed/unsigned comparison warnings for yycheck.
3753 * data/c.m4 (b4_safest_int_type): New macro.
3754 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
3755 a signed int type, cast it to b4_safest_int_type first.
3756 * data/yacc.c: Likewise.
3757 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
3758 also overwritten.
3759
9c437126
PE
37602006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3761
3762 * doc/bison.texinfo: Fix some typos.
3763
284d8a13
PE
37642006-08-02 Paul Eggert <eggert@cs.ucla.edu>
3765
3766 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
3767 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
3768
3769 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
3770 the latest gnulib does this a different way.
3771 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
3772 translation was patched, so stop omitting it.
3773
ec5479ce
JD
37742006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3775
3776 Enable declaration of default %printer/%destructor. Make the parser
3777 use these for all user-declared grammar symbols for which the user does
3778 not declare a specific %printer/%destructor. Thus, the parser uses it
3779 for token 0 if the user declares it but not if Bison generates it as
3780 $end. Discussed starting at
3781 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
3782 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
3783 and
3784 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
3785 * NEWS (2.3+): Mention.
3786 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
3787 declare a %destructor for a mid-rule's semantic value. It's just
3788 impossible to declare one specific to it.
3789 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
3790 code. Describe default %destructor form.
3791 * src/parse-gram.y (grammar_declaration): Parse default
3792 %printer/%destructor declarations.
3793 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
3794 and symbol_destructor_location_get rather than accessing the destructor
3795 and destructor_location members of struct symbol.
3796 (symbol_printers_output): Likewise but for %printer's.
3797 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3798 again.
3799 * src/symtab.c (default_destructor, default_destructor_location,
3800 default_printer, default_printer_location): New static global
3801 variables to record the default %destructor and %printer.
3802 (symbol_destructor_get, symbol_destructor_location_get,
3803 symbol_printer_get, symbol_printer_location_get): New functions to
3804 compute the appropriate %destructor and %printer for a symbol.
3805 (default_destructor_set, default_printer_set): New functions to set the
3806 default %destructor and %printer.
3807 * src/symtab.h: Prototype all those new functions.
3808 * tests/actions.at (Default %printer and %destructor): New test to
3809 check that the right %printer and %destructor are called, that they're
3810 not called for $end, and that $$ and @$ work correctly.
3811 (Default %printer and %destructor for user-declared end token): New
3812 test to check that the default %printer and %destructor are called for
3813 a user-declared end token.
3814 * tests/input.at (Default %printer and %destructor redeclared, Unused
3815 values with default %destructor): New tests to check related grammar
3816 warnings and errors.
3817
868d2d96
JD
38182006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3819
3820 Clean up handling of %destructor for the end token (token 0).
3821 Discussed starting at
3822 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3823 and
3824 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3825
3826 Make the skeletons consistent in how they pop the end token and invoke
3827 its %destructor.
3828 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3829 state, which has token number 0, since this would invoke the
3830 %destructor for the end token.
3831 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3832 until after shifting the end token, or else it won't be popped.
3833 * data/yacc.c (yyparse): Likewise.
3834
3835 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3836 it's the end token. Upon termination, destroy an unshifted lookahead
3837 even when it's the end token.
3838 * data/lalr1.cc (yy::parser::parse): Likewise.
3839 * data/yacc.c (yyparse): Likewise.
3840
3841 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3842 value warnings for the end token when the user gives the end token a
3843 %destructor.
3844
3845 * tests/actions.at (Printers and Destructors): Test all the above.
3846
62a9592d
PE
38472006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3848
3849 Update to latest gnulib and gettext versions.
3850 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3851 Add fopen-safer.
3852 (gnulib_files): Add m4/warning.m4. Don't worry about files
3853 overwritten by autopoint.
3854 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3855 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3856 rejects them.
3857 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3858 so that we can remove the intl files at a better time.
3859 (intl_files_to_remove): Remove aclocal.m4, since it gets
3860 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3861 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3862 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3863 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3864 Remove datarootdir hack; no longer needed.
3865 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3866 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3867 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3868 strdup.h.
3869 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3870 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3871
10d6970f
PE
38722006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3873
3874 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3875 it with --assume-autoconf='latest-stable'.
3876
50a33993
JD
38772006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3878
3879 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3880 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3881 YYSTYPE' and `{'.
3882 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3883 those from muscle_tab.c since the old ones are misleading.
3884
2ce4ed68
AD
38852006-07-13 Akim Demaille <akim@epita.fr>
3886
3887 Support %define "KEY" {VALUE}.
3888 * src/scan-code.h, src/scan-code.l (translate_action)
3889 (translate_rule_action, translate_symbol_action, translate_code):
3890 Return char *, not const char *.
3891 * src/parse-gram.y (declaration): Rename as...
3892 (prologue_declaration): this.
3893 (string_content): Remove this nonterminal, use STRING.
3894 (braceless, content, content.opt): New nonterminal.
3895 Use them.
3896 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3897 as value.
3898 * src/scan-gram.l (getargs.h): Don't include it.
3899
db7e5eb5
PE
39002006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3901
3902 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3903 rather than a for-loop that declares a local bool variable. This
3904 should work around a compatibility problem with a Cray x1e C++
3905 compiler reported by Hung Nguyen in
3906 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3907 The for-loop was introduced in the 2004-11-17 change but I don't
3908 know why it was needed.
3909
a5d80ba5
AD
39102006-07-12 Akim Demaille <akim@epita.fr>
3911
3912 * data/c.m4: Comment changes.
3913
23eb2a69
AD
39142006-07-10 Akim Demaille <akim@lrde.epita.fr>
3915
3916 * src/complain.c (error_message, ERROR_MESSAGE): New.
3917 To factor...
3918 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3919 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3920
ddc8ede1
PE
39212006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3922
3923 * NEWS: Instead of %union, you can define and use your own union type
3924 YYSTYPE if your grammar contains at least one <type> tag.
3925 Your YYSTYPE need not be a macro; it can be a typedef.
3926 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3927 (Union Decl, Decl Summary): Document this.
3928 * data/glr.c (YYSTYPE): Implement this.
3929 * data/glr.cc (YYSTYPE): Likewise.
3930 * data/lalr1.cc (YYSTYPE): Likewise.
3931 * data/yacc.c (YYSTYPE): Likewise.
3932 * src/output.c (prepare): Output tag_seen_flag.
3933 * src/parse-gram.y (declaration, grammar_declaration):
3934 Use 'union_seen' rather than 'typed' to determine whether
3935 %union has been seen, since grammars can now be typed without
3936 %union.
3937 (symbol_declaration, type.opt, symbol_def):
3938 Keep track of whether a tag has been seen.
3939 * src/reader.c (union_seen, tag_seen): New vars.
3940 (typed): remove.
3941 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3942 * src/scan-code.l (untyped_var_seen): New variable.
3943 (handle_action_dollar): Adjust to above changes.
3944 (handle_action_dollar, handle_action_at):
3945 Improve overflow checking for outlandish numbers.
3946 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3947 avoid new diagnostics generated by above changes.
3948 * tests/regression.at (YYSTYPE typedef): Add test to check
3949 for type tags without %union.
3950
3951 * src/symlist.c (symbol_list_length): Return int, not unsigned
3952 int, since callers expect int. This may need to get revisited
3953 once we have proper integer overflow checking.
3954
3955 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3956 object is now static.
3957
3958 * src/getargs.c (flags_argmatch): Return void, not int,
3959 to pacify ./configure --enable-gcc-warnings.
3960
3961 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3962 since last_string is already defined to FLEX_PREFIX (last_string).
3963
7b42569e
AD
39642006-07-09 Akim Demaille <akim@lrde.epita.fr>
3965
3966 Implement --warnings/-W.
3967 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
3968 replaced by...
3969 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
3970 Adjust callers.
3971 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
3972 (warnings_args, warnings_types): New.
3973 (getargs, short_options, long_options): Accept -W/--warnings.
3974 Sort the options by alphabetical order, upper case letter right
3975 before its lower case.
3976
3b452f4e
JD
39772006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3978
3979 Change %merge result type clash warnings to errors. Discussed at
3980 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
3981 * src/reader.c (record_merge_function_type): Use complain_at.
3982 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3983 declared later): Update test case results.
3984
b8a41559
AD
39852006-07-09 Akim Demaille <akim@lrde.epita.fr>
3986
3987 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
3988 to be in alphabetical order.
3989 (trace_args): Spelling fixes.
3990
cd9e1ba2
PE
39912006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3992
3993 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
3994 so they don't collide with user-defined macros.
3995 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
3996 this was never guaranteed, and now that we're using gnulib stdint,
3997 which defines int_fast16_t to long int, the problem is exposed.
3998
cb48f191
PE
39992006-07-08 Paul Eggert <eggert@cs.ucla.edu>
4000
b8445a15
PE
4001 * data/c.m4 (b4_basename): Simplify a bit, since we don't
4002 need the full POSIX semantics (and weren't implementing them
4003 anyway).
4004
cb48f191
PE
4005 Adjust to Autoconf 2.60 and today's gnulib.
4006 * bootstrap (gnulib_modules): Add stdint.
4007 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
4008 no longer copies it.
4009 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
4010 since stdint needs the former and wcwidth (which is now required
4011 by mbswidth) needs the latter.
4012 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
4013 work around a compatibility glitch between gettext 0.14.6 and
4014 Autoconf 2.60.
4015 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
4016 Do not check for uintptr_t, since new stdint module does the right
4017 thing.
4018 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
4019 Add stdint.h, stdint_.h, wcwidth.h.
4020 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
4021 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
4022 stdint.m4, wchar_t.m4, wcwidth.m4.
4023 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
4024 usual order for ../lib/*.h files.
4025 (file_name_split): Use last_component, not base_name, to adjust
4026 to gnulib changes.
4027 * src/parse-gram.h: Include <strverscmp.h> in the usual order
4028 for ../lib/*.h files.
4029 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
4030 Define unconditionally, since we now assume the stdint module.
4031 * src/scan-skel.l: Include <dirname.h>.
4032 (BASE_QPUTS): Use last_component, not base_name.
4033 * src/system.h: Include <unlocked-io.h> in the usual order
4034 for ../lib/*.h files. Include <stdint.h> unconditionally,
4035 since we now use the stdint module.
4036 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
4037 HAVE_UINTPTR_T, since we now use the stdint module.
4038 (base_name): Remove decl, since files now include <dirname.h>
4039 to get the decl.
4040
cd48d21d
AD
40412006-07-08 Akim Demaille <akim@lrde.epita.fr>
4042
4043 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
4044 New, default to 1.
4045 * data/yacc.c, data/glr.c, data/location.cc: Use them.
4046 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
4047 default.
4048 * tests/calc.at: Adjust.
4049
8ec0a172
AD
40502006-07-08 Akim Demaille <akim@lrde.epita.fr>
4051
b8445a15 4052 * data/c.m4 (b4_basename): New.
8ec0a172
AD
4053 (b4_syncline): Also output the location of its invocation (from
4054 the skeleton).
4055 (b4_user_action, b4_define_user_action, b4_user_actions)
4056 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
4057 (b4_user_stype): New.
4058 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
4059
4a678af8
JD
40602006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
4061
4062 In the grammar file, the first column is 1 not 0 on the first line as
4063 on every other line.
4064 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
4065 * tests/input.at (Torturing the Scanner): Update output.
4066
4067 * src/scan-gram.l (scanner_cursor): Declare it static.
4068
dd60572a
JD
40692006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
4070
4071 In warnings, say "previous declaration" rather than "first
4072 declaration".
4073 * src/symtab.c (redeclaration): Do that here.
4074 * src/reader.c (record_merge_function_type): In the case of a result
4075 type clash, report the previous declaration rather than the very first
4076 one in the grammar file.
4077 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4078 declared later): Add a third declaration to check this behavior.
4079 * tests/input.at (Incompatible Aliases): Update output.
4080
2073e1b6
AD
40812006-06-27 Akim Demaille <akim@epita.fr>
4082
4083 * doc/Doxyfile.in: New.
4084 * doc/Makefile.am: Use it.
4085 * src/lalr.h, src/symtab.h: Initial doxygenation.
4086
8ee5b538
JD
40872006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4088
4089 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
4090 declared after the %merge. This continues the effort of the previous
4091 patch.
8ee5b538
JD
4092 * src/reader.c (get_merge_function): Don't set the merger type yet.
4093 (record_merge_function_type): New function for setting the merger type
4094 and checking for clashes.
4095 (grammar_current_rule_merge_set): Set the location of the %merge for
4096 the current rule.
4097 (packgram): Invoke record_merge_function_type for each rule now that
4098 all symbol type declarations have been parsed.
4099 * src/reader.h (merger_list.type_declaration_location): New member
4100 storing the location of the first %merge from which the type for this
4101 merging function was derived.
4102 * src/symlist.h (symbol_list.merger_declaration_location): New member
4103 storing the location of a rule's %merge, if any.
4104 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4105 declared later): New test to catch the error fixed by the above patch.
4106
ffa4ba3a
JD
41072006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4108
4109 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
4110 declarations appear after the rules. Discussed at
4111 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
4112 and
4113 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
4114 Don't mistake the type of $$ in a midrule to be that of its parent
4115 rule's $$.
ffa4ba3a
JD
4116 * src/reader.c (grammar_current_rule_end): Don't invoke
4117 grammar_rule_check yet since not all symbol declarations may have been
4118 parsed yet.
4119 (grammar_midrule_action): Likewise.
4120 Don't record whether the midrule's $$ has been used yet since actions
4121 haven't been translated yet.
4122 Record the midrule's parent rule and its RHS index within the parent
4123 rule.
4124 (grammar_current_rule_action_append): Don't translate the action yet
4125 since not all symbol declarations may have been parsed yet and, thus,
4126 warnings about types for $$, $n, @$, and @n can't be reported yet.
4127 (packgram): Translate the action and invoke grammar_rule_check now that
4128 all symbol declarations have been parsed.
4129 * src/scan-code.l (handle_action_dollar): Now that this is invoked
4130 after parsing the entire grammar file, the symbol list here in the case
4131 of a midrule is actually the midrule's empty RHS, so reference its
4132 parent rule's RHS where necessary.
4133 On the other hand, now that you can already know it's a midrule, you
4134 aren't forced to think $$ has the same type as its parent rule's $$.
4135 (handle_action_at): In the case of a midrule, reference the parent rule
4136 where necessary.
4137 * src/symlist.c (symbol_list_new): Initialize new midrule-related
4138 members.
4139 (symbol_list_length): Now that this is invoked after all rules have
4140 been parsed, a NULL symbol (rather than a NULL symbol list node)
4141 terminates a rule. symbol_list_print already does this correctly.
4142 * src/symlist.h (symbol_list.midrule_parent_rule,
4143 symbol_list.midrule_parent_rhs_index): New members so that midrules can
4144 remember their relationships with their parents.
4145 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
4146 fixed by the above patch.
4147 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
4148 implementing...
4149 (Unused values): ... this old test case and...
4150 (Unused values before symbol declarations): ... this new test case.
4151 This one is the same as `Unused values' except that all symbol
4152 declarations appear after the rules in order to catch the rest of the
4153 errors fixed by the above patch.
4154
e256e17f
JD
41552006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4156
300a1930
JD
4157 More cleanup.
4158 * src/reader.c (current_rule): Declare it static since it's no longer
4159 used outside this file.
4160 (grammar_current_rule_action_append): Remove redundant arguments from
4161 translate_rule_action invocation.
4162 * src/reader.h (current_rule): Remove this unused extern.
4163 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
4164 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 4165
381ecb06
JD
41662006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
4167
4168 Clean up yesterday's patch.
4169 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
4170 to...
4171 * src/reader.c (grammar_current_rule_action_append): ... here for
4172 consistency with grammar_current_rule_symbol_append.
4173 * tests/regression.at (Braced code in declaration in rules section):
4174 Make yyerror and yylex static as usual.
4175
4210cd0b
JD
41762006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
4177
4178 Fix bug that mistakes braced code in a declaration in the rules section
4179 to be a rule action. Mentioned at
4180 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
4181 * src/scan-gram.l: Move midrule action detection from the start of the
4182 scanning of any braced code to...
4183 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
4184 action. For readability, use $2 and @2 rather than the equivalent
4185 global variables.
4186 * tests/regression.at (Braced code in declaration in rules section):
4187 New test to catch the error fixed by the above patch.
4188
4189 Work on code readability some.
4190 * src/scan-code.l (current_rule): Get rid of this misleading and
4191 redundant declaration: it's actually extern'ed in reader.h.
4192 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
4193 translate_action): Add a rule argument and use it instead of the global
4194 current_rule.
4195 (translate_rule_action): This already receives current_rule through an
4196 argument, so pass it on to translate_action instead of assigning
4197 current_rule to current_rule.
4198 (translate_symbol_action, translate_code): Pass rule = NULL to
4199 translate_action.
4200
34f98f46
JD
42012006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
4202
4203 Rename %before-definitions to %start-header and %after-definitions to
4204 %end-header. Don't use these declarations to separate pre-prologue
4205 blocks from post-prologue blocks. Add new order-independent
4206 declarations %before-header and %after-header as alternatives to the
4207 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
4208 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
4209 * NEWS (2.3+): Update for these changes.
4210 * data/glr.c (b4_before_definitions): Update to...
4211 (b4_start_header): ... this.
4212 (b4_after_definitions): Update to...
4213 (b4_end_header): ... this.
4214 * data/glr.cc: Likewise.
4215 * data/lalr1.cc: Likewise.
4216 * data/yacc.c: Likewise.
4217 * doc/bison.texinfo (The prologue): Update names, and replace remaining
4218 prologue blocks with %*-header declarations.
4219 (Calc++ Parser): Likewise.
91661ebb 4220 (Decl Summary): Update names.
148d66d8 4221 (Table of Symbols): Update description.
34f98f46
JD
4222 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
4223 (PERCENT_END_HEADER): ... this.
4224 (PERCENT_BEFORE_DEFINITIONS): Update to...
4225 (PERCENT_START_HEADER): ... this.
4226 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4227 (declaration): Update token names and m4 macro names.
4228 When parsing %end-header and %start-header, invoke translate_code
4229 before muscle_code_grow, and no longer set global booleans to remember
4230 whether these declarations have been seen.
4231 Parse new %after-header and %before-header.
4232 * src/reader.c (before_definitions, after_definitions): Remove.
4233 (prologue_augment): Accept a new bool argument to specify whether to
4234 augment the pre-prologue or post-prologue.
4235 * src/reader.h (before_definitions, after_definitions): Remove these
4236 extern's.
4237 (prologue_augment): Add new bool argument.
4238 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
4239 (PERCENT_END_HEADER): ... this.
4240 (PERCENT_BEFORE_DEFINITIONS): Update to...
4241 (PERCENT_START_HEADER): ... this.
4242 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4243 * tests/actions.at (Printers and Destructors): Update names.
4244
31b2b07e
JD
42452006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
4246
4247 Add comparison operators for C++ location classes. Discussed at
4248 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
4249 * data/c++.m4 (b4_define_location_comparison): New boolean %define
4250 declaration indicating whether filename_type has an operator==. If
4251 filename_type is `std::string', it defaults to `1', `0' otherwise.
4252 * data/location.cc: Iff b4_define_location_comparison is `1', add
4253 operator== and operator!= for class position and for class location.
4254
4255 Some minor fixes.
4256 * src/scan-action.l: Remove unused file.
4257 * src/symtab.c (symbol_printer_set): Use printer_location not
4258 destructor_location.
4259 * src/symtab.h (struct symbol): Replace incorrect source comment for
4260 printer members.
4261 * tests/input.at (Incompatible Aliases): Update output with correct
4262 printer location.
4263
9bc0dd67
JD
42642006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
4265
4266 Don't put the pre-prologue in the header file. For the yacc.c code
4267 file and the glr.c header and code files, move the pre-prologue before
4268 the token definitions. Add new %before-definitions and
4269 %after-definitions to declare code that will go in both the header file
4270 and code file. Discussed at
4271 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
4272 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
4273 and
4274 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
4275 * NEWS (2.3+): Describe these changes.
4276 * data/glr.c (b4_pre_prologue): Move from within to before...
4277 (b4_shared_declarations): ... this.
4278 Add new b4_before_definitions before b4_token_enums.
4279 Add new b4_after_definitions at the end.
4280 * data/glr.cc (b4_pre_prologue): Replace with...
4281 (b4_before_definitions): ... this in the header file.
4282 (b4_after_definitions): New near the end of the header file.
4283 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
4284 code file right before including the header file.
4285 (b4_before_definitions): New in the previous position of
4286 b4_pre_prologue in the header file.
4287 (b4_after_definitions): New near the end of the header file.
4288 * data/yacc.c: Clean up some m4 quoting especially in the header file.
4289 (b4_token_enums_defines): In the code file, move to right before
4290 YYSTYPE for consistency with the header file.
4291 (b4_before_definitions): New right before b4_token_enums_defines in
4292 both the header and code file.
4293 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
4294 header and code file.
4295 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
4296 of prologues for %union dependencies.
91661ebb
JD
4297 (Decl Summary): In %defines description, mention the effect of
4298 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
4299 (Calc++ Parser): Forward declare driver in a %before-definitions rather
4300 than in the pre-prologue so that make check succeeds.
148d66d8 4301 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
4302 %after-definitions.
4303 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
4304 %before-definitions.
4305 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
4306 (declaration): Parse those declarations and append to
4307 b4_before_definitions and b4_after_definitions, respectively.
4308 * src/reader.c (before_definitions, after_definitions): New bools to
4309 track whether those declarations have been seen.
4310 (prologue_augment): Add to the post-prologue if %union,
4311 %before-definitions, or %after-definitions has been seen.
4312 * src/reader.h (before_definitions, after_definitions): New extern's.
4313 * src/scan-gram.l: Scan the new declarations.
4314 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
4315 prologue block in a %before-definitions or a %after-definitions based
4316 on whether the %union is declared.
4317 * tests/regression.at (Early token definitions with --yacc, Early token
4318 definitions without --yacc): Move tests for token definitions into the
4319 post-prologue since token names are no longer defined in the
4320 pre-prologue.
4321
203b9274
AD
43222006-06-20 Akim Demaille <akim@epita.fr>
4323
4324 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
4325 (symbol_get): Use it.
4326 * src/parse-gram.y: Use it.
4327
a7ee59cf
JD
43282006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
4329
4330 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
4331 build succeeds when configured with --enable-gcc-warnings.
4332
5a2baae7
PE
43332006-06-19 Paul Eggert <eggert@cs.ucla.edu>
4334
33ad1a9c
PE
4335 * src/parse-gram.y (char_name): New function.
4336 (CHAR, STRING, string_content): For %printer, properly escape.
4337 (ID): Prefer fputs to fprintf.
4338 (id): Reindent to be consistent with other rules.
4339 Properly quote char.
4340
5a2baae7
PE
4341 The Translation Project changed its way of publishing translations
4342 to maintainers. I haven't received any responses to my request
4343 for supporting the old way, or for documenting the new way. I
4344 have modified 'bootstrap' to use screen scraping
4345 (in this case, HTML scraping). This is unreliable and inelegant,
4346 but I don't see any better way. Yuck.
4347 * bootstrap (TP_URL, WGET_COMMAND): New vars.
4348 (get_translations): New function, which uses HTML scraping to
4349 deduce locations of latest translations.
4350 Use this function to grab both bison and bison-runtime .po files.
4351 Don't bother priming the pump for the runtime-po domain any more,
4352 as it's now translated better than bison is.
4353
58d7a1a1
AD
43542006-06-19 Akim Demaille <akim@epita.fr>
4355
4356 * src/scan-gram.l: No longer "parse" things after `%union' until
4357 `{'. Rather, return a single "%union" token.
4358 No longer make symbols: return strings, and leave the conversion
4359 to symbols to the parser.
4360 (SC_PRE_CODE, token_type): Remove.
4361 * src/parse-gram.y (%union): New field `character'.
4362 Sort tokens.
4363 (CHAR): New token.
4364 (ID, ID_COLON): Now that the scanner no longer makes them
4365 identifiers, adjust all uses to invoke symbol_get.
4366 (id_colon): New, wraps the conversion from string to symbol.
4367 (%union): Accept a possible union_name.
4368 (symbol): Now can be a char.
4369 * data/c.m4 (b4_union_name): Leave a default value.
4370 * data/glr.c, data/yacc.c: Use it.
4371
b931235e
JD
43722006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
4373
4374 For associating token numbers with token names for "yacc.c", don't use
4375 #define statements unless `--yacc' is specified; always use enum
4376 yytokentype. Most important discussions start at:
4377 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
4378 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
4379 and
4380 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
4381 * NEWS (2.3+): Mention.
4382 * data/c.m4 (b4_yacc_if): New.
4383 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
4384 token #define's.
4385 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
4386 on token name definitions.
4387 * src/getargs.c (usage): Capitalize `Yacc' in English.
4388 * src/output.c (prepare): Define b4_yacc_flag.
4389 * tests/regression.at (Early token definitions): Test that tokens names
4390 are defined before the pre-prologue not just before the post-prologue.
4391 Remove this test case and copy to...
4392 (Early token definitions with --yacc): ... this to test #define's.
4393 (Early token definitions without --yacc): ... and this to test enums.
4394
9e6e7ed2
PE
43952006-06-11 Paul Eggert <eggert@cs.ucla.edu>
4396
4397 * NEWS: Reword the post-2.3 change to not be so optimistic about
4398 removing the old "look-ahead" spelling.
4399 Update previous look-ahead/lookahead change reports.
4400 * REFERENCES: look-ahead -> lookahead (since that's
4401 what he actually wrote).
4402 * doc/refcard.tex: look ahead -> lookahead,
4403 look-ahead -> lookahead
4404
742e4900
JD
44052006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
4406
4407 For consistency, use `lookahead' instead of `look-ahead' or
4408 `look_ahead'. Discussed starting at
4409 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
4410 and then at
4411 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
4412 * NEWS: For the next release, note the change to `--report'.
4413 * TODO, doc/bison.1: Update English.
4414 * doc/bison.texinfo: Update English.
4415 (Understanding Your Parser, Bison Options): Document as
4416 `--report=lookahead' rather than `--report=look-ahead'.
4417 * src/conflicts.c: Update English in comments.
4418 (lookahead_set): Rename from look_ahead_set.
4419 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
4420 (resolve_sr_conflict): Rename local look_ahead_tokens to
4421 lookahead_tokens, and update other uses.
4422 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
4423 count_rr_conflicts, conflicts_free): Update uses.
4424 * src/getargs.c (report_args): Move "lookahead" before alternate
4425 spellings.
4426 (report_types): Update uses.
4427 (usage): For `--report' usage description, state `lookahead' spelling
4428 rather than `look-ahead'.
4429 * src/getargs.h (report.report_lookahead_tokens): Rename from
4430 report_look_ahead_tokens.
4431 * src/lalr.c: Update English in comments.
4432 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
4433 (state_lookahead_tokens_count): Rename from
4434 state_look_ahead_tokens_count.
4435 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4436 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
4437 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4438 Update other uses.
4439 Update English in output.
4440 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
4441 * src/print.c: Update English in comments.
4442 (lookahead_set): Rename from look_ahead_set.
4443 (print_reduction): Rename argument lookahead_token from
4444 look_ahead_token.
4445 (print_core, state_default_rule, print_reductions, print_results):
4446 Update uses.
4447 * src/print_graph.c: Update English in comments.
4448 (print_core): Update uses.
4449 * src/state.c: Update English in comments.
4450 (reductions_new): Update uses.
4451 (state_rule_lookahead_tokens_print): Rename from
4452 state_rule_look_ahead_tokens_print, and update other uses.
4453 * src/state.h: Update English in comments.
4454 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
4455 (state_rule_lookahead_tokens_print): Rename from
4456 state_rule_look_ahead_tokens_print.
4457 * src/tables.c: Update English in comments.
4458 (conflict_row, action_row): Update uses.
4459 * tests/glr-regression.at
4460 (Incorrect lookahead during deterministic GLR,
4461 Incorrect lookahead during nondeterministic GLR): Rename
4462 print_look_ahead to print_lookahead.
4463 * tests/torture.at: Update English in comments.
4464 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
4465 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
4466 (Many lookahead tokens): Update uses.
4467 * data/glr.c: Update English in comments.
4468 * lalr1.cc: Likewise.
4469 * yacc.c: Likewise.
4470 * src/conflicts.h: Likewise.
4471 * src/lalr.h: Likewise.
4472 * src/main.c: Likewise.
4473 * src/output.c: Likewise.
4474 * src/parse-gram.c: Likewise.
4475 * src/tables.h: Likewise.
4476 * tests/calc.at: Likewise.
4477
3c40d0b5
JD
44782006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
4479
4480 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
4481
5d278082
PE
44822006-06-07 Paul Eggert <eggert@cs.ucla.edu>
4483
4484 * TODO: Add request from Nelson H. F. Beebe to be able to install
4485 Bison without installing the yacc script.
4486
9e668899
JD
44872006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4488
4489 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
4490 and yytext if they're already #define'd.
4491 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
4492 * src/scan-code-c.c: ... here.
4493 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
4494 <config.h>.
4495
0c8e079f
JD
44962006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4497
4498 Get Bison to build again when configured with --enable-gcc-warnings.
4499 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
4500 missing #include's.
4501 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
4502 loc argument as it shadows a global.
4503 * src/scan-gram.l: Remove stray comma that prevents boundary_set
4504 invocation.
4505
4506 * src/.cvsignore: Add scan-code.c.
4507
2346344a
AD
45082006-06-07 Akim Demaille <akim@epita.fr>
4509
4510 * src/scan-gram.l: Move the "add a trailing ; to actions" code
4511 to...
4512 * src/scan-code.l: here.
4513 * tests/input.at (Torturing the Scanner): Fix another location
4514 error.
4515
4862bdfd
AD
45162006-06-07 Akim Demaille <akim@epita.fr>
4517
4518 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
4519
e9071366
AD
45202006-06-06 Akim Demaille <akim@epita.fr>
4521
4522 Extract the parsing of user actions from the grammar scanner.
4523 As a consequence, the relation between the grammar scanner and
4524 parser is much simpler. We can also split "composite tokens" back
4525 into simple tokens.
4526 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
4527 * src/scan-gram.l (add_column_width, adjust_location): Move to and
4528 rename as...
4529 * src/location.h, src/location.c (add_column_width)
4530 (location_compute): these.
4531 Fix the column count: the initial column is 0.
4532 (location_print): Be robust to ending column being 0.
4533 * src/location.h (boundary_set): New.
4534 * src/main.c: Adjust to scanner_free being renamed as
4535 gram_scanner_free.
4536 * src/output.c: Include scan-code.h.
4537 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
4538 Use boundary_set.
4539 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
4540 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
4541 which is now, again, a separate token.
4542 Adjust all dependencies.
4543 Whereever actions with $ and @ are used, use translate_code.
4544 (action): Remove this nonterminal which is now useless.
4545 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
4546 (grammar_current_rule_action_append): Use translate_code.
4547 (packgram): Bound check ruleno, itemno, and rule_length.
4548 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
4549 (last_string, last_braced_code_loc, max_left_semantic_context)
4550 (scanner_initialize, scanner_free, scanner_last_string_free)
4551 (gram_out, gram_lineno, YY_DECL_): Move to...
4552 * src/scan-gram.h: this new file.
4553 (YY_DECL): Rename as...
4554 (GRAM_DECL): this.
4555 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
4556 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4557 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4558 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4559 Move these declarations, and...
4560 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
4561 these to...
4562 * src/flex-scanner.h: this new file.
4563 * src/scan-gram.l (rule_length, rule_length_overflow)
4564 (increment_rule_length): Remove.
4565 (last_braced_code_loc): Rename as...
4566 (gram_last_braced_code_loc): this.
4567 Adjust to the changes of the parser.
4568 Move all the handling of $ and @ into...
4569 * src/scan-code.l: here.
4570 * src/scan-gram.l (handle_dollar, handle_at): Remove.
4571 (handle_action_dollar, handle_action_at): Move to...
4572 * src/scan-code.l: here.
4573 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
4574 scan-code.h, scan-code-c.c, scan-gram.h.
4575 (EXTRA_bison_SOURCES): Add scan-code.l.
4576 (BUILT_SOURCES): Add scan-code.c.
4577 (yacc): Be robust to white spaces.
4578
4579 * tests/conflicts.at, tests/input.at, tests/reduce.at,
4580 * tests/regression.at: Adjust the column numbers.
4581 * tests/regression.at: Adjust the error message.
7891a7c4 4582
184e42f0
JD
45832006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4584
4585 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4586 Use Akim's wording from
4587 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
4588
7891a7c4
JD
45892006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4590
4591 Between Bison releases, manually append `+' to the previous Bison
4592 release number, and use that as a signal to automatically print the
4593 ChangeLog's CVS Id keyword from --version. Discussed starting at
4594 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
4595 * ChangeLog: Add Id header.
4596 * configure.ac (AC_INIT): Append `+' to `2.3'.
4597 * src/.cvsignore: Add revision.c.
4598 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
4599 (BUILT_SOURCES): Add revision.c.
4600 (revision.c): New target rule. This file defines a new global variable
4601 named revision. It initializes it with either the Id from ChangeLog
4602 or, if VERSION doesn't contain `+', with the empty string.
4603 * src/getargs.c (version): Print the value of revision.
4604 * src/revision.h: Extern revision.
4605
4ad3ed84
PE
46062006-06-05 Paul Eggert <eggert@cs.ucla.edu>
4607
4608 * NEWS: Version 2.3.
4609 * configure.ac (AC_INIT): Likewise.
4610
02103984
PE
46112006-05-30 Paul Eggert <eggert@cs.ucla.edu>
4612
4613 * data/glr.c (YYRECOVERING): Define to be a function-like macro
4614 with no arguments, not as an object-like macro. This is for
4615 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
4616 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
4617 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
4618 Document this.
4619
2c08afa5
JD
46202006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
4621
4622 * src/getargs.c (usage): Back out yesterday's modification of the
4623 --help output so that we don't have to wait for translation before
4624 releasing 2.3.
4625
6077da58
PE
46262006-05-29 Paul Eggert <eggert@cs.ucla.edu>
4627
4628 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
4629 Problem reported by Akim Demaille.
4630
2a26b6c2
JD
46312006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4632
4633 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4634
aefef0d6
PE
46352006-05-26 Paul Eggert <eggert@cs.ucla.edu>
4636
4637 * data/yacc.c (yy_reduce_print): Omit trailing white space in
4638 generated source code. Problem reported by Frans Englich in
4639 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
4640
fcd8e201
PE
46412006-05-22 Paul Eggert <eggert@cs.ucla.edu>
4642
4643 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
4644 shell, not within 'make', so that 'make' by an ordinary builder
4645 (using GNU make) does not worry about configuring gzip. This also
4646 works around a bug reported independently by Keith Thompson and by
4647 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
4648 stderr rather than stdout, messing up the build logs.
4649
7b5cdcbd
JD
46502006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4651
4652 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
4653 to make sure that YYID will never be unused. This fixes a 'make
4654 maintainer-check' failure caused by the recent changes to the 'Trivial
4655 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
4656 not used.
4657 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
4658
5ad0a449
JD
46592006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4660
4661 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
4662 state before an empty RHS is always resolved here. Only the location
4663 of that state is guaranteed to be resolved, and that's enough. This
4664 fixes the remaining bug reported by Derek M. Jones in
4665 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4666 * tests/glr-regression.at (Uninitialized location when reporting
4667 ambiguity): Test the above case.
4668 Also, the embedded comments in this test case claim it checks the case
4669 of an empty RHS that has inherited the initial location. However, the
4670 corresponding LHS was already resolved, so yyresolveLocations didn't
4671 actually have reason to modify it. Fix this by forcing
4672 nondeterministic operation at the beginning of the parse.
4673
50cce58e
PE
46742006-05-20 Paul Eggert <eggert@cs.ucla.edu>
4675
4676 * data/c.m4 (b4_yy_symbol_print_generate):
4677 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
4678 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
4679 of the bugs reported today by Derek M Jones in
4680 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4681 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
4682 defined to be a type name without parens or brackets.
4683 (Location Type): Similarly for YYLTYPE.
4684 * tests/regression.at (Trivial grammars): Put in a test for this
4685 bug that will be caught by 'make maintainer-check' (though not,
4686 alas, by 'make check' unless your compiler is picky).
4687
ab8d9dc5
PE
46882006-05-19 Paul Eggert <eggert@cs.ucla.edu>
4689
0d2c8934 4690 * NEWS: Version 2.2.
ab8d9dc5
PE
4691 * configure.ac (AC_INIT): Likewise.
4692
9138c575
JD
46932006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
4694
4695 * data/glr.c (yyreportTree): Make room in yystates for the state
4696 preceding the RHS. This fixes the segmentation fault reported by Derek
4697 M. Jones in
4698 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
4699 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
4700 to the user. Reported for yyreportTree by Derek M. Jones later in the
4701 same thread.
4702 * THANKS: Add Derek M. Jones.
4703 Update my email address.
4704 Fix typo in Steve Murphy's name.
4705
276f48df
PE
47062006-05-14 Paul Eggert <eggert@cs.ucla.edu>
4707
d6645148
PE
4708 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
4709 checking against YYLAST that caused the parser to miss a potential
4710 alternative in its diagnostic.
4711 Problem reported by Maria Jose Moron Fernandez in
4712 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
4713 * data/lalr1.cc (yysyntax_error_): Likewise.
4714 * data/yacc.c (yysyntax_error): Likewise.
4715 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
4716 tokens, in case we run into an older C compiler.
4717 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
4718 Use them to check for the off-by-one error fixed above.
4719
276f48df
PE
4720 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
4721 YYSIZE_T, not size_t.
4722 * tests/regression.at (Trivial grammars): New test, to catch
4723 the error fixed by the above patch.
4724
cd8b5791
AD
47252006-05-14 Akim Demaille <akim@lrde.epita.fr>
4726
4727 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
4728 scheme.
4729 Reported by Steve Murphy.
4730
34376418
AD
47312006-05-14 Akim Demaille <akim@lrde.epita.fr>
4732
4733 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
4734 * data/glr.cc: b4_location_flag is now b4_locations_flag.
4735
327afc7c
AD
47362006-05-14 Akim Demaille <akim@lrde.epita.fr>
4737
4738 Implement --trace=m4.
4739 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
4740 * src/output.c (output_skeleton): When set, pass -dV to m4.
4741
4742 Factor the handling of flags in m4.
4743 * src/output.c (prepare): Rename the muscle names debug, defines,
4744 error_verbose to debug_flag, defines_flag, error_verbose_flag.
4745 * data/c.m4: Adjust.
4746 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
4747 Use b4_define_flag_if to define other b4_FLAG_if macros.
4748 (b4_location_if): As a consequence, rename as...
4749 (b4_locations_if): this, for consistency.
4750 Adjust all the skeletons.
4751
ba9ecd19
AD
47522006-05-14 Akim Demaille <akim@lrde.epita.fr>
4753
4754 * etc/bench.pm: Shorten bench names.
4755
4e83ea15
AD
47562006-05-14 Akim Demaille <akim@lrde.epita.fr>
4757
4758 * src/output.h, src/output.c (error_verbose): Move to...
4759 * src/getargs.h, src/getargs.c: here.
4760 Sort the flags.
4761 Adjust dependencies.
4762
6e93d810
PE
47632006-05-13 Paul Eggert <eggert@cs.ucla.edu>
4764
4765 * data/c.m4 (b4_copyright): Put the special exception for Bison
4766 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
4767 uses changed. Suggested by Akim Demaille. Also, wrap the
4768 copyright notice, in case it is longer than 80 columns. Replace
4769 comma by newline after title.
6e93d810 4770
eaea13f5
PE
47712006-05-11 Paul Eggert <eggert@cs.ucla.edu>
4772
4773 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
4774 incompatibility, not a bug. Mention that it wasn't fixed as of
4775 flex 2.5.33.
4776
3cf084ec
AD
47772006-05-11 Akim Demaille <akim@lrde.epita.fr>
4778
4779 * examples/extexi: Enforce the precedence of concatenation over
4780 >>.
0a9f1c7d 4781 Reported by Tommy Nordgren.
3cf084ec 4782
32c96bd7
AD
47832006-05-11 Akim Demaille <akim@lrde.epita.fr>
4784
4785 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
4786 with the member "token".
f94705b2 4787 Reported by Martin Nylin.
32c96bd7 4788
eaea13f5
PE
47892006-05-08 Paul Eggert <eggert@cs.ucla.edu>
4790
4791 * data/glr.c: Switch to Bison 2.2 special-exception language in
4792 the copyright notice. Use more-regular format for titles and
4793 copyright notices.
4794 * data/glr.cc: Likewise.
4795 * data/location.cc: Likewise.
4796 * data/yacc.cc: Likewise.
4797 * doc/bison.texinfo (Conditions): Document this.
4798 * NEWS: likewise. Upgrade version to 2.2.
4799
6e2d1146
AD
48002006-04-27 Akim Demaille <akim@lrde.epita.fr>
4801
4802 * data/glr.cc: Remove dead code.
4803
47671055
PE
48042006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4805
4806 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4807 that variable and the line breaks the bootstrap. Problem reported
4808 by Juan M. Guerrero.
4809
ed2e6384
AD
48102006-04-24 Akim Demaille <akim@lrde.epita.fr>
4811
4812 * doc/bison.texinfo (Multiple start-symbols): New.
4813
3cedc2dc
AD
48142006-04-24 Akim Demaille <akim@lrde.epita.fr>
4815
4816 * etc/README, etc/bench.pl: New.
4817
b2ddc3f3
AD
48182006-04-03 Akim Demaille <akim@lrde.epita.fr>
4819
4820 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4821 rule.
4822 Reported by Mickael Labau.
4823 * tests/input.at (Torturing the Scanner): Test it.
4824
91e3ac9a
PE
48252006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4826
4827 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4828 Problem reported by Bob Rossi.
4829
48302006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4831
4832 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4833 and didn't really work.
4834 For the index, use @ifnotinfo, not @iftex.
4835 Minor cleanups of spacing and terminology.
4836
5cf61e93
AD
48372006-03-12 Akim Demaille <akim@lrde.epita.fr>
4838
4839 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4840 of AT_NAME_PREFIX when %name-prefix is not used.
4841
aa08666d
AD
48422006-03-12 Akim Demaille <akim@lrde.epita.fr>
4843
4844 Apply --prefix to C++ skeletons too: they change the namespace.
4845 The test suite already exercize these cases.
4846 * data/c++.m4 (b4_namespace): New.
4847 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4848 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4849 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4850 * doc/bison.texinfo: Document it.
4851 (Option Cross Key): Use @multitable in all formats. It looks
4852 nicer, even in TeX outputs.
4853 (Rules): Use the same code whatever the output type is.
4854 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4855 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4856 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 4857
45567173
AD
48582006-03-10 Akim Demaille <akim@lrde.epita.fr>
4859
4860 * TODO: Remove dead items.
4861
e9d8f881 48622006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
4863
4864 * doc/FAQ: Remove, merged into...
4865 * doc/bison.texinfo (FAQ): this.
4866 * doc/Makefile.am (EXTRA_DIST): Adjust.
4867
c095d689
AD
48682006-03-10 Akim Demaille <akim@lrde.epita.fr>
4869
4870 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4871 even if empty.
4872 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4873 * doc/bison.texinfo (Calc++ Scanner): Use it.
4874
6e0f8287
PE
48752006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4876
4877 Fix two nits reported by twlevo, plus one more that I discovered.
4878
4879 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4880 this is the usual Bison style.
4881 * src/location.h (location_print): Likewise.
4882
4883 * src/reader.h (token_name): Likewise.
4884
d6b771c3
PE
48852006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4886
4887 Fix some nits reported by twlevo.
4888 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4889 and "POSIX". Use more-modern syntax for URLs. Mention C++
4890 and ask for Java. Don't hardwire OS version numbers. Add
4891 copyright notice.
4892 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4893 * src/conflicts.c (solved_conflicts_obstack): Now static.
4894
1e137b71
JD
48952006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4896
4897 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4898 page. Say "you can use it" not "you may use it" as on the web page;
4899 we're describing capabilities not granting permission.
4900
73f2e47e
PE
49012006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4902
6d05403d
PE
4903 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4904 shadowing warnings. Use usual patter for iterating through RHS.
4905 * tests/glr-regression.at
4906 (Uninitialized location when reporting ambiguity):
4907 Modify yylex so that it uses its argument, rather than trying
4908 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4909 const char -> char const.
4910
73f2e47e
PE
4911 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4912 Don't use tabs inside commands; it messes up 'ps'.
4913 Problem reported by twlevo.
4914
8710fc41
JD
49152006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4916
4917 * tests/glr-regression.at (Uninitialized location when reporting
4918 ambiguity): New test case.
4919 * data/glr.c (yyresolveLocations): New function, which uses
4920 YYLLOC_DEFAULT.
4921 (yyresolveValue): Invoke yyresolveLocations before reporting an
4922 ambiguity.
4923 * doc/bison.texinfo (Default Action for Locations): Note
4924 YYLLOC_DEFAULT's usage for ambiguity locations.
4925 (GLR Semantic Actions): Cross-reference those notes.
4926
ae952af2
JD
49272006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4928
4929 * tests/glr-regression.at (Leaked semantic values when reporting
4930 ambiguity): Remove unnecessary union and type declarations.
4931 (Leaked lookahead after nondeterministic parse syntax error): New test
4932 case.
4933 * data/glr.c (yyparse): Check for zero stacks remaining before
4934 attempting to shift the lookahead so that you don't lose it.
4935
35ee866a
JD
49362006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4937
4938 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4939 * tests/glr-regression.at (Leaked semantic values when reporting
4940 ambiguity): New test case.
4941 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4942 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4943 now unnecessary yystackp parameter.
4944 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4945 destructors can be called.
4946
4947 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4948 in existing testcases.
4949
520181ab
JD
49502006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4951
4952 Don't leak semantic values for parent RHS when a user action cuts the
4953 parser, and clean up related code a bit.
4954 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
4955 cuts parse): Rename to...
4956 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
4957 for leaked parent RHS values.
4958 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4959 between an unresolved state (non-empty chain of semantic options) and
4960 an incomplete one (signaled by an empty chain).
ae952af2 4961 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
4962 successfully or unsuccessfully resolved yyGLRState to...
4963 (yyresolveValue): ... here so that yyresolveValue always leaves a
4964 yyGLRState with consistent data and thus is easier to understand.
4965 Remove the yyvalp and yylocp parameters since they are always just
4966 taken from the yys parameter. When reporting a discarded merged value
4967 in debugging output, note that it is incompletely merged. Document the
4968 interface.
4969 (yyresolveAction): If resolving any of the RHS states fails, destroy
4970 them all rather than leaking them. Thus, as long as user actions are
4971 written to clean up the RHS correctly, yyresolveAction always cleans up
4972 the RHS of a semantic option. Document the interface.
4973
18d9185c
PE
49742006-02-27 Paul Eggert <eggert@cs.ucla.edu>
4975
4976 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
4977 led to a segmentation fault in GNU Pascal. Problem reported
4978 by Waldek Hebisch.
4979
841a7737
JD
49802006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
4981
4982 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
4983 mid-rule action inside a nonterminal symbol in order to declare a
4984 destructor for its semantic value.
4985
fc3f467f
PE
49862006-02-16 Paul Eggert <eggert@cs.ucla.edu>
4987
4988 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
4989 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
4990 __cplusplus && ! defined _STDLIB_H && !
4991 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
4992 defined free))]: Include <stdlib.h> rather than rolling our own
4993 declarations of malloc and free, to avoid problems with
4994 incompatible declarations (using 'throw') C++'s stdlib.h. This
4995 should fix Debian bug 340012
4996 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
4997 reported by Guillaume Melquiond.
4998
a3af26dd
PE
49992006-02-13 Paul Eggert <eggert@cs.ucla.edu>
5000
4d7bc38c
PE
5001 * NEWS: Clarify symbols versus types in unused-value warnings.
5002
a3af26dd
PE
5003 * configure.ac (AC_INIT): Bump version number.
5004
4e26c69e
PE
50052006-02-13 Paul Eggert <eggert@cs.ucla.edu>
5006
5007 * NEWS: Version 2.1a.
5008 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
5009 since C99 requires this.
5010
498e897c
PE
50112006-02-11 Paul Eggert <eggert@cs.ucla.edu>
5012
5013 * m4/c-working.m4: New file.
5014 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
5015
57bb17ca
PE
50162006-02-10 Paul Eggert <eggert@cs.ucla.edu>
5017
5018 * Makefile.maint: Merge from coreutils.
5019
0be105dc
PE
50202006-02-09 Paul Eggert <eggert@cs.ucla.edu>
5021
5022 More portability fixes for problems summarized by Nelson H. F. Beebe.
5023
5024 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
5025 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
5026 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
5027 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
5028 messes up because C++ code is compiled in 32-bit mode but linked
5029 in 64-bit mode.
5030
6fc0c024
PE
50312006-02-08 Paul Eggert <eggert@cs.ucla.edu>
5032
5033 More portability fixes for problems summarized by Nelson H. F. Beebe.
5034
7870f699
PE
5035 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
5036 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
5037
6fc0c024
PE
5038 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
5039 nodist_PROGRAMS, since we don't need to actually compile the
5040 example if we're just doing a plain 'make'. This avoids bothering
5041 the installer unnecessarily about problems due to weird C++
5042 compilers.
5043
fe6c2fde
PE
50442006-02-06 Paul Eggert <eggert@cs.ucla.edu>
5045
5046 More portability fixes for problems summarized by Nelson H. F. Beebe.
5047
5048 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
5049 than #include "...", and compile with -I'.'. The old method was
5050 not portable, according to Posix and the C standard, and it does
5051 not work with Sun C 5.7, where previous #line directives affect
5052 the working directory used in later #include "..." directives.
5053
927b425b
JMG
50542006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5055
5056 Various DJGGP specific issues in /djgpp
5057
d9735e9e
PE
50582006-02-02 Paul Eggert <eggert@cs.ucla.edu>
5059
5060 More portability fixes for problems summarized by Nelson H. F. Beebe.
5061
5062 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
5063 '#include <map>' works and that you can apply ++ to iterators.
5064
5a6755af
PE
50652006-02-01 Paul Eggert <eggert@cs.ucla.edu>
5066
67a0dc4f
PE
5067 Work around portability problems summarized by Nelson H. F. Beebe in
5068 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
5069
8c86f0ef
PE
5070 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5071 that '#include <string>' works.
5072
de35dd59
PE
5073 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
5074 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
5075 "warning: sorry: semantics of inline function static data `const
5076 unsigned char translate_table[262]' are wrong (you'll wind up with
5077 multiple copies)".
5078
67a0dc4f
PE
5079 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
5080 or, xor to not_, and_, or_, and xor_, respectively. This works
5081 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
5082 random system header somewhere that includes the equivalent of
5083 <iso646.h>.
5084
5a6755af
PE
5085 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
5086 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 5087 Suite Version 2.0.
5a6755af 5088
3f001415
JD
50892006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
5090
5091 During deterministic GLR operation, user actions should be able to
5092 influence the parse by changing yychar. To make this easier to fix and
5093 to make glr.c easier to evolve in general, don't maintain yytoken in
5094 parallel with yychar; just compute yytoken when needed.
5095 * tests/glr-regression.at (Incorrect lookahead during deterministic
5096 GLR): Check that setting yychar in a user action has the intended
5097 effect.
5098 * data/glr.c (yyGLRStack): Remove yytokenp member.
5099 (yyclearin): Don't set *yytokenp.
5100 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
5101 yychar rather than *yytokenp to determine the current lookahead.
5102 Compute yytoken locally when needed.
5103 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
5104 point to.
5105
5106 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
5107 after `--report' documentation.
5108
e2a8c0f5
PE
51092006-01-30 Paul Eggert <eggert@cs.ucla.edu>
5110
5111 * src/parse-gram.y (grammar_declaration): Location of printer
5112 symbol is @1, not list->location. Bug reported by twlevo.
5113 * tests/input.at (Incompatible Aliases): Adjust to above change.
5114
6b702268
PE
51152006-01-29 Paul Eggert <eggert@cs.ucla.edu>
5116
27622431
PE
5117 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
5118 all the test at once. This makes the output easier to read in the
5119 normal case.
5120
6b702268
PE
5121 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
5122 got from <http://bro-ids.org/download.html>. The bug is that
5123 when two actions appeared in succession, the second one was
5124 scanned before the first one was added to the grammar rule
5125 as a midrule action. Bison then output the incorrect warning
5126 "parse.y:905.17-906.36: warning: unused value: $3".
5127 * src/parse-gram.y (BRACED_CODE, action): These are no longer
5128 associated with a value.
5129 (rhs): Don't invoke grammar_current_rule_action_append.
5130 (action): Invoke it here instead.
5131 * src/reader.c (grammar_midrule_action): Now extern.
5132 (grammar_current_rule_action_append): Don't invoke
5133 grammar_midrule_action; that is now the scanner's job.
5134 * src/reader.h (last_string, last_braced_code_loc):
5135 (grammar_midrule_action): New decls.
5136 * src/scan-gram.l (last_string): Now extern, sigh.
5137 (last_braced_code_loc): New extern variable.
5138 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
5139 rule already has an action.
5140 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
5141 * tests/input.at (AT_CHECK_UNUSED_VALUES):
5142 Add some tests to check that the above changes fixed the bug.
5143
d40ba6c2
PE
51442006-01-27 Paul Eggert <eggert@cs.ucla.edu>
5145
5146 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
5147 All used changed. Check whether the symbol has a destructor,
5148 not whether it is typed.
5149 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
5150 that the values are still reported as unused. All line numbers
5151 adjusted.
5152
401aace6
PE
51532006-01-23 Paul Eggert <eggert@cs.ucla.edu>
5154
5155 Work around a bug in bro 0.8, which underparenthesizes its
5156 definition of YYLLOC_DEFAULT.
5157 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
5158 their arguments.
5159 * data/lalr1.cc: Likewise.
5160 * data/yacc.cc: Likewise.
5161
06f01bc4
PE
51622006-01-22 Paul Eggert <eggert@cs.ucla.edu>
5163
401aace6
PE
5164 Work around a bug in Pike 7.0, and give the Pike folks a
5165 better way to override the usual int widths.
5166 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
5167 user can override the types.
5168 (short): #undef, to work around a bug in Pike 7.0.
5169 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
5170 (union yyalloc.yyss): Use yytype_int16 rather than short.
5171 All uses changed.
5172 (yysigned_char): Remove.
5173 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
5174 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
5175 * tests/regression.at (Web2c Actions): Adjust to above changes.
5176
5177 * src/reader.c (check_and_convert_grammar): New function.
5178 (reader): Close the input file even if something went wrong during
5179 parsing. Minor file descriptor leak reported by twlevo.
5180
06f01bc4
PE
5181 * src/assoc.c (assoc_to_string): Use a default: abort (); case
5182 to pacify gcc -Wswitch-default.
5183 * src/scan-gram.l (adjust_location): Use a default: break; case
5184 to pacify gcc -Wswitch-default.
5185 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
5186 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5187 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5188 Move these decls to scan-skel.l, since they don't need to be
5189 visible elsewhere.
5190 * src/scan-skel.l: Accept the above decls.
5191 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
5192 is used.
5193
02650b7f
PE
51942006-01-21 Paul Eggert <eggert@cs.ucla.edu>
5195
5196 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
5197 since we don't want to insist on a version number at the start
5198 of the changelog every time.
5199 * Makefile.maint: Sync from coreutils a bit better.
5200 (sc_trailing_blank): Renamed from sc_trailing_space.
5201 All uses changed.
5202 (sc_no_if_have_config_h, sc_require_config_h):
5203 (sc_prohibit_assert_without_use): New rules.
5204 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
5205 (sc_dd_max_sym_length): Fix leading spaces in rule.
5206 (sc_system_h_headers): Prefix with @.
5207 (sc_useless_cpp_parens, m4-check): Output line numbers.
5208 (changelog-check): Allow version only in head.
5209 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
5210 satisfy new Makefile.maint rule.
5211 * data/glr.c: Likewise.
5212 * data/glr.cc: Likewise.
5213 * data/lalr1.cc: Likewise.
5214 * data/yacc.c: Likewise.
5215 * lib/ebitsetv.c: Likewise.
5216 * lib/lbitset.c: Likewise.
5217 * lib/subpipe.c: Likewise.
5218 * lib/timevar.c: Likewise.
5219 * src/system.h: Likewise.
5220 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
5221 * djgpp/Makefile.maint: Add copyright notice.
5222 * djgpp/README.in: Likewise.
5223 * djgpp/config.bat: Likewise.
5224 * djgpp/config.site: Likewise.
5225 * djgpp/config_h.sed: Likewise.
5226 * djgpp/djunpack.bat: Likewise.
5227 * djgpp/config.sed: Fix copyright notice to match standard format.
5228 * djgpp/subpipe.h: Likewise.
5229 * lib/bitsetv-print.c: Likewise.
5230 * lib/bitsetv.c: Likewise.
5231 * lib/subpipe.h: Likewise.
5232 * lib/timevar.c: Likewise.
5233 * lib/timevar.h: Likewise.
5234 * djgpp/subpipe.c: Use standard recipe for config.h.
5235 * lib/abitset.c: Likewise.
5236 * lib/bitset.c: Likewise.
5237 * lib/bitset_stats.c: Likewise.
5238 * lib/bitsetv-print.c: Likewise.
5239 * lib/bitsetv.c: Likewise.
5240 * lib/ebitsetv.c: Likewise.
5241 * lib/get-errno.c: Likewise.
5242 * lib/lbitset.c: Likewise.
5243 * lib/subpipe.c: Likewise.
5244 * lib/timevar.c: Likewise.
5245 * lib/vbitset.c: Likewise.
5246 * tests/local.at: Likewise.
5247 * src/scan-gram.l: Don't include verify.h, since system.h does
5248 that for us.
5249 * .x-sc_require_config_h: New file.
5250 * .x-sc_unmarked_diagnostics: New file.
5251
287c78f6
PE
52522006-01-20 Paul Eggert <eggert@cs.ucla.edu>
5253
287c78f6
PE
5254 Be a bit more systematic about using 'abort'.
5255 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
5256 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
5257 Put 'default: abort ();' before some other case, to satisfy older
5258 pedantic compilers.
5259 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5260 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
5261 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
5262 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
5263 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
5264 (get_decision_str, get_orientation_str, get_node_alignment_str):
5265 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
5266 (get_linestyle_str, get_arrowstyle_str): Likewise.
5267 * src/conflicts.c (resolve_sr_conflict):
5268 Use a default case rather than one for the one remaining enum
5269 value, to catch invalid enum values as well.
5270 * src/lalr.c (set_goto_map, map_goto):
5271 Prefer "assert (FOO);" to "if (!FOO) abort ();".
5272 * src/nullable.c (nullable_compute, token_definitions_output):
5273 Likewise.
5274 * src/reader.c (packgram, reader): Likewise.
5275 * src/state.c (transitions_to, state_new, state_reduction_find):
5276 Likewise.
5277 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
5278 (symbol_pack): Likewise.
5279 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
5280 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
5281 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
5282 * src/system.h: Don't include <assert.h>.
5283 (assert): New macro.
5284
5285 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
5286 (Destructor Decl, Parser Function, Pure Calling):
5287 Describe rules for braces inside C code more carefully.
287c78f6 5288
c66dfadd
PE
52892006-01-19 Paul Eggert <eggert@cs.ucla.edu>
5290
c21493b8
PE
5291 Fix some porting glitches found by Nelson H. F. Beebe.
5292 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
5293 compilers that don't understand that abort () does not return.
5294 * src/state.c (transitions_to): Likewise.
5295 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5296 that '#include <cstdlib>' works.
5297 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
5298 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
5299 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
5300 for the benefit of some pre-C99 compilers.
5301
b6e3facf
PE
5302 * bootstrap: Undo changes to gnulib files that autoreconf made.
5303
c66dfadd
PE
5304 Minor fixups to get 'make maintainer-check' to work.
5305 * configure.ac: Don't use -Wnested-externs, as it's incompatible
5306 with the new verify.h implementation.
5307 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
5308 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
5309 * data/yacc.c (YYUSE): Likewise.
5310 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
5311 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
5312 * src/parse-gram.y (declaration): Don't pass a string constant
5313 to a function that expects char *, since GCC might complain
5314 about the constant value.
5315 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
5316 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
5317 before #defining them.
5318 * tests/glr-regression.at
5319 (Incorrectly initialized location for empty right-hand side in GLR):
5320 In yyerror, use the msg arg.
5321 (Corrupted semantic options if user action cuts parse):
5322 (Incorrect lookahead during deterministic GLR):
5323 (Incorrect lookahead during nondeterministic GLR):
5324 Don't name a local var 'index'; it shadows string.h's 'index'.
5325
ed94ef2a
AD
53262006-01-19 Akim Demaille <akim@epita.fr>
5327
5328 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
5329 location, not just parts of it.
5330
e9ad4aec
PE
53312006-01-18 Paul Eggert <eggert@cs.ucla.edu>
5332
d6ca7905
PE
5333 * NEWS: Document the fact that multiple %unions are now allowed.
5334 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
5335 * TODO: This feature is now implemented, so remove it from
5336 the wishlist.
d6ca7905 5337
ef1b70e0
PE
5338 * Makefile.maint: Merge with coreutils Makefile.maint.
5339 (CVS_LIST): Use build-aux version if available.
5340 (VERSION_REGEXP): New macro.
5341 (syntax-check-rules): Add sc_no_if_have_config_h,
5342 sc_prohibit_assert_without_use, sc_require_config_h,
5343 sc_useless_cpp_parens.
5344 (sc_obsolete_symbols): Check for O_NDELAY.
5345 (sc_dd_max_sym_length): Track coreutils.
5346 (sc_unmarked_diagnostics): Look in all files, not just *.c.
5347 (sc_useless_cpp_parens): New rule.
5348 (news-date-check): Look for version or today's date.
5349 (changelog-check): Don't require version number near head.
5350 (copyright-check): Use current year instead of hardwiring 2005.
5351 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
5352 (announcement): Add --gpg-key-ID.
5353
5354 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
5355 with "file system".
5356
2073ce56 5357 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
5358 array. Problem reported by twlevo.
5359 * src/reader.c (packgram): Prepend a new sentinel before ritem.
5360 * src/lalr.c (build_relations): Rely on new sentinel.
5361 * src/gram.c (gram_free): Adjust to new sentinel.
5362
b7691f15
JD
53632006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
5364
5365 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
5366 yylookaheadNeeds. All uses updated.
5367 (yysplitStack): Rename local yynewLookaheadStatuses to
5368 yynewLookaheadNeeds.
5369 * data/glr-regression.at (Incorrect lookahead during nondeterministic
5370 GLR): In comments, change `lookahead status' to `lookahead need'.
5371
ddee1b06
PH
53722006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5373
5374 * data/glr.c (yysplitStack): A little stylistic rewrite.
5375
12f4614d
PH
53762006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5377
5378 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
5379
32c29292
JD
53802006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
5381
5382 * doc/bison.texinfo: Fix some typos.
5383 (GLR Semantic Actions): New subsection discussing special
5384 considerations because GLR semantic actions might be deferred.
5385 (Actions): Mention look-ahead usage of yylval.
5386 (Actions and Locations): Mention look-ahead usage of yylloc.
5387 (Special Features for Use in Actions): Add YYEOF entry and mention it
5388 in the yychar entry.
5389 In the yychar entry, remove mention of the local yychar case (pure
5390 parser) since this is irrelevant information when writing semantic
148d66d8 5391 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
5392 yychar is otherwise described as an external variable.
5393 In the yychar entry, don't call it the `current' look-ahead since it
5394 isn't when semantic actions are deferred.
5395 In the yychar and yyclearin entries, add note about deferred semantic
5396 actions.
5397 Add yylloc and yylval entries discussing look-ahead usage.
5398 (Look-Ahead Tokens): When discussing yychar, don't call it the
5399 `current' look-ahead, and do mention yylval and yylloc.
5400 (Error Recovery): Cross-reference `Action Features' when mentioning
5401 yyclearin.
148d66d8 5402 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
5403 look-ahead.
5404 In the yylloc and yylval entries, mention look-ahead usage.
5405
de366a2f 54062006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
5407
5408 * tests/glr-regression.at: Update copyright year to 2006.
5409
bf70fa87
JD
54102006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5411
5412 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
5413 use during nondeterministic operation to track which stacks have
5414 actually needed the current lookahead.
5415 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
5416 Allocate, deallocate, resize, and otherwise shuffle space for
5417 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
5418 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
5419 appropriately during nondeterministic operation.
5420 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
5421 members to store the current lookahead to be used by the deferred
5422 user action.
5423 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
5424 from which the RHS is taken. Set the lookahead members of the new
5425 yySemanticOption according to the lookahead status for stack yyk.
5426 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
5427 yyaddDeferredAction.
5428 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
5429 members of yySemanticOption before invoking yyuserAction, and then set
5430 them back to their current values afterward.
5431 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
5432 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
5433 * tests/glr-regression.at: Remove `.' from the ends of recent test case
5434 titles for consistency.
5435 (Leaked merged semantic value if user action cuts parse): In order to
5436 suppress lint warnings, use arguments in merge function, and assign
5437 char value < 128 in main.
5438 (Incorrect lookahead during deterministic GLR): New test case.
5439 (Incorrect lookahead during nondeterministic GLR): New test case.
5440
05449a2c
JD
54412006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5442
de366a2f 5443 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
5444 !yyvaluep as signal that no semantic value is available to print.
5445 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
5446 to print a semantic value.
5447
4158e0a1 54482006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 5449
4158e0a1
JD
5450 * tests/glr-regression.at: For consistency with my newer test cases,
5451 don't thank myself.
5452
d659304d
JD
54532006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5454
5455 * data/glr.c (yyresolveValue): When merging semantic options, if at
5456 least one user action succeeds but a later one cuts the parse, then
5457 destroy the semantic value before returning rather than leaking it.
5458 (yyresolveStates): If a user action cuts the parse and thus
5459 yyresolveValue fails, ignore the (unset) semantic value rather than
5460 corrupting the yyGLRState, and empty the semantic options list since
5461 the user actions should have called all necessary destructors.
5462 Simplify code with YYCHK.
5463 * tests/glr-regression.at (Corrupted semantic options if user action
5464 cuts parse): New test case.
5465 (Undesirable destructors if user action cuts parse): New test case.
5466 Before applying any of this patch, this test case never actually failed
5467 for me... but only because the corrupted semantic options usually
5468 masked this bug.
5469 (Leaked merged semantic value if user action cuts parse): New test
5470 case.
5471
6ec2c0f2
AD
54722006-01-05 Akim Demaille <akim@epita.fr>
5473
5474 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
5475
1b9c21fb
PE
54762006-01-04 Paul Eggert <eggert@cs.ucla.edu>
5477
5478 * data/c.m4 (b4_c_modern): New macro, with a new provision for
5479 _MSC_VER. Problem reported by Cenzato Marco.
5480 (b4_c_function_def): Use it.
5481 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
5482 b4_c_modern.
5483 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
5484 than rolling our own.
5485
84866159
AD
54862006-01-04 Akim Demaille <akim@epita.fr>
5487
5488 Also warn about non-used mid-rule values.
5489 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
5490 member.
5491 (symbol_list_new): Adjust.
5492 * src/reader.c (symbol_typed_p): New.
5493 (grammar_rule_check): Use it.
5494 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
5495 Check its rule.
5496 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
5497 Use it.
5498 * tests/actions.at (Exotic Dollars): Adjust.
5499
378f4bd8
AD
55002006-01-04 Akim Demaille <akim@epita.fr>
5501
5502 * src/reader.c (grammar_midrule_action): If $$ is set in a
5503 mid-rule, move the `used' bit to its lhs.
5504 * tests/input.at (Unused values): New.
5505 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
5506
e2a21b6f
PE
55072006-01-03 Paul Eggert <eggert@cs.ucla.edu>
5508
54662697
PE
5509 * doc/bison.texinfo (Bison Options): Say more accurately what
5510 --yacc does.
5511 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
5512 about declarations in the grammar when in Yacc mode, as POSIX does
5513 not require a diagnostic when the grammar uses extensions.
5514
5515 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
5516
073f9288
PE
5517 Warn about dubious constructions like "%token T T".
5518 Reported by twlevo.
5519 * src/symtab.h (struct symbol.declared): New member.
5520 * src/symtab.c (symbol_new): Initialize it to false.
5521 (symbol_class_set): New arg DECLARING, specifying whether
5522 this is a declaration that we want to warn about, if there
5523 is more than one of them. All uses changed.
5524
1221b78a
PE
5525 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
5526 Allow multiple %union directives, whose contents concatenate.
5527 * src/parse-gram.y (grammar_declaration): Likewise.
5528 Use muscle_code_grow, so that we don't need stype_line any more.
5529 All uses changed.
5530
5531 * src/muscle_tab.c (muscle_grow): Fix comment.
5532
e2a21b6f
PE
5533 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
5534 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
5535 Update copyright year to 2006.
5536
8f7e3cf9
AD
55372006-01-03 Akim Demaille <akim@epita.fr>
5538
5539 Have glr.cc pass (some of) the calc.at tests.
5540 * data/glr.cc (b4_parse_param_orig): New.
5541 (b4_parse_param): Improve its definition, and bound it more
5542 clearly in the skeleton.
5543 (b4_epilogue): Append, instead of prepending, in order to keep
5544 #line consistency.
5545 Simplify the generation of auxiliary functions: locations and
5546 purity are mandated.
5547 (b4_global_tokens_and_yystype): Honor it.
5548 * data/location.cc (c++.m4): Don't include it.
5549 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
5550 and AT_SKEL_CC_IF.
5551 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
5552 AT_LALR1_CC_IF.
5553 Be sure to initialize the first position's filename.
5554 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
5555 mandated anyway.
5556 (AT_CHECK_CALC_GLR_CC): New.
5557 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
5558
3953ed88
AD
55592006-01-02 Akim Demaille <akim@epita.fr>
5560
5561 * src/output.c (output_skeleton): Don't hard wire the inclusion of
5562 c.m4.
0a96ba81 5563 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
5564 * data/glr.cc: Do not include stack.hh.
5565
9ecafbbf
AD
55662006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5567
5568 * data/glr.c: Reformat whitespace with tabs.
5569 (b4_lpure_formals): Remove this unused m4 macro.
5570 * tests/cxx-type.at: Reformat whitespace with tabs.
5571 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
5572 since it's a member. Rename type to isNterm for clarity.
5573
c4d497a0
AD
55742005-12-29 Akim <akim@sulaco.local>
5575
5576 Let glr.cc catch up with symbol_value_print.
5577 * data/glr.cc (b4_yysymprint_generate): Replace by...
5578 (b4_yy_symbol_print_generate): this.
5579 (yy_symbol_print, yy_symbol_value_print): Declare them.
5580
4517da37
PE
55812005-12-28 Paul Eggert <eggert@cs.ucla.edu>
5582
5583 * src/location.h (boundary): Note that a line or column equal
5584 to INT_MAX indicates an overflow.
5585 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
5586 (rule_length_overflow, increment_rule_length, add_column_width):
5587 New functions.
5588 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
5589 (<SC_BRACED_CODE>"}"):
5590 Use increment_rule_length rather than incrementing it by hand.
5591 (adjust_location, handle_syncline): Diagnose overflow.
5592 (handle_action_dollar, handle_action_at):
5593 Fix bug with monstrosities like $-2147483648.
5594 Remove now-unnecessary checks.
5595 (scan_integer): Verify assumptions and remove now-unnecessary checks.
5596 (convert_ucn_to_byte): Verify assumptions.
5597 (handle_syncline): New arg LOC. All callers changed.
5598 Don't store through a value derived from char const * pointer.
5599
5600 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
5601 GCC warnings.
5602
e3233bf6
PE
56032005-12-27 Paul Eggert <eggert@cs.ucla.edu>
5604
5605 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
5606 Remove unnecessary forward static decls.
5607
8f3596a6
AD
56082005-12-27 Akim Demaille <akim@epita.fr>
5609
5610 * src/reader.c (grammar_current_rule_check): Also check that $$
5611 is used.
5612 Take the rule to check as argument, hence rename as...
5613 (grammar_rule_check): this.
5614 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
5615 Rename as...
5616 (grammar_rule_begin, grammar_rule_end): these, for consistency.
5617 (grammar_midrule_action, grammar_symbol_append): Now static.
5618 * tests/torture.at (input): Don't rely on the default action
5619 being always performed.
5620 * tests/calc.at: "Set" $$ even when the action is "cut" with
5621 YYERROR or other.
5622 * tests/actions.at (Exotic Dollars): Instead of using unused
5623 values, check that the warning is issued.
5624
721be13c
PE
56252005-12-22 Paul Eggert <eggert@cs.ucla.edu>
5626
5627 * NEWS: Improve wording for unused-value warnings.
5628
a0af42fc
AD
56292005-12-22 Akim Demaille <akim@epita.fr>
5630
5631 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
5632 (b4_yysymprint_generate): Rename as...
5633 (b4_yy_symbol_print_generate): this.
5634 Generate yy_symbol_print instead of yysymprint.
5635 Generate also yy_symbol_value_print, and use it.
5636
affac613
AD
56372005-12-22 Akim Demaille <akim@epita.fr>
5638
721be13c 5639 * NEWS: Warn about unused values.
affac613
AD
5640 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
5641 a `used' member.
5642 (symbol_list_n_get, symbol_list_n_used_set): New.
5643 (symbol_list_n_type_name_get): Use symbol_list_n_get.
5644 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
5645 * src/reader.c (grammar_current_rule_check): Check that values are
5646 used.
5647 * src/symtab.c (symbol_print): Accept 0.
5648 * tests/existing.at: Remove the type information.
5649 Empty the actions.
5650 Remove useless actions (beware of mid-rule actions: perl -000
5651 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
5652 * tests/actions.at (Exotic Dollars): Use unused values.
5653 * tests/calc.at: Likewise.
5654 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5655 Likewise.
5656
5657 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
5658 rule_useful_p.
5659
9d9b8b70
PE
56602005-12-21 Paul Eggert <eggert@cs.ucla.edu>
5661
8bb4c753
PE
5662 Undo 2005-12-01 tentative license wording change. The wording is
5663 still being reviewed by the lawyers, and we don't want to wait for
5664 them before publishing a test release. For now, revert to the
5665 previous wording.
5666 * NEWS: Undo 2005-12-01 change.
5667 * data/glr.c: Revert to previous license wording.
5668 * data/glr.cc: Likewise.
5669 * data/lalr1.cc: Likewise.
5670 * data/location.cc: Likewise.
5671 * data/yacc.c: Likewise.
5672
9d9b8b70
PE
5673 * NEWS: Reword %destructor vs YYABORT etc.
5674 * data/glr.c: Use American spacing, for consistency.
5675 * data/glr.cc: Likewise.
5676 * data/lalr1.cc: Likewise.
5677 * data/yacc.c: Likewise.
5678 * data/yacc.c: Reformat comments slightly.
5679 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
5680 for consistency. Fix some spelling errors and reword recently-included
5681 text slightly.
5682 * tests/cxx-type.at: Cast results of malloc, for C++.
5683
2c3b392a
AD
56842005-12-21 Joel E. Denny <address@hidden>
5685
5686 * tests/cxx-type.at: Construct a tree, count the parents of shared
5687 nodes, and free each node once and only once. Previously, the memory
5688 for semantic values was leaked instead.
5689
d6cff4dc
AD
56902005-12-21 Joel E. Denny <address@hidden>
5691
5692 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
5693 (yylval, yylloc): If pure, #define to yystackp->yyval and
5694 yystackp->yyloc similar to yychar and yynerrs.
5695 (yyparse): If pure, remove local yylval and yylloc. Add local
5696 yystackp to accommodate pure definitions of yylval and yylloc.
5697 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
5698 yylvalp and yyllocp to &yylval and &yylloc.
5699 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
5700 namespace. Previously, nerrs and char were missing, but lval and lloc
5701 weren't necessary.
5702 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
5703 yylvalp and yyllocp parameters since, if pure, these are now always
5704 accessible through yystackp. If not pure, they are still accessible
5705 globally.
5706 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
5707 `if (YYID (N))' to pacify lint.
5708
a85284cf
AD
57092005-12-21 Akim Demaille <akim@epita.fr>
5710
5711 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
5712 destroy the RHS symbols of a rule.
5713 * data/yacc.c (yylen): Initialize to 0.
5714 Keep its value to the number of items to possibly shift.
5715 In particular, a regular successful parse that ends on YYFINAL by
5716 a (internal) YYACCEPT must not have yylen != 0.
5717 (yyerrorlab, yyreturn): Pop the RHS.
5718 Reorder a bit to emphasize the `shifting' bits of code.
5719 (YYPOPSTACK): Now accept a number of items to pop.
5720 * data/lalr1.cc: Likewise.
5721 * data/glr.c: Formatting changes.
5722 Use goto instead of fall through.
5723 * doc/bison.texinfo (Destructor Decl): Complete.
5724
d508c281
JMG
57252005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5726
5727 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5728 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
5729 * djgpp/config.bat: Replace every occurence of the file name
5730 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5731 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5732 * djgpp/config.sed: Replace every occurence of the file name
5733 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5734 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5735 * djgpp/djunpack.bat: DJGPP specific file.
5736 * djgpp/fnchange.lst: DJGPP specific file.
5737 * djgpp/README.in: Add new information about how to unpack the bison
5738 source on MSDOS and other systems which have 8.3 file name restrictions
5739 using djunpack.bat and fnchange.lst.
5740
3e7a2cd9
PE
57412005-12-12 Paul Eggert <eggert@cs.ucla.edu>
5742
5743 * bootstrap (build_cvs_prefix): Remove; unused.
5744 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
5745 when getting gnulib.
5746
57472005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
5748
5749 * data/glr.c: Reorder typedef declarations for structs to match order
5750 of struct declarations.
5751 Rename yystack everywhere to yystackp except in yyparse where it's not
5752 a pointer.
5753 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
5754 consistency.
5755 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
5756 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
5757 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
5758 lint.
5759
877519f8
PE
57602005-12-09 Paul Eggert <eggert@cs.ucla.edu>
5761
0eca5a39
PE
5762 * tests/sets.at (Accept): Fix typos in regular expression used to
5763 sed out the final state number.
5764
2cec9080
PE
5765 Work around portability problem on Solaris 10: flex-generated
5766 files include <stdio.h> before <config.h>, which messes up
5767 because the latter defines __EXTENSIONS__. Address the problem
5768 by creating two new little files that include <config.h> first,
5769 then include the flex-generated files. Rewrite everyone else
5770 to include <config.h> first, as well.
5771 * lib/timevar.c: Always include "config.h".
5772 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
5773 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
5774 (EXTRA_bison_SOURCES): New macro.
5775 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
5776 * src/system.h: Don't include config.h.
5777 * src/LR0.c: Include <config.h> first.
5778 * src/assoc.c: Likewise.
5779 * src/closure.c: Likewise.
5780 * src/complain.c: Likewise.
5781 * src/conflicts.c: Likewise.
5782 * src/derives.c: Likewise.
5783 * src/files.c: Likewise.
5784 * src/getargs.c: Likewise.
5785 * src/gram.c: Likewise.
5786 * src/lalr.c: Likewise.
5787 * src/location.c: Likewise.
5788 * src/main.c: Likewise.
5789 * src/muscle_tab.c: Likewise.
5790 * src/nullable.c: Likewise.
5791 * src/output.c: Likewise.
5792 * src/parse-gram.y: Likewise.
5793 * src/print.c: Likewise.
5794 * src/print_graph.c: Likewise.
5795 * src/reader.c: Likewise.
5796 * src/reduce.c: Likewise.
5797 * src/relation.c: Likewise.
5798 * src/state.c: Likewise.
5799 * src/symlist.c: Likewise.
5800 * src/symtab.c: Likewise.
5801 * src/tables.c: Likewise.
5802 * src/uniqstr.c: Likewise.
5803 * src/vcg.c: Likewise.
5804
877519f8
PE
5805 * src/parse-gram.y: Fix minor problems uncovered by lint.
5806 (current_lhs, current_lhs_location): Now static.
5807 (current_assoc): Remove unused variable.
5808
5809 Cleanups so that Bison-generated parsers have less lint.
5810 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5811 Prepend /*ARGSUSED*/, for lint's sake.
5812 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5813 definition if 'lint' is defined.
5814 (YYID): New macro (or function, if lint).
5815 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5816 * data/yacc.c: Likewise.
5817 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5818 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5819 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5820 is C++ only.
5821 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5822 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5823 Use YYID(0) rather than 0, for lint.
5824 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5825 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5826
f5228370
PE
58272005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5828
5829 * tests/glr-regression.at
5830 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5831 Close memory leak reported by twlevo.
5832
69ce078b
PE
58332005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5834
6ff99711
PE
5835 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5836 all stacks.
5837 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
5838 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5839 New test case.
5840 (Duplicated user destructor for lookahead): This test now is expected
5841 to succeed.
5842
af3412cd
PE
58432005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5844
32b5b719 5845 * NEWS: Document the following change.
af3412cd
PE
5846 * data/yacc.c: Say "parser skeleton" rather than "file", since
5847 it's no longer just a file.
5848 * data/glr.c: Grant a special exception for C GLR parsers, that
5849 reads like the already-existing exception for C LALR(1) parsers.
5850 * data/glr.cc: Likewise.
5851 * data/lalr1.cc: Likewise.
5852 * data/location.cc: Likewise.
5853 * data/yacc.c: Reword the "written by" statement to clarify that
5854 it was the parser skeleton, not the entire output file.
5855 * data/glr.c: Written by Paul Hilfinger.
5856 * data/glr.cc: Written by Akim Demaille.
5857 * data/lalr1.cc: Likewise.
5858
035aa4a0
PE
58592005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5860
d9963c85
PE
5861 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5862 Fix typos in previous change that broke 'make check'.
5863 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5864 supported in C.
5865 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5866 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5867 We can revert this once things settle down.
5868
035aa4a0
PE
5869 * src/conflicts.c (conflicts_print): Don't print file name twice
5870 when %expect fails because there were no conflicts.
5871 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5872 change.
5873 * tests/conflicts.at (%expect not enough, %expect too much):
5874 (%expect with reduce conflicts): Adjust to new behavior.
5875
58762005-11-18 Akim Demaille <akim@epita.fr>
5877
5878 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5879 errors.
5880 * NEWS: Document this.
5881 * doc/bison.texinfo (Expect Decl): Likewise.
5882
d1ff7a7c
AD
58832005-11-16 Akim Demaille <akim@epita.fr>
5884
5885 Generalize the display of semantic values and locations in traces.
5886 * data/glr.c (yy_reduce_print): Fix indices (again).
5887 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5888 literal integers.
5889 * data/lalr1.cc (yyreduce_print): Rename as...
5890 (yy_reduce_print): this.
5891 Display values and locations.
5892 * data/yacc.c (yy_reduce_print): Likewise.
5893 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5894 (yysymprint): Move higher to be visible from yy_reduce_print).
5895 (yyparse): Adjust.
5896 * tests/calc.at: Adjust the expected length of the traces.
5897
6de5398d
AD
58982005-11-14 Akim Demaille <akim@epita.fr>
5899
5900 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5901 from 1 to N, while values and location start at 0.
5902 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5903
a1373f55
AD
59042005-11-14 Akim Demaille <akim@epita.fr>
5905
5906 * data/glr.c (yy_reduce_print): Fix the $ number.
5907
613d8952
AD
59082005-11-14 Akim Demaille <akim@epita.fr>
5909
5910 "Use" parse parameters.
5911 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5912 * data/glr.c, data/glr.cc: Use them.
5913 * data/glr.c (YYUSE): Have a C++ definition that supports
5914 non-pointer types.
5915
b2741627
AD
59162005-11-14 Akim Demaille <akim@epita.fr>
5917
5918 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5919
5059b5c8
AD
59202005-11-14 Akim Demaille <akim@epita.fr>
5921
42249483
AD
5922 * data/glr.cc: New.
5923 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 5924
4626a15d
AD
59252005-11-12 Akim Demaille <akim@epita.fr>
5926
5927 Let position and location be PODs.
5928 * data/location.cc (position::initialize, location::initialize): New.
5929 (position::position, location::location): Define only if
5930 b4_location_constructors is defined.
5931 * data/lalr1.cc (b4_location_constructors): Define it for backward
5932 compatibility.
5933 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5934
59352005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
5936
5937 * data/lalr1.cc: Move the body of the ctor and dtor into the
5938 parser file (instead of the header).
5939 Wrap the implementations in a "namespace yy".
5940
59412005-11-12 Akim Demaille <akim@epita.fr>
5942
5943 Have glr.c include its header file when created.
5944 * data/glr.c (b4_shared_declarations): New.
5945 Output them verbatim in the parser if !%defines, otherwise
5946 output then in the header file, and include it instead.
5947
1989d947
AD
59482005-11-11 Akim Demaille <akim@epita.fr>
5949
5950 * data/glr.c: Comment changes.
5951
59522005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
5953
5954 When yydebug, report semantic and location values for reductions.
5955 * data/glr.c (yy_reduce_print): Report the semantic values and the
5956 locations.
5957 (YY_REDUCE_PRINT): Adjust.
5958 (yyglrReduce): Use them.
5959 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5960 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5961 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5962 traces.
5963
02998094
AD
59642005-11-10 Akim Demaille <akim@epita.fr>
5965
5966 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5967 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
5968 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
5969
5210672f
PE
59702005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
5971
5972 * m4/cxx.m4, examples/Makefile.am: Don't build
5973 examples/calc++ if no C++ compiler is available. (trivial change)
5974
a8991a1d
AD
59752005-11-09 Akim Demaille <akim@epita.fr>
5976
5977 * src/scan-skel.l: Use a couple of asserts.
5978
36b5e963
AD
59792005-11-03 Akim Demaille <akim@epita.fr>
5980
5981 In some (weird) cases, the final state number is incorrect.
5982 Reported by Alexandre Duret-Lutz.
5983 * src/LR0.c (state_list_append): Remove the computation of
5984 final_state.
5985 (save_reductions): Do it here.
5986 (get_state): Alpha conversion.
5987 (generate_states): Use a for loop.
5988 * src/gram.h (item_number_is_rule_number)
5989 (item_number_is_symbol_number): New.
5990 * src/state.c: Use assert.
5991 * src/system.h: Include assert.h.
5992 * tests/sets.at (Accept): New.
5993
44e7ead1
PH
59942005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5995
5996 * data/glr.c (yyfill): Adjust comment.
36b5e963 5997 (yyresolveAction): Initialize default location properly
44e7ead1
PH
5998 for empty right-hand sides.
5999 (yydoAction): Ditto.
6000 Add comment explaining apparently dead code.
36b5e963
AD
6001 * tests/glr-regression.at
6002 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 6003 New test.
36b5e963 6004
e10a80ee
PE
60052005-10-30 Paul Eggert <eggert@cs.ucla.edu>
6006
6007 * bootstrap (cleanup_gnulib): New function. Use it to clean up
6008 gnulib when interrupted. This fixes some race conditions and
6009 works around some portability problems (one noted by Paul
6010 Hilfinger).
6011
067b32ee
AD
60122005-10-22 Akim <akim@epita.fr>
6013
6014 * Makefile.cfg: Adjust to config -> build-aux.
6015 Reported by twledo.
6016
4b367315
AD
60172005-10-21 Akim Demaille <akim@epita.fr>
6018
6019 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
6020 the %parse-params.
6021 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
6022 * data/yacc.c (b4_Pure_if): Rename as...
6023 (b4_yacc_pure_if): this.
6024 (YY_SYMBOL_PRINT, yyparse): Adjust.
6025 * doc/bison.texinfo: Formatting changes.
6026
24cc23d9
AD
60272005-10-21 Akim Demaille <akim@epita.fr>
6028
6029 Finish the transition config -> build-aux.
6030 * configure.ac, Makefile.am: Use build-aux.
6031 * config/prev-version, config/announce-gen, config/Makefile.am:
6032 Move to...
6033 * build-aux/prev-version, build-aux/announce-gen,
6034 * build-aux/Makefile.am: here.
6035
d4476375
AD
60362005-10-14 Akim Demaille <akim@epita.fr>
6037
6038 * examples/calc++/test: Use set -x only when VERBOSE.
6039
302c0aee
PE
60402005-10-13 Paul Eggert <eggert@cs.ucla.edu>
6041
6042 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
6043 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
6044
7625ec2c
AD
60452005-10-13 Akim Demaille <akim@epita.fr>
6046
6047 * src/scan-skel.l: Output the base name parts of the parser and
6048 header file names.
302c0aee 6049 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
6050 additional checks.
6051 Use this to exercise C++ outputs in subdirs.
6052 Reported by Oleg Smolsky.
6053
ba0fe3c7
PE
60542005-10-12 Paul Eggert <eggert@cs.ucla.edu>
6055
6056 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
6057 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
6058 Problem reported by John P. Hartmann.
6059 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
6060 already defined it.
6061
9b8a5ce0
AD
60622005-10-12 Akim Demaille <akim@epita.fr>
6063
6064 * src/parse-gram.y (version_check): Exit 63 to please missing
6065 (stands for "version mismatch).
6066 * tests/input.at, doc/bison.texinfo: Adjust.
6067
4f6e011e
PE
60682005-10-10 Paul Eggert <eggert@cs.ucla.edu>
6069
6070 Work around portability problems with Visual Age C compiler
6071 (xlc and xlC_r) reported by John P. Hartmann.
6072 * data/location.cc (initial_column, initial_line): Remove.
6073 All uses replaced by 0 and 1.
6074 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
6075 that xlc complains about.
6076 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 6077 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 6078 as __STDC__.
4d7aa45e
PE
6079 * data/yacc.c (YYMODERN_C): New macro, which also looks at
6080 __STDC_VERSION__. Use it everywhere instead of looking at
6081 __STDC__ and __cplusplus.
4f6e011e 6082
a1b3bf8c
AD
60832005-10-10 Akim Demaille <akim@epita.fr>
6084
6085 * examples/calc++/test: Be quiet unless VERBOSE.
6086
412e44aa
PE
60872005-10-05 Paul Eggert <eggert@cs.ucla.edu>
6088
2a4647a3
PE
6089 * data/c.m4 (yydestruct, yysymprint):
6090 Use YYUSE instead of casting to void.
6091 * data/glr.c (YYUSE): New macro.
6092 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6093 Use it instead of rolling our own.
6094 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
6095 (YYCHK1):
6096 Use /*CONSTCOND*/ to suppress lint warnings.
6097 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
6098 (YY_STACK_PRINT): Use 'false' not '0'.
6099 (YYUSE): New macro.
6100 (yysymprint_, yydestruct_): Use it instead of rolling our own.
6101 * data/yacc.c (YYUSE): New macro.
6102 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
6103 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
6104 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
6105
6106
412e44aa
PE
6107 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
6108 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
6109
88c6637f
PE
61102005-10-04 Paul Eggert <eggert@cs.ucla.edu>
6111
2f4f028d
PE
6112 Undo the parts of the unlocked-I/O change that substituted
6113 putc or puts for printf. This might hurt performance a bit,
6114 but some people prefer the printf style.
6115 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
6116 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
6117 All uses replaced by YYFPRINTF and YYDPRINTF.
6118 * data/yacc.c: Likewise.
6119 * lib/bitset.c (bitset_print): Likewise.
6120 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
6121 putc and puts.
6122 * lib/lbitset.c (debug_lbitset): Likewise.
6123 * src/closure.c (print_firsts, print_fderives): Likewise.
6124 * src/gram.c (grammar_dump): Likewise.
6125 * src/lalr.c (look_ahead_tokens_print): Likewise.
6126 * src/output.c (escaped_output): Likewise.
6127 (user_actions_output): Break apart two printfs.
6128 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
6129 * src/reduce.c (reduce_print): Likewise.
6130 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
6131 * src/system.h: Include unlocked-io.h rathe than stdio.h.
6132
88c6637f
PE
6133 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6134 Use assignments rather than casts-to-void to suppress
6135 unused-variable warnings. This pacifies 'lint'.
6136 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
6137 unused-variable warnings.
6138
fb32e373
JMG
61392005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6140
6141 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
6142
edb8f44f
PE
61432005-10-02 Paul Eggert <eggert@cs.ucla.edu>
6144
fb9c0b33
PE
6145 Use unlocked I/O for a minor performance improvement on hosts like
6146 GNU/Linux and Solaris that support unlocked I/O. The basic idea
6147 is to use the gnlib unlocked-io module, and to prefer putc and
6148 puts to printf when either will work (since the latter doesn't
6149 come in an unlocked flavor).
6150 * bootstrap (gnulib_modules): Add unlocked-io.
6151 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
6152 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
6153 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
6154 and similarly for puts and putc and printf.
6155 * data/yacc.c: Likewise.
6156 * lib/bitset.c (bitset_print): Likewise.
6157 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
6158 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
6159 to printf.
6160 * lib/lbitset.c (debug_lbitset): Likewise.
6161 * src/closure.c (print_firsts, print_fderives): Likewise.
6162 * src/gram.c (grammar_dump): Likewise.
6163 * src/lalr.c (look_ahead_tokens_print): Likewise.
6164 * src/output.c (escaped_output): Likewise.
6165 (user_actions_output): Coalesce two printfs.
2f4f028d 6166 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
6167 * src/reduce.c (reduce_print): Likewise.
6168 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 6169 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 6170
edb8f44f
PE
6171 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
6172 this confuses xgettext.
6173
b50d2359
AD
61742005-10-02 Akim Demaille <akim@epita.fr>
6175
6176 * bootstrap (gnulib_modules): Add strverscmp.
6177 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
6178 * m4/.cvsignore: Add strverscmp.m4.
6179 * src/parse-gram.y (%require): New token, new rule.
6180 (version_check): New.
6181 * src/scan-gram.l (%require): Adjust.
6182 * tests/input.at (AT_REQUIRE): New.
6183 Use it.
6184 * doc/bison.texinfo (Require Decl): New.
6185 (Calc++ Parser): Use %require.
6186
21667f64
AD
61872005-10-02 Akim Demaille <akim@epita.fr>
6188
6189 * data/location.cc: New.
6190
2b81e969
AD
61912005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
6192 Akim Demaille <akim@epita.fr>
6193
6194 Make sure -odir/foo.cc creates dir/location.hh etc.
6195 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
6196 (spec_file_prefix, spec_verbose_file, spec_graph_file)
6197 (spec_defines_file): Now const.
6198 (dir_prefix): New.
6199 (short_base_name): Remove.
6200 * src/files.c: Adjust.
6201 (dirname.h): Include.
6202 (base_name): Don't prototype it.
6203 (finput): Remove, duplicates gram_in.
6204 (full_base_name, short_base_name): Replace by...
6205 (all_but_ext, all_but_tab_ext): these.
6206 (compute_base_names): Rename as...
6207 (compute_file_name_parts): this.
6208 Update to compute the new variables, including dir_prefix.
6209 Adjust dependencies.
6210 * src/output.c (prepare): Output them.
6211 * src/reader.c: Adjust to use gram_in, not finput.
6212 * src/scan-skel.l (@dir_prefix@): New.
6213
ad6a9b97
JMG
62142005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6215
6216 * lib/subpipe.c: New function end_of_output_subpipe() added
6217 to allow support for non-posix systems. This is a no-op function
6218 for posix systems.
6219
6220 * lib/subpipe.h: New function end_of_output_subpipe() added
6221 to allow support for non-posix systems. This is a no-op function
6222 for posix systems.
6223
6224 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
6225 handle the lack of pipe/fork functionality on non-posix systems.
6226
6227 * djgpp/Makefile.maint: DJGPP specific file.
6228
6229 * djgpp/README.in: DJGPP specific file.
6230
6231 * djgpp/config.bat: DJGPP specific configuration file.
6232
6233 * djgpp/config.sed: DJGPP specific configuration file.
6234
6235 * djgpp/config.site: DJGPP specific configuration file.
6236
6237 * djgpp/config_h.sed: DJGPP specific configuration file.
6238
6239 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
6240
6241 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
6242
fc695704
AD
62432005-10-02 Akim Demaille <akim@epita.fr>
6244
6245 * data/location.cc: New, extract from...
6246 * data/lalr1.cc: here.
6247 (location.hh): Include it after the user prologue, in case the
6248 filename type is defined by the user.
6249 Forward declation location and position before the pre-prologue.
6250 (yyresult_): Rename as...
6251 (yyresult): this, it's a local variable, not an attribute.
6252 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
6253
62542005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
6255
6256 * examples/extexi: Restore the #line generation.
6257
fb9712a9
AD
62582005-09-30 Akim Demaille <akim@epita.fr>,
6259 Alexandre Duret-Lutz <adl@gnu.org>
6260
6261 Move the token type and YYSTYPE in the parser class.
6262 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
6263 (parser::token): New, from the moved free definition of tokens.
6264 (parser::semantic_value): Now a full definition instead of an
6265 indirection to YYSTYPE.
6266 (b4_post_prologue): No longer included in the header file, but
6267 in the implementation file.
6268 * doc/bison.texi (C+ Language Interface): Update.
6269 * src/parse-gram.y: Support unary %define.
6270 * tests/actions.at: Define global_tokens_and_yystype for backward
6271 compatibility until we update the tests.
6272 * tests/calc.at: Idem.
6273 (first_line, first_column, last_line, last_column): Define for lalr1.cc
6274 to simplify the code.
6275
55f0c7b1
PE
62762005-09-29 Paul Eggert <eggert@cs.ucla.edu>
6277
6278 Port to SunOS 4.1.4, which lacks strtoul and strerror.
6279 Ah, the good old days! Problem reported by Peter Klein.
6280 * bootstrap (gnulib_modules): Add strerror, strtoul.
6281 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
6282 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
6283
fb9712a9 62842005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
6285
6286 * data/c.m4 (b4_error_verbose_if): New.
6287 * data/lalr1.cc: Use it.
6288 (YYERROR_VERBOSE_IF): Remove.
6289 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
6290 parser members, replaced by...
6291 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
6292 local variables.
6293 (yysyntax_error_): Takes the state number as argument.
6294 (yyreduce_print_): Use the argument yyrule, not the former
6295 attribute yyn_.
6296
8a6f72f3
PE
62972005-09-26 Paul Eggert <eggert@cs.ucla.edu>
6298
6299 * bootstrap (gnulib_modules): Add verify.
6300 * lib/.cvsignore: Add verify.h.
6301 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
6302 * src/system.h (verify): Remove.
6303 Include verify.h instead.
6304 * src/tables.c (tables_generate): Use new API for 'verify'.
6305
0d50976f
PE
63062005-09-21 Paul Eggert <eggert@cs.ucla.edu>
6307
ebc3737e
PE
6308 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
6309 local variables whose names begin with 'yy'.
6310 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
6311 Trivial changes from Joel E. Denny.
6312
0d50976f
PE
6313 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
6314 it itself.
6315 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
6316 don't use alloca any more.
6317
6318 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
6319 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 6320 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
6321 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
6322 to match yacc.c, to test more hosts.
6323
a05b79df
PE
63242005-09-20 Paul Eggert <eggert@cs.ucla.edu>
6325
55289366
PE
6326 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
6327 doesn't affect behavior.
6328 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
6329 Solaris, AIX, MSC.
6330 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
6331 This works a bit better with glibc, if user code has already included
6332 stdlib.h.
6333 * doc/bison.texinfo (Bison Parser): Document that users can't
6334 arbitrarily use malloc and free for other purposes. Document
6335 that <alloca.h> and <malloc.h> might be included.
6336 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
6337 user must declare alloca.
6338
a05b79df
PE
6339 * HACKING (release): Forwarn the Translation Project about
6340 stable releses.
6341
3ab2ca22
AD
63422005-09-20 Akim Demaille <akim@epita.fr>
6343
6344 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
6345
a9739e7c
PE
63462005-09-19 Paul Eggert <eggert@cs.ucla.edu>
6347
a702593e
PE
6348 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
6349 (YYSTACK_ALLOC_MAXIMUM): Use it.
6350 (yysyntax_error): New function.
6351 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
6352 multiple syntax errors are reported, and alloca is being used.
6353 Instead, reallocate buffers twice as big each time, so that
6354 we waste at most half the allocated memory. Start with a small
6355 (128-byte) buffer that will suffice in most cases anyway.
6356 Use yysyntax_error to do most of the work.
6357
6358 * doc/bison.texinfo (Error Reporting, Table of Symbols):
6359 yynerrs is the number of errors reported, not the number of
6360 errors encountered.
6361
a9739e7c
PE
6362 * tests/glr-regression.at (Duplicated user destructor for lookahead):
6363 Mark it as expected to fail.
6364 Cast result of malloc; problem reported by twlevo@xs4all.nl.
6365 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
6366 Don't start user-code symbols with "yy", to avoid name space problems.
6367
f479c6c6
AD
63682005-09-19 Akim Demaille <akim@epita.fr>
6369
6370 Remove the traits, failed experiment.
6371 It never proved useful, and anyway because of the current
6372 definition, it was not possible to have several specialization of
6373 this traits, making it useless.
6374 * data/lalr1.cc (yy:traits): Remove.
6375 Inline its definitions in the parser class.
6376
e2586f82
AD
63772005-09-19 Akim Demaille <akim@epita.fr>
6378
6379 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
6380 least Mac OSX with a /usr/local install of gettext.
6381
2e8cf949
AD
63822005-09-19 Akim Demaille <akim@epita.fr>
6383
6384 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
6385 and yytoken for similarity with the other skeletons.
6386
c7fb0b90
AD
63872005-09-19 Akim Demaille <akim@epita.fr>
6388
4e26c69e 6389 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 6390
1bd0deda
PE
63912005-09-16 Paul Eggert <eggert@cs.ucla.edu>
6392
6393 * NEWS: Version 2.1.
6394
6395 * NEWS: Remove notice of yytname change, since it was never in an
6396 official release.
6397 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
6398 diagnostic.
6399 * src/output.c (prepare): Likewise.
6400 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
6401 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
6402 is not defined. This is an awful hack, but it's enough for now.
6403 All callers changed.
6404 * tests/glr-regression-at (make_value): Args are const pointers now,
6405 to avoid GCC warning.
6406 (Duplicated user destructor for lookahead): New test. Currently
6407 skipped. It fails on my host but I'm not sure it'll always fail.
6408
64092005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
6410
6411 * src/symtab.h (struct symbol): Declare the printer and destructor
6412 as const, to avoid accidental calls to free.
6413 (symbol_destructor_set, symbol_printer_set): Adjust.
6414 * src/symtab.c: Adjust.
6415
1bd0deda 64162005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
6417
6418 * data/c.m4 (b4_token_enums): New.
6419 (b4_token_defines): Rename as...
6420 (b4_token_enums_defines): this.
6421 (b4_token_defines): New, output only the #defines.
6422 * data/yacc.c, data/glr.c: Adjust.
6423 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
6424 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
6425 as default values.
6426
dbcdae2d
AD
64272005-09-16 Akim Demaille <akim@epita.fr>
6428
6429 * data/lalr1.cc (yylex_): Remove, inline its code.
6430 (yyreport_syntax_error_): Remove, replaced by...
6431 (yysyntax_error_): this which returns a string and leaves to the
6432 caller the call to the users' error function.
6433 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
6434 Move from members of the parser object...
6435 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
6436 to local variables of the parse function.
6437
70d8f291
AD
64382005-09-16 Akim Demaille <akim@epita.fr>
6439
6440 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
6441 since it's in Bison's name space.
6442
b47dbebe
PE
64432005-09-15 Paul Eggert <eggert@cs.ucla.edu>
6444
ae199bf1
PE
6445 * data/glr.c (yyresolveValue): Add default case to pacify
6446 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
6447
b47dbebe
PE
6448 * NEWS: Document when yyparse started to return 2.
6449 * doc/bison.texinfo (Parser Function): Document when yyparse
6450 returns 2.
6451
6452 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
6453 (b4_filename_type): Renamed back from b4_file_name_type. All uses
6454 changed.
6455 (class position): file_name -> filename (reverting). All uses changed.
6456
64572005-09-14 Paul Eggert <eggert@cs.ucla.edu>
6458
6459 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
6460 do anything if $@ exists. This reverts part of the 2005-07-07
6461 patch.
6462
00292f66
PE
64632005-09-11 Paul Eggert <eggert@cs.ucla.edu>
6464
6465 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
6466 contains obsolete information and isn't worth distributing as a
6467 separate file anyway.
6468 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
6469 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
6470 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
6471 (yyparse): Abort if user code uses longjmp to throw an unexpected
6472 value.
6473
a420f962
PE
64742005-09-09 Paul Eggert <eggert@cs.ucla.edu>
6475
00292f66
PE
6476 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
6477 Suggested by twlevo@xs4all.nl.
6478
127287e9
PE
6479 * data/glr.c (YYCHK1): Do not assume YYE is in range.
6480 This avoids a diagnostic from gcc -Wswitch-enum.
6481 Problem reported by twlevo@xs4all.nl.
6482
a420f962
PE
6483 * doc/bison.texinfo: Don't use "filename", as per GNU coding
6484 standards. Use "file name" or "file" or "name", depending on
6485 the context.
6486 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
6487 not to hack/foo.tab.c.
6488 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
6489 * data/glr.c: b4_filename -> b4_file_name.
6490 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
6491 All uses changed.
6492 (class position): filename -> file_name. All uses changed.
6493 * data/yacc.c: b4_filename -> b4_file_name.
6494 * lib/bitset.h: filename -> file_name in local vars.
6495 * lib/bitset_stats.c: Likewise.
6496 * src/files.c: Likewise.
6497 * src/scan-skel.l ("@output ".*\n): Likewise.
6498 * src/files.c (file_name_split): Renamed from filename_split.
6499 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
6500
65012005-09-08 Paul Eggert <eggert@cs.ucla.edu>
6502
6503 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
6504 to accommodate latest gnulib.
6505
6506 * tests/glr-regression.at (Duplicate representation of merged trees):
6507 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
6508
6509 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
6510 needed.
6511
42a6501d
PE
65122005-08-26 Paul Eggert <eggert@cs.ucla.edu>
6513
6514 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
6515 All uses changed. Invoke user destructor after an error during a
6516 split parse (trivial change from Joel E. Denny).
6517
6518 * tests/glr-regression.at
6519 (User destructor after an error during a split parse): New test case.
6520 Problem reported by Joel E. Denny in:
6521 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
6522
ef9a1faf
PE
65232005-08-25 Paul Eggert <eggert@cs.ucla.edu>
6524
5b4aaf78
PE
6525 * README-cvs: Give URLs for recommended tools.
6526 Mention Gzip version problem, and bootstrapping issues.
6527 Remove troubleshooting section, as it's somewhat obsolete.
6528
b5240ba5
PE
6529 * bootstrap (no_cache): New var, to accommodate different wget
6530 variants. Use it instead of '-C off'. Problem reported by
6531 twlevo@xs4all.nl.
6532
ef9a1faf
PE
6533 * data/glr.c (yydestroyStackItem): New function.
6534 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
6535 debugging information. Problem reported by Joel E. Denny.
6536
e6efa9da
AD
65372005-08-25 Akim Demaille <akim@epita.fr>
6538
6539 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
6540
adc90f13
PE
65412005-08-24 Paul Eggert <eggert@cs.ucla.edu>
6542
6543 * data/glr.c (yyrecoverSyntaxError, yyreturn):
6544 Don't invoke destructor on unresolved entries.
6545 * tests/glr-regression.at
6546 (User destructor for unresolved GLR semantic value): New test case.
6547 Problem reported by Joel E. Denny in:
6548 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
6549
f9315de5
PE
65502005-08-21 Paul Eggert <eggert@cs.ucla.edu>
6551
15d29c1f
PE
6552 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
6553 Add strnlen.c.
6554 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
6555 lib-prefix.m4, po.m4.
6556
dd5f2af2
PE
6557 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
6558 in yydestruct diagnostic, since it might not be an error.
6559 Problem reported by Joel Denny near end of
6560 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 6561 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
6562 * data/yacc.c (yyreturn): Likewise.
6563 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
6564
6565 * src/files.c: Remove obsolete FIXME comment.
6566
6567 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
6568 with the other templates, and to fix bogus run-on messages such
6569 as the one reported at the end of
6570 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6571 All callers changed to avoid the newline.
6572 (yyprocessOneStack): Output two lines rather than one, to accommodate
6573 the above change. This changes the debug output format slightly.
6574
f9315de5
PE
6575 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
6576 reported by Joel E. Denny in
6577 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
6578 (trivial change).
6579 * tests/glr-regression.at (Duplicate representation of merged trees):
6580 New test, from Joel E. Denny in:
6581 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
6582 * THANKS: Add Joel E. Denny.
6583
6584 * configure.ac (AC_INIT): Bump to 2.0c.
6585
04098407
PE
65862005-07-24 Paul Eggert <eggert@cs.ucla.edu>
6587
6588 * NEWS: Version 2.0b.
6589
ca5d2013
PE
6590 * Makefile.am (SUBDIRS): Put examples before tests, so that
6591 "make check" doesn't finish with "All 1 tests passed".
6592
3d54b576
PE
6593 * tests/regression.at (Token definitions): Don't rely on
6594 AT_PARSER_CHECK for data that contains backslashes. It currently
6595 uses 'echo', and 'echo' isn't portable if its argument contains
6596 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
6597 that the byte '\0xff' is not printable in the C locale; it is,
6598 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
6599 not printable, so use '\0x81' to test.
6600
d53ae497
PE
6601 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
6602 version of GCC, since the macro is used with non-GCC compilers.
6603
fc01665e
PE
6604 Fix core dump reported by Pablo De Napoli in
6605 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
6606 * tests/regression.at (Invalid inputs with {}): New test.
6607 * src/parse-gram.y (token_name): Translate type before using
6608 it as an index.
6609
04098407
PE
6610 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
6611 the user's name space. All uses changed to __attribute__
6612 ((__unused__)).
6613 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
6614 Add __attribute__ ((__noreturn__)).
6615
6616 * etc/clcommit: Remove. We weren't using it, and it failed
6617 "make maintainer-distcheck".
6618 * Makefile.maint: Merge from coreutils.
6619 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
6620 (syntax-check-rules): Change list of rules as described below.
6621 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
6622 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
6623 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
6624 (sc_trailing_space): New rules.
6625 (sc_xalloc_h_in_src): Remove.
6626 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
6627 (sc_space_tab, sc_error_exit_success, sc_changelog):
6628 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
6629 (makefile-check, po-check, author_mark_check):
6630 (makefile_path_separator_check, copyright-check):
6631 Use grep -n, to make it easier to find violations.
6632 Use CVS_LIST and CVS_LIST_EXCEPT.
6633 (header_regexp, h_re): Remove.
6634 (dd_c): New macro.
6635 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
6636 (my-distcheck): Use more-modern GCC flags.
6637 (signatures, %.asc): Remove.
6638 (rel-files, announcement): Remove signatures.
6639 Restore old updating code, even though we don't use it, so
6640 that we're the same as coreutils.
6641 (alpha, beta, major): Depend on news-date-check.
6642 Make the upload commands.
6643
6644 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
6645 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
6646 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
6647 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
6648 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
6649 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
6650 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
6651 * tests/sets.at: Likewise.
6652
6653 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
6654 we comment out the Autoconf version number.
6655 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
6656 it's error-prone and "make maintainer-distcheck" rejects it.
6657
6658 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
6659 Indent calls to "error" to pacify "make maintainer-distcheck",
6660 when the calls are not intended to be translated.
6661 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
6662
6663 * src/Makefile.am (DEFS): Use +=, to pacify
6664 "make maintainer-distcheck".
6665 (bison_SOURCES): Add scan-skel.h.
6666 (sc_tight_scope): New rule, from coreutils.
6667
6668 * src/files.c (src_extension, header_extension):
6669 Now static, not extern.
6670 * src/getargs.c (short_options): Likewise.
6671 * src/muscle_tab.c (muscle_table): Likewise.
6672 * src/parse-gram.y (current_class, current_type, current_prec):
6673 Likewise.
6674 * src/reader.c (grammar_end, previous_rule_end): Likewise.
6675 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
6676 * src/main.c (main): Cast bindtextdomain and textdomain calls to
6677 void, to avoid warning when NLS is disabled.
6678 * src/output.c: Include scan-skel.h.
6679 (scan_skel): Remove decl, since scan-skel.h does this.
6680 (output_skeleton):
6681 Indent calls to "error" to pacify "make maintainer-distcheck".
6682 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
6683 * src/reader.h (gram_end, gram_lineno): New decls to pacify
6684 "make maintainer-distcheck".
6685 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
6686 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
6687 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
6688 (skel_lex_destroy, scan_skel): Move these decls to...
6689 * src/scan-skel.h: New file.
6690 * src/uniqstr.c (uniqstr_assert):
6691 Indent calls to "error" to pacify "make maintainer-distcheck".
6692
6693 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
6694 not @VAR@.
6695
6696 * tests/torture.at: Revamp to avoid misuse of atoi that
6697 "make maintainer-distcheck" complained about.
6698
6699 * examples/extexi (message): Don't print a message more than once,
6700 and omit line-number decoration that makes Emacs compile think
6701 that informative messages are worth worrying about.
6702
67032005-07-22 Paul Eggert <eggert@cs.ucla.edu>
6704
6705 * configure.ac: Update version number.
6706
6707 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
6708 accidentally.
6709 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
6710 autogenerated by the maintainer.
6711 * examples/calc++/.cvsignore: Add *.yy.
6712
6713 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
6714 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6715 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6716
6717 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
6718
6719 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
6720 from maintainer-distcheck about casting the argument of 'free'.
6721
6722 * NEWS: Mention recent yytname changes.
6723 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
6724
6725 * bootstrap: For translations that have not yet been upgraded to
6726 the new runtime-po domain, prime the pump by extracting the
6727 relevant strings from the obsolete translations. This code can be
6728 removed once the bison-runtime domain has been translated by each
6729 team.
6730
6731 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
6732 now that token names are already quoted.
6733
6734 Fix problem reported by Anthony Heading.
6735 * data/glr.c (YYTOKEN_TABLE): New macro.
6736 (yytname): Define if YYTOKEN_TABLE.
6737 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
6738 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
6739 (YYERROR_VERBOSE): Define the same way the other skeletons do.
6740 * src/output.c (prepare_symbols): Output token_table_flag.
6741
0ffda363
PE
67422005-07-21 Paul Eggert <eggert@cs.ucla.edu>
6743
6744 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
6745 again if the first call fails.
6746
6747 * data/glr.c (yytnamerr): New function.
6748 (yyreportSyntaxError): Use it to dequote most string literals.
6749 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
6750 with other skeletons. All uses changed.
6751 (yytnameerr_): New function.
6752 (yyreport_syntax_error): Use it to dequote most string literals.
6753 * data/yacc.c (yytnamerr): New function.
6754 (yyerrlab): Use it to decode most string literals.
6755 * doc/bison.texinfo (Decl Summary, Calling Convention):
6756 Clarify quoting convention of yytname.
6757 * src/output.c (prepare_symbols): Quote all names. This undoes
6758 the 2005-04-17 change, which is now accomplished (mostly) via
6759 changes in the parsers as described above.
6760 * tests/regression.at (Token definitions, Web2c Actions):
6761 Undo most 2005-04-17 change here, too.
6762
67632005-07-20 Paul Eggert <eggert@cs.ucla.edu>
6764
6765 Fix more problems reported by twlevo@xs4all.nl.
6766 * tests/cxx-type.at: Don't pipe output of ./types through sed to
6767 remove trailing spaces. This loses the exit status of ./types,
6768 and isn't needed since ./types shouldn't be emitting trailing
6769 spaces.
6770 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
6771 as the stack isn't valid in that case.
6772
6773 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6774 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6775 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6776 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
6777 is used.
6778 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
6779 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6780 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6781 Likewise.
6782
6783 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
6784 overly-picky compilers that reject 'char *foo = "bar";'.
6785
6786 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
6787 to FILE * parameter, not to stderr. This fixes a typo introduced
6788 in the 2005-07-12 change.
6789
6790 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
6791 warnings from GCC 4.
6792
6793 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
6794 (yyglrShiftDefer, yysplitStack):
6795 Remove unused parameters b4_pure_formals. All uses changed.
6796 (yyglrShift): Remove unused parameters b4_user_formals.
6797 All uses changed.
6798 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6799
6100a9aa
PE
68002005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6801
258b75ca
PE
6802 Destructor cleanups and regularization among the three skeletons.
6803 * NEWS: Document the behavior changes.
6804 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6805 stack before failing, as the cleanup code will do it for us now.
6806 * data/lalr1.cc (yyerrlab): Likewise.
6807 * data/glr.c (yyparse): Pop everything off the stack before
6808 freeing it, so that destructors get called properly.
6809 * data/lalr1.cc (yyreturn): Likewise.
6810 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6811 This is more consistent.
6812 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6813 why destructors might be called. 1.875 -> 2.1.
6814 (Destructor Decl, Decl Summary, Table of Symbols):
6815 Some English-language cleanups for %destructor.
6816 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6817 Add output line for destructor of start symbol.
6818 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6819 because of that same extra output line.
6820
1a059451
PE
6821 * NEWS: Document minor wording changes in diagnostics of
6822 Bison-generated parsers.
6823 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6824 Remove unused formals. All uses changed.
6825 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6826 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6827 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6828 Rename yyoverflowab to yyexhaustedlab.
6829 When memory exhaustion occurs during syntax-error reporting,
6830 report it separately rather than in a single diagnostic; this
6831 eases translation.
6832 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6833 (Memory Exhausted): Renamed from Parser Stack Overflow.
6834 Revamp wording slightly to prefer "memory exhaustion".
6835 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6836
97460c78
PE
6837 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6838
30757c8c
PE
6839 Add i18n support to the GLR skeleton. Partially fix the C++
6840 skeleton; a C++ expert needs to finish this. Remove debugging
6841 msgids; there's little point to having them translated, since they
6842 can be understood only by someone who can read the
6843 (English-language) source code.
6844
6845 Generate runtime-po/bison-runtime.pot automatically, so that we
6846 don't have to worry about garbage getting in that file. We'll
6847 make sure after the next official release that old msgids don't
6848 get lost. See
6849 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6850
6851 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6852 Now auto-generated.
6853 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6854 Fix typos in explanations of the runtime file.
6855 * bootstrap: Change gettext keyword from YYI18N to YY_.
6856 Use standard Makefile.in.in in runtime-po, since we'll arrange
6857 for backward-compatible bison-runtime.po files in a different way.
6858 * data/glr.c (YY_): New macro, from yacc.c.
6859 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6860 Translate messages intended for users.
6861 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6862 the wording in the other skeletons. We don't know that the memory
6863 is virtual.
6864 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6865 Use same method that yacc.c uses.
6866 Don't translate debugging messages.
6867 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6868 it doesn't work (yet), and requires C++ expertise to fix.
6869 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6870 Move defn to a more logical place, to be consistent with other
6871 skeletons.
6872 Don't translate debugging messages.
6873 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6874 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6875 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6876 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6877
ac8c5689
PE
6878 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6879 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6880 void, not int.
6881 * tests/glr-regression.at (Badly Collapsed GLR States):
6882 Likewise.
6883 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6884 yylex should return 0 at EOF rather than aborting.
6885
6100a9aa
PE
6886 Improve tests for stack overflow in GLR parser.
6887 Problem reported by twlevo@xs4all.nl.
6888 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6889 All uses removed.
6890 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6891 can handle the problem.
6892 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6893 (yyparse): New local variable yyresult to record the result.
6894 Use result of setjmp to set it, rather than storing itinto
6895 struct.
6896 (yyDone): Remove label.
6897 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6898 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6899 if YYABORT is used).
6900 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6901 yyparse status; put status > 1 into diagnostic.
6902 Check that status==2 works.
6903 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6904 Use exit status 3 for failure to open (which shouldn't happen).
6905
15f40952
PE
69062005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6907
67fd79c4
PE
6908 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6909 1 on syntax error; just let yyparse do its thing.
6910 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6911 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6912 (Exploding the Stack Size with Alloca):
6913 (Exploding the Stack Size with Malloc):
6914 Expect exit status 2, not 1, since the parser is supposed to blow
6915 its stack. Problem reported by twlevo@xs4all.nl.
6916
15f40952
PE
6917 * data/glr.c (yyparse): Don't assume that the initial calls
6918 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6919 Print a stack-overflow message and fail instead.
6920 Initialize the line-number information before creating the stack,
6921 so that the stack-overflow message can report line zero safely.
6922
f32c66b5
PE
69232005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6924
a22ff96f 6925 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
6926 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6927 (yyuserMerge): Provide a default case if b4_mergers is empty.
6928 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6929 * tests/glr-regression.at
6930 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 6931 Add casts to pacify C++ compilers.
1beb0b24
PE
6932 * tests/glr-regression.at (Improper merging of GLR delayed action
6933 sets): Declare yylex before using it.
f32c66b5 6934 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
6935 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6936 test for valgrind; valgrind is independent of g++.
6937 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6938 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6939 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6940 Use a destructor, so that we can expand the stack. Change
6941 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 6942
d741bd1b
PE
69432005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6944
6945 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6946 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6947
0410a6e0
PE
69482005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6949
6950 * PACKAGING: New file, suggested by Bruno Haible and taken from
6951 similar wording in gettext's PACKAGING file.
6952 * NEWS: Mention PACKAGING.
6953 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6954
f7ab6a50
PE
69552005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6956
baf785db 6957 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
6958 * bootstrap: Get runtime translations into runtime-po.
6959 Create runtime-po files automatically, if possible.
6960 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6961 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6962 does not infringe on the user's name space.
6963 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6964 * doc/bison.texinfo (Internationalization): Revamp the English
6965 and Texinfo syntax a bit, to try to make it clearer.
6966 (Bison Options, Option Cross Key): Mention --print-localedir.
6967 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
6968 YYENABLE_NLS. Quote a bit more.
6969 * runtime-po/.cvsignore: New file.
6970 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
6971 * runtime-po/Rules-quot: Remove; now created by bootstrap.
6972 * runtime-po/quot.sed: Likewise.
6973 * runtime-po/boldquot.sed: Likewise.
6974 * runtime-po/en@quot.header: Likewise.
6975 * runtime-po/en@boldquot.header: Likewise.
6976 * runtime-po/insert-header.sin: Likewise.
6977 * runtime-po/remove-potcdate.sin: Likewise.
6978 * runtime-po/Makevars: Likewise.
6979 * runtime-po/LINGUAS: Likewise.
6980 * runtime-po/de.po: Likewise; we will rely on the translation project
6981 to maintain this, so "bootstrap" should get it.
0410a6e0 6982 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
6983 its value.
6984 * src/main.c (main): Bind the bison-runtime domain, too.
6985
69862005-07-12 Bruno Haible <bruno@clisp.org>
6987
6988 * data/yacc.c: Include <libintl.h> when NLS is enabled.
6989 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
6990 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
6991 * runtime-po: New directory.
6992 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
6993 $(DOMAIN).pot-update rule, so that old messages are never dropped.
6994 * runtime-po/Rules-quot: New file, copied from po/.
6995 * runtime-po/quot.sed: Likewise.
6996 * runtime-po/boldquot.sed: Likewise.
6997 * runtime-po/en@quot.header: Likewise.
6998 * runtime-po/en@boldquot.header: Likewise.
6999 * runtime-po/insert-header.sin: Likewise.
7000 * runtime-po/remove-potcdate.sin: Likewise.
7001 * runtime-po/Makevars: New file.
7002 * runtime-po/POTFILES.in: New file.
7003 * runtime-po/LINGUAS: New file.
7004 * runtime-po/bison-runtime.pot: New file.
7005 * runtime-po/de.po: New file.
7006 * m4/bison.m4: New file.
7007 * Makefile.am (SUBDIRS): Add runtime-po.
7008 (aclocaldir, aclocal_DATA): New variables.
7009 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
7010 Define aclocaldir.
7011 * src/getargs.c (usage): Document --print-localedir option.
7012 (PRINT_LOCALEDIR_OPTION): New enum item.
7013 (long_options): Add --print-localedir option.
7014 (getargs): Handle --print-localedir option.
7015 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
7016 (Internationalization): New section.
7017
22dda0f0
AD
70182005-07-12 Akim Demaille <akim@epita.fr>
7019
7020 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
7021 for consistency with the rest of the code.
7022 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
7023 Add separators.
7024
82b248ad
AD
70252005-07-12 Akim Demaille <akim@epita.fr>
7026
7027 * src/parse-gram.y: Use %printer instead of YYPRINT.
7028
fa0e9314
AD
70292005-07-12 Akim Demaille <akim@epita.fr>
7030
867a3e00
AD
7031 * src/symtab.h, src/symtab.c (symbol_print): New.
7032 * src/symlist.h, src/symlist.c (symbol_list_print): New.
7033 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
7034
70352005-07-12 Akim Demaille <akim@epita.fr>
7036
7037 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
7038 b4_at_dollar and b4_dollar_dollar.
7039
e054b190
PE
70402005-07-11 Paul Eggert <eggert@cs.ucla.edu>
7041
7042 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
7043 and Pennello's paper.
7044
34160ec4
PE
70452005-07-09 Paul Eggert <eggert@cs.ucla.edu>
7046
407d4a75
PE
7047 * data/yacc.c (yyparse): Undo previous patch. Instead,
7048 set yylsp[0] and yyvsp[0] only if the initial action
7049 sets yylloc and yylval, respectively.
7050
34160ec4
PE
7051 * data/yacc.c (yyparse): In the initial action, set
7052 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
7053 This avoids the use of undefined variables if the initial
7054 action does not set yylloc and/or yylval.
7055
c3d5a4a7
PE
70562005-07-07 Paul Eggert <eggert@cs.ucla.edu>
7057
b34d96c1
PE
7058 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
7059 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
7060 Remove from CVS. These files are automatically generated.
7061 * examples/extexi: Clarify that this file is now part of Bison,
7062 not GNU M4, and that it works with any POSIX-compatible Awk.
7063 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
7064 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
7065 so that we also get calc++-parser.yy. Geneate it.
7066 Use $(AWK), not gawk, since any conforming Awk will do.
7067 Put comment before action, since older 'make' can't handle comment
7068 in action.
7069 $(BUILT_SOURCES): List all built sources, not just some of them.
7070 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
7071 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
7072 $($(calc_sources_generated)): Remove unnecessary test for existence
7073 of target. (This had a shell syntax error anyway; a stray "x".)
7074 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
7075 calc++-parser.yy.
7076 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
7077
c3d5a4a7
PE
7078 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
7079 implied by the other modules.
7080
828c373b
AD
70812005-07-06 Akim Demaille <akim@epita.fr>
7082
7083 Bind examples/calc++ to the package.
7084 * examples/calc++/Makefile: Remove, replaced by...
7085 * examples/calc++/Makefile.am: ... this new file.
7086 * examples/calc++/test: Remove input.
7087 * examples/calc++/compile: Remove.
7088 * examples/Makefile.am: New.
7089 * configure.ac, Makefile.am: Adjust.
7090 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
7091
63cb01d6
PE
70922005-07-05 Paul Eggert <eggert@cs.ucla.edu>
7093
fd2df2ed
PE
7094 * data/glr.c (yyFail): Drastically simplify; since the format argument
7095 never had any % directives, we can simply pass it to yyerror.
7096 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
7097 be modified later, as that is the usual style in glr.c.
7098 Problems reported by Paul Hilfinger.
7099
63cb01d6
PE
7100 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
7101 and size overflow errors.
7102 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
7103 in case the user prolog sets feature-test macros like _GNU_SOURCE.
7104 (YYSIZEMAX): New macro.
7105 (yystpcpy): New function, taken from yacc.c.
7106 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
7107 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
7108 so that we don't have to maintain their signatures.
7109 (yyFail): Check for buffer overflow, by using vsnprintf rather
7110 than vsprintf. Allocate a bigger buffer if possible.
7111 Report an error if buffer allocation fails.
7112 (yyStackOverflow): New function.
7113 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
7114 the initialization was successful. It might fail if storage was
7115 exhausted.
7116 (yyexpandGLRStack): Add more checks for storage allocation failure.
7117 Use yyStackOverflow to report failures.
7118 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
7119 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
7120 Don't assume stack number fits in int.
7121 (yysplitStack): Check for storage allocation failure.
7122 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
7123 can print diagnostics on storage allocation failure. All callers
7124 changed.
7125 (yyresolveValue): Use yybool for boolean.
7126 (yyreportSyntaxError): Check for size-calculation overflow.
7127 This code is taken from yacc.c.
7128 (yyparse): Check for storage allocation errors when allocating
7129 the initial stack.
7130
1c59e0a1
AD
71312005-07-05 Akim Demaille <akim@epita.fr>
7132
7133 Extract calc++ from the documentation.
7134 * doc/bison.texinfo (Calc++): Add the extraction marks.
7135 * examples/extexi: New, from the aborted GNU Programming 2E.
7136 Separate the different paragraph of a file with empty lines.
7137 * examples/Makefile: Use it to extract the whole calc++ example.
7138
8a0adb01
AD
71392005-06-24 Akim Demaille <akim@epita.fr>
7140
7141 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
7142 class typedefs.
7143
12545799
AD
71442005-06-22 Akim Demaille <akim@epita.fr>
7145
7146 * doc/bison.texinfo (C++ Language Interface): First stab.
7147 (C++ Parsers): Remove.
7148
99be0235
AD
71492005-06-22 Akim Demaille <akim@epita.fr>
7150
7151 * data/lalr1.cc (yylex_): Honor %lex-param.
7152
0ffd4fd1
AD
71532005-06-22 Akim Demaille <akim@epita.fr>
7154
7155 Start a set of simple examples.
7156 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
7157 * examples/calc++/calc++-driver.hh,
7158 * examples/calc++/calc++-parser.yy,
7159 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
7160 * examples/calc++/compile, examples/calc++/test: New.
7161
0925ebb4
PE
71622005-06-09 Paul Eggert <eggert@cs.ucla.edu>
7163
7164 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
7165 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
7166 which stems from the 2005-05-27 patch.
7167
43d3b664
PH
71682005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7169
7170 * data/glr.c: Modify treatment of unused parameters to permit use
7171 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
7172
3062864d
PE
71732005-05-30 Paul Eggert <eggert@cs.ucla.edu>
7174
7175 Fix infringement on user name space reported by Janos Zoltan Szabo.
7176 * data/yacc.c (yyparse): strlen -> yystrlen.
7177
989b5b8e
AD
71782005-05-30 Akim Demaille <akim@epita.fr>
7179
7180 * data/lalr1.cc (_): New.
7181 Translate the various messages.
7182
bedf57f5
PE
71832005-05-27 Paul Eggert <eggert@cs.ucla.edu>
7184
7185 Fix infringement on user name space reported by Bruno Haible.
7186 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
7187 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
7188 the user's name space.
7189 (alloca): Include <stdlib.h> to get it, if it's not built in.
7190 (YYMALLOC, YYFREE): Define only if needed.
7191 (malloc, free): Declare, but only if needed, as this infringes on
7192 the user name space.
7193
4d1801f1
PE
71942005-05-25 Paul Eggert <eggert@cs.ucla.edu>
7195
7196 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
7197 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
7198 with %d format.
7199 * lib/ebitset.c (min, max): Undef before defining.
7200 * lib/vbitset.c (min, max): Likewise.
7201 * lib/subpipe.c (create_subpipe): Save local variables in case
7202 vfork clobbers them.
7203
72042005-05-24 Bruno Haible <bruno@clisp.org>
7205
7206 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
7207 error message syntax used by gcc-4.0.
7208
b94a9e1e
PE
72092005-05-23 Paul Eggert <eggert@cs.ucla.edu>
7210
85ac3861
PE
7211 * README: Mention m4 1.4.3. Remove obsolete advice about
7212 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
7213
b94a9e1e
PE
7214 * bootstrap: Remove workaround for problem I encountered with
7215 gettext 0.14.1; it seems to be fixed now.
7216
51c30d21
PE
72172005-05-22 Paul Eggert <eggert@cs.ucla.edu>
7218
009ce67d
PE
7219 * NEWS: Version 2.0a.
7220
f2a97c62
PE
7221 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
7222 the previous change.
7223
c8775f93
PE
7224 Various maintainer cleanups.
7225 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
7226 conftest*, for benefit of CVS commands run at the same time as
7227 "configure". Add build-aux, since "bootstrap" now creates it and
7228 its subfiles.
7229 * Makefile.cfg (move_if_change): Remove.
7230 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
7231 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
7232 (po_repo, do-po-update, po-update, wget_files, get-targets):
7233 (config.guess-url_prefix, config.sub-url_prefix):
7234 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
7235 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
7236 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
7237 Remove.
7238 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
7239 this is now the recommended name.
7240 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
7241 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
7242 ylwrap. These files now go into build-aux.
7243 * config/move-if-change: Remove.
7244 * config/prev-version.txt: Bump from 1.75 to 2.0.
7245
3ea5f0ec
PE
7246 * bootstrap: Add stdio-safer, unistd-safer modules.
7247 Remove m4/glibc2.m4 (introduced by latest gnulib, but
7248 we don't need it).
7249 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
7250 fopen-safer.c, stdio-safer.h, unistd-safer.h.
7251 * lib/subpipe.c: Include "unistd-safer.h".
7252 (create_subpipe): Make sure all the newly-created
7253 file descriptors are > 2, so that diagnostics don't
7254 get sent down them (which might cause Bison to hang, in theory).
7255 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
7256 * src/files.c (xfopen): Use fopen_safer, not fopen.
7257
51c30d21
PE
7258 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
7259 yesterday's yacc.c fix.
7260
cea1469d
PE
72612005-05-21 Paul Eggert <eggert@cs.ucla.edu>
7262
3ea5f0ec
PE
7263 * data/glr.c, data/lalr1.cc: Update copyright date.
7264
cea1469d
PE
7265 Fix a destructor bug reported by Wolfgang Spraul in
7266 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
7267 * data/yacc.c (yyabortlab): Don't call destructor, and
7268 don't set yychar to EMPTY.
7269 (yyoverflowlab): Don't call destructor.
7270 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
7271 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
7272 since we no longer output the message "discarding lookahead token
7273 end of input ()".
7274
5e6f62f2
PH
72752005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7276
7277 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
7278 fix a small glitch in debugging output.
7279 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
7280 after YY_SYMBOL_PRINT where needed.
7281
7282 (struct yyGLRState): Add some comments.
7283 (struct yySemanticOption): Add some comments.
7284 (union yyGLRStackItem): Add comment.
7285
7286 (yymergeOptionSets): Correct this to properly perform the union,
7287 avoiding infinite reported by Michael Rosien.
7288 Update comment.
7289
7290 * tests/glr-regression.at: Add test for GLR merging error reported
7291 by M. Rosien.
cea1469d 7292
0fb669f9
PE
72932005-05-13 Paul Eggert <eggert@cs.ucla.edu>
7294
7295 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
7296 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
7297 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
7298 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
7299 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
7300 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
7301 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
7302 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
7303 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
7304 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
7305 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
7306 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
7307 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
7308 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
7309 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
7310 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
7311 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
7312 src/derives.h, src/files.c, src/files.h, src/getargs.c,
7313 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
7314 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
7315 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
7316 src/output.h, src/parse-gram.c, src/parse-gram.h,
7317 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
7318 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
7319 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
7320 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
7321 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
7322 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
7323 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
7324 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
7325 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
7326 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
7327 tests/reduce.at, tests/regression.at, tests/sets.at,
7328 tests/synclines.at, tests/testsuite.at, tests/torture.at:
7329 Update FSF postal mail address.
7330
51f4735e
PE
73312005-05-11 Paul Eggert <eggert@cs.ucla.edu>
7332
7333 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
7334 Problem reported by Ralf Menzel.
7335
80ce3401
PE
73362005-05-01 Paul Eggert <eggert@cs.ucla.edu>
7337
7338 * tests/actions.at: Test that stack overflow invokes destructors.
7339 From Marcus Holland-Moritz.
7340 * data/yacc.c (yyerrlab): Move the code that destroys the stack
7341 from here....
7342 (yyreturn): to here. That way, destructors are called properly
7343 even if the stack overflows, or the user calls YYACCEPT or
7344 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
7345 (yyoverflowlab): Destroy the lookahead.
7346
73472005-04-24 Paul Eggert <eggert@cs.ucla.edu>
7348
7349 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
7350
72f000b0
PE
73512005-04-17 Paul Eggert <eggert@cs.ucla.edu>
7352
7353 * NEWS: Bison-generated C parsers no longer quote literal strings
7354 associated with tokens.
7355 * src/output.c (prepare_symbols): Don't escape strings,
7356 since users don't want to see C escapes.
7357 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
7358 in diagnostics.
c19683bb 7359 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
7360 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
7361
1094323f
PE
73622005-04-16 Paul Eggert <eggert@cs.ucla.edu>
7363
7364 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
7365 the data size is known to be too small and we can't increase it.
7366 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
7367
ca407bdf
PE
73682005-04-15 Paul Eggert <eggert@cs.ucla.edu>
7369
7370 * src/parse-gram.y: Include quotearg.h.
7371 (string_as_id): Quote $1 before using it as a key, since the
7372 lexer no longer quotes it for us.
7373 (string_content): Don't strip quotes, since lexer no longer
7374 quotes it for us.
7375 * src/scan-gram.l: Include quotearg.h.
7376 ("\""): Omit quote.
7377 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
7378 a key, since the rest of the lexer doesn't quote it.
7379 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
7380 * tests/regression.at (Token definitions): Check for backslashes
7381 in token strings.
7382
7383 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
7384 (YYSIZE_T): Define to unsigned long int when using an older compiler.
7385 (yyparse): Revamp code to generate long syntax error message, to
7386 make it easier to translate, and to avoid problems with arithmetic
7387 overflow. Change "virtual memory" to "memory" in diagnostic, since
7388 we don't know whether the memory is virtual.
7389
1ce59070
PE
73902005-04-13 Paul Eggert <eggert@cs.ucla.edu>
7391
7392 * NEWS: Bison-generated C parsers now use the _ macro to
7393 translate strings.
7394 * data/yacc.c (_) [!defined _]: New macro.
7395 All English strings wrapped inside this macro.
7396 * doc/bison.texinfo (Bison Parser): Document _.
7397 * po/POTFILES.in: Include src/parse-gram.c, since it now
7398 includes translateable strings that parse-gram.y doesn't.
7399
a749a695
PE
74002005-04-12 Paul Eggert <eggert@cs.ucla.edu>
7401
7402 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
7403 reverting the 2004-10-11 change to this function.
7404 (symbol_check_alias_consistency): Don't call symbol_type_set
7405 if the type name is already correct.
7406 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
7407
8fb1053b
PE
74082005-03-25 Paul Eggert <eggert@cs.ucla.edu>
7409
7410 * tests/regression.at (Token definitions): Don't use a token named
7411 c, as that generates a "#define c ..." that runs afoul of buggy
7412 stdlib.h that uses the identifier c as a member of struct
7413 drand48_data. Problem reported by Horst Wente.
7414
ff498c4a
PE
74152005-03-21 Paul Eggert <eggert@cs.ucla.edu>
7416
7417 * bootstrap: Change translation URL from
7418 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
7419 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
7420 redirection glitches. Problem reported by twlevo@xs4all.nl.
7421
65211d70
PE
74222005-03-20 Paul Eggert <eggert@cs.ucla.edu>
7423
7424 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
7425 after operands; POSIX says this isn't portable for the c99 command.
7426
9577fb1f
PE
74272005-03-18 Paul Eggert <eggert@cs.ucla.edu>
7428
7429 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
7430 immediately if a data overrun has occurred; this may help us track
7431 down what may be a spurious failure on MacOS.
7432
78b178f7
PE
74332005-03-17 Paul Eggert <eggert@cs.ucla.edu>
7434
a2599d0f
PE
7435 Respond to problems reported by twlevo@xs4all.nl.
7436
7437 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
7438
78b178f7
PE
7439 * src/vcg.h: Comment fix.
7440 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
7441 (G_CMAX): Change to -1 instead of INT_MAX.
7442
7443 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 7444
7296e729
PE
74452005-03-15 Paul Eggert <eggert@cs.ucla.edu>
7446
7447 * src/tables.c (state_number_to_vector_number): Put it inside an
7448 "#if 0", since it's not currently used. Problem reported by
7449 Roland McGrath.
7450
05ac60f3
PE
74512005-03-06 Paul Eggert <eggert@cs.ucla.edu>
7452
7453 * src/output.c (escaped_output): Renamed from
7454 escaped_file_name_output, since we now use it for symbol tags as
7455 well. All uses changed.
7456 (symbol_destructors_output, symbol_printers_output):
7457 Escape symbol tags too.
7458 Problem reported by Matyas Forstner in
7459 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
7460
7461 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
7462 not needed.
7463 * src/output.c (user_actions_output, token_definitions_output,
7464 symbol_destructors_output, symbol_printers_output): Likewise.
7465 * src/reader.c (prologue_augment): Likewise.
7466 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
7467
7468 * src/vcg.c (output_edge): Don't quote linestyle arg.
7469 Problem reported by twlevo@xs4all.nl.
7470
7eb453ac
PE
74712005-02-28 Paul Eggert <eggert@cs.ucla.edu>
7472
7473 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
7474 example, reported by Derek M Jones. Also, make the example even
7475 more outrageous, to better illustrate how bad the problem is.
7476
4c04c52a
PE
74772005-02-24 Paul Eggert <eggert@cs.ucla.edu>
7478
7479 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
7480 putsym. Typo reported by Sebastian Piping.
7481
a61e1620
PE
74822005-02-23 Paul Eggert <eggert@cs.ucla.edu>
7483
7484 * doc/bison.texinfo (Language and Grammar): some -> same
7485 (Epilogue): int he -> in the
7486 Typos reported by Sebastian Piping via Justin Pence.
7487
9ec93868
PE
74882005-02-07 Paul Eggert <eggert@cs.ucla.edu>
7489
7490 * tests/glr-regression.at (Improper handling of embedded actions
7491 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
7492 embedded actions and $-N in GLR parsers", work around an Autoconf bug
7493 with dollar signs in test names.
7494 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
7495 for a similar reason.
7496
73ce7e7e
PE
74972005-01-28 Paul Eggert <eggert@cs.ucla.edu>
7498
7499 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
7500 wants to redefine G_VIEW.
7501
2e72b98e
PE
75022005-01-27 Paul Eggert <eggert@cs.ucla.edu>
7503
7504 * src/vcg.c (get_view_str): Remove case for normal_view.
7505 Problem reported by twlevo@xs4all.nl.
7506
e0d634e5
PE
75072005-01-24 Paul Eggert <eggert@cs.ucla.edu>
7508
ccf830a4
PE
7509 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
7510 Problem reported by twlevo@xs4all.nl.
7511
e0d634e5
PE
7512 * doc/bison.texinfo: Change @dircategory from "GNU programming
7513 tools" to "Software development". Requested by Richard Stallman
7514 via Karl Berry.
7515
7bbc8cb0
PE
75162005-01-23 Paul Eggert <eggert@cs.ucla.edu>
7517
7518 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
7519 Problem reported by twlevo@xs4all.nl.
7520
08b770bc
PE
75212005-01-21 Paul Eggert <eggert@cs.ucla.edu>
7522
7523 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
7524 keyword; it's not needed with modern compilers, and it doesn't
7525 affect correctness with older compilers. Suggested by
7526 twlevo@xs4all.nl.
7527
95f22ad2
PE
75282005-01-17 Paul Eggert <eggert@cs.ucla.edu>
7529
7530 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
7531 gcc -Wswitch-default.
7532 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7533 * data/yacc.c (yyparse): Likewise.
7534
d229d15c
PE
75352005-01-12 Paul Eggert <eggert@cs.ucla.edu>
7536
7537 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
7538 already. Let config.h define any nonstandard values.
7539
ecadd90f
PE
75402005-01-10 Paul Eggert <eggert@cs.ucla.edu>
7541
7542 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
7543 for the benefit of slower hosts. Problem reported by
7544 Nelson H. F. Beebe.
7545
213744b5
PE
75462005-01-07 Paul Eggert <eggert@cs.ucla.edu>
7547
7548 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
7549 being defined and not used.
7550 * data/lalr1.cc (yyparse): Likewise.
7551 Use "if (false)" rather than "if (0)".
7552
249d3236
PE
75532005-01-05 Paul Eggert <eggert@cs.ucla.edu>
7554
7555 * TODO: Mention that we should allow NUL bytes in tokens.
7556
987cc1fb
PE
75572005-01-02 Paul Eggert <eggert@cs.ucla.edu>
7558
7559 * src/scan-skel.l (<<EOF>>): Don't close standard output.
7560 Problem reported by Hans Aberg.
7561
08fe02d9
PE
75622005-01-01 Paul Eggert <eggert@cs.ucla.edu>
7563
7564 * src/getargs.c (version): Happy new year; update overall
7565 program copyright date from 2004 to 2005.
7566
7567 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
7568 Problem reported by Hans Aberg.
7569 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
7570 (Output file names.): Add a test for the case when standard output
7571 is closed.
7572
010c0266
PE
75732004-12-26 Paul Eggert <eggert@cs.ucla.edu>
7574
7575 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
7576 to fix an oversight in the Bison 2.0 manual.
7577
da12206a
PE
75782004-12-25 Paul Eggert <eggert@cs.ucla.edu>
7579
7580 * NEWS: Version 2.0. Reformat the existing news items since
7581 1.875, so that related items are grouped together.
3a4734aa 7582 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
7583 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
7584
c935d934
PE
7585 * tests/torture.at (Exploding the Stack Size with Alloca): Set
7586 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
7587 otherwise, we're not testing alloca. Unfortunately there's no
7588 simple way to consult HAVE_ALLOCA here.
7589
da12206a
PE
7590 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
7591 for yymsg, too.
7592
7593 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
7594 hand. This avoids a warning about comparing int to size_t when
7595 GCC warnings are enabled.
7596
0a2c5137
PE
75972004-12-22 Paul Eggert <eggert@cs.ucla.edu>
7598
d7e14fc0
PE
7599 * NEWS: Bison-generated parsers no longer default to using the
7600 alloca function (when available) to extend the parser stack, due
7601 to widespread problems in unchecked stack-overflow detection.
7602 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
7603 responsibility to set it to a positive value. This lets the user
7604 specify a value that is not a preprocessor constant.
7605 * data/yacc.c (YYMAXDEPTH): Likewise.
7606 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
7607 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
7608 to be a compile-time constant. However, explain the constraints on it.
7609 Also, explain the constraints on YYINITDEPTH.
7610 (Table of Symbols): Explain that alloca is no longer the default.
7611 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
7612 to 1.
7613
0a2c5137
PE
7614 * doc/bison.texinfo (Location Default Action): Mention that n must
7615 be zero when k is zero. Suggested by Frank Heckenbach.
7616
e019c247
AD
76172004-12-22 Akim Demaille <akim@epita.fr>
7618
7619 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
7620 (parser::state_type, parser::semantic_type, parser::location_type):
7621 Private, not public.
7622 (parser::parse): Return ints, not bool.
7623 Returning a bool introduces a problem: 0 corresponds to false, and
7624 it seems weird to return false on success. Returning true changes
7625 the conventions for yyparse.
7626 Alternatively we could return void and send an exception.
7627 There is no clear consensus (yet?).
7628 (state_stack, semantic_stack, location_stack): Rename as...
7629 (state_stack_type, semantic_stack_type, location_stack_type): these.
7630 Private, not public.
7631 * tests/c++.at: New.
7632 * tests/testsuite.at, tests/Makefile.am: Adjust.
7633
72731bb7
AD
76342004-12-21 Akim Demaille <akim@epita.fr>
7635
7636 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
7637
9a0d8bec
AD
76382004-12-21 Akim Demaille <akim@epita.fr>
7639
7640 Don't impose std::string for filenames.
7641
7642 * data/lalr1.cc (b4_filename_type): New.
7643 (position::filename): Use it.
7644 (parser.hh): Move the inclusion of stack.hh and location.hh below
7645 the user code, so that needed headers for the filename type can be
7646 included first.
72731bb7
AD
7647 Forward declare them before the user code.
7648 * tests/Makefile.am (check-local, installcheck-local): Pass
7649 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 7650
99880de5
AD
76512004-12-20 Akim Demaille <akim@epita.fr>
7652
7653 Use more STL like names: my_class instead of MyClass.
7654
7655 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
7656 (SemanticStack, SemanticType, StateStack, StateType)
7657 (TokenNumberType, Stack, Slice, Traits, Parser::location)
7658 (Parser::value): Rename as...
7659 (location_stack, location_type, rhs_number_type, semantic_stack)
7660 (semantic_type, state_stack, state_type, token_number_type, stack)
7661 (slice, traits, parser::yylloc, parser::yylval): these.
7662
7663 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
7664
9bec482e
PE
76652004-12-19 Paul Eggert <eggert@cs.ucla.edu>
7666
7667 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
7668 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7669
f6fbd3da
PE
76702004-12-17 Paul Eggert <eggert@cs.ucla.edu>
7671
7672 Remove uses of 'short int' and 'unsigned short int'. This raises
7673 some arbitrary limits. It uses more memory but nowadays that's
7674 not much of an issue.
7675
7676 This change does not affect the generated parsers; that's a different
7677 task, as some users will want to conserve memory there.
7678
7679 Ideally we should use size_t to represent all object counts, and
7680 something like ptrdiff_t to represent signed differences of object
7681 counts; but that will require more code-cleanup than I have the
7682 time to do right now.
7683
7684 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
7685 Use size_t, not int or short int, to count objects.
7686 * src/closure.c (nritemset, closure): Likewise.
7687 * src/closure.h (nritemset, closure): Likewise.
7688 * src/nullable.c (nullable_compute): Likewise.
7689 * src/print.c (print_core): Likewise.
7690 * src/print_graph.c (print_core): Likewise.
7691 * src/state.c (state_compare, state_hash): Likewise.
7692 * src/state.h (struct state): Likewise.
7693 * src/tables.c (default_goto, goto_actions): Likewise.
7694
7695 * src/gram.h (rule_number, rule): Use int, not short int.
7696 * src/output.c (prepare_rules): Likewise.
7697 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
7698 errs, reductions): Likewise.
7699 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
7700 Likewise.
7701 * src/tables.c (vector_number, tally, action_number,
7702 ACTION_NUMBER_MINIMUM): Likewise.
7703 * src/output.c (muscle_insert_short_int_table): Remove.
7704
efeed023
AD
77052004-12-17 Akim Demaille <akim@epita.fr>
7706
7707 * data/lalr1.cc: Extensive Doxygenation.
7708 (error_): Rename as...
7709 (error): this, since it is visible to the user.
7710 Adjust callers.
7711 (Parser::message): Now an automatic variable from...
7712 (Parser::yyreport_syntax_error_): here.
7713 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
7714 Parser::error.
7715 * tests/input.at: Escape $.
7716
bc82c5a5
PE
77172004-12-16 Paul Eggert <eggert@cs.ucla.edu>
7718
7719 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
7720 Parenthesize rhs to avoid obscure problems with mistakes like
7721 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
7722 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7723 b4_rhs_location): Likewise.
7724 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7725 b4_rhs_location): Likewise.
7726
fd19f271
AD
77272004-12-16 Akim Demaille <akim@epita.fr>
7728
7729 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
7730 yacc.c: be sure to stay within yycheck_.
7731 * tests/actions.at: Re-enable C++ tests.
7732
10454ea4
AD
77332004-12-16 Akim Demaille <akim@epita.fr>
7734
7735 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
7736 real.
7737
c5b95ccf
AD
77382004-12-16 Akim Demaille <akim@epita.fr>
7739
7740 Use #define to handle the %name-prefix.
7741
7742 * data/glr.c, data/yacc.c: Comment changes.
7743 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
7744 so that one can refer to yylex in the parser file, and have it
7745 renamed, as is the case with other skeletons.
7746
617a8f12
AD
77472004-12-16 Akim Demaille <akim@epita.fr>
7748
7749 Move lalr1.cc internals into yy*.
7750
7751 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
7752 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
7753 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
7754 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
7755 (empty_, final_, terror_, errcode_, ntokens_)
7756 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
7757 (looka_, ilooka_, error_range_, nerrs_):
7758 Rename as...
7759 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
7760 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
7761 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
7762 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
7763 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
7764 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
7765 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
7766 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
7767 these.
7768
1e547e6e
PE
77692004-12-15 Paul Eggert <eggert@cs.ucla.edu>
7770
7771 Fix some problems reported by twlevo at xs4all.
7772 * src/symtab.c (symbol_new): Report an error if the input grammar
7773 contains too many symbols. This is better than calling abort() later.
7774 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
7775 (struct node, struct graph):
7776 Rename member expand to stretch. All uses changed.
7777 (struct graph): Remove member layoutalgorithm. All uses removed.
7778 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
7779 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
7780 All uses changed.
7781 (N_STRETCH): Rename from N_EXPAND. All uses changed.
7782
735d6bd4
AD
77832004-12-15 Akim Demaille <akim@epita.fr>
7784
7785 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
7786 Add more Doxygen comments.
7787 (symprint_, stack_print_, reduce_print_, destruct_, pop)
7788 (report_syntax_error_, translate_): Rename as...
7789 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
7790 (yypop_, yyreport_syntax_error_, yytranslate_): this.
7791
2e1f5829
AD
77922004-12-15 Akim Demaille <akim@epita.fr>
7793
7794 * data/lalr1.cc (lex_): Rename as...
7795 (yylex_): this.
7796 Move the trace here.
7797 Take the %name-prefix into account.
7798 Reported by Alexandre Duret-Lutz.
7799
a3cb6248
AD
78002004-12-15 Akim Demaille <akim@epita.fr>
7801
7802 Simplify the C++ parser constructor.
7803
7804 * data/lalr1.cc (debug_): Rename as...
7805 (yydebug_): so that the parser's internals are always in the yy*
7806 pseudo namespace.
7807 Adjust uses.
7808 (b4_parse_param_decl): Remove the leading comma as it is now only
7809 called as unique argument list.
7810 (Parser::Parser): Remove the constructor accepting a location and
7811 an initial debugging level.
7812 Remove from the other ctor the argument for the debugging level.
7813 (debug_level_type, debug_level, set_debug_level): New.
7814
7815 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7816 constructor calls.
7817
07fed891
AD
78182004-12-15 Akim Demaille <akim@epita.fr>
7819
7820 Remove b4_root related material: failure experiment
a3cb6248 7821 (which goal was to allow to derive from a class).
07fed891
AD
7822
7823 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7824 definitions and uses.
7825
e603eaa5
PE
78262004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7827
7828 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7829 not 2, since it's not portable to subtract 1 from the start of an
7830 array. The new item 0 is never set or used. All uses changed.
7831
7832 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7833 the default definition of YYLLOC_DEFAULT. Problem reported
7834 by Frank Heckenbach.
7835
fafb007d
PE
78362004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7837
7838 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7839 the normal case and one for the error case. Just use the
7840 first one uniformly. Problem reported by Frank Heckenbach.
7841 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7842 use exactly the same macro in both places.
7843 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7844 so that the normal-case YYRHSLOC works for the error case too.
7845 All uses changed.
7846 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7847 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7848 * doc/bison.texinfo (Location Default Action): Don't claim that
7849 we have an array of locations. Use the same macro for both glr
7850 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7851 the index is 0.
7852
48814dcd
PE
78532004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7854
a4e1a53b
PE
7855 * HACKING: Update email addresses to send announcements to.
7856
48814dcd
PE
7857 * configure.ac (AC_INIT): Bump version to 1.875f.
7858
337116ba
PE
78592004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7860
7861 * NEWS: Version 1.875e.
7862 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7863
7864 * src/scan-skel.l: Include "complain.h", for "fatal".
7865
7866 * src/relation.h (relation_print, relation_digraph):
7867 Relation sizes are of type relation_node, not size_t (this is
7868 merely a doc fix, since the two types are equivalent).
7869 (relation_transpose): Relation sizes are of type relation_node,
7870 not int.
7871 * src/relation.c: Likewise.
7872 (top, infinity): Now of type relation_node, not int.
7873 (traverse, relation_transpose): Use relation_node, not int.
7874
7875 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7876 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7877 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7878
7879 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 7880 specifying whether the test should be skipped. Use it tp
337116ba 7881 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 7882 fail on some hosts, and should be skipped.
337116ba 7883
da2a7671
PE
78842004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7885
7886 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7887 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7888 unless otherwise specified below.
7889
7890 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7891 to allocate kernel_base, kernel_items, kernel_size, since
7892 they needn't be initialized to 0.
7893 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7894 * src/closure.c (new_closure): Likewise, for itemset.
7895 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7896 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7897 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7898 (build_relations): Likewise for edge, states1, includes.
7899 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7900 * src/reader.c (packgram): Likewise, for ritem, rules.
7901 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7902 * src/relation.c (relation_digraph): Likewise for VERTICES.
7903 (relation_transpose): Likewise for new_R, end_R.
7904 * src/symtab.c (symbols_token_translations_init): Likewise for
7905 token_translations.
7906 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7907 (token_actions): Likewise for yydefact, actrow, conflrow,
7908 conflict_list.
7909 (save_column): Likewise for froms[symno], tos[symno].
7910 (goto_actions): Likewise for state_count.
7911 (pack_table): Likewise for base, pos, check.
7912 (tables_generate): Likewise for width.
7913
7914 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7915 for initial core. Just have a separate core, so we needn't worry
7916 about whether kernel_size and kernel_base are initialized.
7917
7918 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7919 kernel_size, kernel_items): Remove unnecessary initialization.
7920 * src/conflicts.c (conflicts): Likewise.
7921 * src/derives.c (derives): Likewise.
7922 * src/muscle_tablc (muscle_insert): Likewise.
7923 * src/relation.c (relation_digraph): Likewise.
7924 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7925 conflrow, conflict_table, conflict_list, table, check):
7926 Likewise.
7927
7928 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7929 This is because all callers pass unsigned int.
7930 * src/closure.h (new_closure): Likewise.
7931
7932 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7933 (build_relations): Initialize includes[i] in all cases.
7934 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7935 and rules[ruleno].precsym. Initialize members in order.
7936 * src/relation.c (relation_transpose): Always initialize new_R[i]
7937 and end_R[i].
7938 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7939
7940 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7941 conflict_list[0] was always 0, but now it isn't initialized.
7942
7943 * src/table.c (table_grow): When conflict_table grew, the grown
7944 area wasn't cleared. Fix this.
7945
7946 * lib/.cvsignore: Add strdup.c, strdup.h.
7947 * m4/.cvsignore: Add strdup.m4.
7948
00baeeac
PE
79492004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7950
7951 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7952 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7953 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7954 ngotos + 1 without checking for overflow.
7955 (build_relations): Use END_NODE, not -1, to denote end of edges.
7956 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7957 build_relations): Use goto_number, not int, for goto numbers.
7958 * src/tables.c (save_column, default_goto): Likewise.
7959
be3d9d42
AD
79602004-11-23 Akim Demaille <akim@epita.fr>
7961
7962 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7963 of #defining from yystype.
7964 Don't typedef yystype, C++ does not need it.
7965 This lets it possible to forward declare it as union.
7966
78e526d5
PE
79672004-11-23 Paul Eggert <eggert@cs.ucla.edu>
7968
7969 * bootstrap (gnulib_modules): Add extensions.
7970 Problem reported by Jim Meyering.
7971
afbb696d
PE
79722004-11-22 Paul Eggert <eggert@cs.ucla.edu>
7973
7974 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
7975 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
7976 src/system.h, src/tables.c: XFREE -> free, to accommodate
7977 recent change to gnulib xalloc.h.
78e526d5 7978 Problem reported by Jim Meyering.
afbb696d 7979
c1f8f16a
AD
79802004-11-17 Akim Demaille <akim@epita.fr>
7981
7982 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
7983
db7e5eb5 79842004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
7985 Alexandre Duret-Lutz <adl@gnu.org>
7986
7987 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
7988 changes.
7989 (YYCDEBUG): Adjust.
7990 Use it instead of cdebug_.
7991 (Parser::debug_stream, Parser::set_debug_stream): New.
7992 (Parser::symprint_): Define cdebug_ for temporary backward
7993 compatibility.
7994 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
7995 debug_stream ().
7996
68e11668
AD
79972004-11-17 Akim Demaille <akim@epita.fr>
7998
7999 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
8000 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
8001 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
8002 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8003
97cbc73e
PE
80042004-10-27 Paul Eggert <eggert@cs.ucla.edu>
8005
8006 * data/glr.c (yyloc_default): Remove; not used.
8007 Problem reported by Frank Heckenbach.
8008
e342c3be
AD
80092004-10-25 Akim Demaille <akim@epita.fr>
8010
8011 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
8012 Introduce another definition to address simple location arrays.
8013 (yyGLRStack): New member: yyerror_range.
8014 (yyrecoverSyntaxError, yyparse): Update it.
8015 (yyrecoverSyntaxError): Use it when shifting the error token to
8016 have an accurate range, equivalent to the one computed by both
8017 yacc.c and lalr1.cc.
8018 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
8019 that column numbers start at column 0, as per GNU Coding
8020 Standards, the others tests, and the doc.
8021 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
8022 Adjust to the above change (first column is 0).
8023 And adjust the location of the "<error>", now covering the whole
8024 line.
8025
93602feb 80262004-10-22 Akim Demaille <akim@epita.fr>
04098407 8027 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
8028
8029 Remove some arbitrary limits on goto numbers and relations.
8030 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
8031 initial values, since they're never used.
8032 (set_goto_map): ngotos is now unsigned, so test for overflow
8033 by seeing whether it wraps around to zero.
8034 * src/lalr.h (goto_number): Now size_t, not short int.
8035 (GOTO_NUMBER_MAXIMUM): Remove.
8036 * src/relation.c (relation_print, traverse, relation_transpose):
8037 Check for END_NODE rather than looking at sign.
8038 * src/relation.h (END_NODE): New macro.
8039 (relation_node): Now size_t, not short int.
8040
dba08b04
PE
80412004-10-22 Paul Eggert <eggert@cs.ucla.edu>
8042
8043 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
8044 keyword, not an identifier. Problem reported by Baron Schwartz in
8045 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
8046
df09ef2e
AD
80472004-10-11 Akim Demaille <akim@epita.fr>
8048
8049 * src/symtab.c (symbol_check_alias_consistency): Also check
8050 type names, destructors, and printers.
8051 Reported by Alexandre Duret-Lutz.
8052 Recode the handling of associativity and precedence in terms
8053 of symbol_precedence_set.
8054 Accept no redeclaration at all, not even equal to the previous
8055 value.
8056 (redeclaration): New.
8057 Use it to factor redeclaration complaints.
8058 (symbol_make_alias): Don't set the type of the alias, let
8059 symbol_check_alias_consistency do it as for other features.
8060 * src/symtab.h (symbol): Add new member prec_location, and
8061 type_location.
8062 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
8063 * tests/input.at (Incompatible Aliases): New.
8064
146bc99d
PE
80652004-10-09 Paul Eggert <eggert@cs.ucla.edu>
8066
8067 .cvsignore fixes to accommodate gnulib changes,
8068 and the practice of naming build directories "_build".
8069 * .cvsignore: Add "_*". Sort.
8070 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
8071 * m4/.cvsignore: Add "*_gl.m4".
8072
e503aa60
AD
80732004-10-06 Akim Demaille <akim@epita.fr>
8074
8075 * src/parse-gram.y (add_param): Fix the truncation of trailing
8076 spaces.
8077
b4a20338
AD
80782004-10-05 Akim Demaille <akim@epita.fr>
8079
8080 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
8081 whether the reducion was empty or not. This leaves room to
8082 improve the use of YYLLOC_DEFAULT in such a case.
8083 lalr1.cc is still experimental, so changing this is acceptable.
8084 And finally, there are probably not many users who changed the
8085 handling of locations in GLR, so changing is admissible too.
8086
8087 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
8088 empty reduction, set @$ to an empty location ending the previously
8089 stacked symbol.
8090 Adjust uses to make sure the code is triggered on empty
8091 reductions.
8092 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
8093 expected output: empty reductions have empty locations.
8094
f85a5e6f
AD
80952004-09-29 Akim Demaille <akim@epita.fr>
8096
8097 * data/lalr1.cc: Move towards a more standard C++ coding style
8098 for templates: Class < T > -> Class<T>.
8099
b203fc2c
AD
81002004-09-29 Akim Demaille <akim@epita.fr>
8101
8102 * data/lalr1.cc: Reinstall the former ctor, for sake of
8103 compatibility, but warn it will be removed.
8104 Move towards a more standard C++ coding style (i.e., type *var ->
8105 type* var).
8106
5b7e1e73
PE
81072004-09-27 Paul Eggert <eggert@cs.ucla.edu>
8108
3fee967f
PE
8109 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
8110 since it's less likely to work if NULs are involved in the future.
5b7e1e73 8111
0dcca5c2
AD
81122004-09-27 Akim Demaille <akim@epita.fr>
8113
8114 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
8115
6dde1c82
AD
81162004-09-27 Akim Demaille <akim@epita.fr>
8117
8118 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 8119 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
8120 and argument names.
8121 (b4_cc_constructor_call): Likewise.
8122
b233d555
AD
81232004-09-24 Akim Demaille <akim@epita.fr>
8124
8125 * src/parse-gram.y (add_param): Strip the leading and trailing
8126 blanks from a formal argument declaration.
8127 (YY_LOCATION_PRINT): New.
8128
619404e3
AD
81292004-09-24 Akim Demaille <akim@epita.fr>
8130
8131 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
8132 after the location.
8133
dd8d9022
AD
81342004-09-24 Akim Demaille <akim@epita.fr>
8135
8136 * doc/bison.texinfo (Table of Symbols): Sort.
8137
0092f063
AD
81382004-09-21 Akim Demaille <akim@epita.fr>
8139
8140 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
8141 the useless parentheses.
8142 Suggested by Paul Eggert.
8143
451364ed
AD
81442004-09-20 Akim Demaille <akim@epita.fr>
8145
8146 Let the initial-action act on the look-ahead, and use it for the
8147 "initial push" (corresponding to an hypothetical beginning-of-file).
8148 And let lalr1.cc honor %initial-action.
8149
8150 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
8151 example.
8152 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
8153 (Parser::Parser): Remove the ctor that used to initialize it.
8154 (Parser::parse): Like in the other skeletons, issue the "starting
8155 parse" message before any action.
8156 Honor %initial-action.
8157 Initialize the stacks with the lookahead.
8158 * data/yacc.c: Let $$ and @$ in %initial-action designate the
8159 look-ahead.
8160 Push them in the stacks.
8161 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
8162
18d192f0
AD
81632004-09-20 Akim Demaille <akim@epita.fr>
8164
8165 * doc/bison.texinfo (Initial Action Decl): New.
8166
b8458aa5
AD
81672004-09-20 Akim Demaille <akim@epita.fr>
8168
8169 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
8170 clearer criterion to define it.
8171 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
8172 When reducing on an empty RHS, use the latest stacked location as
8173 location.
8174 yylloc is not always available.
8175 * data/glr.c: Likewise.
8176 Also, honor initial-actions.
8177
3fc16193
AD
81782004-09-20 Akim Demaille <akim@epita.fr>
8179
8180 * data/yacc.c (YY_LOCATION_PRINT): New.
8181 Define when we know YYLTYPE's structure, i.e., when the default
8182 YYLLOC_DEFAULT is used.
8183 * data/c.m4 (b4_yysymprint_generate): Use it.
8184 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
8185 value of the result.
8186 (error_start_): Replace with...
8187 (error_range_): this location array.
8188 This allows to replace code relying on the implementation of
8189 locations by portable code.
8190 * data/yacc.c (yylerrsp): Replace with...
8191 (yyerror_range): this.
8192 Every time a token is popped, update yyerror_range[0], to have an
8193 accurate location for the error token.
8194 * data/glr.c (YY_LOCATION_PRINT): New.
8195 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
8196 deference a pointer.
8197 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
8198 report the location in %printers.
8199
8200 * src/scan-skel.l: Instead of abort, report error messages to ease
8201 understanding skeleton scanning failures.
8202
ecfe33e7
AD
82032004-09-16 Akim Demaille <akim@epita.fr>
8204
8205 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
8206 (iterator, const_iterator): these, to be more in the C++ spirit.
8207 Also, return reverse iterators so that when displaying the stack
8208 we display its bottom first.
8209 (Parser::stack_print_, Parser::reduce_print_): Match the messages
8210 from yacc.c.
8211 We should probably use vector here though.
8212
1576d44d
AD
82132004-09-16 Akim Demaille <akim@epita.fr>
8214
8215 Have more complete shift traces.
8216
8217 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
8218 to report Shifts instead of ad hoc YYDPRINTF invocations,
8219 including for the error token.
8220 * data/lalr1.cc (symprint_): Output the location.
8221 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
8222 output the location within the %printer.
8223 Activate GLR tests, at least to make sure they compile properly.
8224 They still don't pass though.
8225 * tests/calc.at: Adjust expect verbose output, since now "Entering
8226 state..." is on a different line than the "Shifting" message.
8227
9c66f418
AD
82282004-09-08 Akim Demaille <akim@epita.fr>
8229
8230 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
8231 Bison directive from the Bison file to the invocation of this
8232 macro, so that these directives are passed to
8233 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
8234 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
8235 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
8236 the extra Bison directives instead of the whole series.
8237 Change the grammar so that there are recoverable errors, and
8238 unrecoverable errors. Now we can have the parser give up before
8239 consuming the whole input. As a result we now can observe that
8240 the lookahead is freed when needed.
8241 Change the parser source to parse argv[1] instead of a hard coded
8242 string.
8243 Simplify yylex, and give a value and location to EOF.
8244 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
8245 passed directives already coded in the file.
8246 Add some tests to check the location of "error".
8247 For some tests, the C++ parser is correct, and not yacc.c.
8248 For other tests, they provide different, but unsatisfying, values,
8249 so keep the C++ value so that at least one parser is "correct"
8250 according to the test suite.
8251 (Actions after errors): Remove, this is subsumed by the
8252 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
8253
52d5733f
AD
82542004-09-06 Akim Demaille <akim@epita.fr>
8255
8256 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 8257 (Parser::pop): New.
52d5733f
AD
8258 Use it.
8259
a0e68930
AD
82602004-09-06 Akim Demaille <akim@epita.fr>
8261
8262 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
8263 argument, an informative message.
8264 Call YY_SYMBOL_PRINT.
8265 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
8266 * data/lalr1.cc (destruct_): Likewise.
8267 In addition, no longer depend on b4_yysymprint_generate and
8268 b4_yydestruct_generate to generate these functions, do it "by
8269 hand".
8270
e757bb10
AD
82712004-09-03 Akim Demaille <akim@epita.fr>
8272
8273 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
8274 invoked, yydestruct the lookahead.
8275 * tests/calc.at (Calculator $1): Update the expected lengths of
8276 traces: there is an added line for the discarded lookahead.
8277 * doc/bison.texinfo (Destructor Decl): Some rewording.
8278 Define "discarded" symbols.
8279
0fe1f06d
AD
82802004-09-02 Akim Demaille <akim@epita.fr>
8281
8282 * data/lalr1.cc (translate_, destruct_): No reason to be static.
8283
284acc8b
AD
82842004-09-02 Akim Demaille <akim@epita.fr>
8285
8286 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
8287 (YYDSYMPRINTF): Rename as...
8288 (YY_SYMBOL_PRINT): this.
8289 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
8290 two.
8291 Use it instead of direct symprint_ calls.
8292 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
8293 one.
8294
a5eb1ed2
AD
82952004-09-02 Akim Demaille <akim@epita.fr>
8296
b7c72fe1
AD
8297 * data/lalr1.cc (b4_yysymprint_generate): New.
8298 (symprint_): New member function, defined when YYDEBUG.
8299 Use it consistently instead of token/nterm debugging output by
8300 hand.
a5eb1ed2
AD
8301 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
8302 %printer calls to use cdebug_ when using lalr1.cc.
8303
417141dd
AD
83042004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
8305
8306 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
8307 with #ifdef YYDEBUG.
8308
2fa09258
AD
83092004-08-26 Akim Demaille <akim@epita.fr>
8310
8311 * doc/bison.texinfo (Implementing Loops): Rename as...
8312 (Implementing Gotos/Loops): this.
8313
9378b508
PE
83142004-08-13 Paul Eggert <eggert@cs.ucla.edu>
8315
8316 Adjust to latest gnulib.
8317 * bootstrap (gnulib_modules): Add xalloc-die.
8318 Set LC_ALL=C so that file names sort consistently.
8319 Prefer the gnulib copies of gettext.m4, glibc21.m4,
8320 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
8321 uintmax_t.m4, ulonglong.m4.
8322 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
8323 po.m4 since we are now using _gl.m4 instead.
8324
87a8ad5c
PE
83252004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
8326
8327 * src/scan-action.l: Remove. Scanning of semantic actions is
8328 handled in scan-gram.l.
8329
dca81a78
PE
83302004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
8331
8332 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
8333
8334 * src/location.h (struct): The file member is a uniqstr.
8335 (equal_boundaries): Use UNIQSTR_EQ for comparison.
8336
c9cbf7c5
PE
83372004-07-22 Paul Eggert <eggert@cs.ucla.edu>
8338
8339 Fix bug with non-%union parsers that have printers or destructors,
8340 which led to a Bison core dump. Reported by Peter Fales in
8341 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 8342
c9cbf7c5
PE
8343 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
8344 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
8345 not to our own type.
8346 * src/output.c (symbol_destructors_output, symbol_printers_output):
8347 Don't assume %union.
8348 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
8349 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
8350 UNION-FLAG. All callers changed.
8351 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
8352 Use type char, not unsigned int, when declaring an array of char;
8353 this lets us remove a cast.
8354 (Printers and Destructors): Add non-%union test cases.
8355
fa7e68c3
PE
83562004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8357
8358 * doc/bison.texinfo: Minor editorial changes, mostly to the new
8359 GLR writeups. E.g., avoid frenchspacing and the future tense,
8360 change "lookahead" to "look-ahead", and change "wrt" to "with
8361 respect to".
2fa09258 8362
fa7e68c3
PE
83632004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8364
8365 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
8366 New sections, split off from the GLR Parsers section. Put the new
8367 Simple GLR Parser near the start of the GLR section, for clarity.
8368 Rewrite connective text.
8369
99a9344e
PE
83702004-06-21 Frank Heckenbach <frank@g-n-u.de>
8371
8372 * doc/bison.texinfo (Simple GLR Parsers): New section.
8373
8dd162d3
PE
83742004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8375
8376 * NEWS, TODO, doc/bison.texinfo:
8377 Use "look-ahead" instead of "lookahead", to be consistent.
8378 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
8379 while we're fixing "look-ahead".
8380 * src/conflicts.c (shift_set): Renamed from shiftset.
8381 (look_ahead_set): Renamed from lookaheadset.
8382 * src/print.c: Likewise.
8383 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
8384 name for "lookahead".
8385 (report_types, usage): Likewise.
8386 * src/getargs.h (report_look_ahead_tokens): Renamed from
8387 report_lookaheads.
8388 * src/lalr.c (compute_look_ahead_tokens): Renamed from
8389 compute_lookaheads.
8390 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
8391 (look_ahead_tokens_print): Renamed from lookaheads_print.
8392 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
8393 state_rule_lookaheads_print.
8394 * src/state.h: Likewise.
8395 (reductions.look_ahead_tokens): Renamed from lookaheads.
8396 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
8397 AT_DATA_LOOKAHEADS_GRAMMAR.
8398
57a90331
PE
83992004-06-03 Paul Eggert <eggert@cs.ucla.edu>
8400
8401 * README: Update location of patched M4 distribution.
8402
8ed3234a
PE
84032004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
8404
8405 Don't assume the C++ compiler takes the same arguments as the C compiler
8406 (trivial change).
8407 * configure.ac (O0CXXFLAGS): New var.
8408 * tests/atlocal.in (CXXFLAGS): Use it.
8409
07971983
PE
84102004-05-29 Paul Eggert <eggert@cs.ucla.edu>
8411
8412 Fix some "make check" problems with C++ reported by
8413 Albert Chin-A-Young for Tru64 C++ in this thread:
8414 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
8415
8416 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
8417 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8418 Output to a .cc file for C++, not to a .c file.
8419 * tests/calc.at (AT_CHECK_CALC): Likewise.
8420 * tests/regression.at (AT_CHECK_DANCER): Likewise.
8421 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
8422
29058652
PE
84232004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
8424
8425 * tests/calc.at, tests/actions.at: Workaround for SGI
8426 C++ compiler. (trivial change)
8427
62cb8a99
PE
84282004-05-27 Paul Eggert <eggert@cs.ucla.edu>
8429
fd418816
PE
8430 Spent a few hours checking out which prerequisite versions the
8431 current sources actually require. I went all the way back to
8432 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
8433 a seemingly endless set of combinations of versions more recent
8434 than that. The bottom line is that the current sources require
8435 fairly recent versions of the build tools, and it'll be some work
8436 to change this.
8437 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
8438 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
8439 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
8440 Add comments explaining why those particular versions are
8441 currently needed.
2fa09258 8442
62cb8a99
PE
8443 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
8444 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 8445 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
8446
8447 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
8448 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
8449
caa52c10
PE
84502004-05-26 Paul Eggert <eggert@cs.ucla.edu>
8451
8452 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
8453 0.11.5. Suggested by Bruno Haible.
8454 * bootstrap: Remove gettext version checking.
8455
8456 * doc/bison.texinfo (Decl Summary): Also mention that %union
8457 can depend on prerequisite types. Problem reported by Tim
8458 Van Holder.
8459
4bfd5e4e
PE
84602004-05-25 Paul Eggert <eggert@cs.ucla.edu>
8461
2cef3017
PE
8462 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
8463 * README-alpha: Don't tell people not to package this.
8464
b9c85d5c
PE
8465 * bootstrap: Don't assume $(...) works; use `...` instead.
8466 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
8467 gettext better.
8468
4bfd5e4e
PE
8469 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
8470 put into the -d output file, and mention what to do if YYSTYPE is
8471 defined as a macro.
8472
6a36ff94
PE
84732004-05-24 Paul Eggert <eggert@cs.ucla.edu>
8474
6712933e
PE
8475 Undo change made earlier today: it caused autopoint to not bring
8476 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
8477 autopoint's.
8478
8479 * bootstrap: Check that gettext version matches what's in
8480 configure.ac. Warn users to ignore robots.txt ERROR 404.
8481 * bootstrap: Undo today's earlier change (logged below).
8482 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 8483
6a36ff94
PE
8484 The gettext version checking is causing more trouble than it's
8485 curing; remove it. Problem reported by Paul Hilfinger.
8486
8487 * bootstrap: Issue a warning that one can expect a message
8488 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
8489 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
8490
209ea708
PE
84912004-05-23 Paul Eggert <eggert@cs.ucla.edu>
8492
8493 Ensure that the C++ compiler used for testing actually works on a
8494 simple test program; if not, skip the C++-related tests. Problem
8495 reported by Vin Shelton in:
161a71f3 8496 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
8497
8498 * m4/cxx.m4: New file.
8499 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
8500 * tests/atlocal.in (BISON_CXX_WORKS): Add.
8501 * tests/local.at (AT_COMPILE_CXX): Use it.
8502
41ca2549
PE
85032004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8504
383e69dc
PE
8505 * data/glr.c (yylloc): Output this macro even if locations are not
8506 being generated, as the GLR parser needs it even in that case.
8507 Problem reported by Troy A. Johnson
8508 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
8509
41ca2549
PE
8510 * configure.ac (AC_INIT): Update to 1.875e.
8511
e476c87d
PE
85122004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8513
8514 * NEWS: Version 1.875d.
8515 * configure.ac (AC_INIT): Likewise.
8516 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
8517
8518 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
8519 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
8520 lalr1.cc runs afoul of the first, and the last two are no longer
8521 supported by GCC 3.4.0.
8522 * README: Mention GNU m4 1.4 or later; mention m4 patches.
8523 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
8524
233a88ad
PE
85252004-05-06 Paul Eggert <eggert@cs.ucla.edu>
8526
8527 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
8528 unsigned int, for compatibility with latest gnulib hash module.
8529 * src/state.c (state_hash, state_hasher): Likewise.
8530 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
8531 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 8532
12ffdd28
PE
85332004-05-03 Paul Eggert <eggert@cs.ucla.edu>
8534
8535 * NEWS: Unescaped newlines are no longer allowed in char & strings.
8536
8537 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
8538 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
8539 character and string literals.
8540 (unexpected_end): New function.
8541 (unexpected_eof): Use it.
8542 (unexpected_newline): New function.
8543 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
8544 actions.
e476c87d 8545
12ffdd28
PE
8546 * NEWS: Document %expect-rr.
8547
8548 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
8549 Fix typo by replacing $1 with $option.
8550 Remove more 'intl'-related files.
9668e2be 8551 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
8552
8553 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
8554 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
8555 strtoul.c.
8556 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
8557 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
8558 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
8559 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
8560 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
8561 * src/.cvsignore: Add *.output.
8562
8563 * src/parse-gram.y: Put copyright notice inside %{ %} so it
8564 gets copied to the output file.
e476c87d 8565
1f65350a
PE
85662004-04-28 Paul Eggert <eggert@twinsun.com>
8567
8568 Get files from the gnulib and po repositories, instead of relying
8569 on them being in our CVS. Upgrade to latest versions of gnulib
8570 and Automake.
8571
8572 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
8573 * bootstrap: Bootstrap from gnulib and po repositories.
8574 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
8575 * README-cvs: Document these changes. Remove version numbers from
8576 mentions of build tools, since they change so often. Mention Flex.
8577
8578 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
8579 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
8580 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
8581 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 8582 does this for us.
12ffdd28
PE
8583 (AC_ISC_POSIX): Remove; we no longer support this
8584 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
8585 (AC_HEADER_STDC): Remove: we now assume C89 or better.
8586 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
8587 Do not check for C89 headers, except for locale.h which is used
8588 by the Yacc library and must port to K&R hosts.
8589 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
8590 Do not check for C89 functions, except for setlocale which is
8591 used by the Yacc library.
8592 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
8593 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
8594 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
8595 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
8596 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
8597 AM_GNU_GETTEXT): Remove; now done by:
8598 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
8599 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
8600 for us.
8601
8602 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
8603 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
8604 Define to empty, as gnulib.mk will do the rest for us.
8605 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
8606 for us.
8607 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
8608 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
8609
8610 * src/files.c: Include gnulib's xstrndup.h.
8611
8612 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
8613 (REALLOC): Use xnrealloc, for likewise.
8614 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
8615 (strnlen, memrchr): Remove decls; functions no longer used.
8616 Include <stpcpy.h>.
8617
8618 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
8619 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
8620 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
8621 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
8622 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
8623 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
8624 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
8625 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
8626 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
8627 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
8628 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
8629 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8630 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
8631 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
8632 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
8633 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
8634 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
8635 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
8636 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
8637 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
8638 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
8639 Remove, as these files are now generated automatically
8640 by bootstrap or automake.
8641
8642 * po/ChangeLog: Remove: all but one entry was a duplicate
8643 of this file, and I moved that 2000-11-02 entry here.
8644
8645 * config/.cvsignore: Add Makefile, depcomp, install-sh.
8646 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
8647 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
8648 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
8649 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
8650 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
8651 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
8652 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
8653 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
8654 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
8655 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
8656 xstrndup.h.
8657 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
8658 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
8659 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
8660 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
8661 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
8662 * src/.cvsignore: Remove *_.c.
8663
8664
8665 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
8666 support it. (The latest stable gzip doesn't.)
8667
86682004-04-27 Paul Eggert <eggert@twinsun.com>
8669
8670 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
8671 case, as stos_ is now used by destructors due to the 2004-02-09
8672 change.
8673
8674 Remove more K&R C support.
8675 * lib/libiberty.y (PARAMS): Remove. All uses removed.
8676 * lib/subpipe.c (errno): Remove decl.
8677 Include <stdlib.h> unconditionally.
8678 (EXIT_FAILURE): Remove macro.
8679 * src/complain.c (vfprintf, strerror): Remove.
8680 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
8681 unconditionally.
8682 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
8683 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
8684 (strchr, strspn, memchr): Remove decls.
8685 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
8686 unconditionally. Do not declare perror.
8687 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
8688 unconditionally.
8689
8690 * src/complain.c (_): Remove useless defn, as system.h defines this.
8691
8692 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
8693 with latest obstack.h.
8694 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
8695 to procedure types, as obstack.h now does that for us.
8696 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
8697
8698 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
8699 so that this include file can stand alone.
8700 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
8701 does this now. Include subpipe.h first after config.h, to
8702 test whether it can stand alone.
8703
8704 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
8705 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
8706 unused declaration.
8707
8708 * tests/synclines.at (%union synch line): Put a dummy member in
8709 the union, because empty unions aren't allowed in C. Caught
8710 by GCC 3.4.0.
8711
4f16766c
PE
87122004-04-13 Jim Meyering <jim@meyering.net>
8713
8714 * src/conflicts.c (conflicts_print): Correct format string typo:
8715 use `%%' to produce literal `%'. (trivial change)
8716
779e7ceb
PE
87172004-03-30 Paul Eggert <eggert@twinsun.com>
8718
8719 * src/getargs.c (version): Update copyright year to 2004.
8720
8721 * data/c.m4 (b4_int_type): Use 'short int' rather than
8722 'short', and similarly for 'long', 'unsigned', etc.
8723 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
8724 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
8725 yy_yypstack, yydumpstack): Likewise.
8726 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
8727 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
8728 Likewise.
8729 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
8730 yy_stack_print, yyparse): Likewise.
8731 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
8732 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
8733 * lib/bitset.c (bitset_print): Likewise.
8734 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
8735 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8736 * lib/bitsetv.c (bitsetv_dump): Likewise.
8737 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
8738 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
8739 Likewise.
8740 * src/LR0.c (allocate_itemsets): Likewise.
8741 * src/gram.h (rule_number, rule): Likewise.
8742 * src/lalr.h (goto_number): Likewise.
8743 * src/nullable.c (nullable_compute): Likewise.
8744 * src/output.c (prepare_rules): Likewise.
8745 * src/relation.c (relation_print, relation_digraph): Likewise.
8746 * src/relation.h (relation_node): Likewise.
8747 * src/state.h (state_number, transitions, errs, reductions,
8748 struct state): Likewise.
8749 * src/symtab.h (symbol_number, struct symbol): Likewise.
8750 * src/tables.c (vector_number, tally, action_number,
8751 default_goto, goto_actions): Likewise.
8752 * tests/existing.at (GNU Cim Grammar): Likewise.
8753 * tests/regression.at (Web2c Actions): Likewise.
8754
8755 * src/output.c (muscle_insert_short_int_table): Renamed from
8756 muscle_insert_short_table. All uses changed.
8757
d6328241
PH
87582004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8759
8760 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
8761 (declaration): Replace expected_conflicts with expected_sr_conflicts.
8762 Add %expect-rr rule.
4f16766c 8763
d6328241
PH
8764 * src/scan-gram.l: Recognize %expect-rr.
8765
4f16766c 8766 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 8767 expected_conflicts.
4f16766c 8768 (expected_rr_conflicts): Declare.
d6328241
PH
8769
8770 * src/conflicts.c (expected_sr_conflicts): Rename from
8771 expected_conflicts.
8772 (expected_rr_conflicts): Define.
8773 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
8774 for GLR parsers.
8775 Use expected_sr_conflicts in place of expected_conflicts.
8776 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 8777
d6328241 8778 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 8779
1452af69
PE
87802004-03-08 Paul Eggert <eggert@gnu.org>
8781
8782 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 8783 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
8784
8785 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
8786 in lalr1.cc.
8787 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
8788 * src/scan-gram.l (scan_integer): New function.
8789 ({int}): Use it.
8790 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
8791 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
8792 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
8793 Say "long int", not "long", for uniformity with GNU style.
8794
006d217d
PE
87952004-02-25 Paul Eggert <eggert@twinsun.com>
8796
8797 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8798 compilers. This fixes a problem with Intel's C++ compiler being
8799 chatty, reported by Guido Trentalancia in
161a71f3 8800 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 8801
c2729758
ADL
88022004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8803
8804 Support %destructor and merge error locations in lalr1.cc.
8805
8806 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8807 (Parser::stos_): Define unconditionally.
8808 (Parser::destruct_): New method. Generate its body with
8809 b4_yydestruct_generate.
8810 (Parser::error_start_): New attribute.
8811 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8812 token which are discarded.
8813 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8814 error_start_ when erroneous token are discarded.
8815 (Parser::parse) <yyerrlab1>: Compute the location of the error
8816 token so that it covers all the discarded tokens.
8817 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8818 it can be called with `%skeleton "lalr1.cc"', and do that.
8819
dd0e0635
PE
88202004-02-02 Paul Eggert <eggert@twinsun.com>
8821
8822 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8823 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8824 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8825 There's no need to mention top_builddir since Automake does that
8826 for us.
8827 (INCLUDES): Remove, as Automake says it's obsolescent.
8828 Contents migrated into AM_CPPFLAGS as described above.
8829 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8830
88312004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8832
8833 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8834 (yyreportSyntaxError): Handle case where lookahead token is
8835 YYEMPTY.
8836
be16239b
PH
88372004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8838
8839 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8840 resulting parsers are compilable with C++.
8841
5fa90832
PE
88422003-12-23 Paul Eggert <eggert@twinsun.com>
8843
8844 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8845 * src/output.c (output_skeleton): Rename local var.
8846 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8847 Bison tokens, as this runs afoul of the 2003-10-07 change that
8848 disallowed NUL bytes in character constants or string literals.
8849
8850 * tests/local.at: Require Autoconf 2.59's Autotest.
8851 * tests/testsuite.at: Don't include local.at, since we now assume
8852 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8853 including it.
8854 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8855 multiple inclusion warnings.
dd0e0635 8856
b165c324
AD
88572003-12-02 Akim Demaille <akim@epita.fr>
8858
8859 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8860 conditions.
8861 From Bruno Haible.
8862
26e06a21
ADL
88632003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8864
8865 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8866
92ac3705
PE
88672003-10-07 Paul Eggert <eggert@twinsun.com>
8868
6a5ecb38
PE
8869 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8870 if testsuite doesn't exist.
8871
92ac3705
PE
8872 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8873 literals, unfortunately.
8874 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8875 Complain about NUL bytes in character constants or string literals.
8876
91d2c560
PE
88772003-10-05 Paul Eggert <eggert@twinsun.com>
8878
8879 * NEWS: Don't document %no-default-prec, as it's still
8880 too experimental.
8881 * doc/bison.texinfo: Document %no-default-prec only if
8882 the defaultprec flag is set. Normally it's not.
8883
0cc3da3a
PE
88842003-10-04 Paul Eggert <eggert@twinsun.com>
8885
8886 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8887 non-modifiable lvalue, instead of a modifiable one.
8888 * doc/bison.texinfo (Actions): Document that $$ can
8889 be assigned to. Do not claim that $$ and $N are
8890 array element references: user code should not rely on this.
8891
22fccf95
PE
88922003-10-01 Paul Eggert <eggert@twinsun.com>
8893
8894 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8895 (grammar_declaration): Use it.
8896 * src/scan-gram.l: New token %no-default-prec.
8897 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8898 * NEWS, doc/bison.texinfo: Document the above.
8899
fc8f2965
AD
89002003-10-01 Akim Demaille <akim@epita.fr>
8901
8902 VCG no longer supports long_straight_phase.
8903
8904 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8905 * src/print_graph.c (print_graph): Adjust.
8906
39a06c25
PE
89072003-09-30 Frank Heckenbach <frank@g-n-u.de>
8908 and Paul Eggert <eggert@twinsun.com>
8909
8910 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8911 Table of Symbols): Document %default-prec.
8912 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8913 (grammar_declaration): Set default_prec on %default-prec.
8914 * src/scan-gram.l (%default-prec): New token.
8915 * src/reader.h (default_prec): New flag.
8916 * src/reader.c: Likewise.
8917 (packgram): Handle it.
8918 * tests/conflicts.at (%default-prec without %prec,
8919 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 8920
39a06c25
PE
89212003-09-30 Paul Eggert <eggert@twinsun.com>
8922
8923 * tests/testsuite.at: Include local.at, not input.at, fixing
8924 a typo in the 2003-08-25 patch.
8925
62b6aef9
AD
89262003-08-27 Akim Demaille <akim@epita.fr>
8927
8928 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8929 GCC warnings.
8930
89e1cc61
AD
89312003-08-26 Akim Demaille <akim@epita.fr>
8932
8933 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8934 "<\#" to avoid magic from Gnus when posting parts of this script.
8935
a08460b0
AD
89362003-08-26 Akim Demaille <akim@epita.fr>
8937
8938 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8939 (Parser::parse): here.
8940 Adjust: nerrs and errstatus is now replaced by...
8941 (Parser::nerrs_, Parser::errstatus_): New.
8942
603f1cfd
AD
89432003-08-25 Akim Demaille <akim@epita.fr>
8944
8945 * config/announce-gen, Makefile.cfg: New.
8946 * Makefile.am: Adjust.
8947 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8948 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8949
cd3684cf
AD
89502003-08-25 Akim Demaille <akim@epita.fr>
8951
8952 When reducing initial empty rules, Bison parser read an initial
8953 location that is not defined. This results in garbage, and that
8954 affects Bison's own parser. Therefore we need (i) to extend Bison
8955 to support a means to initialize this location, and (ii) to use
8956 this CVS Bison to fix CVS Bison's parser.
8957
8958 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8959 with...
8960 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8961 * src/parse-gram.y: Adjust.
8962 (%initial-action): New.
8963 (%error-verbose): Since we require CVS Bison, there is no reason
8964 not to use it.
8965 * src/scan-gram.l: Adjust.
8966 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8967 * data/yacc.c (yyparse): Use b4_initial_action.
8968
4e03e201
AD
89692003-08-25 Akim Demaille <akim@epita.fr>
8970
8971 * doc/bison.texinfo: Don't promote stdout for error messages.
8972
8c182d05
AD
89732003-08-25 Akim Demaille <akim@epita.fr>
8974
8975 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
8976 From Alexandre Duret-Lutz.
8977
6a60c4cf
PE
89782003-08-25 Akim Demaille <akim@epita.fr>
8979
8980 Version 1.875c.
8981
25f66e1a
AD
89822003-08-25 Akim Demaille <akim@epita.fr>
8983
8984 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
8985 Use them.
8986
5348bfbe
AD
89872003-08-25 Akim Demaille <akim@epita.fr>
8988
8989 * data/lalr1.cc (Parser::reduce_print_): New.
8990 Use it.
8991
47301314
AD
89922003-08-25 Akim Demaille <akim@epita.fr>
8993
8994 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
8995 error recovery loops. This patch is based on
161a71f3 8996 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
8997 Also, augment the similarity between lalr1.cc and yacc.c.
8998 Note: the locations of error recovery rules are not correct yet.
8999
9000 * data/lalr1.cc: Comment changes to augment the similarity between
9001 lalr1.cc and yacc.c.
9002 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
9003 (yyerrlab1): Remove, but where it used to be (now the bottom part of
9004 yyerrlab), when hitting EOF, pop the whole stack here instead of
9005 merely falling thru the default error handling mechanism.
9006 (yyerrorlab): New label, with the old contents of YYERROR,
9007 plus the following change: pop the stack of rhs corresponding
9008 to the production that invoked YYERROR. That is how Yacc
9009 behaves (required by POSIX).
9010 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
9011 fail.
9012
1f7a61ff
AD
90132003-08-25 Akim Demaille <akim@epita.fr>
9014
9015 Tune local.at so that people can "autom4te -l autotest calc.at -o
9016 calc" for instance, to extract a sub test suite.
9017
9018 * tests/testsuite.at: Move the initialization, Autotest version
9019 requirement, and AT_TESTED invocation into...
9020 * tests/local.at: here.
9021 * tests/testsuite.at: Include it for compatibility with Autoconf
9022 2.57.
9023 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
9024 be ignore.
9025
327b5b56
PE
90262003-08-04 Paul Eggert <eggert@twinsun.com>
9027
9028 Rework code slightly to avoid gcc -Wtraditional warnings.
9029 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
9030 The returned value is now stored in *YY0. All callers changed.
9031 * src/output.c (merge_output): Adjust to the above change.
9032
0051e3ed
PE
90332003-07-26 Paul Eggert <eggert@twinsun.com>
9034
9035 * data/glr.c (YYASSERT): New macro.
9036 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
9037 yyresolveStates, yyprocessOneStack):
9038 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
9039 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 9040
137437c6
PE
90412003-07-25 Paul Eggert <eggert@twinsun.com>
9042
5b620e06
PE
9043 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
9044 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 9045 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
9046 by Frank Heckenbach, though I have omitted the structure-initialization
9047 part of his glr-knr.diff patch since I recall that the Portable
9048 C Compiler didn't require that change.
9049
137437c6
PE
9050 Let the user specify how to allocate and free memory.
9051 Derived from a suggestion by Frank Heckenbach in
161a71f3 9052 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
9053 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
9054 All uses of free, malloc, realloc changed to use these macros,
9055 and unnecessary casts removed.
9056 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
9057
ddb85ca5
PE
90582003-07-06 Matthias Mann <MatthiasMann@gmx.de>
9059
9060 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
9061 use s.empty() rather than s == "" to test for empty string; see
161a71f3 9062 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
9063 (trivial change)
9064
39910e09
AD
90652003-06-25 Akim Demaille <akim@epita.fr>
9066
9067 * config/depcomp, config/install-sh: Update from masters.
9068
0ae99356
PE
90692003-06-20 Paul Eggert <eggert@twinsun.com>
9070
9071 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
9072 and return properly parenthesized result.
9073 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
9074 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9075 Remove unnecessary parentheses from uses.
9076 * doc/bison.texinfo (Location Default Action): Describe the
9077 conventions for parentheses.
9078
cd05d13c
PE
90792003-06-19 Paul Eggert <eggert@twinsun.com>
9080
81fd08ca
PE
9081 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
9082 yyreportTree): Do not assume that size_t is the same width as int,
9083 when printing sizes. Print sizes using an unsigned format.
9084 Problem reported by Frank Heckenbach in
161a71f3 9085 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 9086
cd05d13c
PE
9087 Port to Forte Developer 7 C compiler.
9088 * data/glr.c (struct YYLTYPE): If locations are not being used,
9089 declare a single dummy member, as empty structs do not conform
9090 to the C standard.
9091 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
9092 the Forte Developer 7 C compiler complains that end-of-loop
9093 code is not reached.
9094
4dcf140b
PE
90952003-06-17 Paul Eggert <eggert@twinsun.com>
9096
9097 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
9098 avoid warnings from picky compilers about redefinition of PARAMS.
9099
8dd76bee
PE
91002003-06-17 Paul Eggert <eggert@twinsun.com>
9101
9102 Version 1.875b.
9103
9104 * NEWS: Document 1.875b.
9105
9106 * lib/bbitset.h: Do not include config.h; that's the includer's job.
9107 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
9108 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
9109 Don't use 'index' in comments, as it's a builtin fn on some hosts.
9110 * lib/bitset_stats.c: Include gettext.h unconditionally, as
9111 per recent gettext manual's suggestion.
9112 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
9113 Use prototypes, not old-style definitions.
9114 * lib/lbitset.c (lbitset_unused_clear): Likewise.
9115 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
9116 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
9117 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
9118 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
9119 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
9120 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
9121 vbitset_or_and_cmp, vbitset_copy): Likewise.
9122
9123 * lib/libiberty.h: Do not include config.h; that's the includer's job.
9124 Do not include <stdlib.h>.
9125 (PARAMS): Define unconditionally for C89.
9126 (ATTRIBUTE_NORETURN): Remove.
9127 (ATTRIBUTE_UNUSED): Define unconditionally.
9128
9129 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 9130 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
9131 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
9132 * lib/vbitset.c, lib/vbitset.h: New files.
9133 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9134 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
9135 from libbitset.
9136
9137 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
9138 `How Can I Reset @code{yyparse}', since texinfo does not allow
9139 arbitrary @ in node names.
9140
9141 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
9142 shouldn't be needed according to the gettext 0.12.1 documentation
9143 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 9144 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 9145 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 9146 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 9147
8dd76bee
PE
9148 * lib/.cvsignore: Add stdbool.h.
9149 * m4/.cvsignore: Add nls.m4, po.m4.
9150
9151 Upgrade to CVS gnulib.
9152 * stdbool_.h: File renamed from stdbool.h.in.
9153 * configure.ac (AM_STDBOOL_H): Invoke this instead of
9154 AC_HEADER_STDBOOL.
9155 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
9156 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
9157 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
9158 (MOSTLYCLEANFILES): New var.
9159 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
9160 (stdbool.h): New rule.
9161 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
9162 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
9163 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
9164 m4/quote.m4: Upgrade to today's gnulib.
9165
9166 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
9167 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
9168 the tests right now.
9169 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
9170 yyerror are declared before use; C99 requires this.
9171
25005f6a
PH
91722003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9173
9174 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
9175 first.
9176 (yyrecoverSyntaxError): Correct the logic for setting and testing
9177 yyerrState.
9178 Correct comment on handling EOF.
9179 Allow states with only a default reduction, rather than failing
8dd76bee 9180 (I can't quite reconstruct why these were not allowed before).
25005f6a 9181
137437c6 9182 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 9183 buffer overruns, corrupting state.
8dd76bee
PE
9184
9185 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
9186 definition.
9187 * src/reader.h (max_left_semantic_context): New variable declaration.
9188 * src/scan-gram.l (max_left_semantic_context): Define.
9189 (handle_action_dollar): Update max_left_semantic_context.
9190 * data/glr.c (YYMAXLEFT): New definition.
9191 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
9192 (yyresolveAction): Ditto.
9193
9194 Fixes to problems with location handling in GLR parsers reported by
9195 Frank Heckenbach (2003/06/05).
9196
9197 * data/glr.c (YYLTYPE): Make trivial if locations not used.
9198 (YYRHSLOC): Add parentheses, and define only if locations used.
9199 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
9200 locations not used.
9201 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
9202 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 9203
25005f6a
PH
9204 * tests/cxx-type.at: Exercise location information; update tests
9205 to differentiate output with and without locations.
8dd76bee 9206 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
9207 because default YYLTYPE not yet defined.
9208 Change semantic actions to compute strings, rather than printing
9209 them directly (to test proper passing of semantics values). Change
9210 output to prefix notation and update test data and expected results.
9211 (yylex): Track locations.
9212 (stmtMerge): Return value rather than printing, and include arguments
9213 in value.
8dd76bee 9214
711f40b7
PE
92152003-06-03 Paul Eggert <eggert@twinsun.com>
9216
9217 Avoid warnings generated by GCC 2.95.4 when Bison is
9218 configured with --enable-gcc-warnings.
9219 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
9220 yy::]b4_parser_class_name[::translate_,
9221 yy::Stack::operator[] (unsigned),
9222 yy::Stack::operator[] (unsigned) const,
9223 yy::Slice::operator[] (unsigned),
9224 yy::Slice::operator[] (unsigned) const):
9225 Rename local vars to avoid warnings.
9226 * tests/glr-regression.at (Improper handling of embedded actions
9227 and $-N in GLR parsers): Remove unused local variable from yylex.
9228 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
9229 (void) as arg when not pure, since we now assume C89 when building
9230 Bison. Pacify GCC by using parameter.
9231
ac695f7d
PE
92322003-06-02 Paul Eggert <eggert@twinsun.com>
9233
9234 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
9235 yy::Location::lines, yy::Location::columns): Rename arguments
9236 to avoid shadowing; this removes a warning generated by GCC 3.3.
9237
26ec81e0
PE
92382003-06-01 Paul Eggert <eggert@twinsun.com>
9239
9240 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
9241 to g++, as GCC 3.3 complains if you do it.
9242 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
9243 everything that WARNING_CFLAGS has, except omit warnings
9244 not suitable for C++.
9245 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
9246 * tests/atlocal.in (CXXFLAGS): New var.
9247 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
9248
9249 Fix a GLR parser bug I reported in February; see
161a71f3 9250 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
9251 The problem was that GLR parsers did not conform to the C standard,
9252 because actions like { $1 = $2 + $3; } expanded to expressions
9253 that invoked YYFILL in separate subexpressions, and YYFILL assigned
9254 to a local variable. The C standard says that expressions
9255 like (var = f ()) + (var = f ()) have undefined behavior.
9256 Another problem was that GCC sometimes issues warnings that
9257 yyfill and its parameters are unused.
9258
9259 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
9260 as possibly unused.
9261 (yyfill): New function.
9262 (YYFILL): Use it.
9263 (yyuserAction): Change type of yynormal to bool, so that it matches
9264 the new yyfill signature. Mark it as possibly unused.
9265
9266
9267 Follow up on a bug I reported in February, where a Bison-generated
9268 parser can loop. Provide a test case and a fix for yacc.c. I
9269 don't have a fix for lalr1.cc or for glr.c, unfortunately.
9270 The original bug report is in:
161a71f3 9271 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
9272
9273 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
9274 macro's size was becoming unwieldy.
9275 (yyerrlab): Do not discard an empty lookahead symbol, as this
9276 might destroy garbage.
9277 (yyerrorlab): New label, with the old contents of YYERROR,
9278 plus the following change: pop the stack of rhs corresponding
9279 to the production that invoked YYERROR. That is how Yacc
9280 behaves, and POSIX requires this behavior.
9281 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
9282 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
9283 Define 'alarm' to do nothing if unistd.h is not available.
9284 Add a new rule "exp: '-' error;" to test the above change to
9285 data/yacc.c. Use 'alarm' to abort any test taking longer than
9286 10 seconds, as it's probably looping.
9287 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
9288 Also, the new yacc.c generates two fewer diagnostics for an
9289 existing test.
9290
d0829076
PE
92912003-05-24 Paul Eggert <eggert@twinsun.com>
9292
c6ae27df
PE
9293 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
9294 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
9295 This fixes a problem reported by John Bowman when the Compaq/HP
9296 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
9297 -ansi -Wall -gall).
9298 * data/yacc.c (union yyalloc): Likewise.
9299 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 9300
d0829076
PE
9301 Switch from 'int' to 'bool' where that makes sense.
9302
9303 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
9304 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
9305 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
9306 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
9307 Return or accept bool, not int. All callers changed.
9308 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
9309 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
9310 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
9311 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
9312 bitset_or_and_cmp_): Likewise.
9313 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
9314 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
9315 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
9316 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
9317 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
9318 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
9319 bitset_stats_or_and_cmp): Likewise.
9320 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
9321 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
9322 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
9323 ebitset_xor_cmp): Likewise.
9324 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
9325 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
9326 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
9327 lbitset_xor_cmp): Likewise.
9328 * lib/bbitset.h: Include <stdbool.h>.
9329 (struct bitset_vtable): The following members now return bool, not
9330 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
9331 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
9332 or_and_cmp).
9333 * src/conflicts.c (count_rr_conflicts): Likewise.
9334 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
9335 All uses changed.
9336 * lib/ebitset.c (ebitset_obstack_init): Likewise.
9337 * lib/lbitset.c (lbitset_obstack_init): Likewise.
9338 * src/getargs.c (debug_flag, defines_flag, locations_flag,
9339 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9340 graph_flag): Likewise.
9341 * src/getargs.h (debug_flag, defines_flag, locations_flag,
9342 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9343 graph_flag): Likewise.
9344 * src/output.c (error_verbose): Likewise.
9345 * src/output.h (error_verbose): Likewise.
9346 * src/reader.c (start_flag, typed): Likewise.
9347 * src/reader.h (typed): Likewise.
9348 * src/getargs.c (LOCATIONS_OPTION): New constant.
9349 (long_options, getargs): Use it.
9350 * src/lalr.c (build_relations): Use bool, not int.
9351 * src/nullable.c (nullable_compute): Likewise.
9352 * src/print.c (print_reductions): Likewise.
9353 * src/tables.c (action_row, pack_vector): Likewise.
9354 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
9355 * src/output.c (prepare): Use it.
9356 * src/output.c (token_definitions_output,
9357 symbol_destructors_output, symbol_destructors_output): Use string,
9358 not boolean integer, to keep track of whether to output separator.
9359 * src/print_graph.c (print_core): Likewise.
9360 * src/state.c (state_rule_lookaheads_print): Likewise.
9361
9362 * config/install-sh: Sync from automake 1.7.5.
9363
6b2584b7
PE
93642003-05-14 Paul Eggert <eggert@twinsun.com>
9365
9366 * src/parse-gram.y (rules_or_grammar_declaration): Require a
9367 semicolon after a grammar declaration, in the interest of possible
9368 future changes to the Bison input language.
9369 Do not allow a stray semicolon at the start of the grammar.
9370 (rhses.1): Allow one or more semicolons after any rule, including
9371 just before "|" as required by POSIX.
9372 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
9373 grammar.
9374
caf37a36
ADL
93752003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
9376
9377 %parse-param support for lalr1.cc.
9378
9379 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
9380 b4_cc_constructor_calls, b4_cc_constructor_call,
9381 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
9382 definitions.
9383 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
9384 parse-param arguments.
9385 (yy::b4_parser_class_name): Declare instance variables to
9386 hold parse-param arguments.
9387 * tests/calc.at: s/value/semantic_value/ because value clashes
9388 with a member of yy::b4_parser_class_name. Adjust C++ code
9389 to handle %parse-param. Enable %parse-param test in C++.
9390
3ab37077
PE
93912003-05-12 Paul Eggert <eggert@twinsun.com>
9392
9393 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
9394 English a bit. Fix fclose typo. Change "const char" to "char
9395 const", and use ANSI C rather than K&R for "main". Suggest
9396 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
9397 and suggest yy_switch_to_buffer.
9398
93992003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
9400
9401 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
9402 C89. This avoids a diagnostic on compilers that define __STDC__
9403 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 9404 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 9405
e743727f
PE
94062003-05-03 Paul Eggert <eggert@twinsun.com>
9407
9408 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
9409 Do not overrun array bounds.
9410 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 9411 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 9412
916708d5
AD
94132003-04-29 Akim Demaille <akim@epita.fr>
9414
9415 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
9416 * src/getargs.c, src/getargs.h: here, as bool, not int.
9417 (nondeterministic_parser): New.
9418 * src/parse-gram.y, src/scan-gram.l: Support
9419 %nondeterministic-parser.
9420 * src/output.c (prepare): Use nondeterministic_parser instead
9421 of glr_parser where appropriate.
9422 * src/tables.c (conflict_row, action_row, save_row)
9423 (token_actions, token_actions, pack_vector): Ditto.
9424
a06ea4aa
AD
94252003-04-29 Akim Demaille <akim@epita.fr>
9426
9427 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
9428
211074ca
AD
94292003-04-29 Akim Demaille <akim@epita.fr>
9430
9431 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
9432 with %pure-parser and %locations to exercise the patch from Yakov
9433 Markovitch below.
9434
6175ffe3
PE
94352003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
9436
9437 * data/yacc.c: (b4_lex_param): Corrected for the case where
9438 %lex-param is provided and %pure-parser isn't.
9439
b1e95857
PE
94402003-04-27 Paul Eggert <eggert@twinsun.com>
9441
9442 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 9443 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
9444 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
9445 if it is not defined.
9446 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
9447
acda9df6
PE
94482003-04-26 Paul Eggert <eggert@twinsun.com>
9449
3470c57b
PE
9450 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
9451 Declare to be of type suitable for the ninf value itself, not of
9452 type suitable for the corresponding table, since the latter might
9453 be unsigned but the ninf value might be negative. This fixes a
9454 bug reported by Alexandre Duret-Lutz in
161a71f3 9455 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 9456
acda9df6
PE
9457 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
9458 invokes it. We shouldn't invoke it twice because it will attempt
9459 to put error.o in the archive twice. This fixes a glitch reported
9460 by Martin Mokrejs in
161a71f3 9461 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 9462
b5250f26
PE
94632003-04-21 Paul Eggert <eggert@twinsun.com>
9464
9465 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
9466 to gnulib.
9467
089ac0f1
PE
94682003-04-21 Yakov Markovitch <Markovitch@iso.ru>
9469
9470 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
9471 Fix obvious typo that results in uncompilable GLR parsers
9472 when both %pure-parser and %locations are used. (trivial change)
9473
5ededac6
PE
94742003-04-17 Paul Eggert <eggert@twinsun.com>
9475
1b8f2fff
PE
9476 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
9477 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
9478 Do not insert the expected token via unput, as this runs afoul
9479 of a POSIX-compatibility bug in flex 2.5.31.
9480 All uses changed to BEGIN the parent state,
9481 since we no longer insert the expected token via unput.
9482 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
9483 that is no longer emitted after the above change.
9484
5ededac6
PE
9485 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
9486 the first one. This change is from Paul Hilfinger, and it fixes
9487 regression reported by Werner Lemberg in
161a71f3 9488 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
9489
9490 (resolve_sr_conflict): Don't invoke state_errs_set
9491 unless one or more tokens have been explicitly made errors.
9492 Otherwise, the above change causes Bison to abort.
9493
9494 * tests/existing.at (GNU pic Grammar): New test case, taken from
9495 Lemberg's email.
9496
b8be9132
AD
94972003-03-31 Akim Demaille <akim@epita.fr>
9498
9499 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
9500
d423d460
AD
95012003-03-31 Akim Demaille <akim@epita.fr>
9502
9503 * src/output.c (prepare_symbols): Avoid trailing spaces in the
9504 output.
9505
c7e441b4
AD
95062003-03-31 Akim Demaille <akim@epita.fr>
9507
9508 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
9509 From Paul Hilfinger.
9510
231897ad
AD
95112003-03-29 Akim Demaille <akim@epita.fr>
9512
9513 * m4/error.m4: Do not put under dynamic conditions some code which
9514 expansion is under static control.
9515
5b066063
AD
95162003-03-29 Akim Demaille <akim@epita.fr>
9517
9518 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
9519
22a74fec
AD
95202003-03-29 Akim Demaille <akim@epita.fr>
9521
9522 * doc/bison.texinfo (Strings are Destroyed): New.
9523
0eee27e7
PE
95242003-03-13 Paul Eggert <eggert@twinsun.com>
9525
9526 * .cvsignore: Add configure.lineno.
9527 * src/.cvsignore: Add yacc.
9528 * tests/.cvsignore: Add testsuite.log.
9529 * doc/fdl.texi: Sync with latest FSF version.
9530
f61aad93
PE
95312003-03-12 Paul Eggert <eggert@twinsun.com>
9532
537636c7
PE
9533 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
9534 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
9535 cursor, instead of leaving it undefined. This fixes a bug
9536 reported by Tim Van Holder in
161a71f3 9537 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
9538 * tests/input.at (Torturing the Scanner): Test the scanner on
9539 an empty input file, which was Tim Van Holder's test case.
9540
9541 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
9542 <sys/resource.h> can be included, include sys/time.h and
9543 sys/times.h first, if available. This works around the SunOS
9544 4.1.4 porting bug reported by Bruce Becker in
161a71f3 9545 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
9546
9547 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
9548 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
9549 AC_HEADER_SYS_WAIT.
9550
f61aad93
PE
9551 Merge changes from gnulib. This was prompted because the CVS
9552 snapshot didn't build on Solaris 7 due to strnlen problems.
9553
9554 These changes need to be merged back into gnulib:
9555 * lib/hash.c: Include <stdbool.h> unconditionally.
9556 * m4/onceonly.m4 (m4_quote): New macro.
9557 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
9558 Quote AC_FOREACH variable-expansions properly.
9559 The 2003-01-03 obstack.h change also needs merging.
9560 {end of changes requiring merging}
5b066063 9561
f61aad93
PE
9562 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9563 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
9564 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
9565 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
9566 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
9567 New files, imported from gnulib.
9568 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
9569 above.
9570
9571 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
9572 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
9573 gnulib sources.
9574
9575 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
9576 Add.
9577 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
9578 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
9579 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
9580 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
9581 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
9582 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
9583 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
9584 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
9585 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
9586 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
9587 (jm_PREREQ_ARGMATCH): Remove.
9588 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
9589 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
9590
9591 * src/system.h: Include <stdbool.h> unconditionally.
9592
9593 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
9594 assuming at least C89 in the bitset code for some time now.
9595
d2ffe116
AD
95962003-03-03 Akim Demaille <akim@epita.fr>
9597
9598 * ro.po: New.
9599
052826fd
AD
96002003-03-02 Akim Demaille <akim@epita.fr>
9601
9602 * doc/bison.texinfo (Table of Symbols): Reactivate the
9603 documentation for %lex-param, and %parse-param.
9604
c4749565
AD
96052003-03-02 Akim Demaille <akim@epita.fr>
9606
9607 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
9608 generate verbose error messages.
9609 Use the number of tokens as an upper bound in yytname, as it
9610 cannot be a non terminal.
9611
d5286af1
AD
96122003-03-02 Akim Demaille <akim@epita.fr>
9613
9614 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
9615 message.
9616
22e304a6
AD
96172003-03-02 Akim Demaille <akim@epita.fr>
9618
22e304a6
AD
9619 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
9620 Use them to exercise yycheck overrun.
9621 Based on Andrew Suffield's grammar.
9622
67a25fed
AD
96232003-03-02 Akim Demaille <akim@epita.fr>
9624
9625 Create tests/local.at for Bison generic testing macros.
9626
9627 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
9628 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
9629 This new file.
9630 * tests/calc.at (AT_CHECK_CALC): Adjust.
9631 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
9632 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
9633 * tests/local.at: here.
9634 (AT_COMPILE_CXX): Tags the tests using it as c++.
9635 Ignore the test if CXX is not functional.
9636
9c2b381f
PE
96372003-03-01 Paul Eggert <eggert@twinsun.com>
9638
9639 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
9640 not loc->end, since loc->end might contain garbage and this leads
9641 to undefined behavior on some platforms.
9642 (id_loc, token_start): Use (IF_LINTed) initial values that do not
9643 depend on *loc, so that the reader doesn't give the the false
9644 impression that *loc is initialized.
9645 (<INITIAL>"%%"): Do not bother setting code_start, since its value
9646 does not survive the return.
9647
0433ba88
AD
96482003-03-01 Akim Demaille <akim@epita.fr>
9649
9650 * src/scan-gram.l (code_start): Always initialize it when entering
9651 into yylex, as SC_EPILOGUE is activated *before* the corresponding
9652 yylex invocation. An alternative would be making it static, but
9653 then it starts with the second %%'s beginning, instead of its end.
9654
b305ea69
PE
96552003-02-28 Paul Eggert <eggert@twinsun.com>
9656
9657 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
9658 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 9659 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 9660
c3d25e01
PE
96612003-02-26 Paul Eggert <eggert@twinsun.com>
9662
9663 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
9664 Remove Sequent/Pyramid discussion (nobody uses them any more).
9665 Merge VMS and MS-DOS discussion; these ports may well be dead
9666 but let's keep mentioning them for now. Put <> around email
9667 addresses. Add copyright notice.
9668
c267ffbc
PE
96692003-02-24 Paul Eggert <eggert@twinsun.com>
9670
9671 * data/glr.c (yy_reduce_print): yylineno -> yylno,
9672 to avoid collision with flex use of yylineno.
9673 Problem reported by Bruce Lilly in
161a71f3 9674 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
9675 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9676 * data/yacc.c (yy_reduce_print): Likewise.
9677
9678 * config/depcomp: Sync with Automake 1.7.3.
9679
f939fc12
AD
96802003-02-21 Akim Demaille <akim@epita.fr>
9681
9682 * data/lalr1.cc: Use temporary variables instead of casts to
9683 change integer types.
9684 Suggested by Paul Eggert.
9685
95923bd6
AD
96862003-02-21 Akim Demaille <akim@epita.fr>
9687
9688 * doc/bison.texinfo: Use "location" consistently to refer to @n,
9689 to avoid confusions with lalr1.cc's notion of Position.
9690 Suggested by Paul Eggert.
9691
2cdc240e
AD
96922003-02-20 Akim Demaille <akim@epita.fr>
9693
9694 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
9695 before initial_columns.
9696 (location.hh): Use consistent variable names when defining the
9697 operator<<.
9698 Use "last" so that we subtract from Positions, not from unsigned.
9699
5d003116
AD
97002003-02-20 Akim Demaille <akim@epita.fr>
9701
9702 * data/lalr1.cc (position.hh): New subfile, including the extended
9703 and Doxygen'ed documentation of class Position.
9704 (location.hh): Use it.
9705 Document a` la Doxygen.
ba1ecc07 9706 With the help of Benoit Perrot.
5d003116 9707
d02b25f9
AD
97082003-02-20 Akim Demaille <akim@epita.fr>
9709
9710 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
9711 AT_YACC_IF.
9712 Redefine AT_YYERROR_SEES_LOC_IF using it.
9713 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
9714 not defined.
9715 Don't use the location in yy::Parser::error_ and
9716 yy::Parser::print_ when not %locations.
9717 Activate more lalr1.cc tests.
9718
0d1c3a04
AD
97192003-02-19 Akim Demaille <akim@epita.fr>
9720
9721 * data/lalr1.cc: When displaying a line number, be sure to make it
9722 an int.
9723
60a777aa
AD
97242003-02-19 Akim Demaille <akim@epita.fr>
9725
9726 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
9727 Remove, useless.
9728 (YYABORT, YYACCEPT, YYERROR): New.
9729 * tests/calc.at: Renable the lalr1.cc test.
9730
0b86fc41
AD
97312003-02-19 Akim Demaille <akim@epita.fr>
9732
9733 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
9734 error recovery, mixing with/without pops and discarding of the
9735 lookahead.
9736 Exercise YYERROR.
9737 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
9738
da99a5dc
PE
97392003-02-17 Paul Eggert <eggert@twinsun.com>
9740
9741 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
9742 * tests/testsuite.at (AT_COMPILE): Use them.
9743 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 9744 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 9745
93b8c255
PE
97462003-02-12 Paul Eggert <eggert@twinsun.com>
9747
9748 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
9749 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 9750 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
9751 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
9752 Check for malloc failure, for consistency with yacc.c.
9753 (yytname_size): Remove, for consistency with yacc.c.
9754
9755 The bug still remains in data/lalr1.cc, as I didn't have time
9756 to fix it there.
9757
7548fed2
AD
97582003-02-06 Akim Demaille <akim@epita.fr>
9759
9760 * configure.ac (GXX): Rename as...
9761 (CXX): this, to keep the original Autoconf semantics.
9762 Require 2.57.
9763 * data/lalr1.cc: Fix b4_copyright invocations.
9764 If YYDEBUG is not defined, don't depend upon name_ being defined.
9765 (location.hh): Include string and iostream.
9766 (Position::filename): New member.
9767 (Position::Position ()): New.
9768 (operator<< (Position)): New.
9769 (operator- (Position, int)): New.
9770 (Location::first, Location::last): Rename as...
9771 (Location::begin, Location::end): these, to mock the conventional
9772 iterator names.
9773 (operator<< (Location)): New.
9774 * tests/atlocal.in (CXX): New.
9775 * tests/testsuite.at (AT_COMPILE_CXX): New.
9776 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
9777 locations in a more synthetic way.
9778 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
9779 lalr1.cc is used.
9780 Adjust the C locations to match those from Emacs: first column is
9781 column 0.
9782 Change all the expected results.
9783 Conform to the GCS: simplify the locations when applicable.
9784 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
9785 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
9786 these CPP macros with the m4 macros new defined by...
9787 (AT_CHECK_PUSHDEFS): this, i.e.:
9788 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 9789 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
9790 New macros.
9791 (AT_CHECK_POPDEFS): Undefine them.
9792 (AT_CHECK_CALC_LALR1_CC): New.
9793 Use it for the first lalr1.cc test.
9794
43a176ef
AD
97952003-02-04 Akim Demaille <akim@epita.fr>
9796
9797 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9798 Location as is defined.
9799
fc049e9c
AD
98002003-02-04 Akim Demaille <akim@epita.fr>
9801
9802 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9803 name_ being defined.
9804
a737b216
PE
98052003-02-03 Paul Eggert <eggert@twinsun.com>
9806
9807 * src/gram.h (start_symbol): Remove unused decl.
9808
9809 Use more-consistent naming conventions for local vars.
9810
9811 * src/derives.c (derives_compute): Change type of local var from
9812 int to rule_number.
9813 * src/gram.c (grammar_rules_partial_print): Likewise.
9814 * src/print.c (print_core): Likewise.
9815 * src/reduce.c (reduce_grammar_tables): Likewise.
9816
9817 * src/gram.c (grammar_dump): Change name of item_number *
9818 local var from r to rp.
9819 * src/nullable.c (nullable_compute): Likewise.
9820
9821 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9822
9823 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9824 for symbol or symbol_number var.
9825 * src/reader.c (grammar_start_symbol_set): Likewise.
9826 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9827 Likewise.
9828 * src/state.c (transitions_to): Likewise.
9829 * src/state.h: Likewise.
9830 * src/tables.c (symbol_number_to_vector_number): Likewise.
9831
9832 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9833 char * var.
9834
9835 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9836 var.
9837
9838 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9839 var.
9840
9841 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9842 Use str, not s, for char * var. Use ch, not c, for character var.
9843 Use size for size var.
9844
9845 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9846 char * var.
9847 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9848 uniqstr var.
9849 * src/uniqstr.h: Likewise.
9850
9851 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9852 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9853 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9854 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9855 param to have same name as that of enum, so that we don't use
9856 "s" to stand for a non-state.
9857
68e93ad5
AD
98582003-02-02 Akim Demaille <akim@epita.fr>
9859
9860 * src/scan-skel.l: Scan more than one inert character per yylex
9861 invocation.
9862
92898986
PE
98632003-02-01 Paul Eggert <eggert@twinsun.com>
9864
9865 Version 1.875a.
9866
1d9d5d71
PE
9867 * po/LINGUAS: Add ms.
9868
0435d061
AD
98692003-01-30 Akim Demaille <akim@epita.fr>
9870
9871 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9872
6029a57f
PH
98732003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9874
9875 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9876 of $1.
0435d061
AD
9877
9878 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 9879 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 9880 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 9881
6029a57f
PH
9882 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9883 (b4_rhs_location): Ditto.
0435d061 9884 (yyfill): New function to copy from stack tree into array
6029a57f 9885 incrementally.
0435d061
AD
9886 (yyuserAction): Modify to allow incremental move of semantic values
9887 to rhs array when in GLR mode.
9888 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
9889 as needed.
9890 Remove dummy use of yystack, as there is now a guaranteed use.
9891 (yydoAction): Modify to allow incremental move of semantic values
9892 to rhs array when in GLR mode.
9893 (yyresolveAction): Ditto.
9894 (yyglrShiftDefer): Update comment.
0435d061 9895 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
9896 (yyglrReduce): Ditto.
9897 (yydoAction): Ditto
0435d061 9898
6029a57f
PH
9899 * tests/glr-regr1.at: Rename to ...
9900 * tests/glr-regression.at: Add new regression test for the problems
9901 described above (adapted from S. Eken).
9902 Update copyright notice.
9903 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9904 * tests/Makefile.am: Ditto.
9905
6cee6297
PE
99062003-01-28 Paul Eggert <eggert@twinsun.com>
9907
9908 * data/lalr1.cc: Do not use @output_header_name@ unless
9909 b4_defines_flag is set. This fixes two bugs reported by
9910 Tim Van Holder in
161a71f3
PE
9911 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9912 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 9913
b2a836b5
PE
99142003-01-21 Paul Eggert <eggert@twinsun.com>
9915
9916 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9917 we don't need to worry about yyerrlab1 being reported as an
9918 "unused label" by non-GCC C compilers. The downside is that if
9919 locations are used then a couple of statements are duplicated each
9920 time YYERROR is invoked, but the upside is that the warnings
9921 should vanish.
9922 (yyerrlab1): Move code to YERROR.
9923 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9924 This reverts some of the 2002-12-27 change.
9925
4196b931
PE
99262003-01-17 Paul Eggert <eggert@twinsun.com>
9927
9928 * src/output.c (symbol_printers_output): Fix typo that led
9929 to core dump. Problem reported by Antonio Rus in
161a71f3 9930 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 9931
3ae831b4
AD
99322003-01-13 Akim Demaille <akim@epita.fr>,
9933 Quoc Peyrot <chojin@lrde.epita.fr>,
9934 Robert Anisko <anisko_r@lrde.epita.fr>
9935
9936 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9937 when the stacks contain one element, as the loop would otherwise
9938 free the last state, and then use the top state (the one we just
9939 popped). This means that the initial elements will not be freed
9940 explicitly, as is the case in yacc.c; it is not a problem, as
9941 these elements have fake values.
9942
e3aa65c5
PE
99432003-01-11 Paul Eggert <eggert@twinsun.com>
9944
9945 * NEWS: %expect-violations are now just warnings, reverting
9946 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9947 bootstrapping problem reported by Matthias Klose; see
161a71f3 9948 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
9949 * src/conflicts.c (conflicts_print): Likewise.
9950 * tests/conflicts.at (%expect not enough, %expect too much,
9951 %expect with reduce conflicts): Likewise.
9952 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9953 that the warning is enabled if the number of conflicts changes
9954 (not necessarily increases).
9955
9956 * src/getargs.c (version): Update copyright year.
9957
f0057011
AD
99582003-01-09 Akim Demaille <akim@epita.fr>
9959
9960 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9961
1ee6d2a0
PE
99622003-01-08 Paul Eggert <eggert@twinsun.com>
9963
9964 * Makefile.maint (WGETFLAGS):
9965 New macro, containing "-C off" to disable proxy caches.
9966 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9967 (rel-check): Use $(WGET) instead of wget.
9968
d4fd77c4
PE
99692003-01-06 Paul Eggert <eggert@twinsun.com>
9970
9971 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
9972 the GLR paper of Scott, Johnstone and Hussain.
9973
464c6927
PE
99742003-01-04 Paul Eggert <eggert@twinsun.com>
9975
d600ee67
PE
9976 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
9977 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
9978 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
9979 (EXTRA_LIBRARIES): New var, for liby.a.
9980 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
9981 (EXTRA_SCRIPTS): New var, for yacc.
9982
464c6927
PE
9983 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
9984 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
9985 Problem reported by Nelson H. F. Beebe.
9986
99872003-01-03 Paul Eggert <eggert@twinsun.com>
9988
9989 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
9990 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
9991 when compiling Bison 1.875's `bitset bset = obstack_alloc
9992 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
9993
9994 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
9995 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
9996 grow to a huge size with typical invocation.
d600ee67 9997
464c6927
PE
9998 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
9999 Use the pattern recommended by Autoconf 2.57, except also protect
10000 against double-definition.
10001 * src/system.h: Likewise.
10002 Portability issues reported by Nelson H. F. Beebe.
d600ee67 10003
464c6927
PE
10004 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
10005 All uses changed. Provide a definition in both C and C++.
10006 (yytrue, yyfalse): Define even if defined (__cplusplus).
10007
10008 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
10009 Reported by Nelson H. F. Beebe.
d600ee67 10010
464c6927
PE
10011 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
10012
0f42c7d5
PE
100132003-01-02 Paul Eggert <eggert@twinsun.com>
10014
10015 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
10016 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
10017 Bug reported by Nelson H. F. Beebe.
10018
dc546b0f
PE
100192003-01-01 Paul Eggert <eggert@twinsun.com>
10020
10021 * Version 1.875.
10022
2c09b6a7
PE
100232002-12-30 Paul Eggert <eggert@twinsun.com>
10024
10025 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
10026 Moved here from...
10027 (<INITIAL>","): Here. This causes stray "," to be treated
10028 more uniformly.
10029
dc546b0f 10030 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
10031 last brace in braced code when not in Yacc mode, for compatibility
10032 with Bison 1.35. This resurrects the 2001-12-15 patch to
10033 src/reader.c.
10034
10035 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
10036 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
10037
535c0f63
PE
100382002-12-28 Paul Eggert <eggert@twinsun.com>
10039
10040 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
10041 that of SYM's type. This fixes Debian bug 168069, reported by
10042 Thomas Olsson.
d600ee67 10043
963fcc17
PE
100442002-12-28 Paul Eggert <eggert@twinsun.com>
10045
10046 Version 1.75f.
10047
10048 Switch back to the Yacc style of conflict reports, undoing some
10049 of the 2002-07-30 change.
10050 * doc/bison.texinfo (Understanding): Use Yacc style for
10051 conflict reports. Also, use new way of locating rules.
10052 * src/conflicts.c (conflict_report):
10053 Renamed from conflict_report_yacc, removing the old
10054 'conflict_report'. Translate the entire conflict report at once,
10055 so that we don't assume that "," has the same interpretation in
10056 all languages.
10057 (conflicts_output): Use Yacc-style conflict report for each state,
10058 instead of our more-complicated style.
10059 (conflicts_print): Use Yacc-style conflict report, except print
10060 the input file name when not emulating Yacc.
10061 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
10062 Conflicted Reduction, %expect not enough, %expect too much,
10063 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
10064 * tests/existing.at (GNU Cim Grammar): Likewise.
10065 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
10066
10067 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
10068 fatal): Don't invoke fflush; it's not needed and it might even be
10069 harmful for stdout, as stdout might not be open.
10070 * src/reduce.c (reduce_print): Likewise.
10071
b1efe548
PE
100722002-12-27 Paul Eggert <eggert@twinsun.com>
10073
10074 Fix a bug where error locations were not being recorded correctly.
10075 This problem was originally reported by Paul Hilfinger in
161a71f3 10076 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
10077
10078 * data/yacc.c (yyparse): New local var yylerrsp, to record the
10079 top of the location stack's error locations.
10080 (yyerrlab): Set it. When discarding a token, push its location
10081 onto yylerrsp so that we don't lose track of the error's end.
10082 (yyerrlab1): Now is only the target of YYERROR, so that we can
10083 properly record the location of the action that failed. For GCC
10084 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
10085 GCC warning about yyerrlab1 being unused if YYERROR is unused.
10086 (yyerrlab2): New label, which yyerrlab now falls through to.
10087 Compute the error's location by applying YYLLOC_DEFAULT to
10088 the locations of all the symbols that went into the error.
10089 * doc/bison.texinfo (Location Default Action): Mention that
10090 YYLLOC_DEFAULT is also invoked for syntax errors.
10091 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10092 Error locations include the locations of all the tokens that were
10093 discarded, not just the last token.
d600ee67 10094
983c5c2c
PE
100952002-12-26 Paul Eggert <eggert@twinsun.com>
10096
b1efe548
PE
10097 * src/files.c: Include quote.h.
10098 (compute_output_file_names): Warn if we detect conflicting
10099 outputs to the same file. This should catch the misunderstanding
10100 exemplified by Debian Bug 165349, reported by Bruce Stephens..
10101
10102 * src/conflicts.c (conflicts_print): If the user specifies
10103 "%expect N", report an error if there are any reduce/reduce
10104 conflicts. This is what the manual says should happen.
10105 This fixes Debian bug 130890, reported by Anthony DeRobertis.
10106 * tests/conflicts.at (%expect with reduce conflicts): New test.
10107
983c5c2c
PE
10108 Don't use m4_include on relative file names, as it doesn't work as
10109 desired if there happens to be a file with that name under ".".
d600ee67 10110
983c5c2c
PE
10111 * m4sugar/version.m4: Remove; it was included but it wasn't used.
10112 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
10113 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
10114 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
10115 * src/output.c (output_skeleton): Use full path names when
10116 specifying a file to include; don't rely on include path, as
10117 it's unreliable when the working file contains a file with
10118 that name.
d600ee67 10119
983c5c2c
PE
101202002-12-25 Paul Eggert <eggert@twinsun.com>
10121
10122 Remove obsolete references to bison.simple and bison.hairy.
10123 Problem mentioned by Aubin Mahe in
161a71f3 10124 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
10125 * data/glr.c: Comment fix.
10126 * doc/bison.1: Remove references. Also, mention "yacc".
10127
10128 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
10129 with -g option.
10130
10131 * src/parse-gram.y (declaration): Use enum "report_states" rather
10132 than its numeric value 1.
10133
10134 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
10135 opening a new one. This fixes Debian bug 165349, reported by
10136 Bruce Stephens.
10137
23f2d9dc
PE
101382002-12-24 Paul Eggert <eggert@twinsun.com>
10139
10140 Version 1.75e.
10141
10142 * Makefile.maint (cvs-update): Don't assume that the shell
10143 supports $(...), as Solaris sh doesn't.
10144
10145 * src/parse-gram.y (lloc_default): Remove test for empty
10146 nonterminals at the end, since it didn't change the result.
10147
101482002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
10149
10150 If the user does not define YYSTYPE as a macro, Bison now declares it
10151 using typedef instead of defining it as a macro. POSIX requires this.
10152 For consistency, YYLTYPE is also declared instead of defined.
10153
10154 %union directives can now have a tag before the `{', e.g., the
10155 directive `%union foo {...}' now generates the C code
10156 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
10157 The default union tag is `YYSTYPE', for compatibility with Solaris 9
10158 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
10159 instead of `yyltype'.
10160
10161 `yystype' and `yyltype' are now obsolescent macros instead of being
10162 typedefs or tags; they are no longer documented and will be
10163 withdrawn in a future release.
10164
10165 * data/glr.c (b4_location_type): Remove.
10166 (YYSTYPE): Renamed from yystype.
10167 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
10168 (struct YYLTYPE): Renamed from struct yyltype.
10169 (YYLTYPE): Renamed from yyltype.
10170 (yyltype, yystype): New (and obsolescent) macros,
10171 for backward compatibility.
10172 * data/yacc.c: Likewise.
10173
10174 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
10175 does not specify a union tag. This is for compatibility with
10176 Solaris 9 yacc.
10177
10178 * src/parse-gram.y (add_param): 2nd arg is now char * not char
10179 const *, since it is now modified by stripping surrounding { }.
10180 (current_braced_code): Remove.
10181 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
10182 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
10183 trailing " {...}". Now of type <chars>.
10184 (grammar_declaration): Adjust to bundled tokens.
10185 (code_content): Remove; stripping is now done by add_param.
10186 (print_token_value): Print contents of bundled tokens.
10187 (token_name): New function.
10188
10189 * src/reader.h (braced_code, current_braced_code): Remove.
10190 (token_name): New decl.
10191
10192 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
10193 token_type, not braced_code code_kind. All uses changed.
10194 (SC_PRE_CODE): New state, for scanning after a keyword that
10195 has (or usually has) an immediately-following braced code.
10196 (token_type): New local var, to keep track of which token type
10197 to return when scanning braced code.
10198 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 10199 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
10200 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
10201 instead of returning a token type immediately.
10202 (<INITIAL>"{"): Set token type.
10203 (<SC_BRACED_CODE>"}"): Use it.
10204 (handle_action_dollar, handle_action_at): Now returns bool
10205 indicating success. Fail if ! current_rule; this prevents a core dump.
10206 (handle_symbol_code_dollar, handle_symbol_code_at):
10207 Remove; merge body into caller.
10208 (handle_dollar, handle_at): Complain in invalid contexts.
10209
10210 * NEWS, doc/bison.texinfo: Document the above.
10211 * NEWS: Fix years and program names in copyright notice.
10212
879ca4f8
PE
102132002-12-17 Paul Eggert <eggert@twinsun.com>
10214
10215 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
10216 Reporting, Table of Symbols): Omit mentions of %lex-param and
10217 %parse-param from the documentation for now.
10218
1c5fe69d
PE
102192002-12-15 Paul Eggert <eggert@twinsun.com>
10220
10221 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
10222 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
10223 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
10224 disagreed with the Bison documentation. Bug
10225 reported by Andrew Walrond.
d600ee67 10226
1c5fe69d
PE
10227 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
10228 as the caller now does that.
10229 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
10230 (YYEMPTY): Parenthesize right hand side, since others use it.
10231 (yyparse): Don't assume that our generated code is the only code
10232 that sets yychar.
10233
d1de5372
PE
102342002-12-13 Paul Eggert <eggert@twinsun.com>
10235
10236 Version 1.75d.
10237
10238 POSIX requires a "yacc" command.
10239 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
10240 (MOSTLYCLEANFILES): Add yacc.
10241 (yacc): New rule.
1c5fe69d 10242 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
10243 as an alias for bison y.
10244
10245 * po/LINGUAS: Add da.
d600ee67 10246
d1de5372
PE
10247 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
10248 problem with latest <getopt.h>.
10249 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
10250
10251 * doc/fdl.texi: Upgrade to 1.2.
10252 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
10253 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
10254 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
10255 gnulib.
10256 * config/install-sh: Sync with autotools.
10257
10258 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 10259 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
10260 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
10261 locations are requested.
10262 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
10263 locations are requested.
10264
d0f3fe23
PE
102652002-12-12 Paul Eggert <eggert@twinsun.com>
10266
10267 Remove unportable casts and storage allocation tricks.
10268 While we're at it, remove almost all casts, since they
10269 usually aren't needed and are a sign of trouble.
10270
10271 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
10272
10273 * src/derives.c (derives_compute): Do not subtract NTOKENS from
10274 the pointer DSET returned by malloc; this isn't portable.
10275 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
10276 Similarly for DERIVES.
10277 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
10278 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
10279 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
10280
10281 * src/derives.c (derives_compute): Do not bother invoking
10282 int_of_rule_number, since rule numbers are integers.
10283
10284 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
10285 rather than XMALLOC (char, N).
10286
10287 * src/files.c (filename_split): Rewrite to avoid cast.
10288
10289 * src/gram.h (symbol_number_as_item_number,
10290 item_number_as_symbol_number, rule_number_as_item_number,
10291 item_number_as_rule_number):
10292 Now inline functions rather than macros, to avoid casts.
10293 * src/state.h (state_number_as_int): Likewise.
10294 * src/tables.c (state_number_to_vector_number,
10295 symbol_number_to_vector_number): Likewise.
10296
10297 * src/gram.h (int_of_rule_number): Remove; no longer used.
10298
10299 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
10300 since the resulting storage is always stored into.
10301
10302 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
10303 where it's needed.
10304
10305 * src/muscle_tab.c (muscle_m4_output):
10306 Now inline. Return bool, not int.
10307 * src/state.c (state_compare): Likewise.
10308 * src/symtab.c (symbol_check_defined,
10309 symbol_check_alias_consistency, symbol_pack, symbol_translation,
10310 hash_compare_symbol, hash_symbol):
10311 Likewise.
10312 * src/uniqstr.c (uniqstr_print): Likewise.
10313 * src/muscle_tab.c (muscle_m4_output_processor):
10314 New function, to avoid casts.
10315 * src/state.c (state_comparator, stage_hasher): Likewise.
10316 * src/symtab.c (symbol_check_defined_processor,
10317 symbol_check_alias_consistency_processor, symbol_pack_processor,
10318 symbol_translation_processor, hash_symbol_comparator,
10319 hash_symbol_hasher): Likewise.
10320 * src/uniqstr.c (uniqstr_print_processor): Likewise.
10321 * src/muscle_tab.c (muscles_m4_output):
10322 Use new functions instead of casting old functions unportably.
10323 * src/state.c (state_hash_new): Likewise.
10324 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
10325 symbols_token_translations_init):
10326 Likewise.
10327 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
10328
10329 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
10330 var instead of casting to long, to avoid casts.
10331 (prepare_states): Use MALLOC rather than alloca, so that we don't
10332 have to worry about alloca.
10333 * src/state.c (state_hash_lookup): Likewise.
10334
10335 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
10336 local var instead of casting to unsigned char, to avoid casts.
10337
10338 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
10339 STATE_ALLOC): Remove.
10340 (transitions_new, errs_new, reductions_new, state_new): Use malloc
10341 rather than calloc, and use offsetof to avoid allocating slightly
10342 too much storage.
10343 (state_new): Initialize all members.
10344
10345 * src/state.c (state_hash): Use unsigned accumulator, not signed.
10346
10347 * src/symtab.c (symbol_free): Remove; unused.
10348 (symbol_get): Remove cast in lhs of assignment.
10349 (symbols_do): Now static. Accept generic arguments, not
10350 hashing-related ones.
10351
10352 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
10353 (symbol_processor): Remove.
10354 (symbols_do): Remove decl; now static.
10355
10356 * src/system.h (alloca): Remove; decl no longer needed.
10357 (<stddef.h>): Include, for offsetof.
10358 (<inttypes.>, <stdint.h>): Include if available.
10359 (uintptr_t): New type, if system lacks it.
10360 (CALLOC, MALLOC, REALLOC): New macros.
10361 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
10362 new macros.
10363
10364 * src/tables.c (table_size): Now int, to pacify GCC.
10365 (table_grow, table_ninf_remap): Use signed table size.
10366 (save_row): Don't bother initializing locals when not needed.
10367 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
10368 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
10369
10370 * src/vcg.h: Correct misspellings.
10371
10372 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
10373
10374
10375 * src/getargs.c (getargs): Don't assume EOF == -1.
10376
26b4a969
PE
103772002-12-09 Paul Eggert <eggert@twinsun.com>
10378
10379 Change identifier spellings to avoid collisions with names
10380 that are reserved by POSIX.
10381
10382 Don't use names ending in _t, since POSIX reserves them.
10383 For consistency, remove _e and _s endings -- they're weren't
10384 needed to remove ambiguity. All uses changed.
10385 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
10386 turn was just renamed from struniq_t.
10387 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
10388 which in turn was just renamed from struniq_processor_t.
10389 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
10390 in turn was renamed from hash_compare_struniq_t.
10391 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
10392 (state_list): Renamed from state_list_t.
10393 * src/assoc.h (assoc): Renamed from assoc_t.
10394 * src/conflicts.c (enum conflict_resolution): Renamed from
10395 enum conflict_resolution_e.
10396 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
10397 (rule_list): Renamed from rule_list_t.
10398 * src/getargs.h (enum trace): Renamed from enum trace_e.
10399 (enum report): Renamed from enum report_e.
10400 * src/gram.h (item_number): Renamed from item_number_t.
10401 (rule_number): Renamed from rule_number_t.
10402 (struct rule_s): Remove the "rule_s" part; not used.
10403 (rule): Renamed from rule_t.
10404 (rule_filter): Renamed from rule_filter_t.
10405 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
10406 (goto_list): Renamed from goto_list_t.
10407 * src/lalr.h (goto_number): Renamed from goto_number_t.
10408 * src/location.h (location): Renamed from location_t.
10409 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
10410 and moved here from:
10411 * src/muscle_tab.h (muscle_entry_t): here.
10412 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
10413 (rule_list): Renamed from rule_list_t.
10414 * src/print_graph.c (static_graph): Renamed from graph.
10415 * src/reader.h (braced_code): Renamed from braced_code_t.
10416 Remove brace_code_e tag.
10417 * src/relation.h (relation_node): Renamed from relation_node_t.
10418 (relation_nodes): Renamed from relation_nodes_t.
10419 (relation): Renamed from relation_t.
10420 * src/state.h (state_number): Renamed from state_number_t.
10421 (struct state): Renamed from struct state_s.
10422 (state): Renamed from state_t.
10423 (transitions): Renamed from transitions_t. Unused (and
10424 misspelled) transtion_s tag removed.
10425 (errs): Renamed from errs_t. Unused errs_s tag removed.
10426 (reductions): Renamed from reductions_t. Unused tag
10427 reductions_s removed.
10428 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
10429 (struct symbol_list): Renamed from struct symbol_list_s.
10430 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
10431 (struct symbol): Renamed from struct symbol_s.
10432 (symbol): Renamed from symbol_t.
10433 * src/tables.c (vector_number): Renamed from vector_number_t.
10434 (action_number): Renamed from action_t.
10435 * src/tables.h (base_number): Renamed from base_t.
10436 * src/vcg.h (enum color): Renamed from enum color_e.
10437 (enum textmode): Renamed from enum textmode_e.
10438 (enum shape): Renamed from enum shape_e.
10439 (struct colorentry): Renamed from struct colorentry_s.
10440 (struct classname): Renamed from struct classname_s.
10441 (struct infoname): Renamed from struct infoname_s.
10442 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
10443 (enum decision): Renamed from enum decision_e.
10444 (enum orientation): Renamed from enum orientation_e.
10445 (enum alignment): Renamed from enum alignment_e.
10446 (enum arrow_mode): Renamed from enum arrow_mode_e.
10447 (enum crossing_type): Renamed from enum crossing_type_e.
10448 (enum view): Renamed from enum view_e.
10449 (struct node): Renamed from struct node_s.
10450 (node): Renamed from node_t.
10451 (enum linestyle): Renamed from enum linestyle_e.
10452 (enum arrowstyle): Renamed from enum arrowstyle_e.
10453 (struct edge): Renamed from struct edge.
10454 (edge): Renamed from edge_t.
10455 (struct graph): Renamed from struct graph_s.
10456 (graph): Renamed from graph_t.
10457 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
10458 Rename value_t -> value.
10459 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
10460 value_t_as_yystype -> value_as_yystype.
10461
10462 Don't include <errno.h> in the mainstream code, since it
10463 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
10464 * lib/get-errno.c, lib/get-errno.h: New files.
10465 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
10466 get-errno.c.
10467 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
10468 * src/output.c (output_skeleton): Likewise.
10469 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
10470 instead of errno.
10471 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
10472 Likewise.
10473 (handle_action_dollar, handle_action_at): Likewise.
10474 * src/system.h: Do not include <errno.h>.
10475 (TAB_EXT): Renamed from EXT_TAB.
10476 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
10477
10478 Avoid str[a-z]*, since <string.h> reserves that name space.
10479 Change all instances of "struniq" in names to "uniqstr", and
10480 likewise for "STRUNIQ" and "UNIQSTR".
10481 * src/uniqstr.c: Renamed from src/struniq.c.
10482 * src/uniqstr.h: Renamed from src/struniq.h.
10483 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
10484 * src/files.c (strsuffix): Remove; unused.
10485 (concat2): Renamed from stringappend. Now static.
10486 * src/files.h (strsuffix, stringappend): Remove; unused.
10487 * src/parse-gram.y (<chars>): Renamed from <string>.
10488 (<uniqstr>): Renamed from <struniq>.
10489 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
10490 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
10491 (struct graph_s.expand): Renamed from struct graph_s.stretch.
10492 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
10493 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
10494 (N_EXPAND): Renamed from N_STRETCH.
10495
10496 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
10497 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
10498 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
10499 Remove; unused.
10500 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
10501 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
10502 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
10503 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
10504 (BASE_MAXIMUM): Renamed from BASE_MAX.
10505 (BASE_MINIMUM): Renamed from BASE_MIN.
10506 (ACTION_MAX): Remove; unused.
10507 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
10508 Unnecessary casts removed from above defines.
10509
10510
10511 Fix misspelling in names.
10512 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
10513 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
10514 G_NODE_ALIGNEMENT.
10515
10516
10517 * lib/timevar.c (timevar_report): Renamed from time_report,
10518 for consistency with other names.
10519 * lib/timevar.h (timevar_report): New decl.
10520 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
10521
10522
10523 Sort include-file uses.
10524
10525 Reorder all include files under src to be in the order "system.h".
10526 then the ../lib include files in angle brackets (alphabetized),
10527 then the . include files in double-quotes (alphabetized). Fix
10528 dependency breakages encountered in this process, as follows:
10529 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
10530 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
10531 * src/state.h: Include "symtab.h".
10532
996b1c7e
PE
105332002-12-08 Paul Eggert <eggert@twinsun.com>
10534
10535 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
10536 since this causes problems when __file__ contains character
10537 sequences like "@" that are treated specially by src/scan-skel.l.
10538 Instead, just use the file's basename. This fixes the bug
10539 reported by Martin Mokrejs in
161a71f3 10540 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 10541
e19c4e5d
PE
105422002-12-06 Paul Eggert <eggert@twinsun.com>
10543
10544 Add support for rules that do not have trailing semicolons, as
10545 POSIX requires. Improve the quality of locations in Bison
10546 diagnostics.
26b4a969 10547
e19c4e5d
PE
10548 * src/location.c: Include <quotearg.h>.
10549 (empty_location): Now const.
10550 (location_print): New function. Follow the recommendation of the
10551 GNU Coding Standards for locations that span file boundaries.
10552 * src/location.h: Do not include <quotearg.h>; no longer needed.
10553 (boundary): New type.
10554 (location_t): Use it. This allows locations to span file boundaries.
10555 All member uses changed: file -> start.file or end.file (as needed),
10556 first_line -> start.line, first_column -> start.column,
10557 last_line -> end.line, last_column -> end.column.
10558 (equal_boundaries): New function.
10559 (LOCATION_RESET, LOCATION_STEP): Remove.
10560 (LOCATION_PRINT): Remove. All callers changed to use location_print.
10561 (empty_location): Now const.
10562 (location_print): New decl.
10563 * src/parse-gram.y (lloc_default): New function, which handles
10564 empty locations more accurately.
10565 (YYLLOC_DEFAULT): Use it.
10566 (%token COLON): Remove.
10567 (%token ID_COLON): New token.
26b4a969 10568 (rules): Use it.
e19c4e5d
PE
10569 (declarations, rules): Remove trailing semicolon.
10570 (declaration, rules_or_grammar_declaration):
10571 Allow empty (";") declaration.
10572 (symbol_def): Remove empty actions; no longer needed.
10573 (rules_or_grammar_declaration): Remove trailing semicolon.
10574 (semi_colon.opt): Remove.
10575 * src/reader.h: Include location.h.
10576 (scanner_cursor): New decl.
10577 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
10578 rolling our own.
10579 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
10580 of *loc.
10581 (STEP): Remove. No longer needed, now that adjust_location does
10582 the work. All uses removed.
10583 (scanner_cursor): New var.
10584 (adjust_location): Renamed from extend_location. It now sets
10585 *loc and adjusts the scanner cursor. All uses changed.
10586 Don't bother testing for CR.
10587 (handle_syncline): Remove location arg; now updates scanner cursor.
10588 All callers changed.
10589 (unexpected_end_of_file): Now accepts start boundary of token or
10590 comment, not location. All callers changed. Update scanner cursor,
10591 not the location.
10592 (SC_AFTER_IDENTIFIER): New state.
10593 (context_state): Renamed from c_context. All uses changed.
10594 (id_loc, code_start, token_start): New local vars.
10595 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
10596 processing of Yacc white space and equivalents here.
10597 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
10598 instead of returning ID immediately, since we need to search for
10599 a subsequent colon.
10600 (<INITIAL>"'", "\""): Save token_start.
10601 (<INITIAL>"%{", "{", "%%"): Save code_start.
10602 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
10603 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
10604 BEGIN context_state at end, not INITIAL.
10605 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
10606 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
10607 Return correct token start.
10608 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
10609 the start of a character, string or multiline comment is found.
10610 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
10611 Reduction): Adjust reported locations to match the more-precise
10612 results now expected.
10613 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
10614 * tests/reduce.at (Useless Rules, Reduced Automaton,
10615 Underivable Rules): Likewise.
10616 * tests/regression.at (Invalid inputs): No longer `expecting ";"
10617 or "|"' now that so many other tokens are allowed by the new grammar.
10618
10619 * src/complain.h (current_file): Remove duplicate decl;
10620 current_file is now owned by files.h.
10621 * src/complain.c, src/scan-gram.l: Include files.h.
10622
106232002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 10624
e19c4e5d
PE
10625 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
10626 promotes to int; it might be unsigned int.
10627 * data/yacc.c (yy_reduce_print): Likewise.
10628
10629 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
10630 be #defined in the prologue, not in the Bison declarations.
10631 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 10632
b64755e3
PE
106332002-12-02 Paul Eggert <eggert@twinsun.com>
10634
10635 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
10636 * lib/strtoul.c: New file, from gnulib.
10637 This fixes a porting bug reported by Peter Klein in
161a71f3 10638 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 10639
6e746484
PE
106402002-11-30 Paul Eggert <eggert@twinsun.com>
10641
b64755e3
PE
10642 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
10643 and put only a forward declaration in the prologue. This is for
10644 consistency with the other scanner helper functions.
10645
6ba55592
PE
10646 Type clashes now generate warnings, not errors, since it
10647 appears that POSIX may allow some grammars with type clashes.
10648 * src/reader.c (grammar_current_rule_check): Warn about
10649 type clashes instead of complaining.
10650 * tests/input.at (Type Clashes): Expect warnings, not complaints.
10651
6e746484
PE
10652 Add Yacc library, since POSIX requires it.
10653 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
10654 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
10655 * lib/main.c, lib/yyerror.c: New files.
10656
10657 gram_error can be static; it need not be extern.
10658 * src/reader.h (gram_error): Remove decl.
10659 * src/parse-gram.y (gram_error): Now static. Add static decl.
10660 (print_token_value): Omit parameter names from forward decl,
10661 for consistency.
10662
88510f9c
PE
106632002-11-29 Paul Eggert <eggert@twinsun.com>
10664
6e746484
PE
10665 * doc/bison.texinfo: Emphasize that yylex and yyerror must
10666 be declared before being used. E.g., one should typically
10667 declare them in the prologue. Use GNU coding style in examples.
10668 Put "const" consistently after the type it modifies. Mention
10669 that C99 supports "inline". Mention that yyerror traditionally
10670 returns "int".
10671
88510f9c
PE
10672 %parse-param and %lex-param now take just one argument, the
10673 declaration; the argument name is deduced from the declaration.
10674
10675 * doc/bison.texinfo (Parser Function, Pure Calling, Error
10676 Reporting, Table of Symbols): Document this.
10677 * src/parse-gram.y (add_param): New function.
10678 (COMMA): Remove.
10679 (declaration): Implement new rule for %parse-param and %lex-param.
10680 * src/scan-gram.l: "," now elicits a warning, rather than being
10681 a token; this is more compatible with byacc.
10682 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
10683
bb92250c
PE
106842002-11-27 Paul Eggert <eggert@twinsun.com>
10685
10686 Rename identifiers to avoid real and potential collisions.
10687
10688 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
10689 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 10690 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
10691 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10692 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
10693 * src/parse-gram.y (print_token_value): Renamed from yyprint.
10694 All uses changed.
10695 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
10696 The name "yycontrol" violates the name space rules, and this stuff
10697 wasn't being used anyway.
10698 (input): Remove action; this stuff wasn't being used.
10699 (gram_error): Rename local variable yylloc -> loc.
10700 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
10701 (YY_DECL): Don't use "yy" at start of local variables.
10702 All uses changed, e.g., yylloc -> loc.
10703 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
10704 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
10705 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
10706 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
10707
10708 * src/parse-gram.y (gram_error): loc is now const *.
10709 * src/reader.h (gram_error): Likewise.
10710
3af4feb2
PE
107112002-11-24 Paul Eggert <eggert@twinsun.com>
10712
10713 Version 1.75c.
10714
10715 * tests/actions.at (Actions after errors): Use an output format
10716 more similar to that of the Printers and Destructors test.
10717 Test the position of the ';' token too.
10718 (Printers and Destructors): Likewise.
10719 (Printers and Destructors: %glr-parser): Remove for now, to avoid
10720 unnecessarily alarming people when the test fails.
10721
10722 * data/yacc.c (yyerrlab1): Move this label down, so that the
10723 parser does not discard the lookahead token if the user code
10724 invokes YYERROR. This change is required for POSIX conformance.
10725
10726 * lib/error.c: Sync with gnulib.
10727
107282002-11-22 Paul Eggert <eggert@twinsun.com>
10729
10730 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
10731 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
10732 * lib/xmalloc.c: Likewise.
26b4a969 10733
58004308
PE
107342002-11-20 Paul Eggert <eggert@twinsun.com>
10735
10736 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
10737
107382002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 10739
58004308
PE
10740 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
10741 should use `if (! x) abort ();' rather than `assert (x);', and
10742 anyway it's one less thing to worry about configuring.
10743
10744 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
10745 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
10746 and replace all instances of assert with abort.
10747 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10748 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
10749
10750 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
10751 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
10752 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
10753 hash_find_entry, hash_rehash, hash_insert): Likewise.
10754 * src/conflicts.c (resolve_sr_conflict): Likewise.
10755 * src/lalr.c (set_goto_map, map_goto): Likewise.
10756 * src/nullable.c (nullable_compute): Likewise.
10757 * src/output.c (prepare_rules, token_definitions_output): Likewise.
10758 * src/reader.c (packgram, reader): Likewise.
10759 * src/state.c (state_new, state_free, state_transitions_set,
10760 state_reduction_find): Likewise.
10761 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
10762 symbol_pack): Likewise.
10763 * src/tables.c (conflict_row, pack_vector): Likewise.
10764 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10765 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10766 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
10767 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
10768
10769 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
10770 (ARGMATCH_CONSTRAINT): New macro.
10771 (ARGMATCH_ASSERT): Use it.
10772
10773 * src/system.h (verify): New macro.
10774 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
10775 rather than assert.
10776 * src/tables.c (tables_generate): Likewise.
10777
10778 * src/struniq.c (struniq_assert): Now returns void, and aborts
10779 if the assertion is false.
10780 (struniq_assert_p): Remove.
10781 * src/struniq.h: Likewise.
10782
76ae8198
PE
107832002-11-18 Paul Eggert <eggert@twinsun.com>
10784
10785 * data/glr.c (yygetLRActions): Replace `yyindex' with
10786 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
10787 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 10788 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 10789
d3c4e709
AD
107902002-11-18 Akim Demaille <akim@epita.fr>
10791
10792 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
10793 space.
10794 From Tim Van Holder.
10795
8d8a7238
PE
107962002-11-17 Paul Eggert <eggert@twinsun.com>
10797
10798 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10799 to "SyntaxError" for consistency with my 2002-11-15 change.
10800
10801 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10802 not define to {}, since this breaks the common use of `YYDPRINTF
10803 ((...));' if a single statement is desired (e.g. before `else').
10804 Work around GCC warnings by surrounding corresponding calls with
10805 {} if needed.
10806 (yyhasResolvedValue): Remove unused function.
10807 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10808 loop body.
10809 (yyreportSyntaxError): Renamed from yyreportParseError.
10810 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10811 All uses changed.
10812 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10813 extern when possible. Remove unused initializations.
10814
b0937b22
AD
108152002-11-16 Akim Demaille <akim@epita.fr>
10816
10817 Augment the similarity between GLR and LALR traces.
10818
10819 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10820 (YY_REDUCE_PRINT): New.
10821 (yyparse): Use them.
10822 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10823 YYDPRINT here.
10824 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10825 state reached after the reduction/recovery, since...
10826 (yyparse, yyprocessOneStack): Report the state we are entering in.
10827
c5e3e510
AD
108282002-11-16 Akim Demaille <akim@epita.fr>
10829
10830 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10831 Add support for --trace=skeleton.
10832 * src/scan-skel.l: %option debug.
10833 Scan strings of non-@ or \n instead of character by character.
10834 (scan_skel): Handle trace_skeleton.
10835 (QPUTS): New.
10836 (@output_parser_name@, @output_header_name@): ``Restore'' their
10837 support (used to be M4 macros).
10838 * data/yacc.c: Quote larger chunks, a la glr.c.
10839 * data/lalr1.cc: Likewise.
10840 The header guards are no longer available, so use some other
10841 string than `YYLSP_NEEDED'.
10842
4c6cc1db
AD
108432002-11-16 Akim Demaille <akim@epita.fr>
10844
10845 Make the ``Printers and Destructors'' test more verbose, taking
10846 `yacc.c''s behavior as (possibly wrong) reference.
10847
10848 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10849 instead of fprint on stdout.
10850 Set and report the last_line of the symbols.
10851 Consistently display values and locations.
10852
6d9e8019
PE
108532002-11-16 Paul Eggert <eggert@twinsun.com>
10854
10855 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10856
6e649e65
PE
108572002-11-15 Paul Eggert <eggert@twinsun.com>
10858
b25d88f6
PE
10859 * tests/actions.at (Actions after errors): New test case.
10860
6e649e65
PE
10861 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10862 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10863 tests/action.at, tests/calc.at, tests/conflicts.at,
10864 tests/cxx-type.at, tests/regression.at:
10865 "parse error" -> "syntax error" for POSIX compatibility.
10866 "parsing stack overflow..." -> "parser stack overflow" so
10867 that code matches Bison documentation.
10868
0f39aab9
AD
108692002-11-15 Akim Demaille <akim@epita.fr>
10870
10871 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10872 take two BRACED_CODE, not two string_content.
10873 Free the scanner's obstack when we are done.
10874 (code_content): New.
10875 * tests/calc.at: Adjust.
10876 * doc/bison.texinfo: Adjust.
10877 Also, make sure to include the `,' for these declarations.
10878
761c1926
AD
108792002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10880
10881 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10882 definition; avoids potential autoreconf problems.
10883
b0f98b10
AD
108842002-11-15 Akim Demaille <akim@epita.fr>
10885
10886 Always check the value returned by yyparse.
10887
10888 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10889 returned by yyparse.
10890 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10891 Adjust calls.
10892 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10893 returned by yyparse.
10894
970785f1
PH
108952002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10896
10897 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10898 on input.at test.
10899
8fcc7db1
PE
109002002-11-14 Paul Eggert <eggert@twinsun.com>
10901
7ec1b48e
PE
10902 * src/output.c (output_skeleton): Call xfopen instead of
10903 duplicating xfopen's body.
10904
cfff7583 10905 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 10906 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 10907
8fcc7db1
PE
10908 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10909 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10910 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10911 file twice in the grammar, as an extra check.
10912
10913 * tests/input.at (Torturing the Scanner): Surround the
10914 backslash-newline tests with "#if 0", to make it less likely that
10915 we'll run into compiler bugs. Bring back solitary \ inside
10916 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 10917 test backslash-newline in C character constant.
8fcc7db1 10918
4e8d992c
AD
109192002-11-14 Akim Demaille <akim@epita.fr>
10920
10921 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10922 status of the compiler.
f32b346d 10923 Calling `exit 1' is no longer needed.
4e8d992c
AD
10924 Reported by Nelson H. F. Beebe.
10925
9501dc6e
AD
109262002-11-14 Akim Demaille <akim@epita.fr>
10927
10928 * tests/atlocal.in (CPPFLAGS): We have config.h.
10929 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10930 New.
10931 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10932 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10933 * tests/regression.at, tests/torture.at: Use them for all the
10934 grammars that are to be compiled.
10935 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10936 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10937 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10938
18b519c0
AD
109392002-11-14 Akim Demaille <akim@epita.fr>
10940
10941 * doc/bison.texinfo: Various formatting changes (alignments in
10942 samples, additional @group/@end group, GCS in samples.
10943 Use @deffn instead of simple @table to define the directives,
10944 macros, variables etc.
10945
9a86cdb9
PE
109462002-11-13 Paul Eggert <eggert@twinsun.com>
10947
daa33def 10948 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 10949 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 10950
daa33def 10951 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 10952 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
10953 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10954 * tests/headers.at (export YYLTYPE): Likewise.
10955
10956 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 10957 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 10958
9a86cdb9
PE
10959 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10960 comments, since they're not portable. Use GNU coding style.
10961
9c1e26bd
AD
109622002-11-13 Akim Demaille <akim@epita.fr>
10963
10964 * data/yacc.c: Leave bigger chunks of quoted text.
10965 (YYDSYMPRINTF): New.
10966 Use it to report symbol activities.
10967 * data/glr.c (YYDSYMPRINTF): New.
10968 Use it.
10969
87f721cc
PE
109702002-11-12 Paul Eggert <eggert@twinsun.com>
10971
10972 Version 1.75b.
10973
10974 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
10975 (yyglrReduce): Return yyok, not 0.
10976 This should avoid the enumerated-type warnings reported
464c6927 10977 by Nelson H. F. Beebe in
161a71f3 10978 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
10979
10980 * lib/bbitset.h (BITSET_INLINE): Remove.
10981 * lib/bitset.h [! BITSET_INLINE]: Remove.
10982 (bitset_set, bitset_reset, bitset_test): Rename local vars
10983 to avoid shadowing warnings by GCC.
10984
10985 * data/glr.c (inline): Remove #define. It's the user's
10986 responsibility to #define it away, just like 'const'.
464c6927 10987 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 10988 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 10989
87f721cc
PE
10990 * Makefile.maint (po-check): Scan .l and .y files instead of the
10991 .c and the .h files that they generate. This fixes the bug
10992 reported by Tim Van Holder in:
161a71f3 10993 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
10994 Look for N_ as well as for _. Try to avoid matching #define for
10995 N_ and _.
10996 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
10997 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
10998 * src/scan-gram.l: Revamp regular expressions so that " and '
10999 do not confuse xgettext.
11000
11001 * src/struniq.h (struniq_new): Do not declare the return type
11002 to be 'const'; this violates the C standard.
11003 * src/struniq.c (struniq_new): Likewise.
11004
be14ade5
AD
110052002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
11006
11007 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
11008 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
11009 linker.
11010
05291fbc
AD
110112002-11-12 Akim Demaille <akim@epita.fr>
11012
11013 * Makefile.maint: Sync with Autoconf:
11014 (local_updates): New.
11015
1f5fd52e
AD
110162002-11-12 Akim Demaille <akim@epita.fr>
11017
11018 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
11019
283f1e64
AD
110202002-11-12 Akim Demaille <akim@epita.fr>
11021
11022 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
11023 locations.
11024
886b69d1
AD
110252002-11-12 Akim Demaille <akim@epita.fr>
11026
11027 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
11028 not yyvalue.
11029
3df37415
AD
110302002-11-12 Akim Demaille <akim@epita.fr>
11031
11032 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
11033 Use it to test the GLR parser.
11034
7bd6c77e
AD
110352002-11-12 Akim Demaille <akim@epita.fr>
11036
11037 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
11038 defines it.
11039 * data/glr.c (yystos): New.
11040 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
11041 (YYDSYMPRINT): New.
11042 (yyval): Don't define it, it is handled via M4.
11043 (yyrecoverParseError): Free verbosely the discarded symbols.
11044 * data/yacc.c (yysymprint): Remove, rather...
11045 (b4_yysymprint_generate): invoke.
11046 * data/c.m4 (b4_yysymprint_generate): New.
11047 Accept pointers as arguments, as opposed to the version from
11048 yacc.c.
11049 (b4_yydestruct_generate): Likewise.
11050 * tests/cations.at (Printers and Destructors): Use Bison directives
11051 instead of CPP macros.
11052 Don't rely on internal details.
11053
b0400cc6
AD
110542002-11-12 Akim Demaille <akim@epita.fr>
11055
11056 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
11057 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
11058 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
11059 it against YYEMPTY and so forth), work on yytoken (i.e., set
11060 it to YYEMPTY etc.).
11061 (yydestruct): Replace with a b4_yydestruct_generate invocation.
11062 (b4_symbol_actions): Remove.
11063 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
11064 for 0, end-of-input.
11065
72f889cc
AD
110662002-11-12 Akim Demaille <akim@epita.fr>
11067
11068 * doc/bison.texinfo (Destructor Decl): New.
11069
b1ae9233
AD
110702002-11-12 Akim Demaille <akim@epita.fr>
11071
11072 * src/tables.c (tables_generate): Use free for pointers that
11073 cannot be NULL, not XFREE.
11074 (pack_vector): Use assert, not fatal, for bound violations.
11075 * src/state.c (state_new): Likewise.
11076 * src/reader.c (reader): Likewise.
11077 * src/lalr.c (set_goto_map): Likewise.
72f889cc 11078 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
11079 the file name.
11080
7ec2d4cd
AD
110812002-11-12 Akim Demaille <akim@epita.fr>
11082
11083 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
11084 Restore.
11085 * src/scan-gram.l (last_string): Is global to the file, not to
11086 yylex.
11087 * src/parse-gram.y (input): Don't append the epilogue here,
11088 (epilogue.opt): do it here, and free the scanner's obstack.
11089 * src/reader.c (epilogue_set): Rename as...
11090 (epilogue_augment): this.
11091 * data/c.m4 (b4_epilogue): Defaults to empty.
11092
573a6cd3
AD
110932002-11-12 Akim Demaille <akim@epita.fr>
11094
11095 * src/getargs.c (long_options): Remove duplicates.
11096 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
11097 Remove.
11098 * doc/bison.rnh: Remove.
11099 * doc/bison.texinfo (VMS Invocation): Remove.
11100
95612cfa
AD
111012002-11-12 Akim Demaille <akim@epita.fr>
11102
11103 * src/struniq.h, src/struniq.c (struniq_t): Is const.
11104 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
11105
11106 Use struniq for symbols.
11107
11108 * src/symtab.h (symbol_t): The tag member is a struniq.
11109 (symbol_type_set): Adjust.
11110 * src/symtab.c (symbol_new): Takes a struniq.
11111 (symbol_free): Don't free the tag member.
11112 (hash_compare_symbol_t, hash_symbol_t): Rename as...
11113 (hash_compare_symbol, hash_symbol): these.
11114 Use the fact that tags as struniqs.
11115 (symbol_get): Use struniq_new.
11116 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
11117 Returns a strniq.
11118 * src/reader.h (merger_list, grammar_currentmerge_set): The name
11119 and type members are struniqs.
11120 * src/reader.c (get_merge_function)
11121 (grammar_current_rule_merge_set): Adjust.
11122 (TYPE, current_type): Are struniq.
11123
11124 Use struniq for file names.
11125
11126 * src/files.h, src/files.c (infile): Split into...
11127 (grammar_file, current_file): these.
11128 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
11129 * src/reduce.c (reduce_print): Likewise.
11130 * src/getargs.c (getargs): Likewise.
11131 * src/complain.h, src/complain.c: Likewise.
11132 * src/main.c (main): Call struniqs_new early enough to use it for
11133 file names.
11134 Don't free the input file name.
11135
3e6656f9
AD
111362002-11-12 Akim Demaille <akim@epita.fr>
11137
11138 * src/symtab.c (symbol_free): Remove dead deactivated code:
11139 type_name are properly removed.
11140 Don't use XFREE to free items that cannot be NULL.
11141 * src/struniq.h, src/struniq.c: New.
11142 * src/main.c (main): Initialize/free struniqs.
11143 * src/parse-gram.y (%union): Add astruniq member.
11144 (yyprint): Adjust.
11145 * src/scan-gram.l (<{tag}>): Return a struniq.
11146 Free the obstack bit that used to store it.
11147 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
11148
7672019c
PE
111492002-11-11 Paul Eggert <eggert@twinsun.com>
11150
11151 Revamp to fix many (but not all) of the C- and M4-related quoting
11152 problems. Among other things, this fixes the Bison bug reported
11153 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 11154 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
11155
11156 Use new @ escapes consistently. Represent brackets with @{ and @}
11157 rather than @<:@ and @:>@, since this works a bit better with dumb
11158 editors like vi. Represent @ with @@, since @ is now consistently
11159 an escape. Use @oline@ and @ofile@ rather than __oline__ and
11160 __ofile__, to avoid unexpected expansions. Similarly, use @output
11161 rather than #output.
11162
11163 * data/c.m4 (b4_copyright): Omit file name from comment, since
11164 the file name could contain "*/".
11165 (b4_synclines_flag): Don't quote the 2nd argument; it should already
11166 be quoted. All uses changed.
11167
11168 * data/glr.c: Use new @ escapes consistently.
11169 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
11170 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
11171 Remove, since they couldn't handle arbitrary characters in file
11172 names.
11173 * data/lalr1.cc: Likewise.
11174 * data/yacc.c: Likewise.
11175
11176 * src/files.c (output_infix): Remove; all uses removed.
11177 * src/files.h: Likewise.
11178
11179 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
11180 mishandled funny characters in file names, and anyway it isn't
11181 needed any more.
11182 * data/yacc.c: Likewise.
11183 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
11184
11185 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
11186 * data/yacc.c: Likewise.
11187
11188 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
11189 strings now.
11190 (muscle_init): Quote filename as a C string.
11191 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
11192 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
11193 * src/output.c (escaped_file_name_output): New function.
11194 (prepare_symbols): Quote tokens for M4.
11195 (prepare): Don't insert output_infix, output_prefix,
11196 output_parser_name, output_header_name; this is now down by scan-skel.
11197 Insert skeleton as a C string.
11198
11199 * src/output.c (user_actions_output, symbol_destructors_output,
11200 symbol_printers_output): Quote filenames for C and M4.
11201 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11202
11203 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
11204 escapes other than \\ and \'; this simplifies the code.
11205 (<SC_STRING>): Likewise, for \\ and \".
11206 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
11207 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
11208 Use new escapes @{ and @} for [ and ].
11209
11210 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
11211 them with auto vars.
11212 Switch to new escape scheme, where @ is the escape character uniformly.
11213 Abort if a stray escape character is found. Avoid unbounded input
11214 buffer when parsing non-escaped text.
11215
11216 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
11217 __oline__, #output, $@, and @{ do not have unintended meanings.
11218
acea4f3b
PE
112192002-11-09 Paul Eggert <eggert@twinsun.com>
11220
11221 Fix the test failure due to GCC warnings described in
161a71f3 11222 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
11223 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
11224 evaluate to 0 if it's impossible for NINF to be in the respective
11225 table.
11226 (yygetLRActions, yyrecoverParseError): Use them.
11227
11228 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
11229 counted in the token inserted at end of file. Now takes
11230 location_t *, not location_t, so that the location can be
11231 adjusted. All uses changed.
11232
11233 * tests/regression.at (Invalid inputs): Adjust wording in
11234 diagnostic to match the new behavior.
11235
11236 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
11237 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
11238 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
11239 abort ();'. This reduces the runtime of the "Many lookaheads"
11240 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
11241 GCC 3.2.
11242
20ef1ad5
PE
112432002-11-07 Paul Eggert <eggert@twinsun.com>
11244
11245 * src/parse-gram.y (CHARACTER): Remove unused token.
11246 All uses removed.
11247
11248 * src/scan-gram.l: Remove stack option. We no longer use the
11249 stack, since the stack was never deeper than 1; instead, use the
11250 new auto var c_context to record the stacked value.
11251
11252 Remove nounput option. At an unexpected end of file, we now unput
11253 the minimal input necessary to end cleanly; this simplifies the
11254 code.
11255
11256 Avoid unbounded token sizes where this is easy.
11257
11258 (unexpected_end_of_file): New function.
11259 Use it to systematize the error message on unexpected EOF.
11260 (last-string): Now auto, not static.
11261 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
11262 (scanner_last_string_free): Remove; not used.
11263 (percent_percent_count): Move decl to just before use.
11264 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
11265 not the (never otherwised-used) CHARACTER.
11266
93724f13
AD
112672002-11-07 Akim Demaille <akim@epita.fr>
11268
11269 Let yyerror always receive the msg as last argument, so that
11270 yyerror can be variadic.
11271
11272 * data/yacc.c (b4_yyerror_args): New.
11273 Use it when calling yyerror.
11274 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
11275 Use it when calling yyerror.
11276 * doc/bison.texinfo (Error Reporting): Adjust.
11277 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
11278 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
11279
6e40b4eb
AD
112802002-11-06 Akim Demaille <akim@epita.fr>
11281
11282 #line should have quoted strings.
11283 Ideally, this should be done by m4_quotearg.
11284
11285 * src/scan-skel.l: Include quotearg.h.
11286 Quote __ofile__.
11287 * src/output.c (symbol_printers_output)
11288 (symbol_destructors_output): Quote the file name.
11289
2dfbfc12
AD
112902002-11-06 Akim Demaille <akim@epita.fr>
11291
11292 * tests/regression.at (Invalid inputs): Adjust to the recent
11293 messages.
11294
437c2d80
AD
112952002-11-06 Akim Demaille <akim@epita.fr>
11296
11297 Restore --no-lines.
11298 Reported by Jim Kent.
11299
11300 * data/c.m4 (b4_syncline): New.
11301 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
11302 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
11303 * src/output.c (user_actions_output): Likewise.
11304 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 11305 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 11306
900c5db5
AD
113072002-11-06 Akim Demaille <akim@epita.fr>
11308
11309 * src/main.c (main): Free `infile'.
11310 * src/scan-gram.l (handle_syncline): New.
11311 Recognize `#line'.
11312 * src/output.c (user_actions_output, symbol_destructors_output)
11313 (symbol_printers_output): Use the location's file name, not
11314 infile.
11315 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11316
e183b123 113172002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 11318
e183b123 11319 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 11320 either has GLR conflict entries.
e183b123 11321
193eb6b7
PE
113222002-11-05 Paul Eggert <eggert@twinsun.com>
11323
e183b123
PE
11324 * src/scan-gram.l: Use more accurate diagnostics, e.g.
11325 "integer out of range" rather than "invalid value".
11326 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
11327 accordingly.
11328
193eb6b7
PE
11329 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
11330 Also, remove one static variable in the scanner.
11331
11332 * src/scan-gram.l (braces_level): Now auto, not static.
11333 Initialize to zero if the compiler is being picky.
11334 (INITIAL): Clear braces_level instead of incrementing it.
11335 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
11336 as POSIX 1003.1-2001 requires.
11337 * src/system.h (IF_LINT): New macro, taken from coreutils.
11338 * configure.ac: Define "lint" if --enable-gcc-warnings.
11339
29c01725
AD
113402002-11-05 Akim Demaille <akim@epita.fr>
11341
11342 * src/scan-gram.l: When it starts with `%', complain about the
11343 whole directive, not just that `invalid character: %'.
11344
8aeac3ca
AD
113452002-11-04 Akim Demaille <akim@epita.fr>
11346
11347 * Makefile.maint: Update from Autoconf.
11348 (update, cvs-update, po-update, do-po-update): New.
11349
793a58bb
AD
113502002-11-04 Akim Demaille <akim@epita.fr>
11351
11352 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
11353 and yyerror.
11354 Have yyerror `use' its arguments.
11355 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
11356 returns true when location & yacc & pure & parse-param.
11357 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
11358
c4d720cd
AD
113592002-11-04 Akim Demaille <akim@epita.fr>
11360
11361 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
11362 clashes.
11363 * src/scan-gram.l: Use [\'] instead of ['] to pacify
11364 font-lock-mode.
11365 Use complain_at.
11366 Use quote, not quote_n since LOCATION_PRINT no longer uses the
11367 slot 0.
11368
613a0dc5
PE
113692002-11-03 Paul Eggert <eggert@twinsun.com>
11370
11371 * src/reader.c (get_merge_function, grammar_current_rule_check):
11372 Use consistent diagnostics for reporting type name clashes.
11373 Quote the types with <>, for consistency with Yacc.
11374 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
11375
2a8d363a
AD
113762002-11-03 Akim Demaille <akim@epita.fr>
11377
11378 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
11379 New.
11380 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
11381 (b4_parse_param): Remove.
11382 Use b4_identification.
11383 Propagate b4_pure_args where needed to pass them to yyerror.
11384 * data/glr.m4 (b4_parse_param): Remove.
11385 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
11386 (b4_lpure_formals): New.
11387 Use b4_identification.
11388 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
11389 b4_user_formals and b4_user_args.
11390 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
11391 (yyreportAmbiguity): When using a pure parser, also need
11392 the location, and the parse-params.
11393 Adjust callers.
11394 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
11395 When using a pure parser, also need the parse-params.
11396 Adjust callers.
11397 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
11398 (%pure-parser + %parse-param) LALR and GLR parsers.
11399 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
11400 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
11401 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
11402 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
11403 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
11404 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
11405 * doc/bison.texinfo: Untabify the whole file.
11406 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
11407 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
11408 (Error Reporting): Adjust to these new directives.
11409 Document %error-verbose, deprecate YYERROR_VERBOSE.
11410
9e32add8
AD
114112002-11-03 Akim Demaille <akim@epita.fr>
11412
11413 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
11414 AT_CHECK_CALC_GLR invocations to use % directives, instead of
11415 command line options.
11416 * tests/cxx-type.at: Formatting changes.
11417
b02d90a5
PE
114182002-11-03 Paul Eggert <eggert@twinsun.com>
11419
11420 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
11421 to count columns correctly, and to check for invalid inputs.
9e32add8 11422
b02d90a5
PE
11423 Use mbsnwidth to count columns correctly. Account for tabs, too.
11424 Include mbswidth.h.
11425 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
11426 (extend_location): New function.
11427 (YY_LINES): Remove.
11428
11429 Handle CRLF in C code rather than in Lex code.
11430 (YY_INPUT): New macro.
11431 (no_cr_read): New function.
11432
11433 Scan UCNs, even though we don't fully handle them yet.
11434 (convert_ucn_to_byte): New function.
11435
11436 Handle backslash-newline correctly in C code.
11437 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
11438 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
11439 all uses changed.
11440 (tag, splice): New EREs. Do not allow NUL or newline in tags.
11441 Use {splice} wherever C allows backslash-newline.
11442 YY_STEP after space, newline, vertical-tab.
11443 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 11444
b02d90a5
PE
11445 (letter, id): Don't assume ASCII; e.g., spell out a-z.
11446
11447 ({int}, handle_action_dollar, handle_action_at): Check for integer
11448 overflow.
9e32add8 11449
b02d90a5
PE
11450 (YY_STEP): Omit trailing semicolon, so that it's more like C.
11451
11452 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
11453 as well as \000. Check for UCHAR_MAX, not 255.
11454 Allow \x with an arbitrary positive number of digits, as in C.
11455 Check for overflow here.
11456 Allow \? and UCNs, for compatibility with C.
11457
11458 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
11459 with quote slot used by complain_at.
11460
11461 * tests/input.at: Add tests for backslash-newline, m4 quotes
11462 in symbols, long literals, and funny escapes in strings.
11463
11464 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
11465 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
11466 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
11467 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
11468 * m4/mbswidth.m4: New file, from GNU coreutils.
11469
11470 * doc/bison.texinfo (Grammar Outline): Document // comments.
11471 (Symbols): Document that trigraphs have no special meaning in Bison,
11472 nor is backslash-newline allowed.
11473 (Actions): Document that trigraphs have no special meaning.
11474
11475 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
11476 no longer used.
11477
114782002-11-02 Paul Eggert <eggert@twinsun.com>
11479
11480 * src/reader.c: Don't include quote.h; not needed.
11481 (get_merge_function): Reword warning to be consistent with
11482 type clash diagnostic in grammar_current_rule_check.
11483
11484 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
11485 bug in trigraph handling.
11486
11487 * src/output.c (prepare_symbols): When printing token names,
11488 escape "[" as "@<:@" and likewise for "]".
11489
11490 * src/system.h (errno): Remove declaration, as we are now
11491 assuming C89 or better, and C89 guarantees errno.
11492
762b212b
PE
114932002-10-30 Paul Eggert <eggert@twinsun.com>
11494
11495 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
11496 Check for close failures.
11497 * src/files.h (xfclose): Return void, not int, since it always
11498 returned zero.
11499 * src/files.c (xfclose): Likewise. Report I/O error if ferror
11500 indicates one.
11501 * src/output.c (output_skeleton): Use xfclose rather than fclose
11502 and ferror. xfclose now checks ferror.
11503
11504 * data/glr.c (YYLEFTMOST_STATE): Remove.
11505 (yyreportTree): Use a stack-based leftmost state. This avoids
11506 our continuing battles with bogus warnings about initializers.
11507
56100c60
AD
115082002-10-30 Akim Demaille <akim@epita.fr>
11509
11510 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
11511 #if.
11512
51b4a04c
PH
115132002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11514
11515 * tests/glr-regr1.at: New test for reported regressions.
11516 * tests/testsuite.at: Add glr-regr1.at test.
11517 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 11518
bf1ebda2
PE
115192002-10-24 Paul Eggert <eggert@twinsun.com>
11520
5c16c6b1
PE
11521 Version 1.75a.
11522
bf1ebda2
PE
11523 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
11524 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
11525 we use malloc. Don't assume 'A' through 'Z' are contiguous.
11526 Don't assume strdup exists; POSIX says its an XSI extension.
11527 Check for buffer overflow on input.
11528
b526ee61
AD
115292002-10-24 Akim Demaille <akim@epita.fr>
11530
11531 * src/output.c (output_skeleton): Don't disable M4sugar comments
11532 too soon: it results in comments being expanded.
11533 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
11534 first output.
11535
f1886bb2
AD
115362002-10-24 Akim Demaille <akim@epita.fr>
11537
11538 * data/yacc.c (m4_int_type): New.
11539 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
11540 char' as only yacc.c wants K&R portability.
11541 * data/glr.c (yysigned_char): Remove.
11542 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
11543 Reported by Quoc Peyrot.
11544
c5576256
PE
115452002-10-23 Paul Eggert <eggert@twinsun.com>
11546
11547 * src/main.c (main): With --trace=time, report times even if a
11548 non-fatal error occurs. Formerly, the times were reported in some
11549 such cases but not in others.
11550 * src/reader.c (reader): Just return if a complaint has been issued,
11551 instead of exiting, so that 'main' can report times.
11552
27b0ffea
AD
115532002-10-22 Akim Demaille <akim@epita.fr>
11554
11555 * src/system.h: Include sys/types.
11556 Reported by Bert Deknuydt.
11557
223a7883
PE
115582002-10-23 Paul Eggert <eggert@twinsun.com>
11559
11560 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
11561 Suggested by Art Haas.
11562
115632002-10-22 Paul Eggert <eggert@twinsun.com>
11564
11565 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
11566 decl; not needed any more.
11567 * src/main.c (main): Use return to exit, undoing yesterday's change.
11568 The last OS that we could find where this wouldn't work is
11569 SunOS 3.5, and that's too old to worry about now.
11570
11571 * data/glr.c (struct yyltype): Define members even when not
11572 doing locations. This is more consistent with yacc.c, and it
11573 works around the following bug reports:
161a71f3
PE
11574 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
11575 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 11576
223a7883
PE
11577 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
11578 @acronym consistently. Standardize on "Yacc" instead of "YACC",
11579 "Algol" instead of "ALGOL". Give a bit more history about BNF.
11580
8b76775a
AD
115812002-10-22 Akim Demaille <akim@epita.fr>
11582
11583 * data/README: New.
11584
6db10d14
PE
115852002-10-21 Paul Eggert <eggert@twinsun.com>
11586
11587 Be consistent about 'bool'; the old code used an enum in one
11588 module and an int in another, and this violates the C standard.
11589 * m4/stdbool.m4: New file, from coreutils 4.5.3.
11590 * configure.ac (AC_HEADER_STDBOOL): Add.
11591 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
11592 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
11593 * src/symtab.c (hash_compare_symbol_t): Likewise.
11594 * src/system.h (bool, false, true): Use a definition consistent
11595 with ../lib/hash.c. All uses changed.
11596
11597 * src/complain.c (warning_issued): Renamed from warn_message_count,
11598 so that we needn't worry about integer overflow (!).
11599 Now of type bool. All uses changed.
11600 (complaint_issued): Renamed from complain_message_count; likewise.
11601
11602 * src/main.c (main): Use exit to exit with failure.
27b0ffea 11603
6db10d14
PE
11604 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
11605 rather than 1 and 0.
11606 * src/main.c (main): Likewise.
11607 * src/getargs.c (getargs): Likewise.
11608 * src/reader.c (reader): Likewise.
11609
11610 * src/getarg.c (getargs): Remove duplicate code for
11611 "Try `bison --help'".
11612
11613 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
11614 What was that "2" for?
11615
11616 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
11617 * src/getargs.c (usage): Likewise.
11618
11619 * src/getargs.c (getargs): When there are too few operands, report
11620 the last one. When there are too many, report the first extra
11621 one. This is how diffutils does it.
11622
92a060fd
PE
116232002-10-20 Paul Eggert <eggert@twinsun.com>
11624
11625 Remove K&R vestiges.
11626 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
11627 * src/complain.c (VA_START): Remove. Assume prototypes.
11628 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
11629 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
11630 fatal): Assume prototypes.
11631 * src/complain.h: Assume prototypes.
11632 * src/system.h (PARAMS): Remove.
11633 Include <limits.h> unconditionally, since it's guaranteeed even
11634 for a freestanding C89 compiler.
11635 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
11636 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 11637
e7cb57c0
AD
116382002-10-20 Akim Demaille <akim@epita.fr>
11639
11640 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
11641 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
11642 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
11643 (yyresolveStates, yyresolveAction, yyresolveStack)
11644 (yyprocessOneStack): Use them.
11645 (yy_reduce_print): New.
11646 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
11647
0245f82d
AD
116482002-10-20 Akim Demaille <akim@epita.fr>
11649
11650 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
11651 arguments and output `void'.
11652 (b4_c_function): Rename as...
11653 (b4_c_function_def): this.
11654 (b4_c_function_decl, b4_c_ansi_function_def)
11655 (b4_c_ansi_function_decl): New.
11656 Change the interpretation of the arguments: before `int, foo', now
11657 `int foo, foo'.
11658 * data/yacc.c (yyparse): Prototype and define thanks to these.
11659 Adjust b4_c_function_def uses.
11660 * data/glr.c (yyparse): Likewise, but ANSI only.
11661
39912f52
AD
116622002-10-20 Akim Demaille <akim@epita.fr>
11663
11664 * src/output.c (prepare): Move the definition of `tokens_number',
11665 `nterms_number', `undef_token_number', `user_token_number_max'
11666 to...
11667 (prepare_tokens): Here.
11668 (prepare_tokens): Rename as...
11669 (prepare_symbols): this.
11670 (prepare): Move the definition of `rules_number' to...
11671 (prepare_rules): here.
11672 (prepare): Move the definition of `last', `final_state_number',
11673 `states_number' to...
11674 (prepare_states): here.
11675 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
11676
20c1e2ad
AD
116772002-10-20 Akim Demaille <akim@epita.fr>
11678
11679 * src/tables.h, src/tables.c, src/output.c: Comment changes.
11680
21964f43
AD
116812002-10-20 Akim Demaille <akim@epita.fr>
11682
11683 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
11684 * data/c.m4: here.
11685
66d30cd4
AD
116862002-10-20 Akim Demaille <akim@epita.fr>
11687
11688 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
11689 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
11690 `pair'.
11691 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
11692 `name' to...
11693 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
11694 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
11695 These.
11696
95f2c9fe
PE
116972002-10-19 Paul Eggert <eggert@twinsun.com>
11698
11699 Do not create a temporary file, as that involves security and
11700 cleanup headaches. Instead, use a pair of pipes.
11701 Derived from a suggestion by Florian Krohm.
11702 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
11703 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
11704 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
11705 (BISON_PREREQ_SUBPIPE): Add.
11706 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
11707 Add subpipe.h, subpipe.c.
11708 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
11709 * po/POTFILES.in: Add lib/subpipe.c.
11710 * src/output.c: Include "subpipe.h".
11711 (m4_invoke): Remove decl.
11712 (scan_skel): New decl.
11713 (output_skeleton): Use pipe rather than temporary file for m4 input.
11714 Check that m4sugar.m4 is readable, to avoid deadlock.
11715 Check for pipe I/O error.
11716 * src/scan-skel.l (readpipe): Remove decl.
11717 (scan_skel): New function, to be used in place of m4_invoke.
11718 Read from stream rather than file.
66d30cd4 11719
95f2c9fe
PE
11720 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
11721 float, as this generates a warning on Solaris 8 + GCC 3.2 with
11722 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
11723 this generates a more-accurate value anyway.
11724
11725 * lib/timevar.c (timervar_accumulate): Rename locals to
11726 avoid confusion with similarly-named more-global.
11727 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
11728
11729 * src/output.c (prepare): Use xstrdup to convert char const *
11730 to char *, to avoid GCC warning.
11731
c19988b7
AD
117322002-10-19 Akim Demaille <akim@epita.fr>
11733
11734 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
11735 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
11736 Use them to have `calc.y' ready for %pure-parser.
11737 * data/yacc.c (YYLEX): Pass a yylex return type to
11738 b4_c_function_call.
11739
ae7453f2
AD
117402002-10-19 Akim Demaille <akim@epita.fr>
11741
11742 Prototype support of %lex-param and %parse-param.
11743
11744 * src/parse-gram.y: Add the definition of the %lex-param and
11745 %parse-param tokens, plus their rules.
11746 Drop the `_' version of %glr-parser.
11747 Add the "," token.
11748 * src/scan-gram.l (INITIAL): Scan them.
11749 * src/muscle_tab.c: Comment changes.
11750 (muscle_insert, muscle_find): Rename `pair' as `probe'.
11751 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
11752 (muscle_entry_s): The `value' member is no longer const.
11753 Adjust all dependencies.
11754 * src/muscle_tab.c (muscle_init): Adjust: use
11755 MUSCLE_INSERT_STRING.
11756 Initialize the obstack earlier.
11757 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
11758 (muscle_pair_list_grow): New.
11759 * data/c.m4 (b4_c_function_call, b4_c_args): New.
11760 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
11761 * tests/calc.at: Use %locations, not --locations.
11762 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
11763
0e575721
AD
117642002-10-19 Akim Demaille <akim@epita.fr>
11765
11766 * src/getargs.c (usage): Take status as argument and exit
11767 accordingly.
11768 Report the traditional `Try ... --help' message when status != 0.
11769 (usage, version): Don't take a FILE * as arg, it is pointless.
11770 (getargs): When there is an incorrect number of arguments, make it
11771 an error, and report it GNUlically thanks to `usage ()'.
11772
724ce7f5
PE
117732002-10-18 Paul Eggert <eggert@twinsun.com>
11774
3a781eb2
PE
11775 * data/glr.c (yyreportParseError): Don't assume that sprintf
11776 yields the length of the printed string, as this is not true
11777 on SunOS 4.1.4. Reported by Peter Klein.
11778
724ce7f5
PE
11779 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
11780 * tests/conflicts.at (%nonassoc and eof): Likewise.
11781 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
11782
473d0a75
AD
117832002-10-17 Akim Demaille <akim@epita.fr>
11784
11785 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
11786 * src/getargs.c (trace_types, trace_args): Adjust.
11787 * src/reader.c (grammar_current_rule_prec_set)
11788 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
11789 Standardize error messages.
11790 And s/@prec/%prec/!
11791 (reader): Use trace_flag to enable scanner/parser debugging,
11792 instead of an adhoc scheme.
11793 * src/scan-gram.l: Remove trailing debugging code.
11794
e76d2469
PE
117952002-10-16 Paul Eggert <eggert@twinsun.com>
11796
93e2236a
PE
11797 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11798 MUSCLE_TAB_H.
11799
e76d2469
PE
11800 * NEWS: Officially drop support for building Bison with K&R C,
11801 since it didn't work anyway and it's not worth worrying about.
11802 * Makefile.maint (wget_files): Remove ansi2knr.c.
11803 (ansi2knr.c-url_prefix): Remove.
11804 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11805 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11806 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11807
5bd1c419
PE
118082002-10-15 Paul Eggert <eggert@twinsun.com>
11809
11810 Stop using the "enum_" trick for K&R-style function definitions;
11811 it confused me, and I was the author! Instead, assume that people
11812 who want to use K&R C compilers (when using these modules in GCC,
11813 perhaps?) will run ansi2knr.
11814
11815 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11816 All uses of "enum_" changed to "enum ".
11817 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11818 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 11819
5bd1c419
PE
11820 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11821 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11822 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11823 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11824 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11825 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11826 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11827 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11828 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11829 Use function prototypes; this removes the need for declaring
11830 static functions simply to provide their prototypes.
11831 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11832 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11833 bitset_count_, bitset_create, bitset_dump, bitset_first,
11834 bitset_free, bitset_init, bitset_last, bitset_next,
11835 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11836 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11837 bitset_print, bitset_release_memory, bitset_toggle_,
11838 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11839 debug_bitset): Likewise.
11840 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11841 * lib/bitset_stats.c (bitset_log_histogram_print,
11842 bitset_percent_histogram_print, bitset_stats_and,
11843 bitset_stats_and_cmp, bitset_stats_and_or,
11844 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11845 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11846 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11847 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11848 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11849 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11850 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11851 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11852 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11853 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11854 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11855 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11856 bitset_stats_zero): Likewise.
11857 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11858 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11859 bitsetv_dump, debug_bitsetv): Likewise.
11860 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11861 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11862 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11863 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11864 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11865 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11866 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11867 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11868 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11869 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11870 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11871 Likewise.
11872 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11873 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11874 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11875 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11876 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11877 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11878 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11879 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11880 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11881 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11882 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 11883
ae26e1f0
AD
118842002-10-14 Akim Demaille <akim@epita.fr>
11885
11886 Version 1.75.
11887
d43baf71
AD
118882002-10-14 Akim Demaille <akim@epita.fr>
11889
11890 * tests/Makefile.am (maintainer-check-posix): New.
11891
7ebc83e3
AD
118922002-10-14 Akim Demaille <akim@epita.fr>
11893
11894 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11895 member.
11896
05846dae
AD
118972002-10-14 Akim Demaille <akim@epita.fr>
11898
11899 * src/tables.c (table_ninf_remap): base -> tab.
11900 Reported by Matt Rosing.
11901
1318e37d
PE
119022002-10-14 Paul Eggert <eggert@twinsun.com>
11903
447fbb17
PE
11904 * tests/action.at, tests/calc.at, tests/conflicts.at,
11905 tests/cxx-type.at, tests/headers.at, tests/input.at,
11906 tests/regression.at, tests/synclines.at, tests/torture.at:
11907 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11908 so that the tests still work even if POSIXLY_CORRECT is set.
11909 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 11910
1318e37d
PE
11911 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11912 for portability to K&R hosts. Fix typo: signed char is guaranteed
11913 only to 127, not to 128.
11914 * data/glr.c (yysigned_char): New type.
11915 * data/yacc.c (yysigned_char): Likewise.
11916 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11917
cc0f0794
PE
119182002-10-13 Paul Eggert <eggert@twinsun.com>
11919
5038f418
PE
11920 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11921 true due to limited range of data type" warning from GCC.
11922
cc0f0794
PE
11923 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11924 by wrapping enum yytokentype's definition inside #ifndef
11925 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11926
6fed0802
AD
119272002-10-13 Akim Demaille <akim@epita.fr>
11928
11929 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11930 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11931
32f0598d
AD
119322002-10-13 Akim Demaille <akim@epita.fr>
11933
11934 * Makefile.maint: Update from Autoconf 2.54.
11935 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11936
7ea9a33f
AD
119372002-10-13 Akim Demaille <akim@epita.fr>
11938
11939 * src/print.c (print_state): Separate the list of solved conflicts
11940 from the other items.
11941 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11942
ea99527d
AD
119432002-10-13 Akim Demaille <akim@epita.fr>
11944
11945 Let nondeterministic skeletons be usable with deterministic
11946 tables.
11947
11948 With the patch, GAWK compiled by GCC without -O2 passes its test
11949 suite using a GLR parser driven by LALR tables. It fails with -O2
11950 because `struct stat' gives two different answers on my machine:
11951 88 (definition of an auto var) and later 96 (memset on this var).
11952 Hence the stack is badly corrumpted. The headers inclusion is to
11953 blame: if I move the awk.h inclusion before GLR's system header
11954 inclusion, the two struct stat have the same size.
11955
11956 * src/tables.c (pack_table): Always create conflict_table.
11957 (token_actions): Always create conflict_list.
11958 * data/glr.c (YYFLAG): Remove, unused.
11959
f377f69f
AD
119602002-10-13 Akim Demaille <akim@epita.fr>
11961
11962 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11963 (O0FLAGS): New.
11964 (VALGRIND, GXX): New.
11965 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11966 * tests/bison.in: Run $PREBISON a pre-command.
11967 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
11968 (maintainer-check-g++): New.
11969 * Makefile.am (maintainer-check): New.
11970
2a1fe6ed
AD
119712002-10-13 Akim Demaille <akim@epita.fr>
11972
11973 * data/glr.c: Formatting changes.
11974 Tweak some trace messages to match yacc.c's.
11975
f50adbbd
AD
119762002-10-13 Akim Demaille <akim@epita.fr>
11977
11978 GLR parsers sometimes raise parse errors instead of performing the
11979 default reduction.
11980 Reported by Charles-Henry de Boysson.
11981
11982 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 11983 check the length of the traces when %glr.
f50adbbd
AD
11984 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
11985 GLR's traces.
11986 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
11987 Test GLR parsers.
11988 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
11989 (yyltype): Remove the yy prefix from the member names.
11990 (yytable): Complete its comment.
11991 (yygetLRActions): Map error action number from YYTABLE from
11992 YYTABLE_NINF to 0.
11993 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
11994 (which was a bug: it should have been YYTABEL_NINF, and yet it was
11995 not satisfying as we could compare an YYACTION computed from
11996 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
11997 only value for error actions.
11998 (yyreportParseError): In verbose parse error messages, don't issue
11999 `error' in the list of expected tokens.
12000 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
12001 next action to perform to match glr.c's decoding.
12002 (yytable): Complete its comment.
12003
bcbad5b9
PE
120042002-10-13 Paul Eggert <eggert@twinsun.com>
12005
12006 Fix problem reported by Henrik Grubbstroem in
161a71f3 12007 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
12008 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
12009 because the Bison parser reads the second action before reducing
12010 the first one.
12011 * src/scan-gram.l (rule_length): New static var.
12012 Use it to keep track of the rule length in the scanner, since
12013 we can't expect the parser to be in lock-step sync with the scanner.
12014 (handle_action_dollar, handle_action_at): Use this var.
12015 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 12016
14904b89
PE
120172002-10-12 Paul Eggert <eggert@twinsun.com>
12018
1fe611e5
PE
12019 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
12020 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
12021 Include <sys/time.h> when checking for clock_t and struct tms.
12022 Use same include order as source.
12023 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 12024 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 12025
1fe611e5
PE
12026 * lib/timevar.c: Update copyright date and clarify comments.
12027 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 12028
1fe611e5
PE
12029 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
12030 GCC version as of today, then merge Bison's changes.
12031 Change "GCC" to "Bison" in copyright notice. timevar.def's
12032 author is Akim, so change that too.
12033
98194095
PE
12034 * src/reader.c (grammar_current_rule_check):
12035 Don't worry about the default action if $$ is untyped.
12036 Prevents bogus warnings reported by Jim Gifford in
161a71f3 12037 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 12038
14904b89
PE
12039 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
12040 * data/glr.c, data/lalr1.cc, data/yacc.c:
12041 Output token definitions before the first part of user declarations.
12042 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 12043 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 12044
ff6dca18
PE
120452002-10-11 Paul Eggert <eggert@twinsun.com>
12046
12047 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
12048 (yyparse): here. This undoes some of the 2002-07-25 change.
12049 Compatibility problem reported by Ralf S. Engelschall with
12050 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
12051
eb714592
AD
120522002-10-11 Akim Demaille <akim@epita.fr>
12053
12054 * tests/regression.at Characters Escapes): New.
12055 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
12056 characters.
12057 Reported by Jan Nieuwenhuizen.
12058
b7195100
AD
120592002-10-11 Akim Demaille <akim@epita.fr>
12060
12061 * po/id.po: New.
12062
f28a0f2d
PE
120632002-10-10 Paul Eggert <eggert@twinsun.com>
12064
12065 Portability fixes for bitsets; this also avoids several GCC
12066 warnings.
12067
12068 * lib/abitset.c: Include <stddef.h>, for offsetof.
12069 * lib/lbitset.c: Likewise.
12070
12071 * lib/abitset.c (abitset_bytes): Return a size that is aligned
12072 properly for vectors of objects. Do not assume that adding a
12073 header size to a multiple of a word size yields a value that is
12074 properly aligned for the whole union.
12075 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12076
12077 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
12078 unique names for structures.
12079 * lib/ebitset.c (ebitset_bytes): Likewise.
12080 * lib/lbitset.c (lbitset_bytes): Likewise.
12081
12082 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
12083 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
12084 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
12085 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
12086 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
12087 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
12088 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
12089 to improve the type-checking that GCC can do.
12090 * lib/bitset.c (bitset_op4_cmp): Likewise.
12091 * lib/bitset_stats.c (bitset_stats_count,
12092 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
12093 bitset_stats_copy, bitset_stats_disjoint_p,
12094 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
12095 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
12096 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
12097 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
12098 bitset_stats_and_or_cmp, bitset_stats_andn_or,
12099 bitset_stats_andn_or_cmp, bitset_stats_or_and,
12100 bitset_stats_or_and_cmp): Likewise.
12101 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
12102 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
12103 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
12104 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
12105
12106 * lib/abitset.h: Include bitset.h, not bbitset.h.
12107 * lib/ebitset.h: Likewise.
12108 * lib/lbitset.h: Likewise.
12109
12110 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
12111 All instances of parameters of type enum bitset_opts are now of
12112 type enum_bitset_opts, to conform to the C Standard, and similarly
12113 for enum_bitset_type.
12114 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
12115 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
12116
12117 Do not use "struct bitset_struct" to mean different things in
12118 different modules. Not only is this confusing, it violates
12119 the C Standard, which requires that structure types in different
12120 modules must be compatible if one is to be passed to the other.
12121 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
12122 All instances of "struct bitset_struct *" replaced with "bitset".
12123 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
12124 (union bitset_union, struct abitset_struct, struct ebitset_struct,
12125 struct lbitset_struct, struct bitset_stats_struct): New types.
12126 All uses of struct bitset_struct changed to union bitset_union,
12127 etc.
ba0fe3c7 12128 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
12129 struct bitset_struct): Remove.
12130 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
12131 struct bitset_struct): Remove.
12132 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
12133 bitset_struct): Remove.
12134 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
12135 Likewise.
12136
12137 Do not call a function of type T using a call that assumes the
12138 function is of a different type U. Standard C requires that a
12139 function must be called with a type that is compatible with its
12140 definition.
12141 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12142 New decls.
12143 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12144 New functions.
12145 * lib/ebitset.c (PFV): Remove.
12146 * lib/lbitset.c (PFV): Likewise.
12147 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
12148 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
12149 decls.
12150 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
12151 (ebitset_vtable): Use them.
12152 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
12153 lbitset_xor): New functions.
12154 (lbitset_vtable): Use them.
12155
12156 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
12157 Declare.
12158
12159 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
12160 GCC warning.
12161 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
12162 Use offsetof, for simplicity.
12163
6fbe4984
PE
121642002-10-06 Paul Eggert <eggert@twinsun.com>
12165
12166 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
12167 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 12168 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
12169 which was inadvertently undone by the 2002-09-30 patch.
12170 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
12171 the same width as int.
12172
420f93c8
PE
121732002-10-04 Paul Eggert <eggert@twinsun.com>
12174
12175 Version 1.50.
12176
12177 * configure.ac (AC_INIT), NEWS: Increment version number.
12178
12179 * doc/bison.texinfo: Minor spelling, grammar, and white space
12180 fixes.
12181 (Symbols): Mention that any negative value returned from yylex
12182 signifies end-of-input. Warn about negative chars. Mention
12183 the portable Standard C character set.
12184
12185 The GNU coding standard says CFLAGS and YFLAGS are reserved
12186 for the installer to set.
12187 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
12188 * src/Makefile.am (AM_CFLAGS): Likewise.
12189 (AM_YFLAGS): Renamed from YFLAGS.
12190
12191 Fix some MAX and MIN problems.
12192 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
12193 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
12194 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
12195 * src/reader.c (reader): Use it.
12196
12197 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
12198 POSIX 1003.1-2001 has removed fgrep.
12199
122002002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
12201
12202 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
12203 interpreted as signed.
12204 * lib/ebitset.c (ebitset_list): Fix bug.
12205
ff68026d
PE
122062002-10-01 Paul Eggert <eggert@twinsun.com>
12207
12208 More fixes for 64-bit hosts and large bitsets.
12209
12210 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
12211 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
12212 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
12213 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
12214 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
12215 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
12216 bitset_count_): Likewise.
12217 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
12218 bitset_first, bitset_last): Likewise.
12219 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
12220 bitset_stats_list_reverse, bitset_stats_size,
12221 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
12222 Likewise.
12223 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12224 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12225 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12226 bitsetv_reflexive_transitive_closure): Likewise.
12227 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
12228 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
12229 Likewise.
12230 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
12231 Likewise.
420f93c8 12232
ff68026d
PE
12233 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
12234 Use size_t, not unsigned int, to count bytes.
12235 * lib/abitset.h (abitset_bytes): Likewise.
12236 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
12237 Likewise.
12238 * lib/bitset.h (bitset_bytes): Likewise.
12239 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
12240 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
12241 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12242 * lib/ebitset.c (ebitset_bytes): Likewise.
12243 * lib/ebitset.h (ebitset_bytes): Likewise.
12244 * lib/lbitset.c (lbitset_bytes): Likewise.
12245 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 12246
ff68026d
PE
12247 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
12248 abitset_subset_p, abitset_disjoint_p, abitset_and,
12249 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
12250 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
12251 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
12252 abitset_or_and, abitset_or_and_cmp):
12253 Use bitset_windex instead of unsigned int.
12254 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12255 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
12256 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
12257 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
12258 Likewise.
12259 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 12260
ff68026d
PE
12261 * lib/bitset.c (bitset_print):
12262 Use proper printf formats for widths of integer types.
12263 * lib/bitset_stats.c (bitset_percent_histogram_print,
12264 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
12265 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12266 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12267 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 12268
ff68026d
PE
12269 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
12270 BITSET_SIZE_MAX): New macros.
12271 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
12272 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
12273 to BITSET_WINDEX_MAX.
12274
12275 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
12276 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
12277 since we now return the bitset_bindex type (not int).
12278
12279 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
12280 when computing sizes.
12281 * lib/ebitset.c (ebitset_elts_grow): Likewise.
12282
12283 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
12284 and avoid cast to unsigned.
12285
6aa452a6
AD
122862002-09-30 Akim Demaille <akim@epita.fr>
12287
12288 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12289 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
12290 Updates from Michael Hayes.
12291
927f7817
AD
122922002-09-30 Art Haas <ahaas@neosoft.com>
12293
12294 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
12295 invocations.
12296 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
12297 defined.
12298
9738f41e
AD
122992002-09-27 Akim Demaille <akim@epita.fr>
12300
12301 Version 1.49c.
12302
a5c75d7f
AD
123032002-09-27 Akim Demaille <akim@epita.fr>
12304
12305 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
12306 (Because of AC_LIBSOURCE).
12307
8280e179
AD
123082002-09-27 Akim Demaille <akim@epita.fr>
12309
12310 Playing with Autoscan.
12311
12312 * configure.ac: Remove the old LIBOBJ tweaks.
12313 (AC_REPLACE_FUNCS): Add strrchr and strtol.
12314 * lib/strrchr.c: New.
12315 * lib/strtol.c: New, from the Coreutils 4.5.1.
12316
ae64af35
AD
123172002-09-27 Akim Demaille <akim@epita.fr>
12318
12319 Playing with Autoscan.
12320
12321 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
12322 * lib/Makefile.am (libbison_a_SOURCES): No longer include
12323 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
12324 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
12325 Coreutils 4.5.1.
12326
d1a1114f
AD
123272002-09-24 Akim Demaille <akim@epita.fr>
12328
12329 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
12330 (Frequently Asked Questions, Parser Stack Overflow): New.
12331
b906441c
AD
123322002-09-13 Akim Demaille <akim@epita.fr>
12333
12334 Playing with autoscan.
12335
12336 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
12337 * src/files.c (skeleton_find): Remove, unused.
12338 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
12339 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
12340
bd701811
AD
123412002-09-13 Akim Demaille <akim@epita.fr>
12342
12343 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
12344 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
12345
e0a13e7b
AD
123462002-09-13 Akim Demaille <akim@epita.fr>
12347
12348 * configure.ac: Require 2.54.
12349 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
12350 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
12351 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
12352 Remove, provided by Autoconf macros.
12353
c97011bf
AD
123542002-09-12 Akim Demaille <akim@epita.fr>
12355
12356 * m4/prereq.m4: Update, from Coreutils 4.5.1.
12357
d862b1be
AD
123582002-09-12 Akim Demaille <akim@epita.fr>
12359
12360 * m4/prereq.m4: Update, from Fileutils 4.1.5.
12361 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
12362 Reported by Martin Mokrejs.
12363
3d38c03a
AD
123642002-09-10 Akim Demaille <akim@epita.fr>
12365
12366 * src/parse-gram.y: Associate a human readable string to each
12367 token type.
12368 * tests/regression.at (Invalid inputs): Adjust.
12369
b6347355
AD
123702002-09-10 Gary V. Vaughan <gary@gnu.org>
12371
12372 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
12373 with an Autoconf-2.5x style configure.ac.
12374
09ba4ab2
PE
123752002-09-06 Paul Eggert <eggert@twinsun.com>
12376
12377 * doc/bison.texinfo (Conditions): Make explicit that the GPL
12378 exception applies only to yacc.c. This is a modification of a
12379 patch originally suggested by Akim Demaille.
12380
21846f69
AD
123812002-09-06 Akim Demaille <akim@epita.fr>
12382
09ba4ab2
PE
12383 * data/c.m4 (b4_copyright): Move the GPL exception comment from
12384 here to...
12385 * data/yacc.c: here.
12386
21846f69
AD
12387 * data/lalr1.cc (struct yyltype): Don't define it, since we use
12388 LocationType.
12389 (b4_ltype): Default to yy::Location from location.hh.
12390
c0ad8bf3
AD
123912002-09-04 Jim Meyering <jim@meyering.net>
12392
12393 * data/yacc.c: Guard the declaration of yytoknum also with
12394 `#ifdef YYPRINT', so it is declared only when used.
12395
3a93251e
AD
123962002-09-04 Akim Demaille <akim@epita.fr>
12397
12398 * configure.in: Rename as...
12399 * configure.ac: this.
12400 Bump to 1.49c.
12401
427c0dda
AD
124022002-09-04 Akim Demaille <akim@epita.fr>
12403
12404 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
12405 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
12406 translate maintainer only messages.
12407
6a254321
PE
124082002-08-12 Paul Eggert <eggert@twinsun.com>
12409
645e30d1
PE
12410 Version 1.49b.
12411
6a254321
PE
12412 * Makefile.am (SUBDIRS): Remove intl.
12413 (DISTCLEANFILES): Remove.
12414 * NEWS: Mention that GNU M4 is now required. Clarify what is
12415 meant by "larger grammars". Mention the pt_BR translation.
12416 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
12417 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
12418 Bump version from 0.11.2 to 0.11.5.
12419 (BISON_PREREQ_STAGE): Remove.
12420 (AM_GNU_GETTEXT): Use external gettext.
12421 (AC_OUTPUT): Remove intl/Makefile.
12422
12423 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
12424
12425 * data/glr.c: Include string.h, for strlen.
12426 (yyreportParseError): Use size_t for yysize.
12427 (yy_yypstack): No longer nested inside yypstates, as nested
12428 functions are not portable. Do not assume size_t is the
12429 same width as int.
12430 (yypstates): Do not assume that ptrdiff_t is the same width
12431 as int, and similarly for yyposn and YYINDEX.
12432
12433 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
12434
12435 * lib/Makefile.am (INCLUDES): Do not include from the intl
12436 directory, which has been removed.
12437 * src/Makefile.am (INCLUDES): Likewise.
12438
12439 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
12440 (bitsets_sources, additional_bitsets_sources, timevars_sources):
12441 New vars.
12442
12443 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
12444 * tests/Makefile.am (EXTRA_DIST): Likewise.
12445
12446 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
12447 Do not assume that bitset_windex is the same width as unsigned.
12448
12449 * lib/abitset.c (abitset_unused_clear): Do not assume that
12450 bitset_word is the same width as int.
12451 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
12452 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
12453 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
12454 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
12455 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
12456
12457 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
12458 portability to one's complement hosts!).
12459 * lib/ebitset.c (ebitset_op1): Likewise.
12460 * lib/lbitset.c (lbitset_op1): Likewise.
12461
12462 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
12463 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12464 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
12465 Sync with fileutils.
12466 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
12467 lib/gettext.h: Sync with diffutils.
12468
12469 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
12470 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
12471
12472 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
12473 PROTOTYPES to check for prototypes, and "defined __STDC__" to
12474 check for void *.
12475
12476 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
12477 size_t; the old version tried to do this but casted improperly.
12478 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
12479 (bitset_test): Now returns int, not unsigned long.
12480
12481 * lib/bitset_stats.c: Include "gettext.h".
12482 (_): New macro.
12483 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
12484 name locals "index", as it generates unnecessary warnings on some
12485 hosts that have an "index" function.
12486
12487 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
12488 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
12489 they need translation.
12490 * src/LR0.c (state_list_append, new_itemsets, get_state,
12491 append_states, generate_states): Likewise.
12492 * src/assoc.c (assoc_to_string): Likewise.
12493 * src/closure.c (print_closure, set_firsts, closure): Likewise.
12494 * src/gram.c (grammar_dump): Likewise.
12495 * src/injections.c (injections_compute): Likewise.
12496 * src/lalr.c (lookaheads_print): Likewise.
12497 * src/relation.c (relation_transpose): Likewise.
12498 * src/scan-gram.l: Likewise.
12499 * src/tables.c (table_grow, pack_vector): Likewise.
12500
12501 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
12502 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
12503 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
12504 * m4/mbstate_t.m4: Sync with fileutils.
12505 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
12506
12507 * po/LINGUAS: Add pt_BR.
12508 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
12509 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
12510 lib/timevar.c.
12511 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
12512 manual recommends.
12513 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
12514
12515 * src/complain.c (strerror_r): Remove decl; not needed.
12516 (strerror): Use same pattern as ../lib/error.c.
12517
12518 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
12519
12520 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
12521
12522 * src/main.c (main): Cast result of bindtextdomain and textdomain
12523 to void, to avoid a GCC warning when --disable-nls is in effect.
12524
12525 * src/scan-gram.l: Use strings rather than escapes when possible,
12526 to minimize the number of warnings from xgettext.
12527 (handle_action_dollar, handle_action_at): Don't use isdigit,
12528 as it mishandles negative chars and it may not work as expected
12529 outside the C locale.
12530
12531 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
12532 this is a GCC extension and is not portable to other compilers.
12533
12534 * src/system.h (alloca): Use same pattern as ../lib/error.c.
12535 Do not include <ctype.h>; no longer needed.
12536 Do not include <malloc.h>; no longer needed (and generates
12537 warnings on OpenBSD 3.0).
12538
12539 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
12540 it's not portable.
12541
12542 * tests/regression.at: Do not use 'cc -c input.c -o input';
12543 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
12544
12545 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
12546 exit status as failure, not just exit status 1. Sun C exits
12547 with status 2 sometimes.
12548
12549 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
12550 Use it for the two large tests.
12551
c8f002c7
AD
125522002-08-02 Akim Demaille <akim@epita.fr>
12553
12554 * src/conflicts.c (conflicts_output): Don't output rules never
12555 reduced here, since anyway that computation doesn't work.
12556 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
12557 (rule_useless_p, rule_never_reduced_p): New.
12558 (grammar_rules_partial_print): Use a filter instead of a range.
12559 Display the title only if needed.
12560 (grammar_rules_print): Adjust.
12561 (grammar_rules_never_reduced_report): New.
12562 * src/tables.c (action_row): Move the computation of rules never
12563 reduced to...
12564 (token_actions): here.
12565 * src/main.c (main): Make the parser before making the report, so
12566 that rules never reduced are computed.
12567 Call grammar_rules_never_reduced_report.
12568 * src/print.c (print_results): Report rules never reduced.
12569 * tests/conflicts.at, tests/reduce.at: Adjust.
12570
cd08e51e
AD
125712002-08-01 Akim Demaille <akim@epita.fr>
12572
12573 Instead of attaching lookaheads and duplicating the rules being
12574 reduced by a state, attach the lookaheads to the reductions.
12575
12576 * src/state.h (state_t): Remove the `lookaheads',
12577 `lookaheads_rule' member.
12578 (reductions_t): Add a `lookaheads' member.
12579 Use a regular array for the `rules'.
12580 * src/state.c (reductions_new): Initialize the lookaheads member
12581 to 0.
12582 (state_rule_lookaheads_print): Adjust.
12583 * src/state.h, src/state.c (state_reductions_find): New.
12584 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
12585 (count_rr_conflicts): Adjust.
12586 * src/lalr.c (LArule): Remove.
12587 (add_lookback_edge): Adjust.
12588 (state_lookaheads_count): New.
12589 (states_lookaheads_initialize): Merge into...
12590 (initialize_LA): this.
12591 (lalr_free): Adjust.
12592 * src/main.c (main): Don't free nullable and derives too early: it
12593 is used by --verbose.
12594 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
12595
bb0027a9
AD
125962002-08-01 Akim Demaille <akim@epita.fr>
12597
12598 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
12599 `rule_number_t**'.
12600 (set_derives, free_derives): Rename as...
12601 (derives_compute, derives_free): this.
12602 Adjust all dependencies.
12603 * src/nullable.c (set_nullable, free_nullable): Rename as...
12604 (nullable_compute, nullable_free): these.
12605 (rule_list_t): Store rule_t *, not rule_number_t.
12606 * src/state.c (state_rule_lookaheads_print): Directly compare rule
12607 pointers, instead of their numbers.
12608 * src/main.c (main): Call nullable_free, and derives_free earlier,
12609 as they were lo longer used.
12610
3325ddc4
AD
126112002-08-01 Akim Demaille <akim@epita.fr>
12612
12613 * lib/timevar.c (get_time): Include children time.
12614 * src/lalr.h (LA, LArule): Don't export them: used with the
12615 state_t.
12616 * src/lalr.c (LA, LArule): Static.
12617 * src/lalr.h, src/lalr.c (lalr_free): New.
12618 * src/main.c (main): Call it.
12619 * src/tables.c (pack_vector): Check whether loc is >= to the
12620 table_size, not >.
12621 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
12622 (tables_generate): do it, since that's also it which allocates
12623 them.
12624 Don't free LA and LArule, main does.
12625
c6f1a33c
AD
126262002-07-31 Akim Demaille <akim@epita.fr>
12627
12628 Separate parser tables computation and output.
12629
12630 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
12631 (conflict_list, conflict_list_cnt, table, check, table_ninf)
12632 (yydefgoto, yydefact, high): Move to...
12633 * src/tables.h, src/tables.c: here.
12634 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12635 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12636 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
12637 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
12638 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
12639 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
12640 (action_row, save_row, token_actions, save_column, default_goto)
12641 (goto_actions, sort_actions, matching_state, pack_vector)
12642 (table_ninf_remap, pack_table, prepare_actions): Move to...
12643 * src/tables.c: here.
12644 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
12645 * src/output.c (token_actions, output_base, output_conflicts)
12646 (output_check): Merge into...
12647 (prepare_actions): this.
12648 (actions_output): Rename as...
12649 (user_actions_output): this.
12650 * src/main.c (main): Call tables_generate and tables_free.
12651
1509d42f
AD
126522002-07-31 Akim Demaille <akim@epita.fr>
12653
12654 Steal GCC's --time-report support.
12655
12656 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
12657 stolen/adjusted from GCC.
12658 * m4/stage.m4: Remove time related checks.
12659 * m4/timevar.m4: New.
12660 * configure.in: Adjust.
12661 * src/system.h: Adjust to using timevar.h.
12662 * src/getargs.h, src/getargs.c: Support trace_time for
12663 --trace=time.
12664 * src/main.c (stage): Remove.
12665 (main): Replace `stage' invocations with timevar calls.
12666 * src/output.c: Insert pertinent timevar calls.
12667
273a74fa
AD
126682002-07-31 Akim Demaille <akim@epita.fr>
12669
12670 Let --trace have arguments.
12671
12672 * src/getargs.h (enum trace_e): New.
12673 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
12674 (long_options, short_options): --trace/-T takes an optional
12675 argument.
12676 Change all the uses of trace_flag to reflect the new flags.
12677 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
12678
12679 Strengthen `stage' portability.
12680
12681 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
12682 * configure.in: Use it.
12683 Don't check for malloc.h and sys/times.h.
12684 * src/system.h: Include them when appropriate.
12685 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
12686 times and struct tms are available.
12687
217598da
AD
126882002-07-30 Akim Demaille <akim@epita.fr>
12689
12690 In verbose parse error message, don't report `error' as an
12691 expected token.
12692 * tests/actions.at (Printers and Destructors): Adjust.
12693 * tests/calc.at (Calculator $1): Adjust.
12694 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
12695 error message, do not report the parser accepts the error token in
12696 that state.
12697
52489d44
AD
126982002-07-30 Akim Demaille <akim@epita.fr>
12699
12700 Normalize conflict related messages.
12701
12702 * src/complain.h, src/complain.c (warn, complain): New.
12703 * src/conflicts.c (conflicts_print): Use them.
12704 (conflict_report_yacc): New, extracted from...
12705 (conflicts_print): here.
12706 * tests/conflicts.at, tests/existing.at: Adjust.
12707
e8832397
AD
127082002-07-30 Akim Demaille <akim@epita.fr>
12709
12710 Report rules which are never reduced by the parser: those hidden
12711 by conflicts.
12712
12713 * src/LR0.c (save_reductions): Don't make the final state too
12714 different: save its reduction (accept) instead of having a state
12715 without any action (no shift or goto, no reduce).
12716 Note: the final state is now a ``regular'' state, i.e., the
12717 parsers now contain `reduce 0' as default reduction.
12718 Nevertheless, since they decide to `accept' when yystate =
12719 final_state, they still will not reduce rule 0.
12720 * src/print.c (print_actions, print_reduction): Adjust.
12721 * src/output.c (action_row): Track reduced rules.
12722 (token_actions): Report rules never reduced.
12723 * tests/conflicts.at, tests/regression.at: Adjust.
12724
caf23d24
AD
127252002-07-30 Akim Demaille <akim@epita.fr>
12726
12727 `stage' was accidently included in a previous patch.
12728 Initiate its autoconfiscation.
12729
12730 * configure.in: Look for malloc.h and sys/times.h.
12731 * src/main.c (stage): Adjust.
12732 Report only when trace_flag.
12733
640748ee
AD
127342002-07-29 Akim Demaille <akim@epita.fr>
12735
12736 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
12737 state_number_t.
12738 (errs_t): symbol_t*, not symbol_number_t.
12739 (reductions_t): rule_t*, not rule_number_t.
12740 (FOR_EACH_SHIFT): New.
12741 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
12742 * src/print.c, src/print_graph.c: Adjust.
12743
88bce5a2
AD
127442002-07-29 Akim Demaille <akim@epita.fr>
12745
12746 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
12747
12748 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
12749 (endtoken, accept): these.
12750 * src/reader.c (reader): Set endtoken's default tag to "$end".
12751 Set undeftoken's tag to "$undefined" instead of "$undefined.".
12752 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
12753 Adjust.
12754
1bfb97db
AD
127552002-07-29 Akim Demaille <akim@epita.fr>
12756
12757 * src/reduce.c (reduce_grammar): When the language is empty,
12758 complain about the start symbol, not the axiom.
12759 Use its location.
12760 * tests/reduce.at (Empty Language): New.
12761
fc5734fe
AD
127622002-07-26 Akim Demaille <akim@epita.fr>
12763
12764 * src/reader.h, src/reader.c (gram_error): ... can't get
12765 yycontrol without making too strong assumptions on the parser
12766 itself.
12767 * src/output.c (prepare_tokens): Use the real 0th value of
12768 token_translations instead of `0'.
12769 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
12770 visible here.
12771 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
12772 for the time being: %locations ought to provide it to yyerror.
12773
3650b4b8
AD
127742002-07-25 Akim Demaille <akim@epita.fr>
12775
12776 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
12777 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
12778 * tests/regression.at (Web2c Actions): Adjust.
12779
4b3d3a8e
AD
127802002-07-25 Akim Demaille <akim@epita.fr>
12781
12782 Stop storing rules from 1 to nrules + 1.
12783
12784 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12785 * src/nullable.c, src/output.c, src/print.c, src/reader.c
12786 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
12787 Iterate from 0 to nrules.
12788 Use rule_number_as_item_number and item_number_as_rule_number.
12789 Adjust to `derive' now containing possibly 0.
12790 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12791 Handle the `- 1' part in rule numbers from/to item numbers.
12792 * src/conflicts.c (log_resolution): Fix the message which reversed
12793 shift and reduce.
12794 * src/output.c (action_row): Initialize default_rule to -1.
12795 (token_actions): Adjust.
12796 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
12797 expected output.
12798 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12799
4a2a22f4
AD
128002002-07-25 Akim Demaille <akim@epita.fr>
12801
12802 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12803 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12804 (b4_c_knr_arg_decl): New.
12805 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12806 yyreport_parse_error.
12807
b8df3223
AD
128082002-07-25 Akim Demaille <akim@epita.fr>
12809
12810 * data/yacc.c (yyreport_parse_error): New, extracted from...
12811 (yyparse): here.
12812 (yydestruct, yysymprint): Move above yyparse.
12813 Be K&R compliant.
12814
a762e609
AD
128152002-07-25 Akim Demaille <akim@epita.fr>
12816
12817 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12818 replace...
12819 (b4_sint_type, b4_uint_type): these.
12820 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12821 * tests/regression.at (Web2c Actions): Adjust.
12822
12b0043a
AD
128232002-07-25 Akim Demaille <akim@epita.fr>
12824
12825 * src/gram.h (TIEM_NUMBER_MAX): New.
12826 (item_number_of_rule_number, rule_number_of_item_number): Rename
12827 as...
12828 (rule_number_as_item_number, item_number_as_rule_number): these.
12829 Adjust dependencies.
12830 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12831 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12832 (symbol_number_to_vector_number): New.
12833 (order): Of vector_number_t* type.
12834 (base_t, BASE_MAX, BASE_MIN): New.
12835 (froms, tos, width, pos, check): Of base_t type.
12836 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12837 (actrow): Of action_number_t type.
12838 (conflrow): Of unsigned int type.
12839 (table_ninf, base_ninf): New.
12840 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12841 (muscle_insert_int_table, muscle_insert_base_table)
12842 (muscle_insert_rule_number_table): New.
12843 (prepare_tokens): Output `toknum' as int_table.
12844 (action_row): Returns a rule_number_t.
12845 Use ACTION_MIN, not SHRT_MIN.
12846 (token_actions): yydefact is rule_number_t*.
12847 (table_ninf_remap): New.
12848 (pack_table): Use it for `base' and `table'.
12849 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12850 replaced with...
12851 (YYPACT_NINF, YYTABLE_NINF): these.
12852 (yypact, yytable): Compute their types instead of hard-coded
12853 `short'.
12854 * tests/regression.at (Web2c Actions): Adjust.
12855
5dde258a
AD
128562002-07-19 Akim Demaille <akim@epita.fr>
12857
12858 * src/scan-gram.l (id): Can start with an underscore.
12859
a945ec39
AD
128602002-07-16 Akim Demaille <akim@epita.fr>
12861
12862 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12863 Adjust all former `associativity' dependencies.
12864 * src/symtab.c (symbol_new): Default associativity is `undef', not
12865 `right'.
12866 (symbol_check_alias_consistence): Adjust.
12867
fae437e8
AD
128682002-07-09 Akim Demaille <akim@epita.fr>
12869
12870 * doc/bison.texinfo: Properly set the ``header'' part.
12871 Use @dircategory ``GNU programming tools'' as per Texinfo's
12872 documentation.
12873 Use @copying.
12874
1a715ef2
AD
128752002-07-09 Akim Demaille <akim@epita.fr>
12876
12877 * lib/quotearg.h: Protect against multiple inclusions.
12878 * src/location.h (location_t): Add a `file' member.
12879 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12880 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12881 `error_one_per_line' support.
12882
a5d50994
AD
128832002-07-09 Akim Demaille <akim@epita.fr>
12884
12885 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12886 * src/reader.c (lineno): Remove.
12887 Adjust all dependencies.
12888 (get_merge_function): Take a location and use complain_at.
12889 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12890 * tests/regression.at (Invalid inputs, Mixing %token styles):
12891 Adjust.
12892
b275314e
AD
128932002-07-09 Akim Demaille <akim@epita.fr>
12894
12895 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12896 recovery rule, and forbid extensions when --yacc.
12897 (gram_error): Use complain_at.
12898 * src/reader.c (reader): Exit if there were parse errors.
12899
865b9df1
AD
129002002-07-09 Akim Demaille <akim@epita.fr>
12901
12902 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12903 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12904 Reported by R Blake <blakers@mac.com>.
12905
c76e14da
AD
129062002-07-09 Akim Demaille <akim@epita.fr>
12907
12908 * data/yacc.c: Output the copyright notive in the header.
12909
7db2ed2d
AD
129102002-07-03 Akim Demaille <akim@epita.fr>
12911
12912 * src/output.c (froms, tos): Are state_number_t.
12913 (save_column): sp, sp1, and sp2 are state_number_t.
12914 (prepare): Rename `final' as `final_state_number', `nnts' as
12915 `nterms_number', `nrules' as `rules_number', `nstates' as
12916 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12917 unused.
12918 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12919 * data/lalr1.cc (nsym_): Remove, unused.
12920
e68e0410
AD
129212002-07-03 Akim Demaille <akim@epita.fr>
12922
12923 * src/lalr.h, src/lalr.c (goto_number_t): New.
12924 * src/lalr.c (goto_list_t): New.
12925 Propagate them.
12926 * src/nullable.c (rule_list_t): New.
12927 Propagate.
12928 * src/types.h: Remove.
12929
e1a4f3a4
AD
129302002-07-03 Akim Demaille <akim@epita.fr>
12931
12932 * src/closure.c (print_fderives): Use rule_rhs_print.
12933 * src/derives.c (print_derives): Use rule_rhs_print.
12934 (rule_list_t): New, replaces `shorts'.
12935 (set_derives): Add comments.
12936 * tests/sets.at (Nullable, Firsts): Adjust.
12937
536545f3
AD
129382002-07-03 Akim Demaille <akim@epita.fr>
12939
12940 * src/output.c (prepare_actions): Free `tally' and `width'.
12941 (prepare_actions): Allocate and free `order'.
12942 * src/symtab.c (symbols_free): Free `symbols'.
12943 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12944 * src/output.c (m4_invoke): Move to...
12945 * src/scan-skel.l: here.
12946 (<<EOF>>): Close yyout, and free its name.
12947
8b752b00
AD
129482002-07-03 Akim Demaille <akim@epita.fr>
12949
12950 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12951
12952 * src/LR0.c (new_state): Merge into...
12953 (state_list_append): this.
12954 (new_states): Merge into...
12955 (generate_states): here.
12956 (set_states): Don't ensure a proper `errs' state member here, do it...
12957 * src/conflicts.c (conflicts_solve): here.
12958 * src/state.h, src/state.c: Comment changes.
12959 (state_t): Rename member `shifts' as `transitions'.
12960 Adjust all dependencies.
12961 (errs_new): For consistency, also take the values as argument.
12962 (errs_dup): Remove.
12963 (state_errs_set): New.
12964 (state_reductions_set, state_transitions_set): Assert that no
12965 previous value was assigned.
12966 (state_free): New.
12967 (states_free): Use it.
12968 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
12969 temporary storage: use `errs' and `nerrs' as elsewhere.
12970 (set_conflicts): Allocate and free this `errs'.
12971
613f5e1a
AD
129722002-07-02 Akim Demaille <akim@epita.fr>
12973
12974 * lib/libiberty.h: New.
12975 * lib: Update the bitset implementation from upstream.
12976 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
12977 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
12978 * src/main.c: Adjust bitset stats calls.
12979
26e0cadc
PE
129802002-07-01 Paul Eggert <eggert@twinsun.com>
12981
12982 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
12983 char, so that negative chars don't collide with $.
12984
1154cced
AD
129852002-06-30 Akim Demaille <akim@epita.fr>
12986
12987 Have the GLR tests be `warning' checked, and fix the warnings.
12988
12989 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
12990 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
12991 (yyremoveDeletes): `yyi' and `yyj' are size_t.
12992 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
12993 (yyaddDeferredAction): static.
12994 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
12995 (yyreportParseError): yyprefix is const.
12996 yytokenp is used only when verbose.
12997 (yy__GNUC__): Replace with __GNUC__.
12998 (yypdumpstack): yyi is size_t.
12999 (yypreference): Un-yy local variables and arguments, to avoid
13000 clashes with `yyr1'. Anyway, we are not in the user name space.
13001 (yytname_size): be an int, as is compared with ints.
13002 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
13003 Use them.
13004 * tests/cxx-gram.at: Use quotation to protect $1.
13005 Use AT_COMPILE to enable warnings hunts.
13006 Prototype yylex and yyerror.
13007 `Use' argc.
13008 Include `string.h', not `strings.h'.
13009 Produce and prototype stmtMerge only when used.
13010 yylex takes a location.
13011
97650f4e
AD
130122002-06-30 Akim Demaille <akim@epita.fr>
13013
13014 We spend a lot of time in quotearg, in particular when --verbose.
13015
13016 * src/symtab.c (symbol_get): Store a quoted version of the key.
13017 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
13018 Adjust all callers.
13019
d2576365
AD
130202002-06-30 Akim Demaille <akim@epita.fr>
13021
13022 * src/state.h (reductions_t): Rename member `nreds' as num.
13023 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
13024 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
13025
ccaf65bc
AD
130262002-06-30 Akim Demaille <akim@epita.fr>
13027
13028 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
13029 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
13030 (shifts_to): Rename as...
13031 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
13032 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
13033 (TRANSITION_IS_DISABLED, transitions_to): these.
13034
87675353
AD
130352002-06-30 Akim Demaille <akim@epita.fr>
13036
13037 * src/print.c (print_shifts, print_gotos): Merge into...
13038 (print_transitions): this.
13039 (print_transitions, print_errs, print_reductions): Align the
13040 lookaheads columns.
13041 (print_core, print_transitions, print_errs, print_state,
13042 print_grammar): Output empty lines separator before, not after.
13043 (state_default_rule_compute): Rename as...
13044 (state_default_rule): this.
13045 * tests/conflicts.at (Defaulted Conflicted Reduction),
13046 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
13047 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
13048
ce4ccb4b
AD
130492002-06-30 Akim Demaille <akim@epita.fr>
13050
13051 Display items as we display rules.
13052
13053 * src/gram.h, src/gram.c (rule_lhs_print): New.
13054 * src/gram.c (grammar_rules_partial_print): Use it.
13055 * src/print.c (print_core): Likewise.
13056 * tests/conflicts.at (Defaulted Conflicted Reduction),
13057 (Unresolved SR Conflicts): Adjust.
13058 (Unresolved SR Conflicts): Adjust and rename as...
13059 (Resolved SR Conflicts): this, as was meant.
13060 * tests/regression.at (Web2c Report): Adjust.
13061
bc933ef1
AD
130622002-06-30 Akim Demaille <akim@epita.fr>
13063
13064 * src/print.c (state_default_rule_compute): New, extracted from...
13065 (print_reductions): here.
13066 Pessimize, but clarify the code.
13067 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
13068
53d4308d
AD
130692002-06-30 Akim Demaille <akim@epita.fr>
13070
13071 * src/output.c (action_row): Let default_rule be always a rule
13072 number.
13073
574fb2d5
AD
130742002-06-30 Akim Demaille <akim@epita.fr>
13075
13076 * src/closure.c (print_firsts, print_fderives, closure):
13077 Use BITSET_EXECUTE.
13078 * src/lalr.c (lookaheads_print): Likewise.
13079 * src/state.c (state_rule_lookaheads_print): Likewise.
13080 * src/print_graph.c (print_core): Likewise.
13081 * src/print.c (print_reductions): Likewise.
13082 * src/output.c (action_row): Likewise.
13083 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
13084
05811fd7
AD
130852002-06-30 Akim Demaille <akim@epita.fr>
13086
13087 * src/print_graph.c: Use report_flag.
13088
0e4d5753
AD
130892002-06-30 Akim Demaille <akim@epita.fr>
13090
13091 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
13092 to...
13093 * src/relation.h, src/relation.c (traverse, relation_digraph)
13094 (relation_print, relation_transpose): New.
13095
24c7d800
AD
130962002-06-30 Akim Demaille <akim@epita.fr>
13097
13098 * src/state.h, src/state.c (shifts_to): New.
13099 * src/lalr.c (build_relations): Use it.
13100
9222837b
AD
131012002-06-30 Akim Demaille <akim@epita.fr>
13102
13103 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
13104 (item_number_of_rule_number, rule_number_of_item_number): New.
13105 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
13106 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
13107 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
13108 Propagate their use.
13109 Much remains to be done, in particular wrt `shorts' from types.h.
13110
260008e5
AD
131112002-06-30 Akim Demaille <akim@epita.fr>
13112
13113 * src/symtab.c (symbol_new): Initialize the `printer' member.
13114
8a731ca8
AD
131152002-06-30 Akim Demaille <akim@epita.fr>
13116
13117 * src/LR0.c (save_reductions): Remove, replaced by...
13118 * src/state.h, src/state.c (state_reductions_set): New.
13119 (reductions, errs): Rename as...
13120 (reductions_t, errs_t): these.
13121 Adjust all dependencies.
13122
32e1e0a4
AD
131232002-06-30 Akim Demaille <akim@epita.fr>
13124
13125 * src/LR0.c (state_list_t, state_list_append): New.
13126 (first_state, last_state): Now symbol_list_t.
13127 (this_state): Remove.
13128 (new_itemsets, append_states, save_reductions): Take a state_t as
13129 argument.
13130 (set_states, generate_states): Adjust.
13131 (save_shifts): Remove, replaced by...
13132 * src/state.h, src/state.c (state_shifts_set): New.
13133 (shifts): Rename as...
13134 (shifts_t): this.
13135 Adjust all dependencies.
13136 * src/state.h (state_t): Remove the `next' member.
13137
e5fb6710
AD
131382002-06-30 Akim Demaille <akim@epita.fr>
13139
13140 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
13141 escaped in slot 0.
13142
c7ca99d4
AD
131432002-06-30 Akim Demaille <akim@epita.fr>
13144
13145 Use hash.h for the state hash table.
13146
13147 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
13148 (allocate_storage): Use state_hash_new.
13149 (free_storage): Use state_hash_free.
13150 (new_state, get_state): Adjust.
13151 * src/lalr.h, src/lalr.c (states): Move to...
13152 * src/states.h (state_t): Remove the `link' member, no longer
13153 used.
13154 * src/states.h, src/states.c: here.
13155 (state_hash_new, state_hash_free, state_hash_lookup)
13156 (state_hash_insert, states_free): New.
13157 * src/states.c (state_table, state_compare, state_hash): New.
13158 * src/output.c (output_actions): Do not free states now, since we
13159 still need to know the final_state number in `prepare', called
13160 afterwards. Do it...
13161 * src/main.c (main): here: call states_free after `output'.
13162
df0e7316
AD
131632002-06-30 Akim Demaille <akim@epita.fr>
13164
13165 * src/state.h, src/state.c (state_new): New, extracted from...
13166 * src/LR0.c (new_state): here.
13167 * src/state.h (STATE_ALLOC): Move to...
13168 * src/state.c: here.
13169 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
13170 * src/state.h, src/state.c: here.
13171
39f41916
AD
131722002-06-30 Akim Demaille <akim@epita.fr>
13173
13174 * src/reader.c (gensym): Rename as...
13175 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
13176 (getsym): Rename as...
13177 (symbol_get): this.
13178
d57650a5
AD
131792002-06-30 Akim Demaille <akim@epita.fr>
13180
13181 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
13182 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
13183 * src/output.c, src/print.c, src/print_graph.c: Propagate.
13184 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
13185
5a08f1ce
AD
131862002-06-30 Akim Demaille <akim@epita.fr>
13187
13188 Make the test suite pass with warnings checked.
13189
13190 * tests/actions.at (Printers and Destructors): Improve.
13191 Avoid unsigned vs. signed issues.
13192 * tests/calc.at: Don't exercise the scanner here, do it...
13193 * tests/input.at (Torturing the Scanner): here.
13194
720623af
PH
131952002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13196
88e7e941 13197 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
13198 reorganize first lines parallel to yacc.c.
13199
fb8135fa
AD
132002002-06-28 Akim Demaille <akim@epita.fr>
13201
13202 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
13203 (b4_token_enum, b4_token_defines): New, factored from...
13204 * data/lalr1.cc, data/yacc.c, glr.c: here.
13205
41442480
AD
132062002-06-28 Akim Demaille <akim@epita.fr>
13207
13208 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
13209 unused variables.
13210 * src/output.c (merger_output): static.
13211
e0e5bf84
AD
132122002-06-28 Akim Demaille <akim@epita.fr>
13213
ba0fe3c7 13214 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
13215 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
13216 pacify GCC.
13217 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 13218
676385e2
PH
132192002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13220
13221 Accumulated changelog for new GLR parsing features.
13222
6a254321 13223 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
13224 conflicts_total_count.
13225 * src/conflicts.h: Ditto.
13226 * src/output.c (token_actions): Use the new name.
13227 (output_conflicts): Change conflp => conflict_list_heads, and
13228 confl => conflict_list for better readability.
13229 * data/glr.c: Use the new names.
13230 * NEWS: Add self to GLR announcement.
e0e5bf84 13231
676385e2
PH
13232 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
13233
13234 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
13235 Akim Demaille.
13236
13237 * data/bison.glr: Change name to glr.c
13238 * data/glr.c: Renamed from bison.glr.
13239 * data/Makefile.am: Add glr.c
e0e5bf84
AD
13240
13241 * src/getargs.c:
13242
676385e2 13243 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 13244 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 13245
676385e2
PH
13246 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13247
13248 * data/bison.glr: Be sure to restore the
13249 current #line when returning to the skeleton contents after having
13250 exposed the input file's #line.
13251
13252 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13253
13254 * data/bison.glr: Bring up to date with changes to bison.simple.
13255
13256 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13257
13258 * data/bison.glr: Correct definitions that use b4_prefix.
13259 Various reformatting.
13260 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
13261 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
13262 yytokenp argument; now part of stack.
13263 (yychar): Define to behave as documented.
13264 (yyclearin): Ditto.
e0e5bf84 13265
676385e2
PH
13266 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13267
13268 * src/reader.h: Add declaration for free_merger_functions.
13269
13270 * src/reader.c (merge_functions): New variable.
13271 (get_merge_function): New function.
13272 (free_merger_functions): New function.
13273 (readgram): Check for %prec that is not followed by a symbol.
13274 Handle %dprec and %merge declarations.
13275 (packgram): Initialize dprec and merger fields in rules array.
13276
13277 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
13278 conflict_list_cnt, conflict_list_free): New variables.
13279 (table_grow): Also grow conflict_table.
e0e5bf84 13280 (prepare_rules): Output dprec and merger tables.
676385e2 13281 (conflict_row): New function.
e0e5bf84 13282 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
13283 default reduction in conflicted states for GLR parser so that there
13284 are spaces for the conflict lists.
13285 (save_row): Also save conflict information.
13286 (token_actions): Allocate conflict list.
13287 (merger_output): New function.
13288 (pack_vector): Pack conflict table, too.
13289 (output_conflicts): New function to output yyconflp and yyconfl.
13290 (output_check): Allocate conflict_tos.
13291 (output_actions): Output conflict tables, also.
13292 (output_skeleton): Output b4_mergers definition.
13293 (prepare): Output b4_max_rhs_length definition.
13294 Use 'bison.glr' as default skeleton for GLR parsers.
13295
13296 * src/gram.c (glr_parser): New flag.
13297 (grammar_free): Call free_merger_functions.
13298
13299 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
13300 all pairs of conflicting reductions, rather than just all tokens
13301 causing conflicts. Needed to size conflict tables.
e0e5bf84 13302 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
13303 interface.
13304 (conflicts_print): Ditto.
13305 (count_total_conflicts): New function.
13306
13307 * src/reader.h (merger_list): New type.
13308 (merge_functions): New variable.
13309
13310 * src/lex.h (tok_dprec, tok_merge): New token types.
13311
13312 * src/gram.h (rule_s): Add dprec and merger fields.
13313 (glr_parser): New flag.
13314
13315 * src/conflicts.h (count_total_conflicts): New function.
13316
13317 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
13318
13319 * doc/bison.texinfo (Generalized LR Parsing): New section.
13320 (GLR Parsers): New section.
13321 (Language and Grammar): Mention GLR parsing.
13322 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
13323 Correct typo ("tge" -> "the").
13324
13325 * data/bison.glr: New skeleton for GLR parsing.
13326
13327 * tests/cxx-gram.at: New tests for GLR parsing.
13328
13329 * tests/testsuite.at: Include cxx-gram.at.
13330
13331 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 13332
676385e2
PH
13333 * src/parse-gram.y:
13334
13335 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
13336
13337 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 13338
b5480d74 133392002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
13340
13341 * src/options.h, src/options.c: Remove.
13342 * src/getargs.c (short_options, long_options): New.
13343
60491a94
AD
133442002-06-27 Akim Demaille <akim@epita.fr>
13345
13346 * data/bison.simple, data/bison.c++: Rename as...
13347 * data/yacc.c, data/lalr1.cc: these.
13348 * doc/bison.texinfo (Environment Variables): Remove.
13349
9be0c25b
AD
133502002-06-25 Raja R Harinath <harinath@cs.umn.edu>
13351
13352 * src/getargs.c (report_argmatch): Initialize strtok().
13353
1ae72863
AD
133542002-06-20 Akim Demaille <akim@epita.fr>
13355
13356 * data/bison.simple (b4_symbol_actions): New, replaces...
13357 (b4_symbol_destructor, b4_symbol_printer): these.
13358 (yysymprint): Be sure to call YYPRINT only for tokens, and using
13359 user token numbers.
13360
87542d29
AD
133612002-06-20 Akim Demaille <akim@epita.fr>
13362
13363 * data/bison.simple (yydestructor): Rename as...
13364 (yydestruct): this.
13365
1a31ed21
AD
133662002-06-20 Akim Demaille <akim@epita.fr>
13367
13368 * src/symtab.h, src/symtab.c (symbol_type_set)
13369 (symbol_destructor_set, symbol_precedence_set): The location is
13370 the last argument.
13371 Adjust all callers.
13372
e776192e
AD
133732002-06-20 Akim Demaille <akim@epita.fr>
13374
13375 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
13376 internals.
13377 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
13378 Takes a location.
13379 * src/symtab.h, src/symtab.c (symbol_class_set)
13380 (symbol_user_token_number_set): Likewise.
13381 Adjust all callers.
13382 Promote complain_at.
13383 * tests/input.at (Type Clashes): Adjust.
13384
5c1180b3
AD
133852002-06-20 Akim Demaille <akim@epita.fr>
13386
13387 * data/bison.simple (YYLEX): Fix the declaration when
13388 %pure-parser.
13389
e3170060
AD
133902002-06-20 Akim Demaille <akim@epita.fr>
13391
13392 * data/bison.simple (yysymprint): Don't print the token number,
13393 just its name.
13394 * tests/actions.at (Destructors): Rename as...
13395 (Printers and Destructors): this.
13396 Also exercise %printer.
13397
253862fd
AD
133982002-06-20 Akim Demaille <akim@epita.fr>
13399
13400 * data/bison.simple (YYDSYMPRINT): New.
13401 Use it to remove many of the #if YYDEBUG/if (yydebug).
13402
366eea36
AD
134032002-06-20 Akim Demaille <akim@epita.fr>
13404
13405 * src/symtab.h, src/symtab.c (symbol_t): printer and
13406 printer_location are new members.
13407 (symbol_printer_set): New.
13408 * src/parse-gram.y (PERCENT_PRINTER): New token.
13409 Handle its associated rule.
13410 * src/scan-gram.l: Adjust.
13411 (handle_destructor_at, handle_destructor_dollar): Rename as...
13412 (handle_symbol_code_at, handle_symbol_code_dollar): these.
13413 * src/output.c (symbol_printers_output): New.
13414 (output_skeleton): Call it.
13415 * data/bison.simple (yysymprint): New. Cannot be named yyprint
13416 since there are already many grammar files with a user `yyprint'.
13417 Replace the calls to YYPRINT to calls to yysymprint.
13418 * tests/calc.at: Adjust.
13419 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
13420 taking advantage of parser very internal details (stack size!).
13421
4f25ebb0
AD
134222002-06-20 Akim Demaille <akim@epita.fr>
13423
13424 * src/scan-gram.l: Complete the scanner with the missing patterns
13425 to pacify Flex.
13426 Use `quote' and `symbol_tag_get' where appropriate.
13427
93b68a0e
AD
134282002-06-19 Akim Demaille <akim@epita.fr>
13429
13430 * tests/actions.at (Destructors): Augment to test locations.
13431 * data/bison.simple (yydestructor): Pass it the current location
13432 if locations are enabled.
13433 Prototype only when __STDC__ or C++.
13434 Change the argument names to move into the yy name space: there is
13435 user code here.
13436
58612f1d
AD
134372002-06-19 Akim Demaille <akim@epita.fr>
13438
74310291
AD
13439 * data/bison.simple (b4_pure_if): New.
13440 Use it instead of #ifdef YYPURE.
13441
134422002-06-19 Akim Demaille <akim@epita.fr>
13443
13444 * data/bison.simple (b4_location_if): New.
58612f1d
AD
13445 Use it instead of #ifdef YYLSP_NEEDED.
13446
f25bfb75
AD
134472002-06-19 Akim Demaille <akim@epita.fr>
13448
13449 Prepare @$ in %destructor, but currently don't bind it in the
13450 skeleton, as %location use is not cleaned up yet.
13451
13452 * src/scan-gram.l (handle_dollar, handle_destructor_at)
13453 (handle_action_at): New.
13454 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
13455 a braced_code_t and a location as additional arguments.
13456 (handle_destructor_dollar): Instead of requiring `b4_eval', just
13457 unquote one when outputting `b4_dollar_dollar'.
13458 Adjust callers.
13459 * data/bison.simple (b4_eval): Remove.
13460 (b4_symbol_destructor): Adjust.
13461 * tests/input.at (Invalid @n): Adjust.
13462
c732d2c6
AD
134632002-06-19 Zack Weinberg <zack@codesourcery.com>
13464
13465 * doc/bison.texinfo: Document ability to have multiple
13466 prologue sections.
13467
8c165d89
AD
134682002-06-18 Akim Demaille <akim@epita.fr>
13469
13470 * src/files.c (compute_base_names): When computing the output file
13471 names from the input file name, strip the directory part.
13472
ca98bf57
AD
134732002-06-18 Akim Demaille <akim@epita.fr>
13474
13475 * data/bison.simple.new: Comment changes.
13476 Reported by Andreas Schwab.
13477
0bfb02ff
AD
134782002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
13479
13480 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
13481 there are no `label `yyoverflowlab' defined but not used' warnings
13482 when yyoverflow is defined.
13483
24c0aad7
AD
134842002-06-18 Akim Demaille <akim@epita.fr>
13485
13486 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
13487 new member.
13488 (symbol_destructor_set): Adjust.
13489 * src/output.c (symbol_destructors_output): Output the destructor
13490 locations.
13491 Output the symbol name.
13492 * data/bison.simple (b4_symbol_destructor): Adjust.
13493
5719c109
AD
134942002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
13495 and Akim Demaille <akim@epita.fr>
13496
13497 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
13498 what's left on the stack when the error recovery hits EOF.
13499 * tests/actions.at (Destructors): Complete to exercise this case.
13500
9280d3ef
AD
135012002-06-17 Akim Demaille <akim@epita.fr>
13502
13503 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
13504 arguments is really empty, not only equal to `[]'.
13505 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
13506 member.
13507 (symbol_destructor_set): New.
13508 * src/output.c (symbol_destructors_output): New.
13509 * src/reader.h (brace_code_t, current_braced_code): New.
13510 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
13511 (handle_dollar): Rename as...
13512 (handle_action_dollar): this.
13513 (handle_destructor_dollar): New.
13514 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
13515 (grammar_declaration): Use it.
13516 * data/bison.simple (yystos): Is always defined.
13517 (yydestructor): New.
13518 * tests/actions.at (Destructors): New.
13519 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
13520
dafdc66f
AD
135212002-06-17 Akim Demaille <akim@epita.fr>
13522
13523 * src/symlist.h, src/symlist.c (symbol_list_length): New.
13524 * src/scan-gram.l (handle_dollar, handle_at): Compute the
13525 rule_length only when needed.
13526 * src/output.c (actions_output, token_definitions_output): Output
13527 the full M4 block.
13528 * src/symtab.c: Don't access directly to the symbol tag, use
13529 symbol_tag_get.
13530 * src/parse-gram.y: Use symbol_list_free.
13531
56c47203
AD
135322002-06-17 Akim Demaille <akim@epita.fr>
13533
13534 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
13535 (symbol_list_prepend, get_type_name): Move to...
13536 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
13537 (symbol_list_prepend, symbol_list_n_type_name_get): here.
13538 Adjust all callers.
13539 (symbol_list_free): New.
13540 * src/scan-gram.l (handle_dollar): Takes a location.
13541 * tests/input.at (Invalid $n): Adjust.
13542
1e0bab92
AD
135432002-06-17 Akim Demaille <akim@epita.fr>
13544
13545 * src/reader.h, src/reader.c (symbol_list_new): Export it.
13546 (symbol_list_prepend): New.
13547 * src/parse-gram.y (%union): `list' is a new member.
13548 (symbols.1): New, replaces...
13549 (terms_to_prec.1, nterms_to_type.1): these.
13550 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
13551 Take a location as additional argument.
13552 Adjust all callers.
13553
04e60654
AD
135542002-06-15 Akim Demaille <akim@epita.fr>
13555
13556 * src/parse-gram.y: Move %token in the declaration section so that
13557 we don't depend upon CVS Bison.
13558
10e5b8bd
AD
135592002-06-15 Akim Demaille <akim@epita.fr>
13560
13561 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
13562 * src/print.c (print_core): Use it.
13563
9801d40c
AD
135642002-06-15 Akim Demaille <akim@epita.fr>
13565
13566 * src/conflicts.c (log_resolution): Accept the rule involved in
13567 the sr conflicts instead of the lookahead number that points to
13568 that rule.
13569 (flush_reduce): Accept the current lookahead vector as argument,
13570 instead of the index in LA.
13571 (resolve_sr_conflict): Accept the current number of lookahead
13572 bitset to consider for the STATE, instead of the index in LA.
13573 (set_conflicts): Adjust.
13574 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
13575
c0263492
AD
135762002-06-15 Akim Demaille <akim@epita.fr>
13577
13578 * src/state.h (state_t): Replace the `lookaheadsp' member, a
13579 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
13580 Adjust all dependencies.
13581 * src/lalr.c (initialize_lookaheads): Split into...
13582 (states_lookaheads_count, states_lookaheads_initialize): these.
13583 (lalr): Adjust.
13584
9757c359
AD
135852002-06-15 Akim Demaille <akim@epita.fr>
13586
13587 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
13588 out of...
13589 (grammar_rules_print): here.
13590 * src/reduce.c (reduce_output): Use it.
13591 * tests/reduce.at (Useless Rules, Reduced Automaton)
13592 (Underivable Rules): Adjust.
13593
6b98e4b5
AD
135942002-06-15 Akim Demaille <akim@epita.fr>
13595
13596 Copy BYacc's nice way to report the grammar.
13597
13598 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
13599 New.
13600 Don't print the rules' location, it is confusing and useless.
13601 (rule_print): Use grammar_rhs_print.
13602 * src/print.c (print_grammar): Use grammar_rules_print.
13603
6b98e4b5
AD
136042002-06-15 Akim Demaille <akim@epita.fr>
13605
13606 Complete and rationalize `useless thing' warnings.
13607
13608 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
13609 (symbol_tag_print): New.
13610 Use them everywhere in place of accessing directly the tag member.
13611 * src/gram.h, src/gram.c (rule_print): New.
13612 Use it where a rule used to be printed `by hand'.
13613 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
13614 (reduce_grammar_tables): Report the useless rules.
13615 (reduce_print): Useless things are a warning, not an error.
13616 Report it as such.
13617 * tests/reduce.at (Useless Nonterminals, Useless Rules):
13618 (Reduced Automaton, Underivable Rules): Adjust.
13619 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
13620 * tests/conflicts.at (Unresolved SR Conflicts)
13621 (Solved SR Conflicts): Adjust.
13622
ee000ba4
AD
136232002-06-15 Akim Demaille <akim@epita.fr>
13624
13625 Let symbols have a location.
13626
13627 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
13628 (getsym): Adjust.
13629 Adjust all callers.
13630 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
13631 Use location_t, not int.
13632 * src/symtab.c (symbol_check_defined): Take advantage of the
13633 location.
13634 * tests/regression.at (Invalid inputs): Adjust.
13635
8efe435c
AD
136362002-06-15 Akim Demaille <akim@epita.fr>
13637
13638 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
13639 (input): Don't try to initialize yylloc here, do it in the
13640 scanner.
13641 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
13642 * src/gram.h (rule_t): Change line and action_line into location
13643 and action_location, of location_t type.
13644 Adjust all dependencies.
13645 * src/location.h, src/location.c (empty_location): New.
13646 * src/reader.h, src/reader.c (grammar_start_symbol_set)
13647 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
13648 (grammar_current_rule_symbol_append)
13649 (grammar_current_rule_action_append): Expect a location as argument.
13650 * src/reader.c (grammar_midrule_action): Adjust to attach an
13651 action's location as dummy symbol location.
13652 * src/symtab.h, src/symtab.c (startsymbol_location): New.
13653 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
13654 the line numbers.
13655
1921f1d7
AD
136562002-06-14 Akim Demaille <akim@epita.fr>
13657
13658 Grammar declarations may be found in the grammar section.
13659
13660 * src/parse-gram.y (rules_or_grammar_declaration): New.
13661 (declarations): Each declaration may end with a semicolon, not
13662 just...
13663 (grammar_declaration): `"%union"'.
13664 (grammar): Branch to rules_or_grammar_declaration.
13665
4515534c
AD
136662002-06-14 Akim Demaille <akim@epita.fr>
13667
13668 * src/main.c (main): Invoke scanner_free.
13669
f958596b
AD
136702002-06-14 Akim Demaille <akim@epita.fr>
13671
13672 * src/output.c (m4_invoke): Extracted from...
13673 (output_skeleton): here.
13674 Free tempfile.
13675
2c569025
AD
136762002-06-14 Akim Demaille <akim@epita.fr>
13677
13678 * src/parse-gram.y (directives, directive, gram)
13679 (grammar_directives, precedence_directives, precedence_directive):
13680 Rename as...
13681 (declarations, declaration, grammar, grammar_declaration)
13682 (precedence_declaration, precedence_declarator): these.
13683 (symbol_declaration): New.
13684
592e8d4d
AD
136852002-06-14 Akim Demaille <akim@epita.fr>
13686
13687 * src/files.c (action_obstack): Remove, unused.
13688 (output_obstack): Remove it, and all its dependencies, as it is no
13689 longer needed.
13690 * src/reader.c (epilogue_set): Build the epilogue in the
13691 muscle_obstack.
13692 * src/output.h, src/output.c (muscle_obstack): Move to...
13693 * src/muscle_tab.h, src/muscle_tab.h: here.
13694 (muscle_init): Initialize muscle_obstack.
13695 (muscle_free): New.
13696 * src/main.c (main): Call it.
13697
0c15323d
AD
136982002-06-14 Akim Demaille <akim@epita.fr>
13699
13700 * src/location.h: New, extracted from...
13701 * src/reader.h: here.
13702 * src/Makefile.am (noinst_HEADERS): Merge into
13703 (bison_SOURCES): this.
13704 Add location.h.
13705 * src/parse-gram.y: Use location_t instead of Bison's.
13706 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
13707 Use location_t instead of ints.
13708
e96c9728
AD
137092002-06-14 Akim Demaille <akim@epita.fr>
13710
13711 * data/bison.simple, data/bison.c++: Be sure to restore the
13712 current #line when returning to the skeleton contents after having
13713 exposed the input file's #line.
13714
75d1fe16
AD
137152002-06-12 Akim Demaille <akim@epita.fr>
13716
13717 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
13718 eager.
13719 * tests/actions.at (Exotic Dollars): New.
13720
6c35d22c
AD
137212002-06-12 Akim Demaille <akim@epita.fr>
13722
13723 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
13724 ['"/] too eagerly.
13725 * tests/input.at (Torturing the Scanner): New.
13726
1d6412ad
AD
137272002-06-11 Akim Demaille <akim@epita.fr>
13728
13729 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
13730 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
13731 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
13732 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
13733 * src/reader.c (reader): Use it.
13734
4cdb01db
AD
137352002-06-11 Akim Demaille <akim@epita.fr>
13736
13737 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
13738 Adjust all callers.
13739 (scanner_last_string_free): New.
13740
44995b2e
AD
137412002-06-11 Akim Demaille <akim@epita.fr>
13742
13743 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
13744 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
13745 (last_string, YY_OBS_FREE): New.
13746 Use them when returning an ID.
13747
e9955c83
AD
137482002-06-11 Akim Demaille <akim@epita.fr>
13749
13750 Have Bison grammars parsed by a Bison grammar.
13751
13752 * src/reader.c, src/reader.h (prologue_augment): New.
13753 * src/reader.c (copy_definition): Remove.
13754
13755 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
13756 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
13757 (grammar_current_rule_prec_set, grammar_current_rule_check)
13758 (grammar_current_rule_symbol_append)
13759 (grammar_current_rule_action_append): Export.
13760 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
13761 (symbol_list_action_append): Remove.
13762 Hook the routines from reader.
13763 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
13764 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
13765
13766 * src/reader.c (read_declarations): Remove, unused.
13767
13768 * src/parse-gram.y: Handle the epilogue.
13769 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
13770 (grammar_start_symbol_set): this.
13771 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
13772 * src/reader.c (readgram): Remove, unused.
13773 (reader): Adjust to insert eoftoken and axiom where appropriate.
13774
13775 * src/reader.c (copy_dollar): Replace with...
13776 * src/scan-gram.h (handle_dollar): this.
13777 * src/parse-gram.y: Remove `%thong'.
13778
13779 * src/reader.c (copy_at): Replace with...
13780 * src/scan-gram.h (handle_at): this.
13781
13782 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
13783 New.
13784
13785 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
13786 time being.
13787
13788 * src/reader.h, src/reader.c (grammar_rule_end): New.
13789
13790 * src/parse.y (current_type, current_class): New.
13791 Implement `%nterm', `%token' support.
13792 Merge `%term' into `%token'.
13793 (string_as_id): New.
13794 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
13795 type name.
13796
13797 * src/parse-gram.y: Be sure to handle properly the beginning of
13798 rules.
13799
13800 * src/parse-gram.y: Handle %type.
13801 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13802
13803 * src/parse-gram.y: More directives support.
13804 * src/options.c: No longer handle source directives.
13805
13806 * src/parse-gram.y: Fix %output.
13807
13808 * src/parse-gram.y: Handle %union.
13809 Use the prologue locations.
13810 * src/reader.c (parse_union_decl): Remove.
13811
13812 * src/reader.h, src/reader.c (epilogue_set): New.
13813 * src/parse-gram.y: Use it.
13814
13815 * data/bison.simple, data/bison.c++: b4_stype is now either not
13816 defined, then default to int, or to the contents of %union,
13817 without `union' itself.
13818 Adjust.
13819 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13820
13821 * src/output.c (actions_output): Don't output braces, as they are
13822 already handled by the scanner.
13823
13824 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13825 characters to themselves.
13826
13827 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13828 that the epilogue has a proper #line.
13829
13830 * src/parse-gram.y: Handle precedence/associativity.
13831
13832 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13833 a terminal.
13834 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13835 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13836 at all to define terminals that cannot be emitted.
13837
13838 * src/scan-gram.l: Escape M4 characters.
13839
13840 * src/scan-gram.l: Working properly with escapes in user
13841 strings/characters.
13842
13843 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13844 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13845 grammar.
13846 Use more modest sizes, as for the time being the parser does not
13847 release memory, and therefore the process swallows a huge amount
13848 of memory.
13849
13850 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13851 stricter %token grammar.
13852
13853 * src/symtab.h (associativity): Add `undef_assoc'.
13854 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13855 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13856
13857 * tests/regression.at (Invalid %directive): Remove, as it is now
13858 meaningless.
13859 (Invalid inputs): Adjust to the new error messages.
13860 (Token definitions): The new grammar doesn't allow too many
13861 eccentricities.
13862
13863 * src/lex.h, src/lex.c: Remove.
13864 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13865 (copy_character, copy_string2, copy_string, copy_identifier)
13866 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13867 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13868 (parse_action): Remove.
13869 * po/POTFILES.in: Adjust.
13870
2e047461
AD
138712002-06-11 Akim Demaille <akim@epita.fr>
13872
cd05d13c 13873 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
13874 rule's action member: return the action as a string.
13875 Don't require `rule_length' as an argument: compute it.
13876 (grammar_current_rule_symbol_append)
13877 (grammar_current_rule_action_append): New, eved out from
13878 (readgram): here.
13879 Remove `action_flag', `rulelength', unused now.
13880
9af3fbce
AD
138812002-06-11 Akim Demaille <akim@epita.fr>
13882
13883 * src/reader.c (grammar_current_rule_prec_set).
13884 (grammar_current_rule_check): New, eved out from...
13885 (readgram): here.
13886 Remove `xaction', `first_rhs': useless.
13887 * tests/input.at (Type clashes): New.
13888 * tests/existing.at (GNU Cim Grammar): Adjust.
13889
1485e106
AD
138902002-06-11 Akim Demaille <akim@epita.fr>
13891
13892 * src/reader.c (grammar_midrule_action): New, Eved out from
13893 (readgram): here.
13894
da4160c3
AD
138952002-06-11 Akim Demaille <akim@epita.fr>
13896
13897 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13898 New.
13899 (readgram): Use them as replacement of inlined code, crule and
13900 crule1.
13901
f6d0f937
AD
139022002-06-11 Akim Demaille <akim@epita.fr>
13903
13904 * src/reader.c (grammar_end, grammar_symbol_append): New.
13905 (readgram): Use them.
13906 Make the use of `p' as local as possible.
13907
69078d4b
AD
139082002-06-10 Akim Demaille <akim@epita.fr>
13909
13910 GCJ's parser requires the tokens to be defined before the prologue.
13911
13912 * data/bison.simple: Output the token definition before the user's
13913 prologue.
13914 * tests/regression.at (Braces parsing, Duplicate string)
13915 (Mixing %token styles): Check the output from bison.
13916 (Early token definitions): New.
13917
5e424082
AD
139182002-06-10 Akim Demaille <akim@epita.fr>
13919
13920 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13921 assigning twice the same user number to a token, so that we can
13922 use it in...
13923 * src/lex.c (lex): here.
13924 Also use `symbol_class_set' instead of hand written code.
13925 * src/reader.c (parse_assoc_decl): Likewise.
13926
44536b35
AD
139272002-06-10 Akim Demaille <akim@epita.fr>
13928
13929 * src/symtab.c, src/symtab.c (symbol_class_set)
13930 (symbol_user_token_number_set): New.
13931 * src/reader.c (parse_token_decl): Use them.
13932 Use a switch instead of ifs.
13933 Use a single argument.
13934
8b9f2372
AD
139352002-06-10 Akim Demaille <akim@epita.fr>
13936
13937 Remove `%thong' support as it is undocumented, unused, duplicates
13938 `%token's job, and creates useless e-mail traffic with people who
13939 want to know what it is, why it is undocumented, unused, and
13940 duplicates `%token's job.
13941
13942 * src/reader.c (parse_thong_decl): Remove.
13943 * src/options.c (option_table): Remove "thong".
13944 * src/lex.h (tok_thong): Remove.
13945
3ae2b51f
AD
139462002-06-10 Akim Demaille <akim@epita.fr>
13947
13948 * src/symtab.c, src/symtab.c (symbol_type_set)
13949 (symbol_precedence_set): New.
13950 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13951 (value_components_used): Remove, unused.
13952
2f1afb73
AD
139532002-06-09 Akim Demaille <akim@epita.fr>
13954
13955 Move symbols handling code out of the reader.
13956
13957 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13958 (axiom): Move to...
13959 * src/symtab.h, src/symtab.c: here.
13960
13961 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13962 * src/reader.c (startval): Rename as...
13963 * src/symtab.h, src/symtab.c (startsymbol): this.
13964 * src/reader.c: Adjust.
13965
13966 * src/reader.c (symbol_check_defined, symbol_make_alias)
13967 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13968 (token_translations_init)
13969 Move to...
13970 * src/symtab.c: here.
13971 * src/reader.c (packsymbols): Move to...
13972 * src/symtab.h, src/symtab.c (symbols_pack): here.
13973 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
13974 argument.
13975
e9bca3ad
AD
139762002-06-03 Akim Demaille <akim@epita.fr>
13977
13978 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
13979 then statements.
13980
86eff183
AD
139812002-06-03 Akim Demaille <akim@epita.fr>
13982
13983 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
13984 structs with non literals.
13985 * src/scan-skel.l: never-interactive.
13986 * src/conflicts.c (enum conflict_resolution_e): No trailing
13987 comma.
13988 * src/getargs.c (usage): Split long literal strings.
13989 Reported by Hans Aberg.
13990
717be197
AD
139912002-05-28 Akim Demaille <akim@epita.fr>
13992
13993 * data/bison.c++: Use C++ ostreams.
13994 (cdebug_): New member.
13995
670ddffd
AD
139962002-05-28 Akim Demaille <akim@epita.fr>
13997
13998 * src/output.c (output_skeleton): Be sure to allocate enough room
13999 for `/' _and_ for `\0' in full_skeleton.
14000
769b430f
AD
140012002-05-28 Akim Demaille <akim@epita.fr>
14002
14003 * data/bison.c++: Catch up with bison.simple:
14004 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14005 and Paul Eggert <eggert@twinsun.com>: `error' handing.
14006 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
14007 and popping traces.
14008
7067cb36
PH
140092002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14010
14011 * src/output.c (output_skeleton): Put an explicit path in front of
14012 the skeleton file name, rather than relying on the -I directory,
14013 to partially alleviate effects of having a skeleton file lying around
14014 in the current directory.
769b430f 14015
4a713ec2
PH
140162002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14017
769b430f 14018 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
14019 obstack_printf should be obstack_fgrow1.
14020
b408954b
AD
140212002-05-26 Akim Demaille <akim@epita.fr>
14022
14023 * src/state.h (state_t): `solved_conflicts' is a new member.
14024 * src/LR0.c (new_state): Set it to 0.
14025 * src/conflicts.h, src/conflicts.c (print_conflicts)
14026 (free_conflicts, solve_conflicts): Rename as...
14027 (conflicts_print, conflicts_free, conflicts_solve): these.
14028 Adjust callers.
14029 * src/conflicts.c (enum conflict_resolution_e)
14030 (solved_conflicts_obstack): New, used by...
14031 (log_resolution): this.
14032 Adjust to attach the conflict resolution to each state.
14033 Complete the description with the precedence/associativity
14034 information.
14035 (resolve_sr_conflict): Adjust.
14036 * src/print.c (print_state): Output its solved_conflicts.
14037 * tests/conflicts.at (Unresolved SR Conflicts)
14038 (Solved SR Conflicts): Exercise --report=all.
14039
a49aecd5
AD
140402002-05-26 Akim Demaille <akim@epita.fr>
14041
14042 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14043 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14044 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
14045 (token_number_t, item_number_as_token_number)
14046 (token_number_as_item_number, muscle_insert_token_number_table):
14047 Rename as...
14048 (symbol_number_t, item_number_as_symbol_number)
14049 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
14050 these, since it is more appropriate.
14051
5504898e
AD
140522002-05-26 Akim Demaille <akim@epita.fr>
14053
14054 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
14055 `Error:' lines.
14056 * data/bison.simple (yystos) [YYDEBUG]: New.
14057 (yyparse) [YYDEBUG]: Display the symbols which are popped during
14058 error recovery.
14059 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
14060
ec3bc396
AD
140612002-05-25 Akim Demaille <akim@epita.fr>
14062
14063 * doc/bison.texinfo (Debugging): Split into...
14064 (Tracing): this new section, its former contents, and...
14065 (Understanding): this new section.
14066 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
14067 by...
14068 (report_flag): this.
14069 Adjust all dependencies.
14070 (report_args, report_types, report_argmatch): New.
14071 (usage, getargs): Report/support -r, --report.
14072 * src/options.h
14073 (struct option_table_struct): Rename as..,
14074 (struct option_table_s): this.
14075 Rename the `set_flag' member to `flag' to match with getopt_long's
14076 struct.
14077 * src/options.c (option_table): Split verbose into an entry for
14078 %verbose, and another for --verbose.
14079 Support --report/-r, so remove -r from the obsolete --raw.
14080 * src/print.c: Attach full item sets and lookaheads reports to
14081 report_flag instead of trace_flag.
14082 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
14083
78df8250
PE
140842002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14085 and Paul Eggert <eggert@twinsun.com>
769b430f 14086
78df8250
PE
14087 * data/bison.simple (yyparse): Correct error handling to conform to
14088 POSIX and yacc. Specifically, after syntax error is discovered,
14089 do not reduce further before shifting the error token.
14090 Clean up the code a bit by removing the labels yyerrdefault,
14091 yyerrhandle, yyerrpop.
14092 * NEWS: Document the above.
14093
c0c9ea05
PH
140942002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14095
14096 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
14097 type; it isn't always big enough, since it doesn't necessarily
14098 include non-terminals.
769b430f 14099 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
14100 the latter can be removed.
14101 (yy_token_number_type): Remove, only one use.
14102 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
14103 don't use TokenNumberType as element type.
769b430f 14104
c0c9ea05
PH
14105 * tests/regression.at: Modify expected output to agree with change
14106 to yyr1 and yytranslate.
769b430f 14107
6390a83f
FK
141082002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
14109
14110 * src/reader.c (parse_action): Use copy_character instead of
14111 obstack_1grow.
14112
db7c8e9a
AD
141132002-05-13 Akim Demaille <akim@epita.fr>
14114
14115 * tests/regression.at (Token definitions): Prototype yylex and
14116 yyerror.
14117
fcc61800
PH
141182002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14119
158c687b 14120 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
14121 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
14122 32-bit arithmetic.
14123 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
14124
5683e9b2
AD
141252002-05-07 Akim Demaille <akim@epita.fr>
14126
14127 * tests/synclines.at: Be sure to prototype yylex and yyerror to
14128 avoid GCC warnings.
14129
0c2d3f4c
AD
141302002-05-07 Akim Demaille <akim@epita.fr>
14131
14132 Kill GCC warnings.
14133
14134 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
14135 over the RHS of each rule.
14136 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
14137 * src/state.h (state_t): Member `nitems' is unsigned short.
14138 * src/LR0.c (get_state): Adjust.
14139 * src/reader.c (packgram): Likewise.
14140 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
14141 `Type'.
14142 (muscle_insert_int_table): Remove, unused.
14143 (prepare_rules): Remove `max'.
14144
1565b720
AD
141452002-05-06 Akim Demaille <akim@epita.fr>
14146
14147 * src/closure.c (print_firsts): Display of the symbol tags.
14148 (bitmatrix_print): Move to...
14149 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
14150 here.
14151 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
14152
cfaee611
AD
141532002-05-06 Akim Demaille <akim@epita.fr>
14154
14155 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
14156 hash_do_for_each.
14157
458be8e0
AD
141582002-05-06 Akim Demaille <akim@epita.fr>
14159
14160 * src/LR0.c (new_state, get_state): Instead of using the global
14161 `kernel_size' and `kernel_base', have two new arguments:
14162 `core_size' and `core'.
14163 Adjust callers.
14164
a900a624
AD
141652002-05-06 Akim Demaille <akim@epita.fr>
14166
14167 * src/reader.c (packgram): No longer end `ritem' with a 0
14168 sentinel: it is not used.
14169
d4e7d3a1
AD
141702002-05-05 Akim Demaille <akim@epita.fr>
14171
14172 New experimental feature: display the lookaheads in the report and
14173 graph.
14174
14175 * src/print (print_core): When --trace-flag, display the rules
14176 lookaheads.
14177 * src/print_graph.c (print_core): Likewise.
14178 Swap the arguments.
14179 Adjust caller.
14180
39ceb25b
AD
141812002-05-05 Akim Demaille <akim@epita.fr>
14182
14183 * tests/torture.at (Many lookaheads): New test.
14184
5372019f
AD
141852002-05-05 Akim Demaille <akim@epita.fr>
14186
14187 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
14188 (GENERATE_MUSCLE_INSERT_TABLE): this.
14189 (output_int_table, output_unsigned_int_table, output_short_table)
14190 (output_token_number_table, output_item_number_table): Replace with...
14191 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
14192 (muscle_insert_short_table, muscle_insert_token_number_table)
14193 (muscle_insert_item_number_table): these.
14194 Adjust all callers.
14195 (prepare_tokens): Don't free `translations', since...
14196 * src/reader.h, src/reader.c (grammar_free): do it.
14197 Move to...
14198 * src/gram.h, src/gram.c (grammar_free): here.
14199 * data/bison.simple, data/bison.c++: b4_token_number_max is now
14200 b4_translate_max.
14201
5df5f6d5
AD
142022002-05-05 Akim Demaille <akim@epita.fr>
14203
14204 * src/output.c (output_unsigned_int_table): New.
14205 (prepare_rules): `i' is unsigned.
14206 `prhs', `rline', `r2' are unsigned int.
14207 Rename muscle `rhs_number_max' as `rhs_max'.
14208 Output muscles `prhs_max', `rline_max', and `r2_max'.
14209 Free rline and r1.
14210 * data/bison.simple, data/bison.c++: Adjust to use these muscles
14211 to compute types instead of constant types.
14212 * tests/regression.at (Web2c Actions): Adjust.
14213
b87f8b21
AD
142142002-05-04 Akim Demaille <akim@epita.fr>
14215
14216 * src/symtab.h (SALIAS, SUNDEF): Rename as...
14217 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
14218 Adjust dependencies.
14219 * src/output.c (token_definitions_output): Be sure not to output a
14220 `#define 'a'' when fed with `%token 'a' "a"'.
14221 * tests/regression.at (Token definitions): New.
14222
8bb936e4
PE
142232002-05-03 Paul Eggert <eggert@twinsun.com>
14224
14225 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
14226 for K&R C.
14227
142282002-05-03 gettextize <bug-gnu-gettext@gnu.org>
14229
14230 * Makefile.am (SUBDIRS): Remove intl.
14231 (EXTRA_DIST): Add config/config.rpath.
14232
53c71a12
AD
142332002-05-03 Akim Demaille <akim@epita.fr>
14234
14235 * data/bison.simple (m4_if): Don't output empty enums.
14236 And actually, output valid enum definitions :(.
14237
289dd0cf
AD
142382002-05-03 Akim Demaille <akim@epita.fr>
14239
14240 * configure.bat: Remove, completely obsolete.
14241 * Makefile.am (EXTRA_DIST): Adjust.
14242 Don't distribute config.rpath...
14243 * config/Makefile.am (EXTRA_DIST): Do it.
14244
db85e524
AD
142452002-05-03 Akim Demaille <akim@epita.fr>
14246
14247 * configure.in (GETTEXT_VERSION): New.
14248 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
14249
83ccf991
AD
142502002-05-03 Akim Demaille <akim@epita.fr>
14251
14252 * data/bison.simple (b4_token_enum): New.
14253 (b4_token_defines): Use it to output tokens both as #define and
14254 enums.
14255 Suggested by Paul Eggert.
14256 * src/output.c (token_definitions_output): Don't output spurious
14257 white spaces.
14258
1f418995
AD
142592002-05-03 Akim Demaille <akim@epita.fr>
14260
14261 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14262
45119f04
RA
142632002-05-02 Robert Anisko <robert@lrde.epita.fr>
14264
14265 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
14266 Update the stack class, give a try to deque as the default container.
14267
b2d52318
AD
142682002-05-02 Akim Demaille <akim@epita.fr>
14269
14270 * data/bison.simple (yyparse): Do not implement @$ = @1.
14271 (YYLLOC_DEFAULT): Adjust to do it.
14272 * doc/bison.texinfo (Location Default Action): Fix.
14273
3a8b4109
AD
142742002-05-02 Akim Demaille <akim@epita.fr>
14275
14276 * src/reader.c (parse_braces): Merge into...
14277 (parse_action): this.
14278
84614e13
AD
142792002-05-02 Akim Demaille <akim@epita.fr>
14280
14281 * configure.in (ALL_LINGUAS): Remove.
14282 * po/LINGUAS, hr.po: New.
14283
fdbcd8e2
AD
142842002-05-02 Akim Demaille <akim@epita.fr>
14285
14286 Remove the so called hairy (semantic) parsers.
14287
14288 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
14289 * src/gram.h, src/gram.c (semantic_parser): Remove.
14290 (rule_t): Remove the guard and guard_line members.
14291 * src/lex.h (token_t): remove tok_guard.
14292 * src/options.c (option_table): Remove %guard and %semantic_parser
14293 support.
14294 * src/output.c, src/output.h (guards_output): Remove.
14295 (prepare): Adjust.
14296 (token_definitions_output): Don't output the `T'
14297 tokens (???).
14298 (output_skeleton): Don't output the guards.
14299 * src/files.c, src/files.c (attrsfile): Remove.
14300 * src/reader.c (symbol_list): Remove the guard and guard_line
14301 members.
14302 Adjust dependencies.
14303 (parse_guard): Remove.
14304 * data/bison.hairy: Remove.
14305 * doc/bison.texinfo (Environment Variables): Remove occurrences of
14306 BISON_HAIRY.
14307
82b6cb3f
AD
143082002-05-02 Akim Demaille <akim@epita.fr>
14309
14310 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
14311 (parse_guard): Rename the formal argument `stack_offset' as
14312 `rule_length', which is more readable.
14313 Adjust callers.
14314 (copy_at, copy_dollar): Instead of outputting the hard coded
14315 values of $$, $n and so forth, output invocation to b4_lhs_value,
14316 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
14317 Note: this patch partially drops `semantic-parser' support: it
14318 always does `rule_length - n', where semantic parsers ought to
14319 always use `-n'.
82b6cb3f
AD
14320 * data/bison.simple, data/bison.c++ (b4_lhs_value)
14321 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
14322
6cbfbcc5
AD
143232002-05-02 Akim Demaille <akim@epita.fr>
14324
14325 * configure.in (AC_INIT): Bump to 1.49b.
14326 (AM_INIT_AUTOMAKE): Short invocation.
14327
b8548114
AD
143282002-05-02 Akim Demaille <akim@epita.fr>
14329
14330 Version 1.49a.
14331
c20cd1fa
AD
143322002-05-01 Akim Demaille <akim@epita.fr>
14333
14334 * src/skeleton.h: Remove.
14335
8a9566d4
AD
143362002-05-01 Akim Demaille <akim@epita.fr>
14337
14338 * src/skeleton.h: Fix the #endif.
14339 Reported by Magnus Fromreide.
14340
8c6d399a
PE
143412002-04-26 Paul Eggert <eggert@twinsun.com>
14342
14343 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
14344 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 14345 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 14346
2b7ed18a
RA
143472002-04-25 Robert Anisko <robert@lrde.epita.fr>
14348
14349 * src/scan-skel.l: Postprocess quadrigraphs.
14350
14351 * src/reader.c (copy_character): New function, used to output
14352 single characters while replacing `[' and `]' with quadrigraphs, to
14353 avoid troubles with M4 quotes.
14354 (copy_comment): Output characters with copy_character.
14355 (read_additionnal_code): Likewise.
14356 (copy_string2): Likewise.
14357 (copy_definition): Likewise.
14358
14359 * tests/calc.at: Exercise M4 quoting.
14360
34a89c50
AD
143612002-04-25 Akim Demaille <akim@epita.fr>
14362
14363 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
14364 between `!' and the command.
14365 Reported by Paul Eggert.
14366
0dd1580a
RA
143672002-04-24 Robert Anisko <robert@lrde.epita.fr>
14368
14369 * tests/calc.at: Exercise prologue splitting.
14370
14371 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
14372 `b4_post_prologue' instead of `b4_prologue'.
14373
14374 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
14375 muscles.
14376 (output): Free pre_prologue_obstack and post_prologue_obstack.
14377 * src/files.h, src/files.c (attrs_obstack): Remove.
14378 (pre_prologue_obstack, post_prologue_obstack): New.
14379 * src/reader.c (copy_definition): Add a parameter to specify the
14380 obstack to fill, instead of using attrs_obstack unconditionally.
14381 (read_declarations): Pass pre_prologue_obstack to copy_definition if
14382 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
14383
83c1796f
PE
143842002-04-23 Paul Eggert <eggert@twinsun.com>
14385
14386 * data/bison.simple: Remove unnecessary commentary and white
14387 space differences from 1_29-branch.
14388 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
14389
14390 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
14391 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
14392 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
14393 constructors or destructors.
14394
14395 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
14396
1207eeac
AD
143972002-04-23 Akim Demaille <akim@epita.fr>
14398
14399 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
14400 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
14401 location with columns.
14402 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
14403 All reported by Paul Eggert.
14404
78ab8f67
AD
144052002-04-22 Akim Demaille <akim@epita.fr>
14406
14407 * src/reduce.c (dump_grammar): Move to...
14408 * src/gram.h, src/gram.c (grammar_dump): here.
14409 Be sure to separate long item numbers.
14410 Don't read the members of a rule's prec if its nil.
14411
133c20e2
AD
144122002-04-22 Akim Demaille <akim@epita.fr>
14413
14414 * src/output.c (table_size, table_grow): New.
14415 (MAXTABLE): Remove, replace uses with table_size.
14416 (pack_vector): Instead of dying when the table is too big, grow it.
14417
9515e8a7
AD
144182002-04-22 Akim Demaille <akim@epita.fr>
14419
14420 * data/bison.simple (yyr1): Its type is that of a token number.
14421 * data/bison.c++ (r1_): Likewise.
14422 * tests/regression.at (Web2c Actions): Adjust.
14423
23c5a174
AD
144242002-04-22 Akim Demaille <akim@epita.fr>
14425
14426 * src/reader.c (token_translations_init): 256 is now the default
14427 value for the error token, i.e., it will be assigned another
14428 number if the user assigned 256 to one of her tokens.
14429 (reader): Don't force 256 to error.
14430 * doc/bison.texinfo (Symbols): Adjust.
14431 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
14432 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
14433 etc. instead of 10, 20, 30 (which was used to `jump' over error
14434 (256) and undefined (2)).
14435
5fbb0954
AD
144362002-04-22 Akim Demaille <akim@epita.fr>
14437
14438 Propagate more token_number_t.
14439
14440 * src/gram.h (token_number_as_item_number)
14441 (item_number_as_token_number): New.
14442 * src/output.c (GENERATE_OUTPUT_TABLE): New.
14443 Use it to create output_item_number_table and
14444 output_token_number_table.
14445 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14446 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
14447 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
14448 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
14449
4f940944
AD
144502002-04-22 Akim Demaille <akim@epita.fr>
14451
14452 * src/output.h, src/output.c (get_lines_number): Remove.
14453
3ded9a63
AD
144542002-04-19 Akim Demaille <akim@epita.fr>
14455
14456 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
14457 as Lex/Flex'.
14458 (Debugging): More details about enabling the debugging features.
14459 (Table of Symbols): Describe $$, $n, @$, and @n.
14460 Suggested by Tim Josling.
14461
e0c471a9
AD
144622002-04-19 Akim Demaille <akim@epita.fr>
14463
14464 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
14465
fecc10cd
AD
144662002-04-10 Akim Demaille <akim@epita.fr>
14467
14468 * src/system.h: Rely on HAVE_LIMITS_H.
14469 Suggested by Paul Eggert.
14470
51dec47b
AD
144712002-04-09 Akim Demaille <akim@epita.fr>
14472
14473 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
14474 full stderr, and strip it according to the bison options, instead
14475 of composing the error message from different bits.
14476 This makes it easier to check for several error messages.
14477 Adjust all the invocations.
14478 Add an invocation exercising the error token.
14479 Add an invocation demonstrating a stupid error message.
14480 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
14481 Adjust the tests.
14482 Error message are for stderr, not stdout.
14483
007a50a4
AD
144842002-04-09 Akim Demaille <akim@epita.fr>
14485
14486 * src/gram.h, src/gram.c (error_token_number): Remove, use
14487 errtoken->number.
14488 * src/reader.c (reader): Don't specify the user token number (2)
14489 for $undefined, as it uselessly prevents using it.
14490 * src/gram.h (token_number_t): Move to...
14491 * src/symtab.h: here.
14492 (state_t.number): Is a token_number_t.
14493 * src/print.c, src/reader.c: Use undeftoken->number instead of
14494 hard coded 2.
14495 (Even though this 2 is not the same as above: the number of the
14496 undeftoken remains being 2, it is its user token number which
14497 might not be 2).
14498 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
14499 `user_token_number_max'.
14500 Output `undef_token_number'.
14501 * data/bison.simple, data/bison.c++: Use them.
14502 Be sure to map invalid yylex return values to
14503 `undef_token_number'. This saves us from gratuitous SEGV.
14504
14505 * tests/conflicts.at (Solved SR Conflicts)
14506 (Unresolved SR Conflicts): Adjust.
14507 * tests/regression.at (Web2c Actions): Adjust.
14508
06446ccf
AD
145092002-04-08 Akim Demaille <akim@epita.fr>
14510
14511 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
14512 Adding #line.
14513 Remove the duplicate `typedefs'.
14514 (RhsNumberType): Fix the declaration and various other typos.
14515 Use __ofile__.
14516 * data/bison.simple: Use __ofile__.
14517 * src/scan-skel.l: Handle __ofile__.
14518
62a3e4f0
AD
145192002-04-08 Akim Demaille <akim@epita.fr>
14520
14521 * src/gram.h (item_number_t): New, the type of item numbers in
14522 RITEM. Note that it must be able to code symbol numbers as
14523 positive number, and the negation of rule numbers as negative
14524 numbers.
14525 Adjust all dependencies (pretty many).
14526 * src/reduce.c (rule): Remove this `short *' pointer: use
14527 item_number_t.
14528 * src/system.h (MINSHORT, MAXSHORT): Remove.
14529 Include `limits.h'.
14530 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
14531 (shortcpy): Remove.
14532 (MAXTABLE): Move to...
14533 * src/output.c (MAXTABLE): here.
14534 (prepare_rules): Use output_int_table to output rhs.
14535 * data/bison.simple, data/bison.c++: Adjust.
14536 * tests/torture.at (Big triangle): Move the limit from 254 to
14537 500.
14538 * tests/regression.at (Web2c Actions): Ajust.
14539
14540 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
14541 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
14542 passes, but produces negative #line number, once fixed, GCC is
14543 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
14544 C), it passes.
14545 * src/state.h (state_h): Code input lines on ints, not shorts.
14546
bb88b0fc
AD
145472002-04-08 Akim Demaille <akim@epita.fr>
14548
14549 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
14550 and then the grammar.
14551
9a636f47
AD
145522002-04-08 Akim Demaille <akim@epita.fr>
14553
14554 * src/system.h: No longer using strndup.
14555
680e8701
AD
145562002-04-07 Akim Demaille <akim@epita.fr>
14557
14558 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
14559 * src/output.c (output_table_data): Return the longest number.
14560 (prepare_tokens): Output `token_number_max').
14561 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
14562 New.
14563 Use them to define yy_token_number_type/TokenNumberType.
14564 Use this type for yytranslate.
14565 * tests/torture.at (Big triangle): Push the limit from 124 to
14566 253.
14567 * tests/regression.at (Web2c Actions): Adjust.
14568
817e9f41
AD
145692002-04-07 Akim Demaille <akim@epita.fr>
14570
14571 * tests/torture.at (Big triangle): New.
14572 (GNU AWK Grammar, GNU Cim Grammar): Move to...
14573 * tests/existing.at: here.
14574
5123689b
AD
145752002-04-07 Akim Demaille <akim@epita.fr>
14576
14577 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
14578 nritems.
14579 Adjust dependencies.
14580
f3849179
AD
145812002-04-07 Akim Demaille <akim@epita.fr>
14582
14583 * src/reader.c: Normalize increments to prefix form.
14584
bd02036a
AD
145852002-04-07 Akim Demaille <akim@epita.fr>
14586
14587 * src/reader.c, symtab.c: Remove debugging code.
14588
db8837cb
AD
145892002-04-07 Akim Demaille <akim@epita.fr>
14590
14591 Rename all the `bucket's as `symbol_t'.
14592
14593 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
14594 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
14595 * src/symtab.c, src/symtab.h (bucket): Rename as...
14596 (symbol_t): this.
14597 (symbol_list_new, bucket_check_defined, bucket_make_alias)
14598 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
14599 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14600 (buckets_new, buckets_free, buckets_do): Rename as...
14601 (symbol_list_new, symbol_check_defined, symbol_make_alias)
14602 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14603 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
14604 (symbols_new, symbols_free, symbols_do): these.
14605
72a23c97
AD
146062002-04-07 Akim Demaille <akim@epita.fr>
14607
14608 Use lib/hash for the symbol table.
14609
14610 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
14611 EOF.
14612 * src/lex.c (lex): Set the `number' member of new terminals.
14613 * src/reader.c (bucket_check_defined, bucket_make_alias)
14614 (bucket_check_alias_consistence, bucket_translation): New.
14615 (reader, grammar_free, readgram, token_translations_init)
14616 (packsymbols): Adjust.
14617 (reader): Number the predefined tokens.
14618 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
14619 for predefined tokens.
14620 * src/symtab.h (bucket): Remove all the hash table related
14621 members.
14622 * src/symtab.c (symtab): Replace by...
14623 (bucket_table): this.
14624 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14625 (buckets_new, buckets_do): New.
14626
280a38c3
AD
146272002-04-07 Akim Demaille <akim@epita.fr>
14628
14629 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
14630 (start_symbol, max_user_token_number, semantic_parser)
14631 (error_token_number): Initialize.
14632 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
14633 Initialize.
14634 (reader): Don't.
14635 (errtoken, eoftoken, undeftoken, axiom): Extern.
14636
03b31c0c
AD
146372002-04-07 Akim Demaille <akim@epita.fr>
14638
14639 * src/gram.h (rule_s): prec and precsym are now pointers
14640 to the bucket giving the priority/associativity.
14641 Member `associativity' removed: useless.
14642 * src/reduce.c, src/conflicts.c: Adjust.
14643
8b3df748
AD
146442002-04-07 Akim Demaille <akim@epita.fr>
14645
14646 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
14647 Properly escape the symbols' TAG when outputting them.
14648
e601aa1d
AD
146492002-04-07 Akim Demaille <akim@epita.fr>
14650
14651 * src/lalr.h (LA): Is a bitsetv, not bitset*.
14652
b0299a2e
AD
146532002-04-07 Akim Demaille <akim@epita.fr>
14654
14655 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
14656 (LArule): this, which is an array to rule_t*.
14657 * src/print.c, src/conflicts.c: Adjust.
14658
d7e1f00c
AD
146592002-04-07 Akim Demaille <akim@epita.fr>
14660
14661 * src/gram.h (rule_t): Rename `number' as `user_number'.
14662 `number' is a new member.
14663 Adjust dependencies.
14664 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
14665
cc9305dd
AD
146662002-04-07 Akim Demaille <akim@epita.fr>
14667
14668 As a result of the previous patch, it is no longer needed
14669 to reorder ritem itself.
14670
14671 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
14672
b0940840
AD
146732002-04-07 Akim Demaille <akim@epita.fr>
14674
14675 Be sure never to walk through RITEMS, but use only data related to
14676 the rules themselves. RITEMS should be banished.
14677
14678 * src/output.c (output_token_translations): Rename as...
14679 (prepare_tokens): this.
14680 In addition to `translate', prepare the muscles `tname' and
14681 `toknum', which were handled by...
14682 (output_rule_data): this.
14683 Remove, and move the remainder of its outputs into...
14684 (prepare_rules): this new routines, which also merges content from
14685 (output_gram): this.
14686 (prepare_rules): Be sure never to walk through RITEMS.
14687 (output_stos): Rename as...
14688 (prepare_stos): this.
14689 (output): Always invoke prepare_states, after all, just don't use it
14690 in the output if you don't need it.
14691
643a5994
AD
146922002-04-07 Akim Demaille <akim@epita.fr>
14693
14694 * src/LR0.c (new_state): Display `nstates' as the name of the
14695 newly created state.
14696 Adjust to initialize first_state and last_state if needed.
14697 Be sure to distinguish the initial from the final state.
14698 (new_states): Create the itemset of the initial state, and use
14699 new_state.
14700 * src/closure.c (closure): Now that the initial state has its
14701 items properly set, there is no need for a special case when
14702 creating `ruleset'.
14703
14704 As a result, now the rule 0, reducing to $axiom, is visible in the
14705 outputs. Adjust the test suite.
14706
14707 * tests/conflicts.at (Solved SR Conflicts)
14708 (Unresolved SR Conflicts): Adjust.
14709 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
14710 * tests/conflicts.at (S/R in initial): New.
14711
b4c4ccc2
AD
147122002-04-07 Akim Demaille <akim@epita.fr>
14713
14714 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
14715 the RHS of the rules.
14716 * src/output.c (output_gram): Likewise.
14717
bba97eb2
AD
147182002-04-07 Akim Demaille <akim@epita.fr>
14719
14720 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
14721 bucket.
14722 Adjust all dependencies.
14723 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
14724 `number' of the buckets too.
14725 * src/gram.h: Include `symtab.h'.
14726 (associativity): Move to...
14727 * src/symtab.h: here.
14728 No longer include `gram.h'.
14729
c3b407f4
AD
147302002-04-07 Akim Demaille <akim@epita.fr>
14731
14732 * src/gram.h, src/gram.c (rules_rhs_length): New.
14733 (ritem_longest_rhs): Use it.
14734 * src/gram.h (rule_t): `number' is a new member.
14735 * src/reader.c (packgram): Set it.
14736 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
14737 the end of `rules', and count them out of `nrules'.
14738 (reduce_output, dump_grammar): Adjust.
14739 * src/print.c (print_grammar): It is no longer needed to check for
14740 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
14741 * tests/reduce.at (Reduced Automaton): New test.
14742
11652ab3
AD
147432002-04-07 Akim Demaille <akim@epita.fr>
14744
14745 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
14746 lacking `+ 1' to nrules, Bison reported as useless a token if it
14747 was used solely to set the precedence of the last rule...
14748
26b23c1a
AD
147492002-04-07 Akim Demaille <akim@epita.fr>
14750
14751 * data/bison.c++, data/bison.simple: Don't output the current file
14752 name in #line, to avoid useless diffs between two identical
14753 outputs under different names.
14754
18bcecb0
AD
147552002-04-07 Akim Demaille <akim@epita.fr>
14756
14757 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
14758 Normalize loops to using `< nrules + 1', not `<= nrules'.
14759
fa770c86
AD
147602002-04-07 Akim Demaille <akim@epita.fr>
14761
14762 * TODO: Update.
14763
d9b739c3
AD
147642002-04-07 Akim Demaille <akim@epita.fr>
14765
14766 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
14767 bucket.value as bucket.number.
14768
99013900
AD
147692002-04-07 Akim Demaille <akim@epita.fr>
14770
14771 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
14772 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14773 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
14774 RHS, instead of being an index in RITEMS.
14775
e966383b
PE
147762002-04-04 Paul Eggert <eggert@twinsun.com>
14777
14778 * doc/bison.texinfo: Update copyright date.
14779 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
14780 (Symbols): Warn about running Bison in one character set,
14781 but compiling and/or running in an incompatible one.
14782 Warn about character code 256, too.
14783
147842002-04-03 Paul Eggert <eggert@twinsun.com>
14785
14786 * src/bison.data (YYSTACK_ALLOC): Depend on whether
14787 YYERROR_VERBOSE is nonzero, not whether it is defined.
14788
14789 Merge changes from bison-1_29-branch.
c307773e 14790
8d6c48b9
PE
147912002-03-20 Paul Eggert <eggert@twinsun.com>
14792
14793 Merge fixes from Debian bison_1.34-1.diff.
14794
14795 * configure.in (AC_PREREQ): 2.53.
14796
e53c6322
AD
147972002-03-20 Akim Demaille <akim@epita.fr>
14798
14799 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14800
9ffbeca7
PE
148012002-03-19 Paul Eggert <eggert@twinsun.com>
14802
21db0b2a
PE
14803 * src/bison.simple (YYCOPY): New macro.
14804 (YYSTACK_RELOCATE): Use it.
14805 Remove Type arg; no longer needed. All callers changed.
14806 (yymemcpy): Remove; no longer needed.
14807
9ffbeca7
PE
14808 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14809 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14810
642cb8f8
AD
148112002-03-19 Akim Demaille <akim@epita.fr>
14812
14813 Test and fix the #line outputs.
14814
14815 * tests/atlocal.at (GCC): New.
14816 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 14817 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
14818 (Action synch line, Epilogue synch line): New tests.
14819 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14820 * data/bison.simple, data/bison.c++: Use it.
14821
3c31a486
AD
148222002-03-19 Akim Demaille <akim@epita.fr>
14823
14824 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14825 (Solved SR Conflicts, %expect not enough, %expect right)
14826 (%expect too much): Move to...
14827 * tests/conflicts.at: this new file.
14828
0d8bed56
AD
148292002-03-19 Akim Demaille <akim@epita.fr>
14830
14831 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14832 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14833 that we can move to enums for instance.
14834 * src/output.c (token_definitions_output): Output a list of
14835 `token-name, token-number' instead of the #define.
14836 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14837
9208d17f
AD
148382002-03-14 Akim Demaille <akim@epita.fr>
14839
14840 Use Gettext 0.11.1.
14841
af27eacb
RA
148422002-03-09 Robert Anisko <robert@lrde.epita.fr>
14843
14844 * data/bison.c++: Make the user able to add members to the generated
14845 parser by subclassing.
14846
9101a310
RA
148472002-03-05 Robert Anisko <robert@lrde.epita.fr>
14848
14849 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14850 a character.
14851 Reported by Nicolas Tisserand and Nicolas Burrus.
14852
fff9bf0b
RA
148532002-03-04 Robert Anisko <robert@lrde.epita.fr>
14854
14855 * src/reader.c: Warn about lacking semi-colons, do not complain.
14856
64dba31e
RA
148572002-03-04 Robert Anisko <robert@lrde.epita.fr>
14858
14859 * data/bison.c++: Remove a debug line.
14860
374f5a14
RA
148612002-03-04 Robert Anisko <robert@lrde.epita.fr>
14862
14863 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14864 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14865 provide a default implementation.
14866
bfcf1f3a
AD
148672002-03-04 Akim Demaille <akim@epita.fr>
14868
14869 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14870 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14871 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14872 * tests/semantic.at (Parsing Guards): Similarly.
14873 * src/reader.at (readgram): Complain if the last rule is not ended
14874 with a semi-colon.
14875
65ccf9fc
AD
148762002-03-04 Akim Demaille <akim@epita.fr>
14877
14878 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14879 * src/closure.c: here.
14880 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14881 RTC.
14882 * src/warshall.h, src/warshall.c: Remove.
14883 * tests/sets.at (Broken Closure): Adjust.
14884
d0039cbc
AD
148852002-03-04 Akim Demaille <akim@epita.fr>
14886
14887 * src/output.c (output_skeleton): tempdir is const.
14888 bytes_read is unused.
14889
345cea78
AD
148902002-03-04 Akim Demaille <akim@epita.fr>
14891
14892 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14893 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14894 Update.
14895 From Michael Hayes.
14896
564801f7
AD
148972002-03-04 Akim Demaille <akim@epita.fr>
14898
14899 * src/closure.c (closure): `r' is unused.
14900
e5352bc7
AD
149012002-03-04 Akim Demaille <akim@epita.fr>
14902
14903 * tests/sets.at (Broken Closure): Add the ending `;'.
14904 * src/reader.at (readgram): Complain if a rule is not ended with a
14905 semi-colon.
14906
914feea9
AD
149072002-03-04 Akim Demaille <akim@epita.fr>
14908
14909 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14910 (count_sr_conflicts): Use bitset_count.
14911 * src/reduce.c (inaccessable_symbols): Ditto.
14912 (bits_size): Remove.
14913 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14914
f0250de6
AD
149152002-03-04 Akim Demaille <akim@epita.fr>
14916
14917 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14918 * src/reduce.c: Remove the `bitset_zero's following the
14919 `bitset_create's, as now it is performed by the latter.
14920
ef017502
AD
149212002-03-04 Akim Demaille <akim@epita.fr>
14922
14923 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14924 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14925 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14926 latest sources from Michael.
14927
76514394
AD
149282002-03-04 Akim Demaille <akim@epita.fr>
14929
14930 * src/output.c (output): Don't free the grammar.
14931 * src/reader.c (grammar_free): New.
14932 * src/main.c (main): Call it and don't free symtab here.
14933
55024580
AD
149342002-03-04 Akim Demaille <akim@epita.fr>
14935
14936 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14937 before returning.
14938 Reported by Benoit Perrot.
14939
f9abaa2c
AD
149402002-03-04 Akim Demaille <akim@epita.fr>
14941
14942 Use bitset operations when possible, not loops over bits.
14943
14944 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14945 bitset_or.
14946 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14947 * src/reduce.c (useless_nonterminals): Formatting changes.
14948 * src/warshall.c (TC): Use bitset_or.
14949
0e721e75
AD
149502002-03-04 Akim Demaille <akim@epita.fr>
14951
14952 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14953 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14954 Ditto.
14955
0fb1ffb1
AD
149562002-03-04 Akim Demaille <akim@epita.fr>
14957
14958 * src/lalr.c (F): Now a bitset*.
14959 Adjust all dependencies.
14960
b86796bf
AD
149612002-03-04 Akim Demaille <akim@epita.fr>
14962
14963 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14964 Adjust all dependencies.
14965
602bbf31
AD
149662002-03-04 Akim Demaille <akim@epita.fr>
14967
14968 * src/L0.c, src/LR0.h (nstates): Be size_t.
14969 Adjust comparisons (signed vs unsigned).
14970 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
14971 bitset*.
14972 Adjust all dependencies.
14973
d8a0245c
AD
149742002-03-04 Akim Demaille <akim@epita.fr>
14975
14976 * src/closure.c (firsts): Now, also a bitset.
14977 Adjust all dependencies.
14978 (varsetsize): Remove, now unused.
14979 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
14980
34ba9743
AD
149812002-03-04 Akim Demaille <akim@epita.fr>
14982
14983 * src/print.c: Convert to use bitset.h, not hand coded iterations
14984 over ints.
14985
ed86e78c
AD
149862002-03-04 Akim Demaille <akim@epita.fr>
14987
14988 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
14989
dfdb1797
AD
149902002-03-04 Akim Demaille <akim@epita.fr>
14991
14992 * src/closure.c (ruleset): Be a bitset.
14993 (rulesetsize): Remove.
14994
7086e707
AD
149952002-03-04 Akim Demaille <akim@epita.fr>
14996
14997 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14998 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
14999 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
15000 * src/closure.c (fderives): Be an array of bitsets.
15001
98254360
RA
150022002-02-28 Robert Anisko <robert@lrde.epita.fr>
15003
15004 * data/bison.c++: Merge the two generated headers. Insert a copyright
15005 notice in each output file.
15006
a75c057f
AD
150072002-02-28 Akim Demaille <akim@epita.fr>
15008
15009 * data/bison.c++: Copy the prologue of bison.simple to fetch
15010 useful M4 definitions, such as b4_header_guard.
15011
06b00abc
AD
150122002-02-25 Akim Demaille <akim@epita.fr>
15013
15014 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
15015 translator friendly scheme for the bgr
15016 copyright notice.
06b00abc 15017
70e7d534
AD
150182002-02-25 Akim Demaille <akim@epita.fr>
15019
15020 * src/output.c (header_output): Remove, now handled completely via
15021 M4.
15022
abe017f6
AD
150232002-02-25 Akim Demaille <akim@epita.fr>
15024
15025 * m4/m4.m4: New, from CVS Autoconf.
15026 * configure.in: Invoke it.
15027 * src/output.c (output_skeleton): Use its result instead of the
15028 hard coded name.
15029
381fb12e
AD
150302002-02-25 Akim Demaille <akim@epita.fr>
15031
15032 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
15033 Fileutils 4.1.5.
15034 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
15035 * src/output.c (output_skeleton): Use mkstemp to create a real
15036 temporary file.
15037 Move the filling of `skeleton' and its muscle to...
15038 (prepare): here.
15039 (output): Move the definition of the prologue muscle to...
15040 (prepare): here.
15041 * src/system.h (DEFAULT_TMPDIR): New.
15042
6f38107f
PE
150432002-02-14 Paul Eggert <eggert@twinsun.com>
15044
15045 Remove the support for C++ namespace cleanliness; it was
15046 causing more problems than it was curing, since it didn't work
15047 properly on some nonstandard C++ compilers. This can wait
15048 for a proper C++ parser.
15049
15050 * NEWS: Document this.
15051 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
15052 of C++, as it's treated like C now.
15053 * src/bison.simple (YYSTD): Remove.
15054 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
15055 Treat C++ just like Standard C instead of trying to support
15056 namespace cleanliness.
15057
80cce3da
AD
150582002-02-14 Akim Demaille <akim@epita.fr>
15059
15060 * tests/regression.at (else): Adjust to Andreas' change.
15061
842e8679
AD
150622002-02-14 Akim Demaille <akim@epita.fr>
15063
15064 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
15065
4bda3f10
AD
150662002-02-13 Andreas Schwab <schwab@suse.de>
15067
15068 * src/output.c (output_rule_data): Don't output NULL, it might
15069 not be defined yet.
15070
4162fa07 150712002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 15072
4162fa07
RA
15073 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
15074 (Copyright notice): Update.
b418ecd8 15075
bd16a5dc
AD
150762002-02-11 Akim Demaille <akim@epita.fr>
15077
15078 * tests/regression.at (%nonassoc and eof): Don't include
15079 nonportable headers.
15080
8d69a1a3
RA
150812002-02-08 Robert Anisko <robert@lrde.epita.fr>
15082
15083 * data/bison.c++: Correct error recovery. Make the user able to
15084 initialize the starting location.
15085
9b2d0677
AD
150862002-02-07 Akim Demaille <akim@epita.fr>
15087
15088 * tests/input.at: New.
15089
69e2658b
RA
150902002-02-07 Robert Anisko <robert@lrde.epita.fr>
15091
15092 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 15093 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
15094 directives around tables only needed for debugging.
15095
4aacc3a7
RA
150962002-02-07 Robert Anisko <robert@lrde.epita.fr>
15097
15098 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
15099 C++ parsers.
15100 (yy::b4_name::parse): Use print_.
15101
762a801e
RA
151022002-02-07 Robert Anisko <robert@lrde.epita.fr>
15103
15104 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
15105
4bb2bc3f
RA
151062002-02-07 Robert Anisko <robert@lrde.epita.fr>
15107
15108 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
15109 C++ parsers.
15110 (yy::b4_name::parse): Build verbose error messages, and use error_.
15111
6b45a3ca
RA
151122002-02-06 Robert Anisko <robert@lrde.epita.fr>
15113
15114 * data/bison.c++: Fix m4 quoting in comments.
15115
50997c6e
RA
151162002-02-06 Robert Anisko <robert@lrde.epita.fr>
15117
15118 * data/bison.c++: Adjust the parser code. Fix some muscles that were
15119 not expanded by m4.
15120
3f3eed27
AD
151212002-02-05 Akim Demaille <akim@epita.fr>
15122
15123 * data/bison.c++: Adjust to the M4 back end.
15124 More is certainly needed.
15125
be2a1a68
AD
151262002-02-05 Akim Demaille <akim@epita.fr>
15127
15128 Give a try to M4 as a back end.
15129
15130 * lib/readpipe.c: New, from wdiff.
15131 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
15132 BISON_HAIRY.
15133 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
15134 specific values. Now it is m4 that performs the lookup.
15135 * src/parse-skel.y: Remove.
15136 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
15137 * src/output.c (actions_output, guards_output)
15138 (token_definitions_output): No longer keeps track of the output
15139 line number, hence remove the second argument.
15140 (guards_output): Check against the guard member of a rule, not the
15141 action member.
15142 Adjust callers.
15143 (output_skeleton): Don't look for the skeleton location, let m4 do
15144 that.
15145 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
15146 file will be used.
15147 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
15148 (prepare): Given that for the time being changesyntax is not
15149 usable in M4, rename the muscles using `-' to `_'.
15150 Define `defines_flag', `output_parser_name' and `output_header_name'.
15151 * src/output.h (actions_output, guards_output)
15152 (token_definitions_output): Adjust prototypes.
15153 * src/scan-skel.l: Instead of scanning the skeletons, it now
15154 processes the output of m4: `__oline__' and `#output'.
15155 * data/bison.simple: Adjust to be used by M4(sugar).
15156 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
15157 to date.
15158 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
15159 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
15160 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
15161 shamelessly stolen from CVS Autoconf.
15162
beda758b
AD
151632002-02-05 Akim Demaille <akim@epita.fr>
15164
15165 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
15166 * configure.in: Check for the declarations of free and malloc.
15167 * src/muscle_tab.c: Adjust.
15168
5ece6d43
AD
151692002-02-05 Akim Demaille <akim@epita.fr>
15170
15171 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
15172 which have no values.
15173
5bb18f9a
AD
151742002-02-05 Akim Demaille <akim@epita.fr>
15175
15176 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
15177 * data/: here.
15178
894dd62e
PE
151792002-01-29 Paul Eggert <eggert@twinsun.com>
15180
15181 * src/bison.simple (YYSIZE_T): Do not define merely because
15182 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
15183 On some platforms, <alloca.h> does not declare YYSTD (size_t).
15184
82841af7
AD
151852002-01-27 Akim Demaille <akim@epita.fr>
15186
15187 Fix `%nonassoc and eof'.
15188
15189 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
15190 which were not properly copied! Replace
15191 memcpy (res->errs, src->errs, src->nerrs);
15192 with
15193 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
15194 !!!
15195 * tests/regression.at (%nonassoc and eof): Adjust to newest
15196 Autotest: `.' is not in the PATH.
15197
318b76e9
AD
151982002-01-27 Akim Demaille <akim@epita.fr>
15199
15200 * tests/sets.at (AT_EXTRACT_SETS): New.
15201 (Nullable): Use it.
15202 (Firsts): New.
15203
30d2f3d5
AD
152042002-01-26 Akim Demaille <akim@epita.fr>
15205
15206 * tests/actions.at, tests/calc.at, tests/headers.at,
15207 * tests/torture.at: Adjust to the newest Autotest which no longer
15208 forces `.' in the PATH.
15209
30f8c395
AD
152102002-01-25 Akim Demaille <akim@epita.fr>
15211
15212 * tests/regression.at (%nonassoc and eof): New.
15213 Suggested by Robert Anisko.
15214
29ae55f1
AD
152152002-01-24 Akim Demaille <akim@epita.fr>
15216
15217 Bison dumps core when trying to complain about broken input files.
15218 Reported by Cris van Pelt.
15219
15220 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
15221 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
15222 into...
15223 (Invalid inputs): Strengthen: exercise parse_percent_token.
15224
2b548aa6
RA
152252002-01-24 Robert Anisko <robert.anisko@epita.fr>
15226
15227 * src/Makefile.am: Add bison.c++.
15228 * src/bison.c++: New skeleton.
15229
bb0146c2
AD
152302002-01-21 Paolo Bonzini <bonzini@gnu.org>
15231
15232 * po/it.po: New.
15233
bec30531
AD
152342002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
15235
15236 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
15237
fc6edc45
MA
152382002-01-20 Marc Autret <marc@gnu.org>
15239
15240 * src/files.c (compute_output_file_names): Fix
15241
5e5d5415
MA
152422002-01-20 Marc Autret <marc@gnu.org>
15243
15244 * tests/output.at: New test.
15245 * src/files.c (compute_base_names): Don't map extensions when
15246 the YACC flag is set, use defaults.
15247 Reported by Evgeny Stambulchik.
15248
44ea3fbd
MA
152492002-01-20 Marc Autret <marc@gnu.org>
15250
ba0fe3c7
PE
15251 * src/system.h: Need to define __attribute__ away for non-GCC
15252 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
15253 Suggested by Albert Chin-A-Young.
15254
338963d1
TVH
152552002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
15256
15257 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
15258 canonical definition.
15259 * src/system.h: Use the canonical definition for PARAMS (avoids
15260 a conflict with the macro from lib/hash.h).
15261
c57b2479
AD
152622002-01-11 Akim Demaille <akim@epita.fr>
15263
15264 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 15265 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 15266
b85810ae
AD
152672002-01-09 Akim Demaille <akim@epita.fr>
15268
15269 * src/files.c, src/files.h (output_infix): New.
15270 (tab_extension): Remove.
15271 (compute_base_names): Compute the former, drop the latter.
15272 * src/output.c (prepare): Insert the muscles `output-infix', and
15273 `output-suffix'.
15274 * src/parse-skel.y (string, string.1): New.
15275 (section.header): Use it.
15276 (section.yacc): Remove.
15277 (prefix): Remove too.
15278 * src/scan-skel.l: Adjust.
15279 * src/bison.simple, src/bison.hairy: Adjust.
15280
cae60122
AD
152812002-01-09 Akim Demaille <akim@epita.fr>
15282
15283 * configure.in (WERROR_CFLAGS): Compute it.
15284 * src/Makefile.am (CFLAGS): Pass it.
15285 * tests/atlocal.in (CFLAGS): Idem.
15286 * src/files.c: Fix a few warnings.
15287 (get_extension_index): Remove, unused.
15288
ae404801
AD
152892002-01-08 Akim Demaille <akim@epita.fr>
15290
15291 * src/getargs.c (AS_FILE_NAME): New.
15292 (getargs): Use it to convert DOSish file names.
15293 * src/files.c (base_name): Rename as full_base_name to avoid
15294 clashes with `base_name ()'.
15295 (filename_split): New.
15296 (compute_base_names): N-th rewrite, using filename_split.
15297
22312b71
AD
152982002-01-08 Akim Demaille <akim@epita.fr>
15299
15300 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
15301 New, stolen from the Fileutils 4.1.
15302 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15303 * configure.in: Check for the presence of memrchr, and of its
15304 prototype.
15305
a67cef01
TVH
153062002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
15307
15308 * lib/hash.h (__P): Added definition for this macro.
15309 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
15310 BUILT_SOURCES, to ensure they are generated first.
15311 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
15312 %error-verbose to allow bootstrapping with bison 1.30x.
15313
2b25d624
AD
153142002-01-06 Akim Demaille <akim@epita.fr>
15315
15316 * src/reader.c (parse_braces): Don't fetch the next char, the
15317 convention is to fetch on entry.
15318 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
15319 'switch' without a following semicolon.
15320 * tests/regression.at (braces parsing): New.
15321
3460813b
AD
153222002-01-06 Akim Demaille <akim@epita.fr>
15323
15324 Bison is dead wrong in its RR conflict reports.
15325
15326 * tests/torture.at (GNU Cim Grammar): New.
15327 * src/conflicts.c (count_rr_conflicts): Fix.
15328
73784c64
AD
153292002-01-06 Akim Demaille <akim@epita.fr>
15330
15331 Creating package.m4 from configure.ac causes too many problems.
15332
15333 * tests/Makefile.am (package.m4): Create it by hand,
15334 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
15335
25d81090
AD
153362002-01-06 Akim Demaille <akim@epita.fr>
15337
15338 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
15339 skeleton.h.
15340
a9b8959e
PE
153412002-01-04 Paul Eggert <eggert@twinsun.com>
15342
15343 * doc/bison.texinfo (Debugging):
15344 Remove YYSTDERR; it's no longer defined or used.
15345 Also, s/cstdio.h/cstdio/.
15346
25d81090
AD
153472002-01-03 Akim Demaille <akim@epita.fr>
15348
15349 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
15350
1109455c
AD
153512002-01-03 Akim Demaille <akim@epita.fr>
15352
15353 * src/parse-skel.y (process_skeleton): Don't bind the parser's
15354 tracing code to --trace, wait for a better --trace option, with
15355 args.
15356
7ea5e977
AD
153572002-01-03 Akim Demaille <akim@epita.fr>
15358
15359 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
15360 The ISO C++ standard is extremely clear about it: stderr is
15361 considered a macro, not a regular symbol (see table 94 `Header
15362 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
15363 Therefore std:: does not apply to it. It still does with fprintf.
15364 Also, s/cstdio.h/cstdio/.
15365
fab5b110
AD
153662002-01-03 Akim Demaille <akim@epita.fr>
15367
15368 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
15369 for non system headers.
15370
aed7fd9b
AD
153712002-01-02 Akim Demaille <akim@epita.fr>
15372
15373 Equip the skeleton chain with location tracking, runtime trace,
15374 pure parser and scanner.
15375
15376 * src/parse-skel.y: Request a pure parser, locations, and prefix
15377 renaming.
15378 (%union): Having several members with the same type does not help
15379 type mismatches, simplify.
15380 (YYPRINT, yyprint): New.
15381 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
15382 (skel_error): this.
15383 Handle locations.
15384 * src/scan-skel.l: Adjust to these changes.
15385 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
15386 (LOCATION_PRINT, skel_control_t): New.
15387
24fad99e
AD
153882001-12-30 Akim Demaille <akim@epita.fr>
15389
15390 * src/parse-skel.y: Get rid of the shift/reduce conflict:
15391 replace `gb' with BLANKS.
15392 * src/scan-skel.l: Adjust.
15393
a4b36db4
AD
153942001-12-30 Akim Demaille <akim@epita.fr>
15395
15396 * src/system.h: We don't need nor want bcopy.
15397 Throw away MS-DOS crap: we don't need getpid.
15398 * configure.in: We don't need strndup. It was even causing
15399 problems: because Flex includes the headers *before* us,
15400 _GNU_SOURCE is not defined by config.h, and therefore strndup was
15401 not visible.
15402 * lib/xstrndup.c: New.
15403 * src/scan-skel.l: Use it.
15404 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
15405 * src/parse-skel.y: Use %directives instead of #defines.
15406
1239777d
AD
154072001-12-30 Akim Demaille <akim@epita.fr>
15408
15409 * src/skeleton.h: New.
15410 * src/output.c (output_parser, output_master_parser): Remove, dead
15411 code.
15412 * src/output.h (get_lines_number, actions_output, guards_output)
15413 (token_definitions_output): Prototype them.
15414 * src/parse-skel.y: Add the license notice.
15415 Include output.h and skeleton.h.
15416 (process_skeleton): Returns void, and takes a single parameter.
15417 * src/scan-skel.l: Add the license notice.
15418 Include skeleton.h.
15419 Don't use %option yylineno: it seems that then Flex imagines
15420 REJECT has been used, and therefore it won't reallocate its
15421 buffers (which makes no other sense to me than a bug). It results
15422 in warnings for `unused: yy_flex_realloc'.
15423
9b3add5b
RA
154242001-12-30 Robert Anisko <robert.anisko@epita.fr>
15425
15426 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15427 (MUSCLE_INSERT_PREFIX): ...to there.
15428 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15429 (MUSCLE_INSERT_PREFIX): Move from here...
15430
15431 * src/bison.hairy: Add a section directive. Put braces around muscle
15432 names. This parser skeleton is still broken, but Bison should not
15433 choke on a bad muscle 'syntax'.
15434 * src/bison.simple: Add a section directive. Put braces around muscle
15435 names.
15436
15437 * src/files.h (strsuffix, stringappend): Add declarations.
15438 (tab_extension): Add declaration.
15439 (short_base_name): Add declaration.
15440
15441 * src/files.c (strsuffix, stringappend): No longer static. These
15442 functions are used in the skeleton parser.
15443 (tab_extension): New.
15444 (compute_base_names): Use the computations done in this function
fab5b110 15445 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
15446 names.
15447 (short_base_name): No longer static.
15448
15449 * src/output.c (output_skeleton): New.
15450 (output): Disable call to output_master_parser, and give a try to
15451 a new skeleton handling system.
15452 (guards_output, actions_output): No longer static.
15453 (token_definitions_output, get_lines_number): No longer static.
15454
15455 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
15456
fab5b110 15457 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
15458 parse-skel.y.
15459
15460 * src/parse-skel.y: New file.
15461 * src/scan-skel.l: New file.
15462
b5b61c61
AD
154632001-12-29 Akim Demaille <akim@epita.fr>
15464
15465 %name-prefix is broken.
15466
15467 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
15468 Adjust all dependencies.
15469 * tests/headers.at (export YYLTYPE): Strengthen this test: use
15470 %name-prefix.
15471
15472 Renaming yylval but not yylloc is not consistent. Now we do.
15473
15474 * src/bison.simple: Prefix yylloc if used.
15475 * doc/bison.texinfo (Decl Summary): Document that.
15476
8c9a50be
AD
154772001-12-29 Akim Demaille <akim@epita.fr>
15478
15479 * doc/bison.texinfo: Promote `%long-directive' over
15480 `%long_directive'.
15481 Remove all references to fixed-output-files, yacc is enough.
15482
d99361e6
AD
154832001-12-29 Akim Demaille <akim@epita.fr>
15484
15485 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
15486 user prologue. These are defaults.
15487 * tests/actions.at (Mid-rule actions): Make sure the user can
15488 define YYDEBUG and YYERROR_VERBOSE.
15489
b9cecb91
AD
154902001-12-29 Akim Demaille <akim@epita.fr>
15491
15492 * src/output.c (header_output): Don't forget to export YYLTYPE and
15493 yylloc.
15494 * tests/headers.at (export YYLTYPE): New, make sure it does.
15495 * tests/regression.at (%union and --defines, Invalid CPP headers):
15496 Move to...
15497 * tests/headers.at: here.
15498
aea13e97
AD
154992001-12-29 Akim Demaille <akim@epita.fr>
15500
15501 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
15502
931394cb
AD
155032001-12-29 Akim Demaille <akim@epita.fr>
15504
15505 * tests/actions.at (Mid-rule actions): Output on a single line
15506 instead of several.
15507
704a47c4
AD
155082001-12-29 Akim Demaille <akim@epita.fr>
15509
15510 * doc/bison.texinfo: Formatting changes.
15511
091e20bb
AD
155122001-12-29 Akim Demaille <akim@epita.fr>
15513
15514 Don't store the token defs in a muscle, just be ready to output it
15515 on command. Now possible via `symbols'. Fixes a memory leak.
15516
15517 * src/output.c (token_definitions_output): New.
15518 (output_parser, header_output): Use it.
15519 * src/reader.c (symbols_save): Remove.
15520
cce71710
AD
155212001-12-29 Akim Demaille <akim@epita.fr>
15522
15523 * src/bison.simple: Do not provide a default for YYSTYPE and
15524 YYLTYPE before the user's prologue. Otherwise it's hardly... a
15525 default.
15526
82c035a8
AD
155272001-12-29 Akim Demaille <akim@epita.fr>
15528
15529 Mid-rule actions are simply... ignored!
15530
15531 * src/reader.c (readgram): Be sure to attach mid-rule actions to
15532 the empty-rule associated to the dummy symbol, not to the host
15533 rule.
15534 * tests/actions.at (Mid-rule actions): New.
15535
8419d367
AD
155362001-12-29 Akim Demaille <akim@epita.fr>
15537
15538 Memory leak.
15539
15540 * src/reader.c (reader): Free grammar.
15541
375d5806
AD
155422001-12-29 Akim Demaille <akim@epita.fr>
15543
15544 Memory leak.
15545
15546 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
15547 since it allocates it for each state, although only one is needed.
15548 (allocate_storage): Do it here.
15549
f51cb8ff
AD
155502001-12-29 Akim Demaille <akim@epita.fr>
15551
15552 * src/options.h, src/options.c (create_long_option_table): Rename
15553 as...
15554 (long_option_table_new): this, with a clearer prototype.
15555 (percent_table): Remove, unused,
15556 * src/getargs.c (getargs): Adjust.
15557
29e88316
AD
155582001-12-29 Akim Demaille <akim@epita.fr>
15559
15560 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
15561 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
15562 as states.
15563
b9f71f19
AD
155642001-12-29 Akim Demaille <akim@epita.fr>
15565
15566 * src/lalr.c (build_relations): Rename `states' as `states1'.
15567 Sorry, I don't understand exactly what it is, no better name...
15568
1a2b5d37
AD
155692001-12-29 Akim Demaille <akim@epita.fr>
15570
15571 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
15572 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
15573 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
15574 as rules.
15575
1cca533e
AD
155762001-12-29 Akim Demaille <akim@epita.fr>
15577
15578 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
15579 ago.
15580
c03ae966
AD
155812001-12-29 Akim Demaille <akim@epita.fr>
15582
15583 * src/reader.c, src/reader.h (user_toknums): Remove.
15584 Adjust all users to use symbols[i]->user_token_number.
15585
5a670b1e
AD
155862001-12-29 Akim Demaille <akim@epita.fr>
15587
15588 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
15589 Adjust all users to use symbols[i]->prec or ->assoc.
15590
ad949da9
AD
155912001-12-29 Akim Demaille <akim@epita.fr>
15592
15593 * src/reader.c, src/reader.h (tags): Remove.
15594 Adjust all users to use symbols[i]->tag.
15595
0e78e603
AD
155962001-12-29 Akim Demaille <akim@epita.fr>
15597
15598 * src/gram.h, src/gram.c (symbols): New, similar to state_table
15599 and rule_table.
15600 * src/reader.c (packsymbols): Fill this table.
15601 Drop sprec.
15602 * src/conflicts.c (resolve_sr_conflict): Adjust.
15603 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
15604 single table.
15605 Use symbols[i]->tag instead of tags[i].
15606
213e640e
AD
156072001-12-29 Akim Demaille <akim@epita.fr>
15608
15609 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
15610 In addition, put a comment in there, to replace...
15611 * tests/regression.at (%union and C comments): Remove.
15612
e7b8bef1
AD
156132001-12-29 Akim Demaille <akim@epita.fr>
15614
15615 * tests/regression.at (Web2c Actions): Blindly move the actual
15616 output as expected output. The contents *seem* right to me, but I
15617 can't pretend reading perfectly parser tables... Nonetheless, all
15618 the other tests pass correctly, the table look OK, even though the
15619 presence of `$axiom' is to be noted: AFAICS it is useless (but
15620 harmless).
15621
b68e7744
AD
156222001-12-29 Akim Demaille <akim@epita.fr>
15623
15624 * src/reader.c (readgram): Don't add the rule 0 if there were no
15625 rules read. In other words, add it _after_ having performed
15626 grammar sanity checks.
15627 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
15628
78d5bae9
AD
156292001-12-29 Akim Demaille <akim@epita.fr>
15630
15631 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
15632 visible, and some states have now a different number.
15633
ff442794
AD
156342001-12-29 Akim Demaille <akim@epita.fr>
15635
15636 * src/reader.c (readgram): Bind the initial rule's lineno to that
15637 of the first rule.
15638 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
15639 (Solved SR Conflicts): Adjust rule 0's line number.
15640
610ab194
AD
156412001-12-29 Akim Demaille <akim@epita.fr>
15642
15643 Fix the `GAWK Grammar' failure.
15644
15645 * src/LR0.c (final_state): Initialize to -1 so that we do compute
15646 the reductions of the first state which was mistakenly confused
15647 with the final state because precisely final_state was initialized
15648 to 0.
15649 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
15650 now noticed by Bison.
15651 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
15652 have a reduction on $default.
15653
29d29c8f
AD
156542001-12-29 Akim Demaille <akim@epita.fr>
15655
15656 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
15657 rule line numbers.
15658 * src/closure.c (print_closure): Likewise.
15659 * src/derives.c (print_derives): Likewise.
15660 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
15661 now.
15662
7c6b64d0
AD
156632001-12-29 Akim Demaille <akim@epita.fr>
15664
15665 * src/lalr.c (lookaheads_print): New.
15666 (lalr): Call it when --trace-flag.
15667 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
15668 are dumped.
15669
3d4daee3
AD
156702001-12-29 Akim Demaille <akim@epita.fr>
15671
15672 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
15673 when walking through ritem, even via rule->rhs.
15674 * src/reduce.c (dump_grammar, useful_production, reduce_output)
15675 (useful_production, useless_nonterminals): Likewise.
15676 (reduce_grammar_tables): Likewise, plus update nritems.
15677 * src/nullable.c (set_nullable): Likewise.
15678 * src/lalr.c (build_relations): Likewise.
15679 * tests/sets.at (Nullable): Adjust.
15680 Fortunately, now, the $axiom is no longer nullable.
15681
9e7f6bbd
AD
156822001-12-29 Akim Demaille <akim@epita.fr>
15683
15684 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
15685 the 0-sentinel.
15686 * src/gram.c (ritem_longest_rhs): Likewise.
15687 * src/reduce.c (nonterminals_reduce): Likewise.
15688 * src/print_graph.c (print_graph): Likewise.
15689 * src/output.c (output_rule_data): Likewise.
15690 * src/nullable.c (set_nullable): Likewise.
15691
255ef638
AD
156922001-12-29 Akim Demaille <akim@epita.fr>
15693
15694 * src/output.c: Comment changes.
15695
0d8a7363
AD
156962001-12-27 Paul Eggert <eggert@twinsun.com>
15697
15698 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
15699 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
15700 Sparc, as they were causing more porting problems than the
15701 (minor) performance improvement was worth.
15702
15703 Also, catch up with 1.31's YYSTD.
15704
3db472b9
AD
157052001-12-27 Akim Demaille <akim@epita.fr>
15706
15707 * src/output.c (output_gram): Rely on nritems, not the
15708 0-sentinel. See below.
15709 Use -1 as separator, not 0.
15710 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
15711 Rely on -1 as separator in yyrhs, instead of 0.
15712 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
15713 twice `Now at end of input', therefore there are two lines less to
15714 expect.
15715
b365aa05
AD
157162001-12-27 Akim Demaille <akim@epita.fr>
15717
15718 * tests/regression.at (Unresolved SR Conflicts):
15719 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
15720 below.
15721
30171f79
AD
157222001-12-27 Akim Demaille <akim@epita.fr>
15723
15724 * src/LR0.c (new_state): Recognize the final state by the fact it
15725 is reached by eoftoken.
15726 (insert_start_shifting_state, insert_eof_shifting_state)
15727 (insert_accepting_state, augment_automaton): Remove, since now
15728 these states are automatically computed from the initial state.
15729 (generate_states): Adjust.
15730 * src/print.c: When reporting a rule number to the user, substract
15731 1, so that the axiom rule is rule 0, and the first user rule is 1.
15732 * src/reduce.c: Likewise.
15733 * src/print_graph.c (print_core): For the time being, just as for
15734 the report, depend upon --trace-flags to dump the full set of
15735 items.
15736 * src/reader.c (readgram): Once the grammar read, insert the rule
15737 0: `$axiom: START-SYMBOL $'.
15738 * tests/set.at: Adjust: rule 0 is now displayed, and since the
15739 number of the states has changed (the final state is no longer
15740 necessarily the last), catch up.
15741
75142d45
AD
157422001-12-27 Akim Demaille <akim@epita.fr>
15743
15744 Try to make the use of the eoftoken valid. Given that its value
15745 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
15746 is used instead of > 0 where appropriate, (ii), depend upon nritems
15747 instead of the 0-sentinel.
15748
15749 * src/gram.h, src/gram.c (nritems): New.
15750 Expected to be duplication of nitems, but for the time being...
15751 * src/reader.c (packgram): Assert nritems and nitems are equal.
15752 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
15753 * src/closure.c (print_closure, print_fderives): Likewise.
15754 * src/gram.c (ritem_print): Likewise.
15755 * src/print.c (print_core, print_grammar): Likewise.
15756 * src/print_graph.c: Likewise.
15757
b7c49edf
AD
157582001-12-27 Akim Demaille <akim@epita.fr>
15759
15760 * src/main.c (main): If there are complains after grammar
15761 reductions, then output the report anyway if requested, then die.
15762 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
15763 * src/reader.c (eoftoken): New.
15764 (parse_token_decl): If the token being defined has value `0', it
15765 is the eoftoken.
15766 (packsymbols): No longer hack `tags' to insert `$' by hand.
15767 Be sure to preserve the value of the eoftoken.
15768 (reader): Make sure eoftoken is defined.
15769 Initialize nsyms to 0: now eoftoken is created just like the others.
15770 * src/print.c (print_grammar): Don't special case the eof token.
15771 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
15772 lie anyway, albeit pleasant.
15773 * tests/calc.at: Exercise error messages with eoftoken.
15774 Change the grammar so that empty input is invalid.
15775 Adjust expectations.
15776 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
15777
ec2da99f
AD
157782001-12-27 Akim Demaille <akim@epita.fr>
15779
15780 * configure.in: Check the protos of strchr ans strspn.
15781 Replace strchr if needed.
15782 * src/system.h: Provide the protos of strchr, strspn and memchr if
15783 missing.
15784 * lib/strchr.c: New.
15785 * src/reader.c (symbols_save): Use strchr.
15786
8adfa272
AD
157872001-12-27 Akim Demaille <akim@epita.fr>
15788
15789 * src/print.c, src/print_graph.c (escape): New.
15790 Use it to quote the TAGS outputs.
15791 * src/print_graph.c (print_state): Now errors are in red, and
15792 reductions in green.
15793 Prefer high to wide: output the state number on a line of its own.
15794
80dac38c
AD
157952001-12-27 Akim Demaille <akim@epita.fr>
15796
15797 * src/state.h, src/state.c (reductions_new): New.
15798 * src/LR0.c (set_state_table): Let all the states have a
15799 `reductions', even if reduced to 0.
15800 (save_reductions): Adjust.
15801 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15802 * src/print.c (print_reductions, print_actions): Adjust.
15803 * src/output.c (action_row): Adjust.
15804
2cec70b9
AD
158052001-12-27 Akim Demaille <akim@epita.fr>
15806
15807 * src/state.h, src/state.c (errs_new, errs_dup): New.
15808 * src/LR0.c (set_state_table): Let all the states have an errs,
15809 even if reduced to 0.
15810 * src/print.c (print_errs, print_reductions): Adjust.
15811 * src/output.c (output_actions, action_row): Adjust.
15812 * src/conflicts.c (resolve_sr_conflict): Adjust.
15813
13ca549a
AD
158142001-12-27 Akim Demaille <akim@epita.fr>
15815
15816 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15817
5092aba5
AD
158182001-12-27 Akim Demaille <akim@epita.fr>
15819
15820 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15821 * src/print.c: here.
15822 (lookaheadset, shiftset): New, used as additional storage by
15823 print_reductions.
15824 (print_results): Adjust.
15825 (print_shifts, print_gotos, print_errs): New, extracted from...
15826 (print_actions): here.
15827 * src/print_graph.c (print_actions): Remove dead code.
15828
11e2beca
AD
158292001-12-27 Akim Demaille <akim@epita.fr>
15830
15831 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15832 `$n' and `@n'.
15833
dac3c910
AD
158342001-12-27 Akim Demaille <akim@epita.fr>
15835
15836 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15837 (build_relations): Adjust.
15838
d0b0fefa
AD
158392001-12-27 Akim Demaille <akim@epita.fr>
15840
15841 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15842 duplication.
15843
adc8c848
AD
158442001-12-27 Akim Demaille <akim@epita.fr>
15845
15846 * src/reader.c (packgram): Catch nitems overflows.
15847
14d293ac
AD
158482001-12-27 Akim Demaille <akim@epita.fr>
15849
15850 * src/files.c, src/files.h (guard_obstack): Remove.
15851 * src/output.c (output): Adjust.
15852 * src/reader.c (parse_braces): New, factoring...
15853 (copy_action, copy_guard): these two which are renamed as...
15854 (parse_action, parse_guard): these.
15855 As a voluntary consequence, using braces around guards is now
15856 mandatory.
15857
f499b062
AD
158582001-12-27 Akim Demaille <akim@epita.fr>
15859
15860 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15861 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15862 members.
15863 (symbol_list_new): Adjust.
15864 (copy_action): action_line is the first line, not the last.
15865 (copy_guard): Just as for actions, store the `action' only, not
15866 the switch/case/break flesh.
15867 Don't parse the user action that might follow the guard, let...
15868 (readgram): do it, i.e., now, there can be an action after a
15869 guard.
15870 In other words the guard is just explicitly optional.
15871 (packgram): Adjust.
15872 * src/output.c (guards_output): New.
15873 (output_parser): Call it when needed.
15874 (output): Also free the guard and attrs obstacks.
15875 * src/files.c, src/files.h (obstack_save): Remove.
15876 (output_files): Remove.
15877 As a result, if one needs the former `.act' file, using an
15878 appropriate skeleton which requires actions and guards is now
15879 required.
15880 * src/main.c (main): Adjust.
15881 * tests/semantic.at: New.
15882 * tests/regression.at: Use `input.y' as input file name.
15883 Avoid 8+3 problems by requiring input.c when the test needs the
15884 parser.
15885
d945f5cd
AD
158862001-12-27 Akim Demaille <akim@epita.fr>
15887
15888 * src/reader.c (symbol_list_new): Be sure to initialize all the
15889 fields.
15890
d200e455
AD
158912001-12-27 Akim Demaille <akim@epita.fr>
15892
15893 All the hacks using a final pseudo state are now useless.
15894
15895 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15896 * src/lalr.c (nLA): New.
15897 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15898 instead of lookaheadsp from the pseudo state (nstate + 1).
15899
f9507c28
AD
159002001-12-27 Akim Demaille <akim@epita.fr>
15901
15902 * src/output.c (action_row, token_actions): Use a state_t instead
15903 of a integer, and nlookaheads instead of the following state's
15904 lookaheadsp.
15905
065fbd27
AD
159062001-12-27 Akim Demaille <akim@epita.fr>
15907
15908 * src/conflicts.c (log_resolution, flush_shift)
15909 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15910 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15911 (conflicts_print, print_reductions): Use a state_t instead of an
15912 integer when referring to a state.
15913 As much as possible, depend upon nlookaheads, instead of the
15914 `lookaheadsp' member of the following state (since lookaheads of
15915 successive states are successive, the difference between state n + 1
15916 and n served as the number of lookaheads for state n).
15917 * src/lalr.c (add_lookback_edge): Likewise.
15918 * src/print.c (print_core, print_actions, print_state)
15919 (print_results): Likewise.
15920 * src/print_graph.c (print_core, print_actions, print_state)
15921 (print_graph): Likewise.
15922 * src/conflicts.h: Adjust.
15923
1b177bd7
AD
159242001-12-27 Akim Demaille <akim@epita.fr>
15925
15926 * src/bison.hairy: Formatting/comment changes.
15927 ANSIfy.
15928 Remove `register' indications.
15929 Add plenty of `static'.
15930
7742ddeb
AD
159312001-12-27 Akim Demaille <akim@epita.fr>
15932
15933 * src/output.c (prepare): Drop the muscle `ntbase' which
15934 duplicates ntokens.
15935 * src/bison.simple: Formatting/comment changes.
15936 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15937 is an undocumented synonym.
15938
1fa14068
AD
159392001-12-22 Akim Demaille <akim@epita.fr>
15940
15941 * src/output.c (output_table_data): Change the prototype to use
15942 `int' for array ranges: some invocations do pass an int, not a
15943 short.
15944 Reported by Wayne Green.
15945
b9752825
AD
159462001-12-22 Akim Demaille <akim@epita.fr>
15947
15948 Some actions of web2c.y are improperly triggered.
15949 Reported by Mike Castle.
15950
15951 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15952 * tests/regression.at (Web2c): Rename as...
15953 (Web2c Report): this.
15954 (Web2c Actions): New.
15955
776209d6
AD
159562001-12-22 Akim Demaille <akim@epita.fr>
15957
15958 Reductions in web2c.y are improperly reported.
15959 Reported by Mike Castle.
15960
15961 * src/conflicts.c (print_reductions): Fix.
15962 * tests/regression.at (Web2c): New.
15963
275fc3ad
AD
159642001-12-18 Akim Demaille <akim@epita.fr>
15965
15966 Some host fail on `assert (!"foo")', which expands to
15967 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
15968 Reported by Nelson Beebee.
15969
15970 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
15971 `#define it_succeeded 0' and `assert (it_succeeded)'.
15972
897668ee
MA
159732001-12-17 Marc Autret <autret_m@epita.fr>
15974
15975 * src/bison.simple: Don't hard code the skeleton line and filename.
15976 * src/output.c (output_parser): Rename 'line' as 'output_line'.
15977 New line counter 'skeleton_line' (skeleton-line muscle).
15978
ab3399e0
PE
159792001-12-17 Paul Eggert <eggert@twinsun.com>
15980
15981 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
15982 YYDEBUG must be defined to a nonzero value.
15983
15984 * src/bison.simple (yytname): Do not assume that the user defines
15985 YYDEBUG to a properly parenthesized expression.
15986
3877f72b
AD
159872001-12-17 Akim Demaille <akim@epita.fr>
15988
15989 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
15990 nlookaheads is a new member.
15991 Adjust all users.
15992 * src/lalr.h (nlookaheads): Remove this orphan declaration.
15993 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
15994 state.
776209d6 15995
331dbc1b
AD
159962001-12-17 Akim Demaille <akim@epita.fr>
15997
15998 * src/files.h, src/files.c (open_files, close_files): Remove.
15999 * src/main.c (main): Don't open/close files, nor invoke lex_free,
16000 let...
16001 * src/reader.c (reader): Do it.
776209d6 16002
be750e4c
AD
160032001-12-17 Akim Demaille <akim@epita.fr>
16004
16005 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 16006
709ae8c6
AD
160072001-12-17 Akim Demaille <akim@epita.fr>
16008
16009 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
16010 (flush_reduce): New.
16011 (resolve_sr_conflict): Adjust.
776209d6 16012
f87685c3
AD
160132001-12-17 Akim Demaille <akim@epita.fr>
16014
16015 * src/output.c (output_obstack): Be static and rename as...
16016 (format_obstack): this, to avoid any confusion with files.c's
16017 output_obstack.
16018 * src/reader.h (muscle_obstack): Move to...
16019 * src/output.h: here, since it's defined in output.c.
16020
837491d8
AD
160212001-12-17 Akim Demaille <akim@epita.fr>
16022
16023 * src/output.c (action_row, save_column, default_goto)
16024 (sort_actions, matching_state, pack_vector): Better variable
16025 locality.
16026
796d61fb
AD
160272001-12-17 Akim Demaille <akim@epita.fr>
16028
16029 * src/output.c: Various formatting changes.
776209d6 16030
64d15509
AD
160312001-12-17 Akim Demaille <akim@epita.fr>
16032
16033 * src/files.c (output_files): Free the output_obstack.
16034 * src/main.c (main): Call print and print_graph conditionally.
16035 * src/print.c (print): Work unconditionally.
16036 * src/print_graph.c (print_graph): Work unconditionally.
16037 * src/conflicts.c (log_resolution): Output only if verbose_flag.
16038
fbc8ecb7
MA
160392001-12-16 Marc Autret <autret_m@epita.fr>
16040
16041 * src/output.c (actions_output): Fix. When we use %no-lines,
16042 there is one less line per action.
16043
f0440388
MA
160442001-12-16 Marc Autret <autret_m@epita.fr>
16045
16046 * src/bison.simple: Remove a useless #line directive.
16047 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
16048 * src/output.c (get_lines_number): New.
776209d6 16049 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
16050 output muscles.
16051 Fix line numbering.
16052 (actions_output): Computes the number of lines taken by actions.
16053 (output_master_parser): Insert new skeleton which is the name of
16054 the output parser file name.
16055
a79986b8
MA
160562001-12-15 Marc Autret <autret_m@epita.fr>
16057
16058 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
16059
4ec8e00f
MA
160602001-12-15 Marc Autret <autret_m@epita.fr>
16061
16062 * src/output.c (output_gram): Keep track of the hairy one.
16063
1a4648ff
AD
160642001-12-15 Akim Demaille <akim@epita.fr>
16065
16066 Make `make distcheck' work.
16067
16068 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
16069 system.h which uses libgettext.h.
16070
9c2c67e6
AD
160712001-12-15 Akim Demaille <akim@epita.fr>
16072
16073 * src/nullable.c (set_nullable): Useless rules must be skipped,
16074 otherwise, since we range over their symbols, we might look at a
16075 nonterminal which no longer ``exists'', i.e., it is not counted in
16076 `nvars', hence we overflow our arrays.
16077
93ede233
AD
160782001-12-15 Akim Demaille <akim@epita.fr>
16079
16080 The header can also be produced directly, without any obstack!
16081 Yahoo!
16082
16083 * src/files.c, src/files.h (defines_obstack): Remove.
16084 (compute_header_macro): Global.
16085 (defines_obstack_save): Remove.
16086 * src/reader.c (parse_union_decl): No longer output to
16087 defines_obstack: its content can be found in the `stype' muscle
16088 anyway.
16089 (output_token_translations): Merge into...
16090 (symbols_output): this.
16091 Rename as...
16092 (symbols_save): this.
16093 (reader): Adjust.
16094 * src/output.c (header_output): New.
16095 (output): Call it.
16096
2666f928
AD
160972001-12-15 Akim Demaille <akim@epita.fr>
16098
16099 * src/reader.c (parse_union_decl): Instead of handling two obstack
16100 simultaneously, use one to define the `stype' muscle, and use the
16101 value of the latter to fill defines_obstack.
16102 (copy_comment): Remove.
16103 (copy_comment2): Work for a single obstack.
16104 Rename as...
16105 (copy_comment): this.
16106
428046f8
AD
161072001-12-15 Akim Demaille <akim@epita.fr>
16108
16109 * src/lex.c, src/lex.h (xgetc): No longer static.
16110 * src/reader.c (parse_union_decl): Revamp.
16111
ea52d706
AD
161122001-12-15 Akim Demaille <akim@epita.fr>
16113
16114 Still making progress in separating Bison into (i) input, (ii)
16115 process, (iii) output: now we can directly output the parser file
16116 without using table_obstack at all.
16117
16118 * src/files.c, src/files.h (table_obstack): Bye bye.
16119 (parser_file_name): New.
16120 * src/files.c (compute_output_file_names): Compute it.
16121 * src/output.c (actions_output, output_parser)
16122 (output_master_parser): To a file instead of an obstack.
16123
3f96f4dc
AD
161242001-12-15 Akim Demaille <akim@epita.fr>
16125
16126 Attach actions to rules, instead of pre-outputting them to
16127 actions_obstack.
16128
16129 * src/gram.h (rule_t): action and action_line are new members.
16130 * src/reader.c (symbol_list): Likewise.
16131 (copy_action): Save the actions within the rule.
16132 (packgram): Save them in rule_table.
16133 * src/output.c (actions_output): New.
16134 (output_parser): Use it on `%%actions'.
16135 (output_rule_data): Don't free rule_table.
16136 (output): Do it.
16137 (prepare): Don't save the `action' muscle.
16138 * src/bison.simple: s/%%action/%%actions/.
16139
51576fb3
AD
161402001-12-15 Akim Demaille <akim@epita.fr>
16141
16142 * src/reader.c (copy_action): When --yacc, don't append a `;'
16143 to the user action: let it fail if lacking.
dee049eb 16144 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 16145
2648a72d
AD
161462001-12-14 Akim Demaille <akim@epita.fr>
16147
16148 * src/lex.c (literalchar): Simply return the char you decoded, non
16149 longer mess around with obstacks and int pointers.
16150 Adjust all callers.
16151
92790e5b
AD
161522001-12-14 Akim Demaille <akim@epita.fr>
16153
16154 * src/lex.c (literalchar): Don't escape the special characters,
16155 just decode them, and keep them as char (before, eol was output as
16156 the 2 char string `\n' etc.).
16157 * src/output.c (output_rule_data): Use quotearg to output the
16158 token strings.
16159
927c1557
PE
161602001-12-13 Paul Eggert <eggert@twinsun.com>
16161
16162 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
16163 Do not infringe on the global user namespace when using C++.
16164 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
16165 All uses of `fprintf' and `stderr' changed.
16166
16167 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
16168
ed8e1f68
AD
161692001-12-13 Akim Demaille <akim@epita.fr>
16170
16171 The computation of nullable is broken: it doesn't handle empty
16172 RHS's properly.
16173
16174 * tests/torture.at (GNU AWK Grammar): New.
16175 * tests/sets.at (Nullable): New.
16176 * src/nullable.c (set_nullable): Instead of blindly looping over
16177 `ritems', loop over the rules, and then over their rhs's.
16178
16179 Work around Autotest bugs.
16180
16181 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
16182 frame, because Autotest understand lines starting with a `+' as
16183 traces from the shell. Then, they are not processed properly.
16184 Admittedly an Autotest bug, but we don't have time to wait for
16185 Autotest to catch up.
16186 * tests/regression.at (Broken Closure): Adjust to the new table
16187 frames.
16188 Move to...
16189 * tests/sets.at: here.
16190
cb581495
AD
161912001-12-13 Akim Demaille <akim@epita.fr>
16192
16193 * src/closure.c (closure): Use nrules instead of playing tricks
16194 with BITS_PER_WORD.
16195
2e729273
AD
161962001-12-13 Akim Demaille <akim@epita.fr>
16197
16198 * src/print.c (print_actions): Output the handling of `$' as the
16199 traces do: shifting the token EOF. Before EOF was treated as a
16200 nonterminal.
16201 * tests/regression.at: Adjust some tests.
16202 * src/print_graph.c (print_core): Complete the set of items via
16203 closure. The next-to-final and final states are still unsatisfying,
16204 but that's to be addressed elsewhere.
16205 No longer output the rule numbers, but do output the state number.
16206 A single loop for the shifts + gotos is enough, but picked a
16207 distinct color for each.
16208 (print_graph): Initialize and finalize closure.
16209
107f7dfb
AD
162102001-12-13 Akim Demaille <akim@epita.fr>
16211
16212 * src/reader.c (readgram): Remove dead code, an strip useless
16213 braces.
16214 (get_type): Remove, unused.
16215
9b53a24f
AD
162162001-12-12 Akim Demaille <akim@epita.fr>
16217
16218 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
16219 on that of lib/error.c.
16220
dbfb6dcd
AD
162212001-12-12 Akim Demaille <akim@epita.fr>
16222
16223 Some hosts don't like `/' in includes.
16224
16225 * src/system.h: Include libgettext.h without qualifying the path.
16226 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
16227 $(top_srcdir).
16228
c25fb648
MA
162292001-12-11 Marc Autret <autret_m@epita.fr>
16230
16231 * src/output.c (output_parser): Remove useless muscle.
16232
710ddc4f
MA
162332001-12-11 Marc Autret <autret_m@epita.fr>
16234
16235 * src/bison.simple: Remove #line just before %%epilogue. It
16236 is now handled in ...
16237 * src/reader.c (read_additionnal_code): Add the output of a
16238 #line for the epilogue.
16239
e83d80b8
MA
162402001-12-10 Marc Autret <autret_m@epita.fr>
16241
927c1557 16242 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
16243 replace precedent remove.
16244 * src/bison.simple: Remove #line before %%prologue because
16245 %%input-line is wrong at this time.
16246
971d5158
MA
162472001-12-10 Marc Autret <autret_m@epita.fr>
16248
16249 * src/reader.c (symbols_output): Clean up.
927c1557 16250 * src/output.c (output_gram, output): Clean up.
971d5158 16251
5edafffd
AD
162522001-12-10 Akim Demaille <akim@epita.fr>
16253
16254 * src/lalr.c (initialize_lookaheads): New. Extracted from...
16255 * src/LR0.c (set_state_table): here.
16256 * src/lalr.c (lalr): Call it.
16257
0279f8e9
AD
162582001-12-10 Akim Demaille <akim@epita.fr>
16259
16260 * src/state.h (shifts): Remove the `number' member: shifts are
16261 attached to state, hence no longer need to be labelled with a
16262 state number.
16263
190c4f5f
AD
162642001-12-10 Akim Demaille <akim@epita.fr>
16265
16266 Now that states have a complete set of members, the linked list of
16267 shifts is useless: just fill directly the state's shifts member.
16268
16269 * src/state.h (shifts): Remove the `next' member.
16270 * src/LR0.c (first_state, last_state): Remove.
16271 Adjust the callers.
16272 (augment_automaton): Don't look for the shifts that must be added
16273 a shift on EOF: it is those of the state we looked for! But now,
16274 since shifts are attached, it is no longer needed to looking
16275 merely by its id: its number.
16276
2a73b93d
AD
162772001-12-10 Akim Demaille <akim@epita.fr>
16278
16279 * src/LR0.c (augment_automaton): Better variable locality.
16280 Remove an impossible branch: if there is a state corresponding to
16281 the start symbol being shifted, then there is shift for the start
16282 symbol from the initial state.
16283
74392f6a
AD
162842001-12-10 Akim Demaille <akim@epita.fr>
16285
16286 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
16287 only when appropriate: when insert_start_shifting_state' is not
16288 invoked.
16289 * tests/regression.at (Rule Line Numbers): Adjust.
16290
37c82725
AD
162912001-12-10 Akim Demaille <akim@epita.fr>
16292
16293 * src/LR0.c (augment_automaton): Now that all states have shifts,
16294 merge the two cases addition shifts to the initial state.
16295
6a164e0c
AD
162962001-12-10 Akim Demaille <akim@epita.fr>
16297
16298 * src/lalr.c (set_state_table): Move to...
16299 * src/LR0.c: here.
16300 * src/lalr.c (lalr): Don't call it...
16301 * src/LR0.c (generate_states): do it.
16302 * src/LR0.h (first_state): Remove, only the table is used.
16303
7215de24
AD
163042001-12-10 Akim Demaille <akim@epita.fr>
16305
16306 * src/LR0.h (first_shift, first_reduction): Remove.
16307 * src/lalr.c: Don't use first_shift: find shifts through the
16308 states.
16309
80e25d4d
AD
163102001-12-10 Akim Demaille <akim@epita.fr>
16311
16312 * src/LR0.c: Attach shifts to states as soon as they are
16313 computed.
16314 * src/lalr.c (set_state_table): Instead of assigning shifts to
16315 state, just assert that the mapping was properly done.
16316
0ab3728b
AD
163172001-12-10 Akim Demaille <akim@epita.fr>
16318
16319 * src/LR0.c (insert_start_shift): Rename as...
16320 (insert_start_shifting_state): this.
16321 (insert_eof_shifting_state, insert_accepting_state): New.
16322 (augment_automaton): Adjust.
16323 Better locality of the variables.
16324 When looking if the start_symbol is shifted from the initial
16325 state, using `while (... symbol != start_symbol ...)' sounds
16326 better than `while (... symbol < start_symbol ...)': If fail
16327 to see how the order between symbols could be relevant!
16328
78af9bbc
AD
163292001-12-10 Akim Demaille <akim@epita.fr>
16330
16331 * src/getargs.h: Don't declare `spec_name_prefix' and
16332 `spec_file_prefix', declared by src/files.h.
16333 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
16334 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
16335 * src/output.c (prepare): Adjust.
16336 * src/reader.c (symbols_output): Likewise.
16337 * src/vmsgetargs.c: Vaguely adjust, but who cares?
16338
bdef2a41
AD
163392001-12-10 Akim Demaille <akim@epita.fr>
16340
16341 * src/muscle_tab.c (muscle_init): NULL is a better default than
16342 `"0"'.
16343
3735969c
AD
163442001-12-10 Akim Demaille <akim@epita.fr>
16345
16346 * src/reader.c (reader): Calling symbols_output once is enough.
16347
49701457
AD
163482001-12-10 Akim Demaille <akim@epita.fr>
16349
16350 Now that states have a complete set of members, the linked list of
16351 reductions is useless: just fill directly the state's reductions
16352 member.
16353
16354 * src/state.h (struct reductions): Remove member `number' and
16355 `next'.
16356 * src/LR0.c (first_reduction, last_reduction): Remove.
16357 (save_reductions): Don't link the new reductions, store them in
16358 this_state.
16359 * src/lalr.c (set_state_table): No need to attach reductions to
16360 states, it's already done.
16361 * src/output.c (output_actions): No longer free the shifts, then
16362 the reductions, then the states: free all the states and their
16363 members.
16364
0edad749
AD
163652001-12-10 Akim Demaille <akim@epita.fr>
16366
16367 * src/options.c (OPTN, DRTV, BOTH): New.
16368 (option_table): Use them.
16369
0edad749
AD
16370 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
16371 the job of system.h.
16372 * src/options.c: Don't include stdio.h and xalloc.h for the same
16373 reasons.
16374
5449dd0f
AD
163752001-12-10 Akim Demaille <akim@epita.fr>
16376
16377 * src/output.c (output, prepare): Make sure the values of the
16378 muscles `action' and `prologue' are 0-terminated.
16379
a870c567
AD
163802001-12-10 Akim Demaille <akim@epita.fr>
16381
16382 Clean up GCC warnings.
16383
16384 * src/reader.c (copy_action): `buf' is not used.
16385 (parse_skel_decl): Be static.
16386 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
16387 * src/options.h (create_long_option_table): Have a real prototype.
16388 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
16389 (hash_delete_at): Return const void *.
16390 Adjust casts to preserve the const.
16391
80df8768
AD
163922001-12-10 Akim Demaille <akim@epita.fr>
16393
16394 * configure.in: Require 2.52g.
16395 M4 is not needed, but AUTOM4TE is.
16396 * m4/m4.m4: Remove.
16397 * tests/Makefile.am: Adjust.
16398
f693ad14
AD
163992001-12-10 Akim Demaille <akim@epita.fr>
16400
16401 One structure for states is enough, even though theoretically
16402 there are LR(0) states and LALR(1) states.
16403
16404 * src/lalr.h (state_t): Remove.
16405 (state_table): Be state_t **, not state_t *.
16406 * src/state.h (core, CORE_ALLOC): Rename as...
16407 (state_t, STATE_ALLOC): this.
16408 Add the LALR(1) members: shifts, reductions, errs.
16409 * src/LR0.c (state_table): Rename as...
16410 (state_hash): this, to avoid name clashes with the global
16411 `state_table'.
16412 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
16413 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
16414
74ffbcb6
AD
164152001-12-10 Akim Demaille <akim@epita.fr>
16416
16417 Bison dumps core on bash.y.
16418 Reported by Pascal Bart.
16419
16420 * src/warshall.c (bitmatrix_print): New.
16421 (TC): Use it.
ba0fe3c7 16422 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
16423 j must be the outer loop.
16424 * tests/regression.at (Broken Closure): New.
16425
07708e19
AD
164262001-12-05 Akim Demaille <akim@epita.fr>
16427
16428 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
16429 its argument.
ba1ecc07 16430 Reported by Peter Hamorsky.
07708e19 16431
92b16366
AD
164322001-12-05 Akim Demaille <akim@epita.fr>
16433
16434 * src/conflicts.c (err_table): Remove.
16435 (resolve_sr_conflict): Adjust.
16436 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
16437 Rename as...
16438 (state_t.reductions, state_t.shifts): this.
16439
076ab033
AD
164402001-12-05 Akim Demaille <akim@epita.fr>
16441
16442 * src/reduce.c (reduce_grammar_tables): No longer disable the
16443 removal of useless rules via CPP but via `if (0)', so that the
16444 compiler still check the code is valid.
16445 For instance, it should have noticed `rline' no longer exists: use
16446 the `line' member of rule_t.
16447 * src/gram.c (dummy, rline): Remove, unused.
16448
3843c413
AD
164492001-12-05 Akim Demaille <akim@epita.fr>
16450
16451 * src/output.c (pack_vector): Use assert, not berror.
16452 * src/main.c (berror): Remove, unused.
16453
43168960
AD
164542001-12-05 Akim Demaille <akim@epita.fr>
16455
16456 New experimental feature: if --verbose --trace output all the
16457 items of a state, not only its kernel.
16458
16459 * src/print.c (print_core): If `trace_flag', then invoke closure
16460 before outputting the items of the state (print_core is no longer
16461 a correct name them).
16462 (print_results): Invoke new_closure/free_closure if needed.
16463
b2872512
AD
164642001-12-05 Akim Demaille <akim@epita.fr>
16465
16466 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
16467 * src/closure.c, src/closure.h (itemsetsize): Rename as...
16468 (nitemset): for consistency with the rest of the project.
16469
23cbcc6c
AD
164702001-12-05 Akim Demaille <akim@epita.fr>
16471
16472 * src/closure.c (print_closure): Improve.
16473 (closure): Use it for printing input and output.
16474
03ec521c
AD
164752001-12-05 Akim Demaille <akim@epita.fr>
16476
16477 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
16478 indexed by nonterminals.
16479
3a7456dd
AD
164802001-12-05 Akim Demaille <akim@epita.fr>
16481
16482 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
16483 what it was!).
16484 * src/warshall.h: Remove accidental duplication of the content.
16485
1cbcf2e7
AD
164862001-12-05 Akim Demaille <akim@epita.fr>
16487
16488 * src/closure.c (set_fderives): De-obfuscate.
16489
84182270
AD
164902001-12-05 Akim Demaille <akim@epita.fr>
16491
16492 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
16493
3f6f053c
AD
164942001-12-05 Akim Demaille <akim@epita.fr>
16495
16496 * src/closure.c (set_firsts): De-obfuscate.
16497
7a5350ba
AD
164982001-12-05 Akim Demaille <akim@epita.fr>
16499
16500 * src/output.c (action_row): De-obfuscate
16501 using the good o' techniques: arrays not pointers, variable
16502 locality, BITISSET, RESETBIT etc.
16503
d954473d
AD
165042001-12-05 Akim Demaille <akim@epita.fr>
16505
16506 Pessimize the code to simplify it: from now on, all the states
16507 have a valid SHIFTS, which NSHIFTS is possibly 0.
16508
16509 * src/LR0.c (shifts_new): Be global and move to..
16510 * src/state.c, src/state.h: here.
16511 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
16512 * src/print_graph: Adjust.
16513
9839bbe5
AD
165142001-12-05 Akim Demaille <akim@epita.fr>
16515
16516 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
16517 * src/conflicts.c: Use it.
16518 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
16519 incorrectly ``simplified''.
16520
9f136c07
AD
165212001-12-05 Akim Demaille <akim@epita.fr>
16522
16523 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
16524 using the good o' techniques: arrays not pointers, variable
16525 locality, BITISSET, RESETBIT etc.
16526
b608206e
AD
165272001-12-05 Akim Demaille <akim@epita.fr>
16528
16529 * src/state.h (SHIFT_SYMBOL): New.
16530 * src/conflicts.c: Use it to deobfuscate.
16531
52afa962
AD
165322001-12-05 Akim Demaille <akim@epita.fr>
16533
16534 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
16535 (print_reductions): De-obfuscate using the good o' techniques:
16536 arrays not pointers, variable locality, BITISSET.
16537
e74dc321
AD
165382001-12-05 Akim Demaille <akim@epita.fr>
16539
16540 * src/conflicts.c (print_reductions): Arrays, not pointers.
16541 Use BITISSET.
16542
768fca83
AD
165432001-12-05 Akim Demaille <akim@epita.fr>
16544
16545 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16546
a17e599f
AD
165472001-12-05 Akim Demaille <akim@epita.fr>
16548
16549 * src/conflicts.c (print_reductions): Improve variable locality.
16550
a04bc341
AD
165512001-12-05 Akim Demaille <akim@epita.fr>
16552
16553 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16554
c8ea038e
AD
165552001-12-05 Akim Demaille <akim@epita.fr>
16556
16557 * src/conflicts.c (print_reductions): Improve variable locality.
16558
aa2aab3c
AD
165592001-12-05 Akim Demaille <akim@epita.fr>
16560
16561 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
16562 * src/lalr.c: Use them.
16563
b178c8cc
AD
165642001-12-05 Akim Demaille <akim@epita.fr>
16565
16566 * src/LR0.c (augment_automaton): Formatting changes.
16567 Better variable locality.
16568
f67d13aa
AD
165692001-12-05 Akim Demaille <akim@epita.fr>
16570
16571 * src/lalr.c (matrix_print): New.
16572 (transpose): Use it.
16573 Use arrays instead of pointers.
16574
c2713865
AD
165752001-12-05 Akim Demaille <akim@epita.fr>
16576
16577 * src/lalr.c (maxrhs): Move to...
16578 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
16579 * src/lalr.c (build_relations): Adjust.
16580
9887c18a
AD
165812001-12-05 Akim Demaille <akim@epita.fr>
16582
16583 * src/lalr.c (transpose): Free the memory allocated to the
16584 argument, as it is replaced by the results by the unique caller.
16585 (build_relations): Merely invoke transpose: it handles the memory
16586 deallocation.
16587 Improve variable locality.
16588 Avoid variables used as mere abbreviations.
16589 (compute_lookaheads): Use arrays instead of pointers.
16590
4d4f699c
AD
165912001-12-05 Akim Demaille <akim@epita.fr>
16592
16593 * src/lalr.c (initialize_F): Improve variable locality.
16594 Avoid variables used as mere abbreviations.
16595
80a69750
AD
165962001-12-05 Akim Demaille <akim@epita.fr>
16597
16598 * src/derives.c (print_derives): Display the ruleno.
16599 * src/lalr.c (initialize_F, transpose): Better variable locality
16600 to improve readability.
16601 Avoid variables used as mere abbreviations.
16602
fe961097
AD
166032001-12-05 Akim Demaille <akim@epita.fr>
16604
16605 * src/lalr.c (traverse): Use arrays instead of pointers.
16606
e3e4e814
AD
166072001-12-05 Akim Demaille <akim@epita.fr>
16608
16609 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
16610 the handling of squeue.
16611 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16612
630e182b
AD
166132001-12-05 Akim Demaille <akim@epita.fr>
16614
16615 Because useless nonterminals are now kept alive (instead of being
16616 `destroyed'), we now sometimes examine them, and store information
16617 related to them. Hence we need to know their number, and adjust
16618 memory allocations.
16619
16620 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
16621 static.
16622 * src/LR0.c (allocate_itemsets): The memory allocated to
16623 `symbol_count' was used for two different purpose: once to count
16624 the number of occurrences of each symbol, and later reassigned to
16625 `shift_symbol', containing the symbol that can be shifted from a
16626 given state.
16627 Deobfuscate, i.e., allocate, use and free `symbol_count' here
16628 only, and...
16629 (new_itemsets): Allocate `shift_symbol' here.
16630 (allocate_itemsets): symbol_count includes useless nonterminals.
16631 Make room for them.
16632 (free_storage): Use `free', not `XFREE', for pointers that cannot
16633 be null.
16634
81b51460
AD
166352001-12-05 Akim Demaille <akim@epita.fr>
16636
16637 * src/nullable.c (set_nullable): Deobfuscate the handling of
16638 ritem.
16639 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16640
3067fbef
AD
166412001-12-05 Akim Demaille <akim@epita.fr>
16642
16643 * src/gram.c, src/gram.h (ritem_print): New.
16644 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
16645 (This useless function was defined only to work around VMS linkers
16646 that can't handle compilation units with variables only).
16647 * src/reduce.c (dump_grammar): Use it to trace the construction of
16648 ritem.
16649
c2bea5f9
PE
166502001-12-04 Paul Eggert <eggert@twinsun.com>
16651
7d27c823
PE
16652 * src/bison.simple (union yyalloc): Change member names
16653 to be the same as the stack names.
16654 (yyparse): yyptr is now union yyalloc *, not char *.
16655 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
16656 and may generate better code on some machines.
c2bea5f9
PE
16657 (yystpcpy): Use prototype if __STDC__ is defined, not just
16658 if __cplusplus is defined.
35687a9d 16659
2c8a9dfa
AD
166602001-11-30 Akim Demaille <akim@epita.fr>
16661
16662 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
16663 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
16664 Gettext doesn't compile cleanly, and dies with -Werror.
16665 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
16666 Include WARNING_CFLAGS here.
16667 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
16668 before being defined.
16669
f4e421e6
AD
166702001-11-27 Paul Eggert <eggert@twinsun.com>
16671
16672 * lib/quotearg.h (quotearg_n, quotearg_n_style):
16673 First arg is int, not unsigned.
16674 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
16675 (SIZE_MAX, UINT_MAX): New macros.
16676 (quotearg_n_options): Abort if N is negative.
16677 Avoid overflow check on hosts where size_t is 64 bits and int
16678 is 32 bits, as overflow is impossible there.
16679 Fix off-by-one typo that caused unnecessary reallocation.
16680
7093d0f5
AD
166812001-11-29 Paul Eggert <eggert@twinsun.com>
16682
16683 Name space cleanup in generated parser.
16684
16685 * doc/bison.texinfo (Bison Parser): Discuss system headers
16686 and their effect on the user name space.
16687
16688 * src/bison.simple:
16689 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
16690 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
16691 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
16692
16693 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
16694 on user names when possible.
16695
16696 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
16697 Simplify test for whather <alloca.h> exists.
16698
16699 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
16700
16701 (<stdio.h>): Include if YYDEBUG.
16702
16703 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
16704 ! defined (yyoverflow) && ! defined (yymemcpy).
16705
16706 (yymemcpy, yyparse): Rename local variables as needed so that
16707 they all begin with 'yy'.
16708
16709 (yystrlen, yystpcpy): New functions.
16710
16711 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
16712 All uses changed.
16713
16714 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
16715 instead of relying on string.h functions. Use YYSTACK_ALLOC
16716 and YYSTACK_FREE instead of malloc and free.
16717
fd51e5ff
AD
167182001-11-30 Akim Demaille <akim@epita.fr>
16719
16720 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
16721 before their first uses.
16722 (YYBISON, YYPURE): Move to the top of the output.
16723
7d13ff5f
AD
167242001-11-30 Akim Demaille <akim@epita.fr>
16725
16726 * tests/reduce.at (Useless Nonterminals): Fix.
16727
892a3995
AD
167282001-11-30 Akim Demaille <akim@epita.fr>
16729
16730 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
16731 if body instead of `;' to pacify GCC's warnings.
16732
68f1e3ed
AD
167332001-11-30 Akim Demaille <akim@epita.fr>
16734
16735 Instead of mapping the LHS of unused rules to -1, keep the LHS
16736 valid, but flag the rules as invalid.
16737
16738 * src/gram.h (rule_t): `useful' is a new member.
16739 * src/print.c (print_grammar): Adjust.
16740 * src/derives.c (set_derives): Likewise.
16741 * src/reader.c (packgram, reduce_output): Likewise.
16742 * src/reduce.c (reduce_grammar_tables): Likewise.
16743 * tests/reduce.at (Underivable Rules, Useless Rules): New.
16744
d2d1b42b
AD
167452001-11-30 Akim Demaille <akim@epita.fr>
16746
16747 * src/reduce.c (reduce_output): Formatting changes.
16748 * src/print.c (print_results, print_grammar): Likewise.
16749 * tests/regression.at (Rule Line Numbers)
16750 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
16751
760b53a8
AD
167522001-11-30 Akim Demaille <akim@epita.fr>
16753
16754 * src/reduce.c (nonterminals_reduce): Instead of throwing away
16755 useless nonterminals, move them at the end of the symbol arrays.
16756 (reduce_output): Adjust.
16757 * tests/reduce.at (Useless Nonterminals): Adjust.
16758
00238958
AD
167592001-11-30 Akim Demaille <akim@epita.fr>
16760
16761 * src/reduce.c: Various comment/formatting changes.
16762 (nonterminals_reduce): New, extracted from...
16763 (reduce_grammar_tables): here.
16764 (reduce_grammar): Call nonterminals_reduce.
16765
396452de
PE
167662001-11-29 Paul Eggert <eggert@twinsun.com>
16767
16768 * src/bison.simple (YYSTACK_REALLOC): Remove.
16769 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
16770 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
16771 New macros.
16772 (union yyalloc): New type.
16773 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
16774 an arbitrary restriction on hosts where size_t is wider than int.
16775
16776 (yyparse): Don't dump core if alloca or malloc fails; instead, report
16777 a parser stack overflow. Allocate just one block of memory for all
16778 three stacks, instead of allocating three blocks; this typically is
16779 faster and reduces fragmentation.
16780
16781 Do not limit the number of items in the stack to a value that fits
16782 in 'int', as this is an arbitrary limit on hosts with 64-bit
16783 size_t and 32-bit int.
16784
147e184c
MA
167852001-11-29 Marc Autret <autret_m@epita.fr>
16786
16787 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
16788 of defining YYERROR_VERBOSE.
16789 [AT_DATA]: $4 is now out of C declarations in the prologue.
16790
426cf563
MA
167912001-11-28 Marc Autret <autret_m@epita.fr>
16792
16793 * src/reader.c (parse_dquoted_param): New.
16794 (parse_skel_decl): Use it.
16795 * src/lex.h: Add its prototype.
16796 * src/lex.c (literalchar): Become not static.
16797
c7925b99
MA
167982001-11-28 Marc Autret <autret_m@epita.fr>
16799
16800 * src/output.h: And put its extern declaration here.
16801 * src/output.c (error_verbose): Define here.
16802 (prepare): Echo name modification.
16803 * src/getargs.h: Clean its extern declaration.
16804 * src/getargs.c (error_verbose_flag): Remove.
16805 (getargs): Remove case 'e'.
16806 * src/options.c (option_table): 'error-verbose' is now seen as simple
16807 percent option.
16808 Include output.h.
16809
16810 * src/reader.c (read_declarations): Remove case tok_include.
16811 (parse_include_decl): Remove.
16812 * src/lex.h (token_t): Remove tok_include.
16813 * src/options.c (option_table): 'include' is now a simple command line
16814 option.
16815
5b5d1929
MA
168162001-11-28 Marc Autret <autret_m@epita.fr>
16817
16818 * src/bison.simple: Adjust muscle names.
16819 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16820 * src/output.c (prepare): s/_/-/ for the muscles names.
16821 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16822
8850be4b
MA
168232001-11-28 Marc Autret <autret_m@epita.fr>
16824
16825 * src/bison.simple: Fix debug.
16826 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16827
4a38e613
AD
168282001-11-28 Akim Demaille <akim@epita.fr>
16829
16830 * src/LR0.c (shifts_new): New.
16831 (save_shifts, insert_start_shift, augment_automaton): Use it.
16832
4b35e1c1
AD
168332001-11-28 Akim Demaille <akim@epita.fr>
16834
16835 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16836 keep ruleno only.
16837
d2b04478
AD
168382001-11-28 Akim Demaille <akim@epita.fr>
16839
16840 * src/closure.c (closure): Instead of looping over word in array
16841 then bits in words, loop over bits in array.
16842
2c4c30aa
AD
168432001-11-28 Akim Demaille <akim@epita.fr>
16844
16845 * src/closure.c (closure): No longer optimize the special case
16846 where all the bits of `ruleset[r]' are set to 0, to make the code
16847 clearer.
16848
576890b7
AD
168492001-11-28 Akim Demaille <akim@epita.fr>
16850
16851 * src/closure.c (closure): `r' and `c' are new variables, used to
16852 de-obfuscate accesses to RULESET and CORE.
16853
cb487d7d
AD
168542001-11-28 Akim Demaille <akim@epita.fr>
16855
16856 * src/reduce.c (reduce_print): Use ngettext.
16857 (dump_grammar): Improve the trace accuracy.
16858
6013d43f
AD
168592001-11-28 Akim Demaille <akim@epita.fr>
16860
16861 * src/reduce.c (dump_grammar): Don't translate trace messages.
16862
cb4956ee
AD
168632001-11-28 Akim Demaille <akim@epita.fr>
16864
16865 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16866 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16867 as all tags are free'ed afterwards.
16868 From Enrico Scholz.
16869
648185ab
PE
168702001-11-27 Paul Eggert <eggert@twinsun.com>
16871
16872 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16873 use alloca when we didn't want to, and vice versa.
16874
68254a03
MA
168752001-11-27 Marc Autret <autret_m@epita.fr>
16876
9113b58f
AD
16877 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16878 initialization.
68254a03
MA
16879 * src/output.c (prepare): Remove its update.
16880
04d843a2
MA
168812001-11-27 Marc Autret <autret_m@epita.fr>
16882
16883 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16884 Use %error-verbose.
16885
d2079671 168862001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
16887
16888 * src/bison.simple: Remove YYERROR_VERBOSE using.
16889 Use %%error_verbose.
16890 (yyparse): Likewise.
16891 * src/output.c (prepare): Give its final value.
16892 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16893 * src/getargs.h: Add its extern declaration.
16894 * src/getargs.c (error_verbose_flag): New int.
16895 (getargs): Update to catch new case.
16896 * src/options.c (option_table): 'error-verbose' is a new option.
16897 (shortopts): Update.
16898
e0327bc8
AD
168992001-11-27 Akim Demaille <akim@epita.fr>
16900
16901 * src/system.h: Use intl/libgettext.h.
16902 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16903
000f1a3c
AD
169042001-11-27 Akim Demaille <akim@epita.fr>
16905
16906 * tests/torture.at (Exploding the Stack Size with Malloc):
16907 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16908
26cfe0be
AD
169092001-11-27 Akim Demaille <akim@epita.fr>
16910
16911 * src/files.c: Include error.h.
16912 Reported by Hans Aberg.
16913
f6bd5427
MA
169142001-11-26 Marc Autret <autret_m@epita.fr>
16915
d2079671 16916 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
16917 (read_declarations): Add case tok_include.
16918 * src/getargs.h (include): Add its extern definition.
16919 * src/getargs.c (include): New const char *.
16920 (getargs): Add case '-I'.
16921 * src/options.c (option_table): Add include as command line and
16922 percent option.
16923 * src/lex.h (token_t): Add tok_include.
16924
2ca209c1
AD
169252001-11-26 Akim Demaille <akim@epita.fr>
16926
16927 * src/reader.c (readgram): Make sure rules for mid-rule actions
16928 have a lineno equal to that of their host rule.
16929 Reported by Hans Aberg.
16930 * tests/regression.at (Rule Line Numbers): New.
16931
0e41b407
AD
169322001-11-26 Akim Demaille <akim@epita.fr>
16933
16934 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16935 size_ts.
16936
169372001-11-26 Akim Demaille <akim@epita.fr>
16938
16939 * src/complain.c, src/complain.h (error): Remove, provided by
16940 lib/error.[ch].
16941
e0c40012
AD
169422001-11-26 Akim Demaille <akim@epita.fr>
16943
16944 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16945 issue an error message.
16946 * tests/regression.at (Invalid %directive): New.
16947 Reported by Hans Aberg.
16948
5e147124
AD
169492001-11-26 Akim Demaille <akim@epita.fr>
16950
16951 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16952 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16953
a034c8b8
AD
169542001-11-26 Akim Demaille <akim@epita.fr>
16955
16956 * src/conflicts.c (conflicts_print): Don't complain at all when
16957 there are no reduce/reduce conflicts, and as many shift/reduce
16958 conflicts as expected.
16959 * tests/regression.at (%expect right): Adjust.
16960
c64a20f3
AD
169612001-11-23 Akim Demaille <akim@epita.fr>
16962
16963 * lib/alloca.c: Update, from fileutils.
16964
5b0d29bb
AD
169652001-11-23 Akim Demaille <akim@epita.fr>
16966
16967 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
16968
722c4bfe
AD
169692001-11-23 Akim Demaille <akim@epita.fr>
16970
16971 * src/system.h: Include alloca.h.
16972 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
16973
6255b435
AD
169742001-11-23 Akim Demaille <akim@epita.fr>
16975
16976 * src/print_graph.c (print_actions): Remove `rule', unused.
16977 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
16978 pacify GCC's signed < unsigned warnings.
16979 * src/closure.c (itemsetsize): Likewise.
16980 * src/reader.c (symbol_list_new): Static.
16981
b29b2ed5
AD
169822001-11-23 Akim Demaille <akim@epita.fr>
16983
16984 Attaching lineno to buckets is stupid, since only one copy of each
16985 symbol is kept, only the line of the first occurrence is kept too.
16986
16987 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
16988 * src/reader.c (rline_allocated): Remove, unused.
16989 (symbol_list): Have a `line' member.
16990 (symbol_list_new): New.
16991 (readgram): Use it.
16992 * src/print.c (print_grammar): Output the rule line numbers.
16993 * tests/regression.at (Solved SR Conflicts)
16994 (Unresolved SR Conflicts): Adjust.
16995 Reported by Hans Aberg.
16996
a81b1d4a
MA
169972001-11-22 Marc Autret <autret_m@epita.fr>
16998
16999 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
17000
c1ecb3c1
MA
170012001-11-22 Marc Autret <autret_m@epita.fr>
17002
17003 * src/muscle_tab.c (muscle_init): Remove initialization of
17004 skeleton muscle.
17005 * src/output.c (output_master_parser): Do it here.
17006
fbe01355
AD
170072001-11-20 Akim Demaille <akim@epita.fr>
17008
17009 * po/sv.po: New.
17010 * configure.in (ALL_LINGUAS): Adjust.
17011 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
17012 longer contains strings to translate.
17013
81e895c0
AD
170142001-11-19 Akim Demaille <akim@epita.fr>
17015
17016 * src/conflicts.c (conflicts_print): Add a missing \n.
17017
6bb1878b
AD
170182001-11-19 Akim Demaille <akim@epita.fr>
17019
17020 * src/nullable.c (nullable_print): New.
17021 (set_nullable): Call it when tracing.
17022 Better locality of variables.
17023
d9ec2d07
AD
170242001-11-19 Akim Demaille <akim@epita.fr>
17025
17026 * src/print.c (print_actions): Better locality of variables.
17027
720e5c1b
AD
170282001-11-19 Akim Demaille <akim@epita.fr>
17029
17030 * src/derives.c (print_derives): Fix and enrich.
17031 * src/closure.c (print_fderives): Likewise.
17032
fb908786
AD
170332001-11-19 Akim Demaille <akim@epita.fr>
17034
17035 * src/closure.c (itemsetend): Remove, replaced with...
17036 (itemsetsize): new.
17037
125ecb56
AD
170382001-11-19 Akim Demaille <akim@epita.fr>
17039
17040 * src/LR0.c (kernel_end): Remove, replaced with...
17041 (kernel_size): new.
17042
d8cf039f
AD
170432001-11-19 Akim Demaille <akim@epita.fr>
17044
17045 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
17046 to clarify.
17047
7bec0760
AD
170482001-11-19 Akim Demaille <akim@epita.fr>
17049
17050 * src/closure.c (closure): Use arrays instead of pointers to clarify.
17051
c87d4863
AD
170522001-11-19 Akim Demaille <akim@epita.fr>
17053
17054 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
17055 trace messages.
17056 * src/LR0.c: Likewise.
17057 (allocate_itemsets): Use arrays instead of pointers to clarify.
17058
9bfe901c
AD
170592001-11-19 Akim Demaille <akim@epita.fr>
17060
17061 * src/getargs.c (statistics_flag): Replace with...
17062 (trace_flag): New.
17063 (longopts): Accept --trace instead of --statistics.
17064 * src/getargs.h, src/options.c: Adjust.
17065 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
17066 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
17067
97db7bd4
AD
170682001-11-19 Akim Demaille <akim@epita.fr>
17069
cc72668c 17070 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
17071 pointers to clarify the code.
17072 (save_reductions, save_shifts): Factor common parts of alternatives.
17073
2c5f66ed
AD
170742001-11-19 Akim Demaille <akim@epita.fr>
17075
17076 * src/LR0.c (new_state, get_state): Complete TRACE code.
17077 * src/closure.c: Include `reader.h' to get `tags', needed by the
17078 trace code.
17079 Rename the conditional DEBUG as TRACE.
17080 Output consistently TRACEs to stderr, not stdout.
17081 * src/derives.c: Likewise.
17082 * src/reduce.c: (inaccessable_symbols): Using if is better style
17083 than goto.
17084 Use `#if TRACE' instead of `#if 0' for tracing code.
17085
300f275f
AD
170862001-11-19 Akim Demaille <akim@epita.fr>
17087
17088 * src/system.h (LIST_FREE, shortcpy): New.
17089 * src/LR0.c: Use them.
17090 * src/output.c (free_itemsets, free_reductions, free_shifts):
17091 Remove, replaced by LIST_FREE.
17092
f59c437a
AD
170932001-11-19 Akim Demaille <akim@epita.fr>
17094
17095 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
17096 (REDUCTIONS_ALLOC): New.
17097 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
17098 allocation.
17099
6986fd9e
AD
171002001-11-19 Akim Demaille <akim@epita.fr>
17101
17102 * src/LR0.c (new_state): Complete trace code.
17103 * src/nullable.c (set_nullable): Don't translate traces.
17104
4bc30f78
AD
171052001-11-19 Akim Demaille <akim@epita.fr>
17106
17107 * src/print_graph.c (print_core): Better locality of variables.
17108 * src/print.c (print_core): Likewise.
17109
08a946e0
AD
171102001-11-19 Akim Demaille <akim@epita.fr>
17111
17112 * src/vcg.c: You do the output, so you are responsible of the
17113 handling of VCG syntax, in particular: use quotearg.
17114 * src/print_graph.c: Don't.
17115 (print_actions): Don't output the actions as part of the nodes,
17116 since that's the job of the edges.
17117 (print_state): Don't output by hand: fill the node description,
9bfe901c 17118 and ask for its output.
08a946e0 17119
f0473484
AD
171202001-11-19 Akim Demaille <akim@epita.fr>
17121
cc72668c
AD
17122 * src/bison.simple (yyparse): When verbosely reporting an error,
17123 no longer put additional quotes around token names.
f0473484
AD
17124 * tests/calc.at: Adjust.
17125
e41dc700
AD
171262001-11-19 Akim Demaille <akim@epita.fr>
17127
17128 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
17129 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
17130 * src/output.c: Adjust.
17131
652a871c
AD
171322001-11-19 Akim Demaille <akim@epita.fr>
17133
17134 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
17135 (rule_t): this.
17136 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
17137
b2ed6e58
AD
171382001-11-19 Akim Demaille <akim@epita.fr>
17139
17140 * src/gram.h (rule_t): New.
17141 (rule_table): New.
17142 (rrhs, rlhs): Remove, part of state_t.
17143 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
17144 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17145 * src/reader.c, src/reduce.c: Adjust.
17146
edad7067
AD
171472001-11-19 Akim Demaille <akim@epita.fr>
17148
17149 * src/reader.c (symbols_output): New, extracted from...
17150 (packsymbols): Here.
17151 (reader): Call it.
17152
3feec034
AD
171532001-11-19 Akim Demaille <akim@epita.fr>
17154
17155 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
17156 (maxrhs): this new function.
17157
ddcd5fdf
AD
171582001-11-19 Akim Demaille <akim@epita.fr>
17159
cc72668c 17160 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
17161 Adjust.
17162
bb527fc2
AD
171632001-11-19 Akim Demaille <akim@epita.fr>
17164
cc72668c 17165 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
17166 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17167 * src/lalr.c: Adjust.
17168
a845a697
AD
171692001-11-19 Akim Demaille <akim@epita.fr>
17170
17171 * src/lalr.c (initialize_LA): Only initialize LA. Let...
17172 (set_state_table): handle the `lookaheads' members.
17173
f004bf6a
AD
171742001-11-19 Akim Demaille <akim@epita.fr>
17175
cc72668c
AD
17176 * src/lalr.h (lookaheads): Removed array, whose contents is now
17177 a member of...
f004bf6a
AD
17178 (state_t): this structure.
17179 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17180 Adjust.
17181
de326cc0
AD
171822001-11-19 Akim Demaille <akim@epita.fr>
17183
cc72668c
AD
17184 * src/lalr.h (consistent): Removed array, whose contents is now
17185 a member of...
de326cc0
AD
17186 (state_t): this structure.
17187 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17188 Adjust.
17189
90b4416b
AD
171902001-11-19 Akim Demaille <akim@epita.fr>
17191
cc72668c
AD
17192 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
17193 contents are now members of...
90b4416b
AD
17194 (state_t): this structure.
17195 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17196 Adjust.
17197
9703cc49
AD
171982001-11-19 Akim Demaille <akim@epita.fr>
17199
17200 * src/lalr.h (state_t): New.
17201 (state_table): Be a state_t * instead of a core **.
17202 (accessing_symbol): Remove, part of state_t.
17203 * src/lalr.c: Adjust.
17204 (set_accessing_symbol): Merge into...
17205 (set_state_table): this.
17206 * src/print_graph.c, src/conflicts.c: Adjust.
17207
d803322e
AD
172082001-11-14 Akim Demaille <akim@epita.fr>
17209
17210 * tests/calc.at, tests/output.at, tests/regression.at,
17211 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
17212 now the tests are run in private dirs, therefore AC_CLEANUP and
17213 family can be simplified to 0-ary.
17214 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
17215 use abs. path to find config.h.
17216 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
17217 stderr, there can be way too much random noise.
17218 Instead pass -Werror to GCC and rely on the exit status.
17219 Reported by Wolfram Wagner.
17220
3d76b07d
AD
172212001-11-14 Akim Demaille <akim@epita.fr>
17222
17223 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
17224 defined only if yyoverflow is defined, to avoid `warning: unused
17225 variable `yyvs1''.
17226 Reported by The Test Suite.
17227
09b503c8
AD
172282001-11-14 Akim Demaille <akim@epita.fr>
17229
17230 * src/print.c: Include reduce.h.
17231 Reported by Hans Aberg.
17232
172332001-11-14 Akim Demaille <akim@epita.fr>
17234
17235 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
17236 Revert a previous patch: these are really const.
17237 * src/conflicts.c (conflict_report): Additional useless pair of
17238 braces to pacify GCC's warnings for `if () if () {} else {}'.
17239 * src/lex.c (parse_percent_token): Replace equal_offset with
17240 arg_offset.
17241 arg is const.
17242 Be sure to strdup `arg' when used, since there is no reason for
17243 token_buffer not to change.
17244
0f37a994
AD
172452001-11-14 Akim Demaille <akim@epita.fr>
17246
17247 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
17248 definition.
17249 * src/main.c (main): Use them.
17250 Suggested by Hans Aberg.
17251
d39d93b8
AD
172522001-11-12 Akim Demaille <akim@epita.fr>
17253
17254 * src/system.h (ngettext): Now that we use ngettext, be sure to
17255 provide a default definition when NLS are not used.
17256
9edcd895
AD
172572001-11-12 Akim Demaille <akim@epita.fr>
17258
17259 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
17260 Use @kbd to denote user input.
17261 (Language and Grammar): ANSIfy the example.
17262 Adjust its layout for info/notinfo.
17263 (Location Tracking Calc): Output error messages to stderr.
17264 Output locations in a more GNUtically correct way.
17265 Fix a couple of Englishos.
17266 Adjust @group/@end group pairs.
17267
7da99ede
AD
172682001-11-12 Akim Demaille <akim@epita.fr>
17269
e3aa65c5 17270 %expect was not functioning at all.
7da99ede
AD
17271
17272 * src/conflicts.c (expected_conflicts): Set to -1.
17273 (conflict_report): Use ngettext.
17274 (conflicts_print): Check %expect and make its violation an error.
17275 * doc/bison.texinfo (Expect Decl): Adjust.
17276 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
17277 * tests/regression.at (%expect not enough, %expect right)
17278 (%expect too much): New.
17279
ba9dda1a
AD
172802001-11-12 Akim Demaille <akim@epita.fr>
17281
17282 * tests/regression.at (Conflicts): Rename as...
17283 (Unresolved SR Conflicts): this.
17284 (Solved SR Conflicts): New.
17285
337c5bd1
AD
172862001-11-12 Akim Demaille <akim@epita.fr>
17287
17288 * src/reduce.c (print_results): Rename as...
17289 (reduce_output): This.
17290 Output to OUT, passed as argument, instead of output_obstack.
17291 (dump_grammar): Likewise.
17292 (reduce_free): New.
17293 Also free V1.
17294 (reduce_grammar): No longer call reduce_output, since...
17295 * src/print.c (print_results): do it.
17296 * src/main.c (main): Call reduce_free;
17297
c73a41af
AD
172982001-11-12 Akim Demaille <akim@epita.fr>
17299
17300 * src/conflicts.c (print_reductions): Accept OUT as argument.
17301 Output to it, not to output_obstack.
17302 * src/print.c (print_actions): Adjust.
17303
0df87bb6
AD
173042001-11-12 Akim Demaille <akim@epita.fr>
17305
17306 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
17307 the result instead of using...
17308 (src_total, rrc_total, src_count, rrc_count): Remove.
17309 (any_conflicts): Remove.
17310 (print_conflicts): Split into...
17311 (conflicts_print, conflicts_output): New.
17312 * src/conflicts.h: Adjust.
17313 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 17314 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
17315 * tests/regression.at (Conflicts): New.
17316 Reported by Tom Lane.
17317
e4d3d4de
AD
173182001-11-12 Akim Demaille <akim@epita.fr>
17319
17320 * tests/regression.at (Invalid input): Remove, duplicate with
17321 ``Invalid input: 1''.
17322
6d7d248e
AD
173232001-11-12 Akim Demaille <akim@epita.fr>
17324
17325 * tests/torture.at (AT_DATA_STACK_TORTURE)
17326 (Exploding the Stack Size with Alloca)
17327 (Exploding the Stack Size with Malloc): New.
17328
e9e4c321
AD
173292001-11-12 Akim Demaille <akim@epita.fr>
17330
17331 * src/bison.simple (YYSTACK_REALLOC): New.
17332 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 17333 Reported by Per Allansson.
e9e4c321 17334
5f7e0832
AD
173352001-11-12 Pascal Bart <pascal.bart@epita.fr>
17336
17337 * src/bison.simple: Define type yystype instead of YYSTYPE, and
17338 define CPP macro, which substitute YYSTYPE by yystype.
17339 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
17340 with yyltype/YYLTYPE. This allows inclusion of the generated
17341 header within the parser if the compiler, such as GGC, accepts
17342 multiple equivalent #defines.
17343 From Akim.
17344
e3f1699f
AD
173452001-11-05 Akim Demaille <akim@epita.fr>
17346
17347 * src/reader.c (symbols_output): New, extracted from...
17348 (packsymbols): here.
17349 (reader): Adjust.
17350
65be0866
AD
173512001-11-05 Akim Demaille <akim@epita.fr>
17352
17353 * src/lex.c (parse_percent_token): s/quotearg/quote/.
17354
e4d910bf
AD
173552001-11-05 Akim Demaille <akim@epita.fr>
17356
17357 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
17358 pattern.
17359
951366c1
AD
173602001-11-05 Akim Demaille <akim@epita.fr>
17361
17362 * src/options.h (struct option_table_struct): set_flags is void*.
17363 * src/options.c (longopts): Support `--output' and `%output'.
17364 (usage): Adjust.
17365 * src/lex.h (tok_setopt): Remove, replaced with...
17366 (tok_intopt, tok_stropt): these new guys.
17367 * src/lex.c (getopt.h): Not needed.
17368 (token_buffer, unlexed_token_buffer): Not const.
17369 (percent_table): Promote `-' over `_' in directive names.
17370 Active `%name-prefix', `file-prefix', and `output'.
17371 (parse_percent_token): Accept possible arguments to directives.
17372 Promote `-' over `_' in directive names.
17373
d8988b2f
AD
173742001-11-04 Akim Demaille <akim@epita.fr>
17375
17376 * doc/bison.texinfo (Decl Summary): Split the list into
17377 `directives for grammars' and `directives for bison'.
17378 Sort'em.
17379 Add description of `%name-prefix', `file-prefix', and `output'.
17380 Promote `-' over `_' in directive names.
17381 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
17382 Simplify the description of `--name-prefix'.
17383 Promote `-' over `_' in directive names.
17384 Promote `--output' over `--output-file'.
17385 Fix the description of `--defines'.
17386 * tests/output.at: Exercise %file-prefix and %output.
17387
6468d18e
AD
173882001-11-02 Akim Demaille <akim@epita.fr>
17389
17390 * doc/refcard.tex: Update.
17391
6b7e85b9
AD
173922001-11-02 Akim Demaille <akim@epita.fr>
17393
17394 * src/symtab.h (SUNDEF): New.
17395 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
17396 stand for `uninitialized', instead of 0.
17397 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
17398 * src/lex.c (lex): Adjust.
17399
17400 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
17401 Number it 0.
17402 Let yylex return it instead of a plain 0.
17403 Reported by Dick Streefland.
17404
cd5aafcf
AD
174052001-11-02 Akim Demaille <akim@epita.fr>
17406
17407 * tests/regression.at (Mixing %token styles): New test.
17408
037ca2f1
AD
174092001-11-02 Akim Demaille <akim@epita.fr>
17410
17411 * src/reader.c (parse_thong_decl): Formatting changes.
17412 (token_translations_init): New, extracted from...
17413 (packsymbols): Here.
17414 Adjust.
17415
270a173c
AD
174162001-11-01 Akim Demaille <akim@epita.fr>
17417
17418 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
17419 Check that `9foo.y' produces correct cpp guards.
17420 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
17421 guards.
17422 Reported by Wwp.
17423
561f9a30
AD
174242001-11-01 Akim Demaille <akim@epita.fr>
17425
17426 * tests/regression.at (Invalid input: 2): New.
17427 * src/lex.c (unlexed_token_buffer): New.
17428 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
17429 too.
17430 Reported by Wwp.
17431
f987e9d2
AD
174322001-11-01 Akim Demaille <akim@epita.fr>
17433
17434 * tests/calc.at: Catch up with 1.30.
17435 * configure.in: Bump to 1.49a.
17436 Adjust to newer Autotest.
17437
0846f581
PB
174382001-10-19 Pascal Bart <pascal.bart@epita.fr>
17439
17440 * src/conflicts.c: Move global variables rrc_total and src_total ...
17441 (print_conflicts): here.
17442 * src/output.c (output): Free global variable user_toknums.
17443 * src/lex.c (token_obstack): Become static.
17444
3c1a79b3
AD
174452001-10-18 Akim Demaille <akim@epita.fr>
17446
17447 * tests/atlocal.in (GCC): Add.
17448 * tests/calc.at: s/m4_match/m4_bmatch/.
17449 s/m4_patsubst/m4_bpatsubst/.
17450 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
17451 * configure.in: AC_SUBST(GCC).
17452
5d52e7d0
MA
174532001-10-14 Marc Autret <autret_m@epita.fr>
17454
17455 * src/options.c (create_long_option_table): Fix.
17456
631aa1d3
AD
174572001-10-10 Akim Demaille <akim@epita.fr>
17458
17459 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
17460
f6ec6d13
AD
174612001-10-04 Akim Demaille <akim@epita.fr>
17462
17463 * src/reader.c (parse_union_decl): Push the caracters in
17464 union_obstack, not attrs_obstack.
17465
342b8b6e
AD
174662001-10-04 Akim Demaille <akim@epita.fr>
17467
17468 Merge in the branch 1.29.
17469
17470 * src/reader.c (packsymbols): Use a temporary obstack for
17471 `%%tokendef', since output_stack is already used elsewhere.
17472
17473 2001-10-02 Akim Demaille <akim@epita.fr>
17474
17475 Bump 1.29d.
17476
17477 2001-10-02 Akim Demaille <akim@epita.fr>
17478
17479 Version 1.29c.
17480
17481 2001-10-02 Akim Demaille <akim@epita.fr>
17482
17483 * tests/regression.at (Invalid CPP headers): New.
17484 From Alexander Belopolsky.
17485 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
17486
17487 2001-10-02 Akim Demaille <akim@epita.fr>
17488
17489 * tests/regression.at (Invalid input): New.
17490 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
17491 Reported by Shura.
17492
17493 2001-10-02 Akim Demaille <akim@epita.fr>
17494
17495 * tests/calc.at: Now that --debug works, the tests must be adjusted.
17496
17497 2001-10-02 Akim Demaille <akim@epita.fr>
17498
17499 * src/output.c (output_parser): Assert `skeleton'.
17500 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
17501 systems.
17502 From Shura.
17503
17504 2001-10-01 Marc Autret <autret_m@epita.fr>
17505
17506 * src/lex.h: Echo modifications.
17507 * src/lex.c (unlex): Parameter is now token_t.
17508 From Hans Aberg.
17509
17510 2001-10-01 Marc Autret <autret_m@epita.fr>
17511
17512 * src/main.c: Include lex.h.
17513 From Hans Aberg.
17514
17515 2001-09-29 Akim Demaille <akim@epita.fr>
17516
17517 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
17518
17519 2001-09-28 Akim Demaille <akim@epita.fr>
17520
17521 * tests/testsuite.at: Update to newer Autotest.
17522 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
17523
17524 2001-09-27 Akim Demaille <akim@epita.fr>
17525
17526 Position independent wrapper.
17527
17528 * tests/bison: Remove.
17529 * tests/bison.in: New.
17530 * configure.in: Adjust.
17531
17532 2001-09-27 Paul Eggert <eggert@twinsun.com>
17533
17534 Port quotearg fixes from tar 1.13.24.
17535
17536 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
17537 tm to be declared.
17538 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
17539 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
17540
17541 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
17542 * m4/mbrtowc.m4: New file.
17543 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
17544 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
17545
17546 2001-09-27 Akim Demaille <akim@epita.fr>
17547
17548 Bump to 1.29c.
17549
17550 2001-09-27 Akim Demaille <akim@epita.fr>
17551
17552 Version 1.29b.
17553
17554 2001-09-25 Akim Demaille <akim@epita.fr>
17555
17556 * src/system.h: Include `xalloc.h'.
17557 Remove it from the C files.
17558 * src/files.c (output_files): Free the obstacks.
17559 * src/lex.c (init_lex): Rename as...
17560 (lex_init): this.
17561 (lex_free): New.
17562 * src/main.c (main): Use it.
17563
17564 2001-09-24 Marc Autret <autret_m@epita.fr>
17565
17566 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
17567 to output informations in fout (FILE*).
17568 (open_graph, close_graph): Likewise.
17569 (output_graph, output_edge, output_node): Likewise.
17570 * src/vcg.h: Update function prototypes.
17571 * src/print_graph.c (print_graph): Open output graph file.
17572 (print_actions): Adjust.
17573 * src/files.h: Remove extern declaration.
17574 * src/files.c: Remove graph_obstack declaration.
17575 (open_files): Remove graph_obstack initialization.
17576 (output_files): Remove graph_obstack saving.
17577
17578 2001-09-24 Marc Autret <autret_m@epita.fr>
17579
17580 * src/files.c (compute_output_file_names): Fix.
17581
17582 2001-09-24 Marc Autret <autret_m@epita.fr>,
17583 Akim Demaille <akim@epita.fr>
17584
17585 * src/reader.c (reader): Remove call to free_symtab ().
17586 * src/main.c (main): Call it here.
17587 Include symtab.h.
17588 * src/conflicts.c (initialize_conflicts): Rename as...
17589 (solve_conflicts): this.
17590 * src/print.c (print_core, print_actions, print_state)
17591 (print_grammar): Dump to a file instead a `output_obstack'.
17592 (print_results): Dump `output_obstack', and then proceed with the
17593 FILE *.
17594 * src/files.c (compute_output_file_names, close_files): New.
17595 (output_files): Adjust.
17596 * src/main.c (main): Adjust.
17597
17598 2001-09-23 Marc Autret <autret_m@epita.fr>
17599
17600 * src/files.c (compute_header_macro): Computes header macro name
17601 from spec_defines_file when given.
17602
17603 2001-09-23 Marc Autret <autret_m@epita.fr>
17604
17605 * src/files.c (output_files): Add default extensions.
17606
17607 2001-09-22 Akim Demaille <akim@epita.fr>
17608
17609 * src/conflicts.c (finalize_conflicts): Rename as...
17610 (free_conflicts): this.
17611
17612 2001-09-22 Akim Demaille <akim@epita.fr>
17613
17614 * src/gram.c (gram_free): Rename back as...
17615 (dummy): this.
17616 (output_token_translations): Free `token_translations'.
17617 * src/symtab.c (free_symtab): Free the tag field.
17618
17619 2001-09-22 Akim Demaille <akim@epita.fr>
17620
17621 Remove `translations' as it is always set to true.
17622
17623 * src/gram.h: Adjust.
17624 * src/reader.c (packsymbols, parse_token_decl): Adjust
17625 * src/print.c (print_grammar): Adjust.
17626 * src/output.c (output_token_translations): Adjust.
17627 * src/lex.c (lex): Adjust.
17628 * src/gram.c: Be sure the set pointers to NULL.
17629 (dummy): Rename as...
17630 (gram_free): this.
17631
17632 2001-09-22 Akim Demaille <akim@epita.fr>
17633
17634 * configure.in: Invoke AM_LIB_DMALLOC.
17635 * src/system.h: Use dmalloc.
17636 * src/LR0.c: Be sure to have pointers initialized to NULL.
17637 (allocate_itemsets): Allocate kernel_items only if needed.
17638
17639 2001-09-22 Akim Demaille <akim@epita.fr>
17640
17641 * configure.in: Bump to 1.29b.
17642 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
17643 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
17644 need xmalloc.c in calc.y.
17645 From Pascal Bart.
17646
17647 2001-09-21 Akim Demaille <akim@epita.fr>
17648
17649 Version 1.29a.
17650 * Makefile.maint, config/config.guess, config/config.sub,
17651 * config/missing: Update from masters.
17652 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
17653 upon package.m4.
17654 * configure.in (ALL_LINGUAS): Add `tr'.
17655
17656 2001-09-21 Akim Demaille <akim@epita.fr>
17657
17658 * tests/Makefile.am (package.m4): Move to...
17659 ($(srcdir)/$(TESTSUITE)): here.
17660
17661 2001-09-20 Akim Demaille <akim@epita.fr>
17662
17663 * src/complain.c: No longer try to be standalone: use system.h.
17664 Don't assume __STDC__ is defined to 1. Just test if it is defined.
17665 * src/complain.h: Likewise.
17666 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
17667 Remove the unused variable `n'.
17668 From Albert Chin-A-Young.
17669
17670 2001-09-18 Marc Autret <autret_m@epita.fr>
17671
17672 * doc/bison.1: Update.
17673 * doc/bison.texinfo (Bison Options): Update --defines and --graph
17674 descriptions.
17675 (Option Cross Key): Update.
17676 Add --graph.
17677
17678 2001-09-18 Marc Autret <autret_m@epita.fr>
17679
17680 * tests/regression.at: New test (comment in %union).
17681
17682 2001-09-18 Marc Autret <autret_m@epita.fr>
17683
17684 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
17685 do that.
17686 Reported by Keith Browne.
17687
17688 2001-09-18 Marc Autret <autret_m@epita.fr>
17689
17690 * tests/output.at: Add tests for --defines and --graph.
17691
17692 2001-09-18 Marc Autret <autret_m@epita.fr>
17693
17694 * tests/output.at: Removes tests of %{header,src}_extension features.
17695
17696 2001-09-18 Akim Demaille <akim@epita.fr>
17697
17698 * tests/Makefile.am (package.m4): New.
17699 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
17700 (_AT_CHECK_CALC_ERROR): Likewise.
17701 Factor the `, ' part of verbose error messages.
17702
17703 2001-09-18 Marc Autret <autret_m@epita.fr>
17704
17705 * src/getargs.c (longopts): Declare --defines and --graph as options
17706 with optional arguments.
17707 * src/files.h: Add extern declarations.
17708 * src/files.c (spec_graph_file, spec_defines_file): New.
17709 (output_files): Update.
17710 Remove CPP-outed code.
17711
17712 2001-09-18 Marc Autret <autret_m@epita.fr>
17713
17714 Turn off %{source,header}_extension feature.
17715
17716 * src/files.c (compute_exts_from_gf): Update.
17717 (compute_exts_from_src): Update.
17718 (output_files): CPP-out useless code.
17719 * src/files.h: Remove {header,source}_extension extern declarations.
17720 * src/reader.c (parse_dquoted_param): CPP-out.
17721 (parse_header_extension_decl): Remove.
17722 (parse_source_extension_decl): Remove.
17723 (read_declarations): Remove cases tok_{hdrext,srcext}.
17724 * src/lex.c (percent_table): Remove {header,source}_extension entries.
17725 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
17726
17727 2001-09-10 Akim Demaille <akim@epita.fr>
17728
17729 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
17730 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
17731 (AT_CHECK_OUTPUT): this.
17732 Merely check ls' exit status, its output is useless.
17733
17734 2001-09-10 Akim Demaille <akim@epita.fr>
17735
17736 * tests/calc.at: Use m4_match.
17737 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
17738
17739 2001-09-10 Marc Autret <autret_m@epita.fr>,
17740 Akim Demaille <akim@epita.fr>
17741
17742 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
17743 enum color_e.
17744 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
17745 to `normal'.
17746 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
17747 * src/lex.h: Adjust prototype.
17748 (token_t): Add `tok_undef'.
17749 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
17750 (parse_percent_token): Now returns token_t.
17751 Add default statement in switch.
17752 (lex): Separate `c' as an input variable, from the token_t result
17753 part.
17754 (unlexed): Is a token_t.
17755
17756 2001-09-10 Akim Demaille <akim@epita.fr>
17757
17758 * configure.in: Bump to 1.29a.
17759
17760 2001-09-07 Akim Demaille <akim@epita.fr>
17761
17762 Version 1.29.
17763
17764 2001-08-30 Akim Demaille <akim@epita.fr>
17765
17766 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
17767 * m4/atconfig.m4: Remove.
17768 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
17769 * tests/bison: New.
17770 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
17771 m4_if, m4_patsubst, and m4_regexp.
17772 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
17773 `input' file instead of echo.
17774
17775 2001-08-29 Akim Demaille <akim@epita.fr>
17776
17777 Bump to 1.28e.
17778
17779 2001-08-29 Akim Demaille <akim@epita.fr>
17780
17781 Version 1.28d.
17782
17783 2001-08-29 Paul Eggert <eggert@twinsun.com>
17784
17785 * src/bison.simple (yyparse): Don't take the address of an
17786 item before the start of an array, as that doesn't conform to
17787 the C Standard.
17788
17789 2001-08-29 Robert Anisko <anisko_r@epita.fr>
17790
17791 * doc/bison.texinfo (Location Tracking Calc): New node.
17792
17793 2001-08-29 Paul Eggert <eggert@twinsun.com>
17794
17795 * src/output.c (output): Do not define const, as this now
17796 causes more problems than it cures.
17797
17798 2001-08-29 Akim Demaille <akim@epita.fr>
17799
17800 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17801 the nodes.
17802 Be sure to tag the `detailmenu'.
17803
17804 2001-08-29 Akim Demaille <akim@epita.fr>
17805
17806 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17807 download in a tmp dir.
17808
17809 2001-08-28 Marc Autret <autret_m@epita.fr>
17810
17811 * config/depcomp: New file.
17812
17813 2001-08-28 Marc Autret <autret_m@epita.fr>
17814
17815 * doc/bison.1 (mandoc): Adjust.
17816 From Juan Manuel Guerrero.
17817
17818 2001-08-28 Marc Autret <autret_m@epita.fr>
17819
17820 * src/print_graph.c (print_state): Fix.
17821
17822 2001-08-27 Marc Autret <autret_m@epita.fr>
17823
17824 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17825 char * members.
17826 Echo modifications to the functions prototypes.
17827 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17828
17829 2001-08-27 Marc Autret <autret_m@epita.fr>
17830
17831 * src/vcg.c: Include `xalloc.h'.
17832 (add_colorentry): New.
17833 (add_classname): New.
17834 (add_infoname): New.
17835 * src/vcg.h: Add new prototypes.
17836
17837 2001-08-27 Akim Demaille <akim@epita.fr>
17838
17839 * Makefile.maint: Sync. again with CVS Autoconf.
17840
17841 2001-08-27 Akim Demaille <akim@epita.fr>
17842
17843 * Makefile.maint: Formatting changes.
17844 (po-update, cvs-update, update): New targets.
17845 (AMTAR): Remove.
17846
17847 2001-08-27 Akim Demaille <akim@epita.fr>
17848
17849 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17850 * Makefile.maint: Sync. with CVS Autoconf.
17851
17852 2001-08-27 Marc Autret <autret_m@epita.fr>
17853
17854 * src/vcg.h (struct infoname_s): New.
17855 (struct colorentry_s): New.
17856 (graph_s): New fields {vertical,horizontal}_order in structure.
17857 Add `infoname' field.
17858 Add `colorentry' field;
17859 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17860 (G_HORIZONTAL_ORDER): New.
17861 (G_INFONAME): New.
17862 (G_COLORENTRY): New.
17863 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17864 Add output of `infoname'.
17865 Add output of `colorentry'.
17866
17867 2001-08-27 Marc Autret <autret_m@epita.fr>
17868
17869 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17870 This one shadowed a global parameter.
17871
17872 2001-08-24 Marc Autret <autret_m@epita.fr>
17873
17874 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17875 instead of `unsigned'.
17876 (print_state): Do not call obstack_object_size () in obstack_grow ()
17877 to avoid macro variables shadowing.
17878
17879 2001-08-23 Marc Autret <autret_m@epita.fr>
17880
17881 * src/lex.c (percent_table): Typo: s/naem/name/.
17882 Add graph option.
17883 Normalize new options declarations.
17884
17885 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17886
17887 * tests/suite.at: Exercise %header_extension and %source_extension.
17888
17889 2001-08-16 Marc Autret <autret_m@epita.fr>
17890
17891 * src/reader.c (parse_dquoted_param): New.
17892 (parse_header_extension_decl): Use it.
17893 (parse_source_extension_decl): Likewise.
17894
17895 2001-08-16 Marc Autret <autret_m@epita.fr>
17896
17897 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17898 (get_xxxx_str): Use assert () instead of complain ().
17899 Remove return invokations in default cases.
17900 (get_decision_str): Modify default behaviour. Remove second argument.
17901 Echo modifications on calls.
17902 (output_graph): Fix.
17903
17904 2001-08-16 Marc Autret <autret_m@epita.fr>
17905
17906 * src/getargs.c (usage): Update with ``-g, --graph''.
17907
17908 2001-08-16 Marc Autret <autret_m@epita.fr>
17909
17910 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17911 (Option Cross Key): Likewise.
17912 * doc/bison.1: Update.
17913
1c8c2190
PB
179142001-09-25 Pascal Bart <pascal.bart@epita.fr>
17915
17916 * src/output.c (output_master_parser): Don't finish action_obstack.
17917 (output_parser): Don't care about the muscle action, here.
17918 (prepare): Copy the action_obstack in the action muscle.
17919 (output): Free action_obstack.
17920
180d45ba
PB
179212001-09-23 Pascal Bart <pascal.bart@epita.fr>
17922
17923 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17924 will contain `%union' declaration.
17925 (parse_union_decl): Delete #line directive output.
17926 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17927 informations about %union.
17928 (parse_union_decl): Copy the union_obstack in the muscle stype.
17929 * src/bison.simple: Add new #line directive.
17930 Add typdef %%stype YYSTYPE.
17931
c51d1a19
PB
179322001-09-23 Pascal Bart <pascal.bart@epita.fr>
17933
17934 * src/bison.simple: Add new `#line' directive.
17935
6f9344da
PB
179362001-09-22 Pascal Bart <pascal.bart@epita.fr>
17937
17938 * src/bison.simple: New `#line' directive.
17939 * src/output.c (output_parser): Support new dynamic muscle input_line.
17940
652def80
MA
179412001-09-22 Marc Autret <autret_m@epita.fr>
17942
17943 * src/output.c (output_master_parser): New.
17944 (output_parser): Be more re-entrant.
17945
25b222fa
MA
179462001-09-21 Marc Autret <autret_m@epita.fr>
17947
17948 * src/reader.c (copy_definition, parse_union_decl): Update and use
17949 `linef' muscle.
17950 (copy_action): Likewise.
17951 Use obstack_1grow ().
17952 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17953
6bc35ae5
MA
179542001-09-21 Marc Autret <autret_m@epita.fr>
17955
17956 * src/options.c (option_table): Adjust.
17957 * src/lex.c (parse_percent_token): Fix.
17958
c0629aa1
PB
179592001-09-20 Pascal Bart <pascal.bart@epita.fr>
17960
17961 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 17962
82b6d266
PB
179632001-09-20 Pascal Bart <pascal.bart@epita.fr>
17964
17965 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17966 is now an option_table_struct*.
17967 (option_strcmp): New function option_strcmp.
17968 (parse_percent_token): Call option_strcmp.
17969 * src/getargs.c (xalloc.h, options.h): Include it.
17970 (getargs): Call create_long_option_table.
17971 (getargs): Free longopts at the end of the function.
17972 (shortopts): Move in options.c.
17973 * src/options.c (create_long_option_table): New function. Convert
17974 information from option_table to option structure.
17975 * src/reader.c (options.h): Include it.
17976
17977 * src/Makefile.am: Adjust.
17978 * src/options.c (option_table): Create from longopts and percent_table.
17979 * src/getargs.c (longopts): Delete.
17980 * src/lex.c (struct percent_table_struct): Delete.
17981 (percent_table): Delete.
17982 (options.h): Include it.
17983 * src/options.c: Create.
17984 * src/options.h: Create.
17985 Declare enum opt_access_e.
17986 Define struct option_table_struct.
17987
75f5aaea
MA
179882001-09-20 Marc Autret <autret_m@epita.fr>
17989
17990 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
17991 sections of Bison.
17992
f508cb0a
PB
179932001-09-19 Pascal Bart <pascal.bart@epita.fr>
17994
17995 * src/bison.simple: s/%%filename/%%skeleton.
17996 * src/muscle_tab.c (getargs.h): Include it.
17997 (muscle_init): Insert new muscle skeleton.
17998
13105fc1
PB
179992001-09-18 Pascal Bart <pascal.bart@epita.fr>
18000
18001 * src/output.c (output_parser): Delete unused variable actions_dumped.
18002
b0c4483e
PB
180032001-09-07 Pascal Bart <pascal.bart@epita.fr>
18004
18005 * src/output.c (output): Delete call to reader_output_yylsp.
18006 * src/reader.c (reader): Likewise.
ba0fe3c7 18007 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 18008
11d82f03
MA
180092001-09-02 Marc Autret <autret_m@epita.fr>
18010
18011 * src/reader.c: Include muscle_tab.h.
18012 (parse_union_decl): Update.
18013 (parse_macro_decl): Rename parse_muscle_decl.
18014 Update to use renamed functions and variable.
18015 (read_declarations, copy_action, read_additionnal_code, : Updated
18016 with correct variables and functions names.
18017 (packsymbols, reader): Likewise.
342b8b6e 18018
11d82f03 18019 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 18020
11d82f03
MA
18021 * src/output.c: Include muscle_tab.h
18022 In all functions using macro_insert, change by using muscle_insert ().
18023 (macro_obstack): Rename muscle_obstack.
18024 Echo modifications in the whole file.
18025 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
18026 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
18027 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
18028
18029 * src/muscle_tab.h: Update double inclusion macros.
18030 (macro_entry_s): Rename muscle_entry_s.
18031 Update prototypes.
342b8b6e 18032
11d82f03
MA
18033 * src/muscle_tab.c: Include muscle_tab.h.
18034 Rename macro_tabble to muscle_table.
18035 (mhash1, mhash2, mcmp): Use muscle_entry.
18036 (macro_init): Rename muscle_init. Update.
18037 (macro_insert): Rename muscle_insert. Update.
18038 (macro_find): Rename muscle_find. Update.
18039
18040 * src/main.c: Include muscle_tab.h.
18041 (main): Call muscle_init ().
18042 * src/Makefile.am (bison_SOURCES): Echo modifications.
18043
93a37297
MA
180442001-09-02 Marc Autret <autret_m@epita.fr>
18045
f753cd62 18046 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 18047
f753cd62
MA
18048 * src/muscle_tab.c, src/muscle_tab.h: Add files.
18049
180502001-09-02 Marc Autret <autret_m@epita.fr>
18051
18052 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 18053
682d48cd
PB
180542001-09-01 Pascal Bart <pascal.bart@epita.fr>
18055
342b8b6e 18056 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
18057 filename.
18058
087c8fda
MA
180592001-09-01 Marc Autret <autret_m@epita.fr>
18060
18061 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
18062 to an explicit value to activate the feature. We do it here.
18063
dda680cb
PB
180642001-08-31 Pascal Bart <pascal.bart@epita.fr>
18065
18066 * src/output.c (prepare): Delete the `filename' muscule insertion.
18067 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
18068 (parse_union_decl): Likewise.
18069 * src/macrotab.c (macro_init): Initialize filename by infile.
18070
9e644e64
MA
180712001-08-31 Marc Autret <autret_m@epita.fr>
18072
18073 * src/bison.simple (YYLSP_NEEDED): New definition.
18074 * src/output.c (prepare): Add macro insertion of `locations_flag'
18075
17da6427
PB
180762001-08-31 Pascal Bart <pascal.bart@epita.fr>
18077
18078 * src/output.c (prepare): Delete insertion of previous muscles,
18079 and insert the `prefix' muscles.
18080 * src/macrotab.c (macro_init): Likewise.
18081 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 18082 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
18083 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
18084 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 18085 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
18086 name_prefix.
18087
e8cb70b9
PB
180882001-08-31 Pascal Bart <pascal.bart@epita.fr>
18089
18090 * src/main.c (main): Standardize.
18091 * src/output.c (output_table_data, output_parser): Likewise.
18092 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
18093
63c2d5de
MA
180942001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
18095
342b8b6e 18096 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
18097 %%epilogue.
18098 * src/output.c (output): Rename %%declarations to %%prologue.
18099 * src/bison.simple: Echo modifications.
342b8b6e 18100
d8cb5183
MA
181012001-08-31 Marc Autret <autret_m@epita.fr>
18102
18103 * src/reader.c (readgram): CleanUp.
18104 (output_token_defines): Likewise.
18105 (packsymbols): Likewise.
18106 (reader): Likewise.
18107 * src/output.c (output): CPP-out useless code.
18108
6c686258
PB
181092001-08-31 Pascal Bart <pascal.bart@epita.fr>
18110
342b8b6e 18111 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
18112 output_trailers and output_headers.
18113 * src/output.h: Remove obsolete functions prototypes of output_headers
18114 and output_trailers.
18115
8f451ef7
PB
181162001-08-30 Pascal Bart <pascal.bart@epita.fr>
18117
18118 * src/main.c: Include macrotab.h.
342b8b6e 18119 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
18120 Adjust functions prototypes.
18121 * src/macrotab.c (macro_insert): Constify key and value.
18122 (macro_find): Constify key.
18123 (macro_insert): Include 'xalloc.h'
18124 (macro_insert): Use XMALLOC.
18125 (macro_find): Constify return value.
18126 * src/output.c (output_table_data): Rename table to table_data.
18127 (output_parser): Constify macro_key, macro_value.
18128
997b6fd0 181292001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
18130
18131 * src/reader.c (parse_skel_decl): New.
342b8b6e 18132 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
18133 * src/lex.h (token_t): New token `tok_skel'.
18134 * src/lex.c (percent_table): Add skeleton option entry.
18135 Standardize.
18136
ff48177d
MA
181372001-08-29 Marc Autret <autret_m@epita.fr>
18138
18139 * src/bison.simple: Add %%user_code directive at the end.
18140 * src/reader.c (read_additionnal_code): New.
18141 (reader): Use it.
18142 * src/output.c (output_program): Remove.
18143 (output): Update.
18144
b33160bf
MA
181452001-08-28 Marc Autret <autret_m@epita.fr>
18146
18147 * src/output.c (output_actions): Clean up.
4e5caae2 18148 (output_gram): CPP-out useless code.
b33160bf
MA
18149 * src/reader.c (reader): Clean up, CPP-out useless code.
18150
d1a2daf7
PB
181512001-08-28 Pascal Bart <pascal.bart@epita.fr>
18152
342b8b6e 18153 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 18154 directive.
d1a2daf7
PB
18155 * src/bison.simple: Add `%%definitions'.
18156
2b763dfe
MA
181572001-08-28 Marc Autret <autret_m@epita.fr>
18158
18159 * config/depcomp: New file.
18160
f1a87ef6
PE
181612001-08-27 Paul Eggert <eggert@twinsun.com>
18162
18163 * src/bison.simple (yyparse): Don't take the address of an
18164 item before the start of an array, as that doesn't conform to
18165 the C Standard.
18166
82e236e2
RA
181672001-08-27 Robert Anisko <robert.anisko@epita.fr>
18168
f1a87ef6 18169 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
18170 obstack. It was done too late here.
18171
18172 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
18173 completely wrong.
18174 (reader): Initialize the macro obstack here, since we need it to grow
18175 '%define' directives.
18176
18177 * src/reader.h: Declare the macro obstack as extern.
18178
b0cfa28a
RA
181792001-08-27 Robert Anisko <robert.anisko@epita.fr>
18180
18181 * src/output.c (output_parser): Fix. Store single '%' characters in
18182 the output obstack instead of throwing them away.
18183
6fc74234
AD
181842001-08-27 Akim Demaille <akim@epita.fr>
18185
18186 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18187
9c76d118
RA
181882001-08-25 Robert Anisko <robert.anisko@epita.fr>
18189
18190 * lib/Makefile.am: Adjust.
18191
a8289c62
RA
181922001-08-25 Robert Anisko <robert.anisko@epita.fr>
18193
18194 * src/bison.simple: Update and add '%%' directives.
18195
b6610515
RA
181962001-08-25 Robert Anisko <robert.anisko@epita.fr>
18197
18198 * src/reader.c (reader): Remove calls to 'output_headers' and
18199 'output_trailers'. Remove some C output.
18200 (readgram): Disable a piece of code that was writing a default
18201 definition for 'YYSTYPE'.
18202 (reader_output_yylsp): Remove.
18203 (packsymbols): Output token defintions to a macro.
18204 (copy_definition): Disable C output.
6fc74234 18205
b6610515
RA
18206 * src/reader.c (parse_macro_decl): New function used to parse macro
18207 declarations.
18208 (copy_string2): Put the body of copy_string into this new function.
18209 Add a parameter to let the caller choose whether he wants to copy the
18210 string delimiters or not.
18211 (copy_string): Be a simple call to copy_string2 with the last argument
18212 bound to true.
18213 (read_declarations): Add case for macro definition.
18214 (copy_identifier): New.
6fc74234 18215 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
18216 rather than lex.
18217
26f609ff
RA
182182001-08-25 Robert Anisko <robert.anisko@epita.fr>
18219
18220 * src/output.c (prepare): Add prefixed names.
18221 (output_parser): Output semantic actions.
18222 (output_parser): Fix bug on '%%line' directives.
6fc74234 18223
26f609ff
RA
18224 * src/output.c (output_headers): Remove. The C code printed by this
18225 function should now be in the skeletons.
18226 (output_trailers): Remove.
18227 (output): Disable call to 'reader_output_yylsp'.
18228 (output_rule_data): Do not output tables to the table obstack.
18229
18230 * src/output.c: Remove some C dedicated output.
18231 Improve the use of macro and output obstacks.
18232 (output_defines): Remove.
6fc74234 18233
26f609ff
RA
18234 * src/output.c (output_token_translations): Associate 'translate'
18235 table with a macro. No output to the table obstack.
18236 (output_gram): Same for 'rhs' and 'prhs'.
18237 (output_stos): Same for 'stos'.
18238 (output_rule_data): Same for 'r1' and 'r2'.
18239 (token_actions): Same for 'defact'.
18240 (goto_actions): Same for 'defgoto'.
18241 (output_base): Same for 'pact' and 'pgoto'.
18242 (output_table): Same for 'table'.
18243 (output_check): Same for 'check'.
6fc74234 18244
26f609ff
RA
18245 * src/output.c (output_table_data): New function.
18246 (output_short_table): Remove.
18247 (output_short_or_char_table): Remove.
6fc74234 18248
26f609ff
RA
18249 * src/output.c (output_parser): Replace most of the skeleton copy code
18250 with something new. Skeletons are now processed character by character
18251 rather than line by line, and Bison looks for '%%' macros. This is the
18252 first step in making Bison's output process (a lot) more flexible.
18253 (output_parser): Use the macro table.
18254
6f43b113
RA
182552001-08-25 Robert Anisko <robert.anisko@epita.fr>
18256
18257 * src/main.c (main): Initialize the macro table.
18258
dd3127cf
RA
182592001-08-25 Robert Anisko <robert.anisko@epita.fr>
18260
18261 * src/lex.c (percent_table): Add tok_define.
18262 * src/lex.h: Add tok_define.
18263
aa321494
RA
182642001-08-25 Robert Anisko <robert.anisko@epita.fr>
18265
18266 * src/macrotab.c: New file.
18267 * src/macrotab.h: New file.
18268 * src/Makefile.am: Update.
18269
68bd3b6b
RA
182702001-08-25 Robert Anisko <robert.anisko@epita.fr>
18271
18272 * lib/hash.c: New file.
18273 * lib/hash.h: New file.
18274 * lib/Makefile.am: Update.
18275
45f8dd1e
AD
182762001-08-15 Akim Demaille <akim@epita.fr>
18277
18278 Version 1.28c.
18279
40a64a7a 182802001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
18281
18282 * src/reader.c (readgram): Indent output macro YYSTYPE.
18283 (packsymbols): Likewise.
18284 (output_token_defines): Likewise.
18285 * src/files.c: Standardize.
18286 (compute_header_macro): New.
18287 (defines_obstack_save): New. Use compute_header_macro.
18288 (output_files): Update. Use defines_obstack_save.
18289
f9a8293a
AD
182902001-08-15 Akim Demaille <akim@epita.fr>
18291
18292 * doc/bison.texinfo (Table of Symbols): Document
18293 YYSTACK_USE_ALLOCA.
18294
150ca7a7
AD
182952001-08-15 Akim Demaille <akim@epita.fr>
18296
18297 * missing: Update from CVS Automake.
18298 * config/config.guess, config/config.sub, config/texinfo.tex:
18299 Update from gnu.org.
18300
69b5cec4
AD
183012001-08-15 Akim Demaille <akim@epita.fr>
18302
18303 * Makefile.maint: Sync with CVS Autoconf.
18304
f2b5126e
PB
183052001-08-14 Pascal Bart <pascal.bart@epita.fr>
18306
69b5cec4 18307 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
18308 `fdl.texi'.
18309 * doc/fdl.texi: Add to package.
18310
4ecbf796
MA
183112001-08-14 Marc Autret <autret_m@epita.fr>
18312
18313 Turn on %{source,header}_extension features.
18314
69b5cec4 18315 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
18316 source_extension.
18317 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 18318 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
18319 between options.
18320
95fb5662
MA
183212001-08-14 Marc Autret <autret_m@epita.fr>
18322
18323 * src/files.c (compute_base_names): Add extensions computing when
18324 `--file-prefix' used.
18325 Standardize function calls.
18326
78d09da9
MA
183272001-08-13 Marc Autret <autret_m@epita.fr>
18328
69b5cec4 18329 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
18330 defining it (defined but null disables alloca).
18331
5a009f2c
MA
183322001-08-13 Marc Autret <autret_m@epita.fr>
18333
18334 * src/bison.simple (_yy_memcpy): CPP reformat.
18335
1e41465a
PB
183362001-08-13 Pascal Bart <pascal.bart@epita.fr>
18337
18338 * tests/atconfig.in (CPPFLAGS): Fix.
18339
c67a198d
PB
183402001-08-10 Pascal Bart <pascal.bart@epita.fr>
18341
79282c6c 18342 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
18343 `gpl.texi'.
18344 * doc/gpl.texi: Add to package.
18345
09a6de7e
MA
183462001-08-10 Marc Autret <autret_m@epita.fr>
18347
18348 * src/print_graph.h: Fix.
18349 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
18350
b77b9ee0
AD
183512001-08-10 Akim Demaille <akim@epita.fr>
18352
18353 * src/system.h: Provide default declarations for stpcpy, strndup,
18354 and strnlen.
18355
3e259915
MA
183562001-08-10 Robert Anisko <anisko_r@epita.fr>
18357
18358 * doc/bison.texinfo (Locations): Update @$ stuff.
18359
ca96bc2d
MA
183602001-08-09 Robert Anisko <anisko_r@epita.fr>
18361
18362 * src/bison.simple (YYLLOC_DEFAULT): Update.
18363 (yyparse): Adjust.
18364
fdc6758b
MA
183652001-08-08 Marc Autret <autret_m@epita.fr>
18366
b77b9ee0 18367 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
18368 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
18369 Reported by Fabrice Bauzac.
957d4dbf 18370
600cad3b
MA
183712001-08-08 Marc Autret <autret_m@epita.fr>
18372
18373 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
18374 * src/vcg.c (output_node): Fix.
18375 * src/vcg.h: Cleanup.
18376 * src/print_graph.c: Add comments.
b77b9ee0 18377 (node_output_size): New global variable. Simplify the formatting of
600cad3b 18378 the VCG graph output.
b77b9ee0 18379 (print_actions): Unused code is now used. It notifies the final state
600cad3b 18380 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 18381 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
18382 blue.
18383 Get the current node name and node_obstack by argument.
18384 (node_obstack): New variable.
18385 (print_state): Manage node_obstack.
18386 (print_core): Use node_obstack given by argument.
18387 A node is not only computed here but in print_actions also.
18388 (print_graph): CPP out useless code instead of commenting it.
18389
976e528f
AD
183902001-08-07 Pascal Bart <pascal.bart@epita.fr>
18391
18392 * tests/atconfig.in (CPPFLAGS): Fix.
18393
20e8e5ca
AD
183942001-08-07 Akim Demaille <akim@epita.fr>
18395
18396 * src/print_graph.c (quote): New.
18397 (print_core): Use it.
18398
957d4dbf 183992001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 18400
3e3da797
AD
18401 * src/vcg.c (complain.h): Include it.
18402 Unepitaize `return' invocations.
c4b66126 18403 [NDEBUG] (main): Remove.
79282c6c 18404 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
18405 * src/files.c (open_files): Initialize graph_obstack.
18406 * src/print_graph.c (print_actions): CPP out useless code.
18407 (print_core): Don't output the last `\n' in labels.
18408 Use `quote'.
18409 * src/files.c (output_files): Output the VCG file.
18410 * src/main.c (main): Invoke print_graph ();
3e3da797 18411
957d4dbf 184122001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
18413
18414 Automaton VCG graph output.
18415 Using option ``-g'' or long option ``--graph'', you can generate
18416 a gram_filename.vcg file containing a VCG description of the LALR (1)
18417 automaton of your grammar.
18418
18419 * src/main.c: Call to print_graph() function.
18420 * src/getargs.h: Update.
18421 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
18422 (graph_flag): New flag.
18423 (longopts): Update.
18424 (getargs): Add case `g'.
18425 * src/files.c (graph_obstack): New obstack struct.
18426 (open_files): Initialize new obstack.
18427 (output_files): Saves graph_obstack if required.
18428 * src/files.h (graph_obstack): New extern declaration.
18429 * src/Makefile.am: Add new source files.
18430
927c1557 184312001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
18432
18433 * src/print_graph.c, src/print_graph.h (graph): New.
18434 * src/vcg.h: New file.
18435 * src/vcg.c: New file, VCG graph handling.
18436
7333d403
AD
184372001-08-06 Marc Autret <autret_m@epita.fr>
18438
18439 Add of %source_extension and %header_extension which specify
18440 the source or/and the header output file extension.
18441
18442 * src/files.c (compute_base_names): Remove initialisation of
18443 src_extension and header_extension.
18444 (compute_exts_from_gf): Update.
18445 (compute_exts_from_src): Update.
18446 (output_files): Update.
18447 * src/reader.c (parse_header_extension_decl): New.
18448 (parse_source_extension_decl): New.
18449 (read_declarations): New case statements for the new tokens.
18450 * src/lex.c (percent_table): Add entries for %source_extension
18451 and %header_extension.
18452 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
18453
84163231
AD
184542001-08-06 Marc Autret <autret_m@epita.fr>
18455
18456 * configure.in: Bump to 1.28c.
18457 * doc/bison.texinfo: Texinfo thingies.
18458
8303fc42
AD
184592001-08-04 Pascal Bart <pascal.bart@epita.fr>
18460
18461 * tests/atconfig.in (CPPFLAGS): Add.
18462 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
18463
70a84437
AD
184642001-08-03 Akim Demaille <akim@epita.fr>
18465
18466 Version 1.28b.
18467
2ce10144
AD
184682001-08-03 Akim Demaille <akim@epita.fr>
18469
18470 * tests/Makefile.am (check-local): Ship testsuite.
18471 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
18472 Include `string.h'.
18473
1e3e4bc1
AD
184742001-08-03 Akim Demaille <akim@epita.fr>
18475
18476 * configure.in: Try using -Wformat when compiling.
18477
42b45b7f
AD
184782001-08-03 Akim Demaille <akim@epita.fr>
18479
18480 * configure.in: Bump to 1.28b.
18481
8f13fe33
AD
184822001-08-03 Akim Demaille <akim@epita.fr>
18483
18484 * src/complain.c: Adjust strerror_r portability issues.
18485
b37ba92c
AD
184862001-08-03 Akim Demaille <akim@epita.fr>
18487
18488 Version 1.28a.
18489
b0ce6046
AD
184902001-08-03 Akim Demaille <akim@epita.fr>
18491
18492 * src/getargs.c, src/getarg.h (skeleton)): Constify.
18493 * src/lex.c (literalchar): Avoid name clashes on `buf'.
18494 * src/getargs.c: Include complain.h.
18495 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
18496 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
18497
d01c415b
AD
184982001-08-03 Akim Demaille <akim@epita.fr>
18499
18500 * src/reader.c (readgram): Display hidden chars in error messages.
18501
459dd1a6
AD
185022001-08-03 Akim Demaille <akim@epita.fr>
18503
18504 Update to gettext 0.10.39.
18505
53b74c0c
AD
185062001-08-03 Akim Demaille <akim@epita.fr>
18507
18508 * lib/strspn.c: New.
18509
234a3be3
AD
185102001-08-01 Marc Autret <autret_m@epita.fr>
18511
18512 * doc/bison.texinfo: Update.
18513 * doc/bison.1 (mandoc): Update.
18514 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
18515 * src/files.c: Support output files extensions computing.
18516 (src_extension): New static variable.
18517 (header_extension): New static variable.
18518 (tr): New function.
18519 (get_extension_index): New function, gets the index of an extension
18520 filename in a string.
18521 (compute_exts_from_gf): New function, computes extensions from the
18522 grammar file extension.
18523 (compute_exts_from_src): New functions, computes extensions from the
18524 C source file extension, file given by ``-o'' option.
18525 (compute_base_names): Update.
18526 (output_files): Update.
18527
847bf1f5
AD
185282001-08-01 Robert Anisko <anisko_r@epita.fr>
18529
d995fee7 18530 * doc/bison.texi: Document @$.
847bf1f5
AD
18531 (Locations): New section.
18532
d074a105
AD
185332001-07-18 Akim Demaille <akim@epita.fr>
18534
18535 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
18536 * config/prev-version.txt, config/move-if-change: New.
18537 * Makefile.am: Adjust.
18538
3419715d
AD
185392001-07-08 Pascal Bart <pascal.bart@epita.fr>
18540
18541 * src/bison.simple (yyparse): Suppress warning `comparaison
18542 between signed and unsigned'.
18543
62ab6972
AD
185442001-07-05 Pascal Bart <pascal.bart@epita.fr>
18545
18546 * src/getargs.h (raw_flag): Remove.
18547 * src/getargs.c: Die on `-r'/`--raw'.
18548 * src/lex.c (parse_percent_token): Die on `%raw'.
18549 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
18550 * tests/calc.at: Suppress test with option `--raw'.
18551
1e24cc5b
AD
185522001-07-14 Akim Demaille <akim@epita.fr>
18553
18554 * config/: New.
18555 * configure.in: Require Autoconf 2.50.
18556 Update to gettext 0.10.38.
18557
32dfccf8
AD
185582001-03-16 Akim Demaille <akim@epita.fr>
18559
18560 * doc/bison.texinfo: ANSIfy the examples.
18561
cd5bd6ac
AD
185622001-03-16 Akim Demaille <akim@epita.fr>
18563
18564 * getargs.c (skeleton): New variable.
18565 (longopts): --skeleton is a new option.
18566 (shortopts, getargs): -S is a new option.
18567 * getargs.h: Declare skeleton.
18568 * output.c (output_parser): Use it.
18569
5141b016
AD
185702001-03-16 Akim Demaille <akim@epita.fr>
18571
18572 * m4/strerror_r.m4: New.
18573 * m4/error.m4: Run AC_FUNC_STRERROR_R.
18574 * lib/error.h, lib/error.c: Update.
18575
447992b9
AD
185762001-03-16 Akim Demaille <akim@epita.fr>
18577
18578 * src/getargs.c (longopts): Clean up.
18579
274d42ce
AD
185802001-02-21 Akim Demaille <akim@epita.fr>
18581
18582 * src/reader.c (gensym): `gensym_count' is your own.
18583 Use a static buf to create the symbol name, as token_buffer is no
18584 longer a buffer.
18585
22c821f3
AD
185862001-02-08 Akim Demaille <akim@epita.fr>
18587
18588 * src/conflicts.c (conflict_report): Be sure not to append to res
18589 between two calls, which could happen if both first sprintf were
18590 skipped, but not the first cp += strlen.
18591
18569462
AD
185922001-02-08 Akim Demaille <akim@epita.fr>
18593
18594 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
18595 New, from fileutils 4.0.37.
18596 * configure.in: Require Autoconf 2.49c. I took some time before
18597 making this decision. This is the only way out for portability
18598 issues in Bison, it would mean way too much duplicate effort to
18599 import in Bison features implemented in 2.49c since 2.13.
18600 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
18601
0d8f3c8a
AD
186022001-02-02 Akim Demaille <akim@epita.fr>
18603
18604 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 18605 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 18606
f17bcd1f
AD
186072001-01-19 Akim Demaille <akim@epita.fr>
18608
18609 Get rid of the ad hoc handling of token_buffer in the scanner: use
18610 the obstacks.
18611
18612 * src/lex.c (token_obstack): New.
18613 (init_lex): Initialize it. No longer call...
18614 (grow_token_buffer): this. Remove it.
18615 Adjust all the places which used it to use the obstack.
18616
511e79b3
AD
186172001-01-19 Akim Demaille <akim@epita.fr>
18618
18619 * src/lex.h: Rename all the tokens:
18620 s/\bENDFILE\b/tok_eof/g;
18621 s/\bIDENTIFIER\b/tok_identifier/g;
18622 etc.
18623 Let them be enums, not #define, to ease debugging.
18624 Adjust all the code.
18625
0d6508ef
AD
186262001-01-18 Akim Demaille <akim@epita.fr>
18627
18628 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
18629 * src/lex.c (maxtoken, grow_token_buffer): Static.
18630
6deb4447
AD
186312001-01-18 Akim Demaille <akim@epita.fr>
18632
18633 Since we now use obstacks, more % directives can be enabled.
18634
18635 * src/lex.c (percent_table): Also accept `%yacc',
18636 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
18637 `%debug'.
18638 Handle the actions for `%semantic_parser' and `%pure_parser' here,
18639 instead of returning a token.
18640 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
18641 * src/reader.c (read_declarations): Adjust.
18642 * src/files.c (open_files): Don't call `compute_base_names', don't
18643 compute `attrsfile' since they depend upon data which might be
18644 *in* the input file now.
18645 (output_files): Do it here.
18646 * src/output.c (output_headers): Document the fact that this patch
18647 introduces a guaranteed SEGV for semantic parsers.
18648 * doc/bison.texinfo: Document them.
18649 * tests/suite.at: Exercise these %options.
18650
ff4423cc
AD
186512000-12-20 Akim Demaille <akim@epita.fr>
18652
18653 Also handle the output file (--verbose) with obstacks.
18654
18655 * files.c (foutput): Remove.
18656 (output_obstack): New.
18657 Adjust all dependencies.
18658 * src/conflicts.c: Return a string.
18659 * src/system.h (obstack_grow_string): Rename as...
18660 (obstack_sgrow): this. Be ready to work with non literals.
18661 (obstack_fgrow4): New.
18662
956dba3a
AD
186632000-12-20 Akim Demaille <akim@epita.fr>
18664
18665 * src/files.c (open_files): Fix the computation of short_base_name
18666 in the case of `-o foo.tab.c'.
18667
337bab46
AD
186682000-12-20 Akim Demaille <akim@epita.fr>
18669
18670 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
18671 (copy_dollar): Now that everything uses obstacks, get rid of the
18672 FILE * parameters.
18673
5d3214b8
AD
186742000-12-20 Akim Demaille <akim@epita.fr>
18675
18676 * src/files.c (open_files): Actually the `.output' file is based
18677 on the short_base_name, not base_name.
18678 * tests/suite.at (Checking output file names): Adjust.
18679
29092a57
AD
186802000-12-20 Akim Demaille <akim@epita.fr>
18681
18682 * src/bison.s1: Remove, we now use directly...
18683 * src/bison.simple: this.
18684 * src/Makefile.am: Use pkgdata instead of data.
18685
ea5607fd
AD
186862000-12-20 Akim Demaille <akim@epita.fr>
18687
18688 * src/files.c (guard_obstack): New.
18689 (open_files): Initialize it.
18690 (output_files): Dump it...
18691 * src/files.h: Export it.
18692 * src/reader.c (copy_guard): Use it.
18693
27110317
AD
186942000-12-19 Akim Demaille <akim@epita.fr>
18695
18696 * src/files.c (outfile, defsfile, actfile): Removed as global
18697 vars.
18698 (open_files): Don't compute them.
18699 (output_files): Adjust.
18700 (base_name, short_base_name): Be global.
18701 Adjust dependencies.
18702
19c50364
AD
187032000-12-19 Akim Demaille <akim@epita.fr>
18704
18705 * src/files.c (strsuffix): New.
18706 (stringappend): Be just like strcat but allocate.
18707 (base_names): Eve out from open_files.
18708 Try to simplify the rather hairy computation of base_name and
18709 short_base_name.
18710 (open_files): Use it.
18711 * tests/suite.at (Checking output file names): New test.
18712
573c1d9f
AD
187132000-12-19 Akim Demaille <akim@epita.fr>
18714
18715 * src/system.h (obstack_grow_literal_string): Rename as...
18716 (obstack_grow_string): this.
18717 * src/output.c (output_parser): Recognize `%% actions' instead of
18718 `$'.
18719 * src/bison.s1: s/$/%% actions/.
18720 * src/bison.hairy: Likewise.
18721
ef7ddedd
AD
187222000-12-19 Akim Demaille <akim@epita.fr>
18723
18724 * src/output.c (output_parser): Compute the `#line' lines when
18725 there are.
18726 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
18727 Suggested by Hans Aberg.
18728
ff61dabd
AD
187292000-12-19 Akim Demaille <akim@epita.fr>
18730
18731 Let the handling of the skeleton files be local to the procedures
18732 that use it.
18733
18734 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
18735 longer static.
18736 (fparser, open_extra_files): Remove.
18737 (open_files, output_files): Don't take care of fparser.
18738 * src/files.h: Adjust.
18739 * src/output.c (output_parser): Open and close the file to the
18740 skeleton.
18741 * src/reader.c (read_declarations): When %semantic_parser, open
18742 fguard.
18743
55b96341
AD
187442000-12-19 Akim Demaille <akim@epita.fr>
18745
18746 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
18747 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
18748
358c15b7
AD
187492000-12-19 Akim Demaille <akim@epita.fr>
18750
18751 * src/files.c (open_files): Yipee! We no longer need all the code
18752 looking for `/tmp' since we have no tmp file.
18753
7de3329e
AD
187542000-12-19 Akim Demaille <akim@epita.fr>
18755
18756 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
18757 New macros.
18758 * src/files.c (open_files): Less dependency on MSDOS etc.
18759
3abcd459
AD
187602000-12-14 Akim Demaille <akim@epita.fr>
18761
18762 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
18763 Provide a default definition.
18764 Use it when executing the default @ action.
18765 * src/reader.c (reader_output_yylsp): No longer include
18766 `timestamp' and `text' in the default YYLTYPE.
18767
2a91a95e
AD
187682000-12-12 Akim Demaille <akim@epita.fr>
18769
18770 * src/reader.c (copy_definition, parse_union_decl, copy_action)
18771 (copy_guard): Quote the file names.
18772 Reported by Laurent Mascherpa.
18773
14d3eb9b
AD
187742000-12-12 Akim Demaille <akim@epita.fr>
18775
18776 * src/output.c (output_headers, output_program, output): Be sure
18777 to escape special characters when outputting filenames.
18778 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
18779 (output_headers): Don't depend on them, Use ACTSTR.
18780
d7045ec6
AD
187812000-11-17 Akim Demaille <akim@epita.fr>
18782
18783 * lib/obstack.h: Formatting changes.
18784 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
18785 prevents type checking.
18786 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
18787 cast the value to (void *): assigning a `foo *' to a `void *'
18788 variable is valid.
18789 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
18790 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
18791 append characters.
18792
6fd54b73
AD
187932000-11-17 Akim Demaille <akim@epita.fr>
18794
18795 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
18796 as...
18797 (suite.m4, regression.m4, calc.m4): these.
18798 * tests/atgeneral.m4: Update from CVS Autoconf.
18799
4c50eae6
AD
188002000-11-17 Akim Demaille <akim@epita.fr>
18801
18802 * tests/regression.m4 (%union and --defines): New test,
18803 demonstrating a current bug in the obstack implementation.
18804
a35f64ea
AD
188052000-11-17 Akim Demaille <akim@epita.fr>
18806
18807 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18808 macros.
18809 Use them to declare the variables which are global or local to
18810 `yyparse'.
18811
7de23534
AD
188122000-11-17 Akim Demaille <akim@epita.fr>
18813
18814 * acconfig.h: Remove, no longer used.
18815
aa7815f5
AD
188162000-11-07 Akim Demaille <akim@epita.fr>
18817
18818 * src: s/Copyright (C)/Copyright/g.
18819
5af1f549
AD
188202000-11-07 Akim Demaille <akim@epita.fr>
18821
18822 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18823 defining.
18824 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18825
553e2b22
AD
188262000-11-07 Akim Demaille <akim@epita.fr>
18827
18828 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18829 Merge in a single CPP if/else.
18830
8a4f41d6
AD
188312000-11-07 Akim Demaille <akim@epita.fr>
18832
18833 * src/output.c (output): Remove useless variables.
18834 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18835 argument `data' for consistency with the prototypes.
18836 Qualify it `const'.
18837 (obstack_copy, obstack_copy0): Rename the second argument as
18838 `address' for consistency. Qualify it `const'.
18839 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18840 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18841 `const' their input argument (`data' or `address').
18842 Adjust the corresponding macros to include `const' in casts.
18843
095a3fb5
AD
188442000-11-03 Akim Demaille <akim@epita.fr>
18845
18846 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18847 s/PFILE1/BISON_HAIRY/.
18848 Adjust dependencies.
18849
d1cdce7c
AD
188502000-11-03 Akim Demaille <akim@epita.fr>
18851
090c5ebf 18852 For some reason, this was not applied.
d1cdce7c
AD
18853
18854 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18855 `unlink': it's no longer used.
18856
9311529b
AD
188572000-11-03 Akim Demaille <akim@epita.fr>
18858
18859 * src/files.c (skeleton_find): New function, eved out of...
18860 (open_files, open_extra_files): here.
18861
d8880f69
AD
188622000-11-03 Akim Demaille <akim@epita.fr>
18863
18864 Don't use `atexit'.
18865
18866 * src/files.c (obstack_save): New function.
18867 (done): Rename as...
18868 (output_files): this.
18869 Use `obstack_save'.
18870 * src/main.c (main): Don't use `atexit' to register `done', since
18871 it no longer has to remove tmp files, just call `output_files'
18872 when there are no errors.
18873
0dbb648e
AD
188742000-11-02 Akim Demaille <akim@epita.fr>
18875
18876 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18877 `unlink': it's no longer used.
18878 * src/files.h: Formatting changes.
18879
896fe5c1
AD
188802000-11-02 Akim Demaille <akim@epita.fr>
18881
18882 Remove the last uses of mktemp and unlink/delete.
18883
18884 * src/files.c (fdefines, ftable): Removed.
18885 (defines_ostack, table_obstack): New.
18886 Adjust dependencies of the former into uses of the latter.
18887 * src/output.c (output_short_or_char_table, output_short_table):
18888 Convert to using obstacks.
18889 * src/reader.c (copy_comment2): Accept one FILE * and two
18890 obstacks.
18891 (output_token_defines, reader_output_yylsp): Use obstacks.
18892 * src/system.h (obstack_fgrow3): New.
1f65350a 18893 * po/POTFILES.in: Adjust.
896fe5c1 18894
dd60faec
AD
188952000-11-01 Akim Demaille <akim@epita.fr>
18896
18897 Change each use of `fattrs' into a use of `attrs_obstack'.
18898
18899 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18900 * src/files.c (fattrs): Remove.
18901 (attrs_obstack): New.
18902 Adjust all dependencies.
18903 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18904
8c7ebe49
AD
189052000-11-01 Akim Demaille <akim@epita.fr>
18906
18907 Introduce obstacks.
18908 Change each use of `faction' into a use of `action_obstack'.
18909
18910 * lib/obstack.h, lib/obstack.c: New files.
18911 * src/files.c (faction): Remove.
18912 (action_obstack): New.
18913 Adjust all dependencies.
18914
77aee789
AD
189152000-10-20 Akim Demaille <akim@epita.fr>
18916
18917 * lib/quote.h (PARAMS): New macro. Use it.
18918
43591cec
AD
189192000-10-16 Akim Demaille <akim@epita.fr>
18920
18921 * src/output.c (output_short_or_char_table): New function.
18922 (output_short_table, output_token_translations): Use it.
18923 (goto_actions): Use output_short_table.
18924
1e9798d5
AD
189252000-10-16 Akim Demaille <akim@epita.fr>
18926
18927 * src/symtab.c (bucket_new): New function.
18928 (getsym): Use it.
18929
18930 * src/output.c (output_short_table): New argument to display the
18931 comment associated with the table.
18932 Adjust dependencies.
18933 (output_gram): Use it.
18934 (output_rule_data): Nicer output layout for YYTNAME.
18935
f282676b
AD
189362000-10-16 Akim Demaille <akim@epita.fr>
18937
18938 * src/lex.c (read_typename): New function.
18939 (lex): Use it.
18940 * src/reader.c (copy_dollar): Likewise.
18941
550a72a3
AD
189422000-10-16 Akim Demaille <akim@epita.fr>
18943
18944 * src/reader.c (copy_comment2): Expect the input stream to be on
18945 the `/' which is suspected to open a comment, instead of being
18946 called after `//' or `/*' was read.
18947 (copy_comment, copy_definition, parse_union_decl, copy_action)
18948 (copy_guard): Adjust.
18949
131e2fef
AD
189502000-10-16 Akim Demaille <akim@epita.fr>
18951
18952 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18953 `read_signed_integer'.
18954
79282c5a
AD
189552000-10-16 Akim Demaille <akim@epita.fr>
18956
18957 * src/reader.c (copy_dollar): New function.
18958 (copy_guard, copy_action): Use it.
18959
ff4a34be
AD
189602000-10-16 Akim Demaille <akim@epita.fr>
18961
18962 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18963 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18964 New files, from Fileutils 4.0.27.
18965 * src/main.c (printable_version): Remove.
18966 * src/lex.c, src/reader.c: Use `quote'.
18967
189682000-10-04 Akim Demaille <akim@epita.fr>
18969
18970 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
18971
14ded682
AD
189722000-10-04 Akim Demaille <akim@epita.fr>
18973
18974 * doc/bison.texinfo: Various typos spotted by Neil Booth.
18975
8e03724b
AD
189762000-10-04 Akim Demaille <akim@epita.fr>
18977
18978 When a literal string is used to define two different tokens,
18979 `bison -v' segfaults.
18980 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
18981
18982 * tests/regression.m4: New file.
18983 Include the core of the sample provided by Piotr Gackiewicz.
18984 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
18985 properly.
18986
a9e64249
AD
189872000-10-04 Akim Demaille <akim@epita.fr>
18988
18989 * src/reader.c (parse_expect_decl): Keep `count' within the size
18990 of `buffer'.
18991 From Neil Booth.
18992
da9abf43
AD
189932000-10-02 Paul Eggert <eggert@twinsun.com>
18994
18995 * bison.s1 (yyparse): Assign the default value
18996 unconditionally, to avoid a GCC warning and make the parser a
18997 tad smaller.
18998
c33638bb
AD
189992000-10-02 Akim Demaille <akim@epita.fr>
19000
19001 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
19002 options.
19003
444c570a
AD
190042000-10-02 Akim Demaille <akim@epita.fr>
19005
19006 * src/derives.c, src/print.c, src/reduce.c: To ease the
19007 translation, move some `\n' out of the translated strings.
19008
89cab50d
AD
190092000-10-02 Akim Demaille <akim@epita.fr>
19010
19011 The location tracking mechanism is precious for parse error
19012 messages. Nevertheless, it is enabled only when `@n' is used in
19013 the grammar, which is a different issue (you can use it in error
19014 message, but not in the grammar per se). Therefore, there should
19015 be another means to enable it.
19016
19017 * src/getargs.c (getargs): Support `--locations'.
19018 (usage): Report it.
19019 * src/getargs.h (locationsflag): Export it.
19020 * src/lex.c (percent_table): Support `%locations'.
19021 * src/reader.c (yylsp_needed): Remove this variable, now replaced
19022 with `locationsflag'.
19023 * doc/bison.texinfo: Document `--locations' and `%locations'.
19024 Sort the options.
19025 * tests/calc.m4: Test it.
19026
19027 For regularity of the names, replace each
19028 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
19029 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
19030 In addition replace each `flag' with `_flag'.
19031
d6c2cba0
AD
190322000-10-02 Akim Demaille <akim@epita.fr>
19033
19034 Also test parse error messages, including with YYERROR_VERBOSE.
19035
19036 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
19037 associative).
19038 Use it to check the computations.
19039 Use it to check `nonassoc' is honored.
19040 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
19041 `--yyerror-verbose'.
19042 (_AT_CHECK_CALC): Adjust to this option.
19043 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
19044
5a35a6cb
AD
190452000-10-02 Akim Demaille <akim@epita.fr>
19046
19047 Test also `--verbose', `--defines' and `--name-prefix'. Testing
19048 the latter demonstrates a flaw in the handling of non debugging
19049 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
19050 was used in order to simplify:
19051
19052 #if YYDEBUG
19053 if (yydebug)
19054 {
19055 ...
19056 }
19057 #endif
19058
19059 into
19060
19061 if (yydebug)
19062 {
19063 ...
19064 }
19065
19066 unfortunately this leads to a CPP conflict when
19067 `--name-prefix=foo' is used since it produces `#define yydebug
19068 foodebug'.
19069
19070 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
19071 (YYDPRINTF): New macro.
19072 Spread its use.
19073 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
19074 the bison options.
19075 Also test `--verbose', `--defines' and `--name-prefix'.
19076
71da9eea
AD
190772000-10-02 Akim Demaille <akim@epita.fr>
19078
19079 Improve the readability of the produced parsers.
19080
19081 * src/bison.s1: Formatting changes.
19082 Improve the comment related to the `$' mark.
19083 (yydefault): Don't fall through to `yyresume': `goto' there.
19084 * src/output.c (output_parser): When the `$' is met, skip the end
19085 of its line.
19086 New variable, `number_of_dollar_signs', to check there's exactly
19087 one `$' in the parser skeleton.
19088
95e36146
AD
190892000-10-02 Akim Demaille <akim@epita.fr>
19090
19091 * lib/xstrdup.c: New file, from the fileutils.
19092 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
19093 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
19094 instead of strlen + xmalloc + strcpy.
19095 * src/symtab.c (copys): Remove, use xstrdup instead.
19096
d7020c20
AD
190972000-10-02 Akim Demaille <akim@epita.fr>
19098
19099 * src/gram.h (associativity): New enum type which replaces the
19100 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
19101 `right_assoc', `left_assoc' and `non_assoc'.
19102 Adjust all dependencies.
19103 * src/reader.c: Formatting changes.
19104 (LTYPESTR): Don't define it, use it as a literal in
19105 `reader_output_yylsp'.
19106 * src/symtab.h (symbol_class): New enum type which replaces the
19107 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
19108 `sunknown', `stoken and `snterm'.
19109
1916f98e
AD
191102000-10-02 Akim Demaille <akim@epita.fr>
19111
19112 * src/getargs.c (fixed_outfiles): Rename as...
19113 (yaccflag): for consistency and accuracy.
19114 Adjust dependencies.
19115
d7913476
AD
191162000-10-02 Akim Demaille <akim@epita.fr>
19117
19118 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
19119 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
19120 difficult and introduced a lot of core dump. It turns out that
19121 Bison used an implementation of `xmalloc' based on `calloc', and
19122 at various places it does depend upon the initialization to 0. I
19123 have not tried to isolate the pertinent places, and all the former
19124 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
19125 someone should address this issue.
19126
19127 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
19128 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
19129 files.
19130 Adjust dependencies.
19131 * src/warshall.h: New file.
19132 Propagate.
19133
340ef489
AD
191342000-10-02 Akim Demaille <akim@epita.fr>
19135
19136 Various anti-`extern in *.c' changes.
19137
19138 * src/system.h: Include `assert.h'.
19139
b2ca4022
AD
191402000-10-02 Akim Demaille <akim@epita.fr>
19141
19142 * src/state.h (nstates, final_state, first_state, first_shift)
19143 (first_reduction): Move their exportation from here...
19144 * src/LR0.h: to here.
19145 Adjust dependencies.
19146 * src/getargs.c (statisticsflag): New variable.
19147 Add support for `--statistics'.
19148 Adjust dependencies.
19149
19150 Remove a lot of now useless `extern' statements in most files.
19151
403b315b
AD
191522000-10-02 Akim Demaille <akim@epita.fr>
19153
19154 * src/LR0.h: New file.
19155 Propagate its use.
19156
07a58c13
AD
191572000-10-02 Akim Demaille <akim@epita.fr>
19158
19159 * src/print.h: New file.
19160 Propagate its use.
19161 * src/print.c: Formatting and ordering changes.
19162 (verbose, terse): Replace with...
19163 (print_results): this new function.
19164 Adjust dependencies.
19165
0619caf0
AD
191662000-10-02 Akim Demaille <akim@epita.fr>
19167
19168 * src/conflicts.c (conflict_report): New function.
19169 (conflict_log, verbose_conflict_log): Replace with...
19170 (print_conflicts): this function.
19171 Adjust dependencies.
19172 * src/conflicts.h: New file.
19173 Propagate its inclusion.
19174
3519ec76
AD
191752000-10-02 Akim Demaille <akim@epita.fr>
19176
19177 * src/nullable.h: New file.
19178 Propagate its inclusion.
19179 * src/nullable.c: Formatting changes.
19180
015acc48
AD
191812000-10-02 Akim Demaille <akim@epita.fr>
19182
19183 * src/reduce.h: New file.
19184 Propagate its inclusion.
19185 * src/reduce.c: Topological sort and other formatting changes.
19186 (bool, TRUE, FALSE): Move their definition to...
19187 * src/system.h: here.
19188
8963a27b
AD
191892000-10-02 Akim Demaille <akim@epita.fr>
19190
19191 * src/files.c: Formatting changes.
19192 (tryopen, tryclose, openfiles): Rename as...
19193 (xfopen, xfclose, open_files): this.
19194 (stringappend): static.
19195 * src/files.h: Complete the list of exported symbols.
19196 Propagate its use.
19197
a70083a3
AD
191982000-10-02 Akim Demaille <akim@epita.fr>
19199
19200 * src/reader.h: New file.
19201 Propagate its use instead of tedious list of `extern' and
19202 prototypes.
19203 * src/reader.c: Formatting changes, topological sort,
19204 s/register//.
19205
abadc117
AD
192062000-10-02 Akim Demaille <akim@epita.fr>
19207
19208 * src/lex.h: Prototype `lex.c' exported functions.
19209 * src/reader.c: Adjust.
19210 * src/lex.c: Formatting changes.
19211 (safegetc): Rename as...
19212 (xgetc): this.
19213
720d742f
AD
192142000-10-02 Akim Demaille <akim@epita.fr>
19215
19216 * src/lalr.h: New file.
19217 Propagate its inclusion instead of prototypes and `extern'.
19218 * src/lalr.c: Formatting changes, topological sorting etc.
19219
f2acea59
AD
192202000-10-02 Akim Demaille <akim@epita.fr>
19221
19222 * src/output.c (token_actions): Introduce a temporary array,
19223 YYDEFACT, that makes it possible for this function to use
19224 output_short_table.
19225
d019d655
AD
192262000-10-02 Akim Demaille <akim@epita.fr>
19227
19228 `user_toknums' is output as a `short[]' in `output.c', while it is
19229 defined as a `int[]' in `reader.c'. For consistency with the
19230 other output tables, `user_toknums' is now defined as a table of
19231 shorts.
19232
19233 * src/reader.c (user_toknums): Be a short table instead of an int
19234 table.
19235 Adjust dependencies.
19236
19237 Factor the short table outputs.
19238
19239 * src/output.c (output_short_table): New function.
19240 * src/output.c (output_gram, output_stos, output_rule_data)
19241 (output_base, output_table, output_check): Use it.
19242
6c89f1c1
AD
192432000-10-02 Akim Demaille <akim@epita.fr>
19244
19245 * src/output.c (output): Topological sort of the functions, in
19246 order to get rid of the `static' prototypes.
19247 No longer use `register'.
19248 * src/output.h: New file.
19249 Propagate its inclusion in files explicitly prototyping functions
19250 from output.c.
19251
d9efd181
AD
192522000-09-21 Akim Demaille <akim@epita.fr>
19253
19254 * src/atgeneral.m4: Update from Autoconf.
19255
c29240e7 192562000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
19257
19258 * src/closure.h: New file.
19259 * src/closure.c: Formatting changes, topological sort over the
19260 functions, use of closure.h.
19261 (initialize_closure, finalize_closure): Rename as...
19262 (new_closure, free_closure): these. Adjust dependencies.
19263 * src/LR0.c: Formatting changes, topological sort, use of
19264 cloture.h.
19265 (initialize_states): Rename as...
19266 (new_states): this.
19267 * src/Makefile.am (noinst_HEADERS): Adjust.
19268
499daa50
AD
192692000-09-20 Akim Demaille <akim@epita.fr>
19270
19271 * src/acconfig.h: Don't protect config.h against multiple
19272 inclusion.
19273 Don't define PARAMS.
19274 * src/system.h: Define PARAMS.
19275 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
19276 purpose of config.h. system.h must not try to fix wrong
19277 definitions in config.h.
19278
cc84fd5d
AD
192792000-09-20 Akim Demaille <akim@epita.fr>
19280
19281 * src/derives.h: New file.
19282 * src/main.c, src/derives.h: Use it.
19283 Formatting changes.
19284 * src/Makefile.am (noinst_HEADERS): Adjust.
19285
db5b3a89
AD
192862000-09-20 Akim Demaille <akim@epita.fr>
19287
19288 * tests/atgeneral.m4: Update from Autoconf.
19289 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
19290 (AT_CHECK_CALC): New macros.
19291 Use these macros to test bison with options `', `--raw',
19292 `--debug', `--yacc', `--yacc --debug'.
19293
ceed8467
AD
192942000-09-19 Akim Demaille <akim@epita.fr>
19295
19296 * src/output.c: Formatting changes.
19297 * src/machine.h: Remove, leaving its contents in...
19298 * src/system.h: here.
19299 Include stdio.h.
19300 Adjust all dependencies on stdio.h and machine.h.
19301 * src/getargs.h: New file.
19302 Let all `extern' declarations about getargs.c be replaced with
19303 inclusion of `getargs.h'.
19304 * src/Makefile.am (noinst_HEADERS): Adjust.
19305
19306 * tests/calc.m4 (yyin): Be initialized in main, not on the global
19307 scope.
19308 (yyerror): Returns void, not int.
19309 * doc/bison.texinfo: Formatting changes.
19310
05a1d24b
AD
193112000-09-19 Akim Demaille <akim@epita.fr>
19312
19313 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
19314 portable.
19315
cbd25751
AD
193162000-09-18 Akim Demaille <akim@epita.fr>
19317
19318 * configure.in: Append WARNING_CFLAGS to CFLAGS.
19319 * src/Makefile.am (INCLUDES): Don't.
19320 Be ready to fetch headers in lib/.
19321
13863333
AD
193222000-09-18 Akim Demaille <akim@epita.fr>
19323
19324 * doc/bison.texinfo: Update the copyright.
19325 ANSIfy and GNUify the examples.
19326 Remove the old menu.
19327
0d533154
AD
193282000-09-18 Akim Demaille <akim@epita.fr>
19329
19330 First set of tests: use the `calc' example from the documentation.
19331
19332 * src/bison.s1 (yyparse): Condition the code using `yytname' which
19333 is defined only when YYDEBUG is.
19334 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
19335 * src/files.c (tryopen, tryclose): Formatting changes.
19336 Move to the top and be static.
19337 * src/reader.c (read_signed_integer): Likewise.
19338 * tests/calc.m4: New file.
19339 * Makefile.am, suite.m4: Adjust.
19340 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
19341
e79137ac
AD
193422000-09-18 Akim Demaille <akim@epita.fr>
19343
19344 Add support for an Autotest test suite for Bison.
19345
19346 * m4/m4.m4, m4/atconfig.m4: New files.
19347 * m4/Makefile.am (EXTRA_DIST): Adjust.
19348 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
19349 files.
19350 * src/getargs.c: Display a more standard --version message.
19351 * src/reader.c (reader): Formatting changes.
19352 No longer depend upon VERSION_STRING.
19353 * configure.in: No longer use `dnl'.
19354 Set up the test suite and the new directory `tests/.
19355 (VERSION_STRING): Remove.
19356
27821bff
AD
193572000-04-14 Akim Demaille <akim@epita.fr>
19358
19359 * src/reader.c (copy_comment2): New function, same as former
19360 `copy_comment', but outputs into two FILE *.
19361 (copy_comment): Use it.
19362 (parse_union_decl): Use it.
19363 (get_type, parse_start_decl): Use the same `invalid' message.
19364 (parse_start_decl, parse_union_decl): Use the same `multiple'
19365 message.
19366 (parse_union_decl, copy_guard, copy_action): Use the same
19367 `unmatched' message.
19368 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
19369
cfe5fbc0
AD
193702000-03-31 Akim Demaille <akim@epita.fr>
19371
19372 * src/files.c (tryopen, tryclose): Move to the top.
19373 Be static.
19374
cb7db13e
AD
193752000-03-31 Akim Demaille <akim@epita.fr>
19376
19377 * src/main.c (main): Don't call `done', exit does it.
19378
a0f6b076
AD
193792000-03-31 Akim Demaille <akim@epita.fr>
19380
36281465
AD
19381 * allocate.c: s/return (foo)/return foo/.
19382 * lalr.c: Likewise.
19383 * LR0.c: Likewise.
19384 * output.c: Likewise.
19385 * reader.c: Likewise.
19386 * symtab.c: Likewise.
19387 * vmsgetargs.c: Likewise.
19388
193892000-03-31 Akim Demaille <akim@epita.fr>
19390
19391 Clean up the error reporting functions.
a0f6b076
AD
19392
19393 * src/report.c: New file.
19394 * src/report.h: Likewise.
19395 * src/Makefile.am: Adjust.
19396 * m4/error.m4: New file.
19397 * m4/Makefile.am: Adjust.
19398 * configure.in (jm_PREREQ_ERROR): Call it.
19399 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
19400 Remove.
19401 (fatal, fatals): Remove. All callers use complain.c::fatal.
19402 (warn, warni, warns, warnss, warnss): Remove. All callers use
19403 complain.c::complain.
19404 (toomany): Remove, use fatal instead.
19405 * src/files.c (done): No argument, use complain_message_count.
19406 * src/main.c (main): Register `done' to `atexit'.
19407
19408 * src/getargs.c (usage): More `fputs', less `fprintf'.
19409
18539825
AD
194102000-03-28 Akim Demaille <akim@epita.fr>
19411
19412 * lib/: New directory.
19413 * Makefile.am (SUBDIRS): Adjust.
19414 * configure.in: Adjust.
19415 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
19416 useless.
19417 * src/alloca.c: Moved to lib/.
19418 * src/getopt.c: Likewise.
19419 * src/getopt1.c: Likewise.
19420 * src/getopt.h: Likewise.
19421 * src/ansi2knr.c: Likewise.
19422 * src/ansi2knr.1: Likewise.
19423 * src/Makefile.am: Adjust.
19424 * lib/Makefile.am: New file.
19425
9f306f2a
AD
194262000-03-28 Akim Demaille <akim@epita.fr>
19427
19428 * src/getargs.c (usage): Refresh the help message.
19429
0ba347b6
AD
194302000-03-17 Akim Demaille <akim@epita.fr>
19431
19432 * src/getopt1.c: Updated from textutils 2.0e
19433 * src/getopt.c: Likewise.
19434 * src/getopt.h: Likewise.
19435
dbe7f271
AD
194362000-03-17 Akim Demaille <akim@epita.fr>
19437
19438 * src/Makefile.am (bison.simple): Fix the awk program: quote only
19439 the file name, not the whole `#line LINE FILE'.
19440
75bbe78d
AD
194412000-03-17 Akim Demaille <akim@epita.fr>
19442
19443 On syntax errors, report the token on which we choked.
19444
aa5fd0ee
AD
19445 * src/bison.s1 (yyparse): In the label yyerrlab, when
19446 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 19447
7b306f52
AD
194482000-03-17 Akim Demaille <akim@epita.fr>
19449
aa5fd0ee 19450 * src/reader.c (copy_at): New function.
7b306f52
AD
19451 (copy_guard): Use it.
19452 (copy_action): Use it.
19453
e87b5700
AD
194542000-03-17 Akim Demaille <akim@epita.fr>
19455
19456 Be kind to translators, save some useless translations.
19457
aa5fd0ee 19458 * src/main.c (banner): New function.
e87b5700
AD
19459 (fatal_banner): Use it.
19460 (warn_banner): Use it.
19461
ae3c3164
AD
194622000-03-17 Akim Demaille <akim@epita.fr>
19463
aa5fd0ee
AD
19464 * src/reader.c (copy_definition): Use copy_string and
19465 copy_comment. Removed now unused `match', `ended',
19466 `cplus_comment'.
ae3c3164
AD
19467 (copy_comment, copy_string): Moved, to be visible from
19468 copy_definition.
19469
4dc58e7c
AD
194702000-03-17 Akim Demaille <akim@epita.fr>
19471
aa5fd0ee
AD
19472 * src/reader.c (copy_string): Declare `static inline'. No
19473 problems with inline, since it is checked by configure.
4dc58e7c
AD
19474 (copy_comment): Likewise.
19475
0a6384c4
AD
194762000-03-17 Akim Demaille <akim@epita.fr>
19477
aa5fd0ee 19478 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 19479
3cef001a
AD
194802000-03-17 Akim Demaille <akim@epita.fr>
19481
aa5fd0ee 19482 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
19483 (copy_action): Use it. Removed now unused `match', `ended',
19484 `cplus_comment'.
19485 (copy_guard): Likewise.
19486
ca36d2ef
AD
194872000-03-17 Akim Demaille <akim@epita.fr>
19488
aa5fd0ee 19489 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
19490 (copy_action): Use it.
19491 (copy_guard): Likewise.
19492
6666f98f
AD
194932000-03-17 Akim Demaille <akim@epita.fr>
19494
19495 Change the handling of @s so that they behave exactly like $s.
19496 There is now a pseudo variable @$ (readble and writable), location
19497 of the lhs of the rule (by default ranging from the location of
19498 the first symbol of the rhs, to the location of the last symbol,
19499 or, if the rhs is empty, YYLLOC).
19500
19501 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
19502 yyval.
19503 (yyparse): When providing a default semantic action, provide a
19504 default location action.
19505 (after the $): No longer change `*YYLSP', just stack YYLOC the
19506 same way you stack YYVAL.
19507 * src/reader.c (read_declarations): Use warns.
19508 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
19509 (copy_action, case '@'): Likewise.
19510 Use a standard error message, to save useless work from
19511 translators.
19512
41aca2e0
AD
195132000-03-17 Akim Demaille <akim@epita.fr>
19514
aa5fd0ee
AD
19515 * src/bison.s1: Formatting and cosmetics changes.
19516 * src/reader.c: Likewise.
41aca2e0
AD
19517 Update the Copyright notice.
19518
dc08c1d5
AD
195192000-03-17 Akim Demaille <akim@epita.fr>
19520
aa5fd0ee
AD
19521 * src/bison.s1 (#line): All set to `#line' only, since the
19522 Makefile now handles them.
dc08c1d5 19523
9ee3c97b
AD
195242000-03-16 Akim Demaille <akim@epita.fr>
19525
19526 * src/output.c (output_rule_data): Output the documentation of
19527 some of the tables.
19528 (Copyright notice): Update.
19529 Formatting changes.
19530
0de741ca
AD
195312000-03-16 Akim Demaille <akim@epita.fr>
19532
19533 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
19534 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
19535 One `#if YYDEBUG' remains, since it uses variables which are
19536 defined only if `YYDEBUG != 0'.
19537
bb10be54
AD
195382000-03-16 Akim Demaille <akim@epita.fr>
19539
19540 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
19541 and related variables so that the similarities are highlighted.
19542
b07b484a
AD
195432000-03-16 Akim Demaille <akim@epita.fr>
19544
19545 * src/bison.s1: Properly indent CPP directives.
19546
361f60b3
AD
195472000-03-16 Akim Demaille <akim@epita.fr>
19548
19549 * src/bison.s1: Properly indent the `alloca' CPP section.
19550
8c44d3ec
AD
195512000-03-16 Akim Demaille <akim@epita.fr>
19552
19553 Do not hard code values of directories in `configure.in'.
19554 Update the `configure' tool chain.
19555
19556 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
19557 src/makefile.am.
19558 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
19559 (AC_OUTPUT): Add m4/Makefile.
19560 Bump to bison 1.28a, 1.29 has never been released.
19561 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
19562 handled via src/Makefile.am.
19563 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
19564 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
19565 autoheader.
19566 * Makefile.am (SUBDIRS): Add m4.
19567 (ACLOCAL_AM_FLAGS): New variable.
19568 (AUTOMAKE_OPTIONS): Add check-news.
19569 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
19570 the proper line number and file name.
19571 (DEFS): Propagate the location of bison library files and of the
19572 locale files.
19573 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
19574 builddir.
19575 * acinclude.m4: Remove, replaced by the directory m4.
19576 * m4/Makefile.am (EXTRA_DIST): New variable.
19577 * m4/gettext.m4: New file, from the fileutils.
19578 * m4/lcmessage.m4: Likewise
19579 * m4/progtest.m4: Likewise.
19580 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
19581
f95997e7
AD
195822000-03-10 Akim Demaille <akim@epita.fr>
19583
19584 * src/closure.c:
19585 Formatting changes of various comments.
19586 Respect the GNU coding standards at various places.
19587 Don't use `_()' when no translation is needed.
19588
195891999-12-13 Jesse Thilo <jthilo@gnu.org>
19590
19591 * src/files.c:
19592 OS/2 honors TMPDIR environment variable.
19593
195941999-12-13 Jesse Thilo <jthilo@gnu.org>
19595
19596 * doc/bison.texinfo: Tweaked spelling and grammar.
19597 Updated ISBN.
19598 Removed reference to price of printed copy.
19599 Mention BISON_SIMPLE and BISON_HAIRY.
19600
196011999-12-13 Jesse Thilo <jthilo@gnu.org>
19602
19603 * configure.in, NEWS:
19604 Bison 1.29 released.
19605
196061999-10-27 Jesse Thilo <jthilo@gnu.org>
19607
19608 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
19609 Added reference card.
19610
196111999-07-26 Jesse Thilo <jthilo@gnu.org>
19612
19613 * po/ru.po: Added Russian translation.
19614
196151999-07-26 Jesse Thilo <jthilo@gnu.org>
19616
19617 * configure.in: Added Russian translation.
19618
196191999-07-06 Jesse Thilo <jthilo@gnu.org>
19620
19621 * configure.in, NEWS, README:
19622 Released version 1.28.
19623
196241999-06-14 Jesse Thilo <jthilo@gnu.org>
19625
19626 * src/system.h:
19627 Squashed redefinition warning on some systems.
19628
19629 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
19630 Have configure build version string instead of relying on ANSI string
19631 concatentation.
19632
196331999-06-14 Jesse Thilo <jthilo@gnu.org>
19634
19635 * po/POTFILES.in: Got rid of version.c.
19636
196371999-06-14 Jesse Thilo <jthilo@gnu.org>
19638
19639 * acconfig.h, configure.in:
19640 Have configure build version string instead of relying on ANSI string
19641 concatentation.
19642
196431999-06-08 Jesse Thilo <jthilo@gnu.org>
19644
19645 * doc/bison.1:
19646 Dropped mention of `+' for long-named options.
19647
196481999-05-30 Jesse Thilo <jthilo@gnu.org>
19649
19650 * src/files.c: Added <unistd.h> for unlink().
19651
19652 * src/Makefile.am, src/system.h:
19653 I18n fixes.
19654
196551999-05-30 Jesse Thilo <jthilo@gnu.org>
19656
19657 * README: Added a FAQ list.
19658
19659 * configure.in, acconfig.h:
19660 I18n fixes.
19661
196621999-05-30 Jesse Thilo <jthilo@gnu.org>
19663
19664 * doc/FAQ, doc/Makefile.am:
19665 Added a FAQ list.
19666
196671999-05-19 Jesse Thilo <jthilo@gnu.org>
19668
19669 * src/alloc.h, src/symtab.h, src/version.c:
19670 Protected inclusion of "config.h" with HAVE_CONFIG_H.
19671
196721999-04-18 Jesse Thilo <jthilo@gnu.org>
19673
19674 * src/.cvsignore, src/Makefile.am:
19675 Reorganized: sources in `src', documentation in `doc'.
19676
19677 * src/lex.c (literalchar):
19678 fixed the code for escaping double quotes (thanks
19679 Jonathan Czisny.)
19680
196811999-04-18 Jesse Thilo <jthilo@gnu.org>
19682
19683 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
19684 Adjusted paths to reflect directory reorganization.
19685
196861999-04-18 Jesse Thilo <jthilo@gnu.org>
19687
19688 * doc/.cvsignore, doc/Makefile.am:
19689 Reorganized: sources in `src', documentation in `doc'.
19690
196911999-04-18 Jesse Thilo <jthilo@gnu.org>
19692
19693 * configure.in:
19694 Updated AC_INIT file to reflect directory reorganization.
19695
19696 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
19697 Reorganized: sources in `src', documentation in `doc'.
19698
196991999-04-13 Jesse Thilo <jthilo@gnu.org>
19700
19701 * src/allocate.c:
19702 Don't declare calloc() and realloc() if not necessary.
19703
197041999-04-13 Jesse Thilo <jthilo@gnu.org>
19705
19706 * configure.in, acconfig.h, acinclude.m4:
19707 Don't declare calloc() and realloc() if not necessary.
19708
197091999-03-23 Jesse Thilo <jthilo@gnu.org>
19710
19711 * po/.cvsignore: Added i18n support.
19712
197131999-03-23 Jesse Thilo <jthilo@gnu.org>
19714
19715 * acconfig.h, configure.in, Makefile.am:
19716 Added i18n support.
19717
197181999-03-22 Jesse Thilo <jthilo@gnu.org>
19719
19720 * src/bison.s1: Fixed #line numbers.
19721
197221999-03-15 Jesse Thilo <jthilo@gnu.org>
19723
19724 * po/es.po, po/fr.po, po/nl.po, po/de.po:
19725 Added PO files from Translation Project.
19726
197271999-03-03 Jesse Thilo <jthilo@gnu.org>
19728
19729 * Makefile.am:
19730 Added support for non-ANSI compilers (ansi2knr).
19731
197321999-02-16 Jesse Thilo <jthilo@gnu.org>
19733
19734 * configure.in: Bumped version number to 1.27.
19735
19736 * Makefile.am:
19737 Added `bison.simple' to list of files removed by `make distclean'.
19738
197391999-02-12 Jesse Thilo <jthilo@gnu.org>
19740
19741 * src/files.c, src/files.h:
19742 Defined locations of parser files in config.h instead of Makefile.
19743
197441999-02-12 Jesse Thilo <jthilo@gnu.org>
19745
19746 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
19747 Defined locations of parser files in config.h instead of Makefile.
19748
197491999-02-09 Jesse Thilo <jthilo@gnu.org>
19750
19751 * Makefile.am:
19752 Removed inappropriate use of $< macro.
19753
197541999-02-05 Jesse Thilo <jthilo@gnu.org>
19755
19756 * po/Makefile.in.in, po/POTFILES.in:
19757 Add `po' directory skeleton.
19758
197591999-01-27 Jesse Thilo <jthilo@gnu.org>
19760
19761 * README: Document help-bison list.
19762
19763 * configure.in: Add check for mkstemp().
19764
197651999-01-20 Jesse Thilo <jthilo@gnu.org>
19766
19767 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
19768 Hush a few compiler warnings.
19769
19770 * src/files.c:
19771 Add tryclose(), which verifies that fclose was successful.
19772 Hush a couple of compiler warnings.
19773
197741999-01-20 Jesse Thilo <jthilo@gnu.org>
19775
19776 * Makefile.am, OChangeLog:
19777 ChangeLog is now automatically generated. Include the old version as
19778 OChangeLog.
19779
197801999-01-14 Jesse Thilo <jthilo@gnu.org>
19781
19782 * 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:
19783 Update FSF address.
19784
197851999-01-14 Jesse Thilo <jthilo@gnu.org>
19786
19787 * doc/bison.texinfo: Fix formatting glitch.
19788
19789 * doc/bison.texinfo: Update FSF address.
19790
197911999-01-14 Jesse Thilo <jthilo@gnu.org>
19792
19793 * acconfig.h: Update FSF address.
19794
197951999-01-08 Jesse Thilo <jthilo@gnu.org>
19796
19797 * src/system.h:
19798 Don't define PACKAGE here, since config.h defines it.
19799
198001998-12-30 Jesse Thilo <jthilo@gnu.org>
19801
19802 * src/reader.c: Update copyright date.
19803
19804 * src/main.c:
19805 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19806 favor of output directly to stderr (avoids buffer overruns).
19807
19808 * src/reader.c: Some checks for premature EOF.
19809
19810 * 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:
19811 Use prototypes if the compiler understands them.
19812
19813 * src/files.c: Honor TMPDIR on Unix hosts.
19814 Use prototypes if the compiler understands them.
19815
19816 * src/reader.c:
19817 Fix a couple of buffer overrun bugs.
19818 Use prototypes if the compiler understands them.
19819
19820 * src/system.h: Include unistd.h and ctype.h.
19821 Use #ifdef instead of #if for NLS symbols.
19822
198231998-12-30 Jesse Thilo <jthilo@gnu.org>
19824
19825 * doc/bison.texinfo:
19826 Delete comment "consider using @set for edition number, etc..." since
19827 we now are doing so.
19828
198291998-12-30 Jesse Thilo <jthilo@gnu.org>
19830
19831 * configure.in:
19832 Use prototypes if the compiler understands them.
19833
19834 * NEWS: Document 1.26 highlights.
19835
19836 * Makefile.am: Require Automake 1.3 or later.
19837
19838 * acconfig.h:
19839 Use prototypes if the compiler understands them.
19840
198411998-12-29 Jesse Thilo <jthilo@gnu.org>
19842
19843 * src/version.c:
19844 Use VERSION symbol from automake for version number.
19845
198461998-12-29 Jesse Thilo <jthilo@gnu.org>
19847
19848 * acconfig.h, configure.in, version.cin:
19849 Use VERSION symbol from automake for version number.
19850
198511998-11-28 Jesse Thilo <jthilo@gnu.org>
19852
19853 * Makefile.am:
19854 Distribute original version of simple parser (bison.s1), not built
19855 version (bison.simple).
19856
198571998-11-28 Jesse Thilo <jthilo@gnu.org>
19858
19859 * doc/bison.texinfo: Add info dir entry.
19860
19861 * doc/bison.texinfo:
19862 Let automake put version number into documentation.
19863
198641998-11-26 Jesse Thilo <jthilo@gnu.org>
19865
19866 * src/bison.cld, src/build.com, src/vmshlp.mar:
19867 Add non-RCS files from /gd/gnu/bison.
19868
198691998-11-26 Jesse Thilo <jthilo@gnu.org>
19870
19871 * doc/bison.1:
19872 Document the BISON_HAIRY and BISON_SIMPLE variables.
19873
198741998-11-25 Jesse Thilo <jthilo@gnu.org>
19875
19876 * src/version.c: Build version.c automatically.
19877
19878 * src/reader.c:
19879 Fix token numbering (used to start at 258, not 257).
19880
19881 * src/system.h: Include config.h.
19882
19883 * src/getargs.c: Update bug report address.
19884
19885 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19886 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19887
198881998-11-25 Jesse Thilo <jthilo@gnu.org>
19889
19890 * Makefile.am:
19891 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19892
19893 * configure.in, version.cin:
19894 Build version.c automatically.
19895
19896 * AUTHORS: Add AUTHORS file.
19897
19898 * README: Update bug report address.
19899
19900 * bison.simple:
19901 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19902
19903 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19904 Add automake stuff.
19905
199061998-11-25 Jesse Thilo <jthilo@gnu.org>
19907
19908 * doc/bison.texinfo: Clean up some formatting.
19909
199101998-05-05 Richard Stallman <rms@gnu.org>
19911
19912 * doc/bison.texinfo:
19913 Explain better why to make a pure parser.
19914
199151998-01-05 Richard Stallman <rms@gnu.org>
19916
19917 * src/files.c (openfiles):
19918 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19919 find a temporary directory, if possible. Do not unlink files while
19920 they are open.
19921
199221997-08-25 Richard Stallman <rms@gnu.org>
19923
19924 * src/reader.c (stack_offset;):
19925 Change some warni to warns.
19926
19927 * src/lex.c (literalchar): Use warns, not warni.
19928
199291997-06-28 Richard Stallman <rms@gnu.org>
19930
19931 * src/bison.s1: Add a Bison version comment.
19932
19933 * src/main.c (fatal, warn, berror):
19934 Use program_name.
19935
199361997-06-28 Richard Stallman <rms@gnu.org>
19937
19938 * Makefile.in (bison_version): New variable.
19939 (dist): Use that variable.
19940 (bison.s1): Substitute the Bison version into bison.simple.
19941
19942 * bison.simple: Add a Bison version comment.
19943
199441997-06-18 Richard Stallman <rms@gnu.org>
19945
19946 * src/main.c (fatal, warn, berror):
19947 Make error messages standard.
19948 (toomany): Improve error message text.
19949
19950 * 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:
19951 new.h renamed to alloc.h.
19952
199531997-06-18 Richard Stallman <rms@gnu.org>
19954
19955 * Makefile.in: new.h renamed to alloc.h.
19956
199571997-05-24 Richard Stallman <rms@gnu.org>
19958
19959 * src/lex.c (literalchar):
19960 Fix the code for escaping \, " and '.
19961
19962 (lex): Avoid trouble when there are many chars
19963 to discard in a char literal with just several chars in it.
19964
199651997-05-17 Richard Stallman <rms@gnu.org>
19966
19967 * src/bison.s1:
19968 Use malloc, if using alloca is troublesome.
19969 (YYSTACK_USE_ALLOCA): New flag macro.
19970 Define it for some systems and compilers.
19971 (YYSTACK_ALLOC): New macro.
19972 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19973 If it was malloc'd, free it.
19974
199751997-05-17 Richard Stallman <rms@gnu.org>
19976
19977 * bison.simple:
19978 Use malloc, if using alloca is troublesome.
19979 (YYSTACK_USE_ALLOCA): New flag macro.
19980 Define it for some systems and compilers.
19981 (YYSTACK_ALLOC): New macro.
19982 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19983 If it was malloc'd, free it.
19984
199851997-04-23 Richard Stallman <rms@gnu.org>
19986
19987 * src/bison.s1:
19988 (alloca) [__hpux]: Always define as __builtin_alloca.
19989
199901997-04-23 Richard Stallman <rms@gnu.org>
19991
19992 * bison.simple:
19993 (alloca) [__hpux]: Always define as __builtin_alloca.
19994
199951997-04-22 Richard Stallman <rms@gnu.org>
19996
19997 * src/bison.s1:
19998 [__hpux]: Include alloca.h (right for HPUX 10)
19999 instead of declaring alloca (right for HPUX 9).
20000
20001 * src/bison.s1 (__yy_memcpy):
20002 Declare arg `count' as unsigned int.
20003 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
20004
200051997-04-22 Richard Stallman <rms@gnu.org>
20006
20007 * bison.simple:
20008 [__hpux]: Include alloca.h (right for HPUX 10)
20009 instead of declaring alloca (right for HPUX 9).
20010
20011 * bison.simple (__yy_memcpy):
20012 Declare arg `count' as unsigned int.
20013 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
20014
200151997-01-03 Richard Stallman <rms@gnu.org>
20016
20017 * src/allocate.c: [__STDC__ or _MSC_VER]:
20018 Declare calloc and realloc to return void *.
20019
200201997-01-02 Richard Stallman <rms@gnu.org>
20021
20022 * src/system.h:
20023 [_MSC_VER]: Include stdlib.h and process.h.
20024 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
20025
20026 * src/main.c (main): Return FAILURE as a value.
20027 (printable_version): Declare arg as int, not char.
20028
200291997-01-02 Richard Stallman <rms@gnu.org>
20030
20031 * Makefile.in (dist):
20032 Explicitly check for symlinks, and copy them.
20033
200341996-12-19 Richard Stallman <rms@gnu.org>
20035
20036 * src/files.c:
20037 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
20038
200391996-12-18 Paul Eggert <eggert@gnu.org>
20040
20041 * src/bison.s1 (yyparse):
20042 If __GNUC__ and YYPARSE_PARAM are both defined,
20043 declare yyparse to have a void * argument.
20044
200451996-12-18 Paul Eggert <eggert@gnu.org>
20046
20047 * bison.simple (yyparse):
20048 If __GNUC__ and YYPARSE_PARAM are both defined,
20049 declare yyparse to have a void * argument.
20050
200511996-12-17 Richard Stallman <rms@gnu.org>
20052
20053 * src/reduce.c (nbits): Add some casts.
20054
200551996-08-12 Richard Stallman <rms@gnu.org>
20056
20057 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
20058
200591996-08-12 Richard Stallman <rms@gnu.org>
20060
20061 * bison.simple: Test _MSDOS as well as _MSDOS_.
20062
200631996-07-31 Richard Stallman <rms@gnu.org>
20064
20065 * src/bison.s1:
20066 [__sun && __i386]: Include alloca.h.
20067
200681996-07-31 Richard Stallman <rms@gnu.org>
20069
20070 * bison.simple:
20071 [__sun && __i386]: Include alloca.h.
20072
200731996-07-30 Richard Stallman <rms@gnu.org>
20074
20075 * src/bison.s1: Comment change.
20076
20077 * src/bison.s1: Test _MSDOS_, not MSDOS.
20078
200791996-07-30 Richard Stallman <rms@gnu.org>
20080
20081 * bison.simple: Comment change.
20082
20083 * bison.simple: Test _MSDOS_, not MSDOS.
20084
200851996-06-01 Richard Stallman <rms@gnu.org>
20086
20087 * 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:
20088 Insert `_' macro around many string constants.
20089
20090 * src/main.c:
20091 Insert `_' macro around many string constants.
20092
20093 (main): Call setlocale, bindtextdomain and textdomain.
20094
20095 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
20096 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
20097 [ENABLE_NLS]: Include libintl.h.
20098 [ENABLE_NLS] (gettext): Define.
20099 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
20100 (N_, PACKAGE, LOCALEDIR): New macros.
20101
201021996-06-01 Richard Stallman <rms@gnu.org>
20103
20104 * POTFILES.in: New file.
20105
20106 * Makefile.in (allocate.o):
20107 Define target explicitly.
20108
20109 * Makefile.in (CFLAGS): Set to @CFLAGS@.
20110 (LDFLAGS): Set to @LDFLAGS@.
20111 (configure): Run autoconf only if preceding `cd' succeeds.
20112 (bison.s1): Redirect output to temporary file then move the
20113 temporary to the target, rather than redirecting directly to bison.s1.
20114 (clean): Remove config.status and config.log.
20115 (distclean): Don't remove config.status here.
20116
201171996-05-12 Richard Stallman <rms@gnu.org>
20118
20119 * src/bison.s1:
20120 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20121
201221996-05-12 Richard Stallman <rms@gnu.org>
20123
20124 * bison.simple:
20125 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20126
201271996-05-11 Richard Stallman <rms@gnu.org>
20128
20129 * src/bison.s1 (__yy_memcpy):
20130 Really reorder the args, as was supposedly done on Feb 14 1995.
20131 (yyparse): Calls changed accordingly.
20132
201331996-05-11 Richard Stallman <rms@gnu.org>
20134
20135 * Makefile.in (dist): Don't use $(srcdir).
20136
20137 * bison.simple (__yy_memcpy):
20138 Really reorder the args, as was supposedly done on Feb 14 1995.
20139 (yyparse): Calls changed accordingly.
20140
201411996-01-27 Richard Stallman <rms@gnu.org>
20142
20143 * src/output.c (output_rule_data):
20144 Test YYERROR_VERBOSE in the conditional
20145 around the definition of ttyname.
20146
201471995-12-29 Richard Stallman <rms@gnu.org>
20148
20149 * src/bison.s1:
20150 Fix line numbers in #line commands.
20151
201521995-12-29 Richard Stallman <rms@gnu.org>
20153
20154 * bison.simple:
20155 Fix line numbers in #line commands.
20156
201571995-12-27 Richard Stallman <rms@gnu.org>
20158
20159 * src/bison.s1 (YYPARSE_PARAM_DECL):
20160 In C++, make it always null.
20161 (YYPARSE_PARAM_ARG): New macro.
20162 (yyparse): Use YYPARSE_PARAM_ARG.
20163
201641995-12-27 Richard Stallman <rms@gnu.org>
20165
20166 * bison.simple (YYPARSE_PARAM_DECL):
20167 In C++, make it always null.
20168 (YYPARSE_PARAM_ARG): New macro.
20169 (yyparse): Use YYPARSE_PARAM_ARG.
20170
201711995-11-29 Richard Stallman <rms@gnu.org>
20172
20173 * doc/bison.texinfo:
20174 Describe literal string tokens, %raw, %no_lines, %token_table.
20175
201761995-11-29 Daniel Hagerty <hag@gnu.org>
20177
20178 * doc/bison.texinfo: Fixed update date
20179
201801995-10-16 Richard Stallman <rms@gnu.org>
20181
20182 * src/version.c: Version 1.25.
20183
201841995-10-16 Richard Stallman <rms@gnu.org>
20185
20186 * NEWS: *** empty log message ***
20187
201881995-10-16 Richard Stallman <rms@gnu.org>
20189
20190 * doc/bison.1, doc/bison.rnh:
20191 Add new options.
20192
201931995-10-15 Richard Stallman <rms@gnu.org>
20194
20195 * src/vmsgetargs.c, src/getargs.c:
20196 Added -n, -k, and -raw switches.
20197 (noparserflag, toknumflag, rawtoknumflag): New variables.
20198
20199 * src/symtab.h (SALIAS):
20200 New #define for adding aliases to %token.
20201 (struct bucket): Added `alias' field.
20202
20203 * src/reduce.c (reduce_grammar):
20204 Revise error message.
20205 (print_notices): Remove final `.' from error message.
20206
20207 * src/reader.c (reader_output_yylsp):
20208 New function.
20209 (readgram): Use `#if 0' around code that accepted %command
20210 inside grammar rules: The documentation doesn't allow it,
20211 and it will fail since the %command processors scan for the next %.
20212 (parse_token_decl): Extended the %token
20213 declaration to allow a multi-character symbol as an alias.
20214 (parse_thong_decl): New function.
20215 (read_declarations): Added %thong declarations.
20216 (read_declarations): Handle NOOP to deal with allowing
20217 % declarations as another means to specify the flags.
20218 (readgram): Allow %prec prior to semantics embedded in a rule.
20219 (skip_to_char, read_declarations, copy_definition)
20220 (parse_token_decl, parse_start_decl, parse_type_decl)
20221 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
20222 (get_type_name, copy_guard, copy_action, readgram)
20223 (get_type, packsymbols): Revised most error messages.
20224 Changed `fatal' to `warnxxx' to avoid aborting for error.
20225 Revised and use multiple warnxxx functions to avoid using VARARGS1.
20226 (read_declarations): Improve the error message for
20227 an invalid character. Do not abort.
20228 (read_declarations, copy_guard, copy_action): Use
20229 printable_version to avoid unprintable characters in printed output.
20230 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
20231 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
20232 Allow the type of a non-terminal can be given
20233 more than once, as long as all specifications give the same type.
20234
20235 * src/output.c:
20236 (output_headers, output_trailers, output, output_gram)
20237 (output_rule_data): Implement noparserflag variable.
20238 Implement toknumflag variable.
20239 (output): Call reader_output_yylsp to output LTYPESTR.
20240
20241 * src/main.c (main):
20242 If reader sees an error, don't process the grammar.
20243 (fatals): Updated to not use VARARGS1.
20244 (printable_version, int_to_string, warn, warni, warns, warnss)
20245 (warnsss): New error reporting functions. Avoid abort for error.
20246
20247 * src/lex.h:
20248 Added THONG and NOOP for alias processing.
20249 Added SETOPT for the new code that allows setting options with %flags.
20250
20251 * src/lex.c:
20252 Include getopt.h. Add some extern decls.
20253 (safegetc): New function to deal with EOF gracefully.
20254 (literalchar); new function to deal with reading \ escapes.
20255 (lex): Use literalchar.
20256 (lex): Implemented "..." tokens.
20257 (literalchar, lex, parse_percent_token): Made tokenbuffer
20258 always contain the token. This includes growing the token
20259 buffer while reading an integer.
20260 (parse_percent_token): Replaced if-else statement with percent_table.
20261 (parse_percent_token): Added % declarations as another
20262 way to specify the flags -n, -l, and -r. Also added hooks for
20263 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
20264 major changes to files.c.
20265 (lex) Retain in the incoming stream a character following
20266 an incorrect '/'.
20267 (skip_white_space, lex): Revised most error messages
20268 and changed fatal to warn to avoid aborting.
20269 (percent_table): Added %thong declarations.
20270
20271 * src/gram.h: Comment changes.
20272
20273 * src/files.c (openfiles, open_extra_files, done):
20274 Add faction flag
20275 and actfile file. Handle noparserflag. Both for -n switch.
20276
20277 * src/conflicts.c (resolve_sr_conflict):
20278 Remove use of alloca.
20279
202801995-06-01 Jim Meyering <meyering@gnu.org>
20281
20282 * doc/bison.texinfo: *** empty log message ***
20283
202841995-05-06 Richard Stallman <rms@gnu.org>
20285
20286 * src/bison.s1: Comment change.
20287
202881995-05-06 Richard Stallman <rms@gnu.org>
20289
20290 * bison.simple: Comment change.
20291
202921995-05-03 Richard Stallman <rms@gnu.org>
20293
20294 * src/version.c: Version now 1.24.
20295
20296 * src/bison.s1: Change distribution terms.
20297
20298 * src/version.c: Version now 1.23.
20299
203001995-05-03 Richard Stallman <rms@gnu.org>
20301
20302 * doc/bison.texinfo:
20303 Rewrite "Conditions for Using Bison".
20304 Update version to 1.24.
20305
203061995-05-03 Richard Stallman <rms@gnu.org>
20307
20308 * bison.simple: Change distribution terms.
20309
203101995-02-23 Richard Stallman <rms@gnu.org>
20311
20312 * src/files.c: Test __VMS_POSIX as well as VMS.
20313
203141995-02-14 Jim Meyering <meyering@gnu.org>
20315
20316 * src/bison.s1 (__yy_memcpy):
20317 Renamed from __yy_bcopy to avoid
20318 confusion. Reverse FROM and TO arguments to be consistent with
20319 those of memcpy.
20320
203211995-02-14 Jim Meyering <meyering@gnu.org>
20322
20323 * bison.simple (__yy_memcpy):
20324 Renamed from __yy_bcopy to avoid
20325 confusion. Reverse FROM and TO arguments to be consistent with
20326 those of memcpy.
20327
203281994-11-10 David J. MacKenzie <djm@gnu.org>
20329
20330 * NEWS: reformat
20331
20332 * NEWS: New file.
20333
20334 * Makefile.in (DISTFILES): Include NEWS.
20335
20336 * Makefile.in (DISTFILES):
20337 Include install-sh, not install.sh.
20338
20339 * configure.in: Update to Autoconf v2 macro names.
20340
203411994-10-05 David J. MacKenzie <djm@gnu.org>
20342
20343 * Makefile.in: fix typo
20344
20345 * Makefile.in (prefix, exec_prefix):
20346 Let configure set them.
20347
203481994-09-28 David J. MacKenzie <djm@gnu.org>
20349
20350 * Makefile.in: Set datadir to $(prefix)/share.
20351
203521994-09-15 Richard Stallman <rms@gnu.org>
20353
20354 * src/bison.s1:
20355 Update copyright notice and GPL version.
20356
203571994-09-15 Richard Stallman <rms@gnu.org>
20358
20359 * bison.simple:
20360 Update copyright notice and GPL version.
20361
203621994-07-12 Richard Stallman <rms@gnu.org>
20363
20364 * src/reduce.c, src/reader.c:
20365 entered into RCS
20366
203671994-05-05 David J. MacKenzie <djm@gnu.org>
20368
20369 * Makefile.in: entered into RCS
20370
203711994-03-26 Richard Stallman <rms@gnu.org>
20372
20373 * src/bison.s1: entered into RCS
20374
203751994-03-26 Richard Stallman <rms@gnu.org>
20376
20377 * bison.simple: entered into RCS
20378
203791994-03-25 Richard Stallman <rms@gnu.org>
20380
20381 * src/main.c: entered into RCS
20382
203831994-03-24 Richard Stallman <rms@gnu.org>
20384
20385 * src/conflicts.c: entered into RCS
20386
203871994-01-02 Richard Stallman <rms@gnu.org>
20388
20389 * Makefile.in: *** empty log message ***
20390
203911993-11-21 Richard Stallman <rms@gnu.org>
20392
20393 * src/bison.s1: *** empty log message ***
20394
203951993-11-21 Richard Stallman <rms@gnu.org>
20396
20397 * doc/bison.texinfo: entered into RCS
20398
20399 * doc/bison.texinfo: *** empty log message ***
20400
204011993-11-21 Richard Stallman <rms@gnu.org>
20402
20403 * bison.simple: *** empty log message ***
20404
204051993-10-25 David J. MacKenzie <djm@gnu.org>
20406
20407 * doc/bison.texinfo: *** empty log message ***
20408
204091993-10-19 Richard Stallman <rms@gnu.org>
20410
20411 * src/bison.s1: *** empty log message ***
20412
204131993-10-19 Richard Stallman <rms@gnu.org>
20414
20415 * bison.simple: *** empty log message ***
20416
204171993-10-14 Richard Stallman <rms@gnu.org>
20418
20419 * src/bison.s1: *** empty log message ***
20420
204211993-10-14 Richard Stallman <rms@gnu.org>
20422
20423 * bison.simple: *** empty log message ***
20424
204251993-09-14 David J. MacKenzie <djm@gnu.org>
20426
20427 * doc/bison.texinfo: *** empty log message ***
20428
204291993-09-13 Noah Friedman <friedman@gnu.org>
20430
20431 * Makefile.in: *** empty log message ***
20432
204331993-09-10 Richard Stallman <rms@gnu.org>
20434
20435 * src/conflicts.c: *** empty log message ***
20436
20437 * src/system.h: entered into RCS
20438
204391993-09-10 Richard Stallman <rms@gnu.org>
20440
20441 * doc/bison.1: entered into RCS
20442
204431993-09-06 Noah Friedman <friedman@gnu.org>
20444
20445 * src/version.c: entered into RCS
20446
204471993-09-06 Noah Friedman <friedman@gnu.org>
20448
20449 * Makefile.in: *** empty log message ***
20450
204511993-07-30 David J. MacKenzie <djm@gnu.org>
20452
20453 * Makefile.in: *** empty log message ***
20454
204551993-07-24 Richard Stallman <rms@gnu.org>
20456
20457 * src/bison.s1: *** empty log message ***
20458
204591993-07-24 Richard Stallman <rms@gnu.org>
20460
20461 * bison.simple: *** empty log message ***
20462
204631993-07-08 David J. MacKenzie <djm@gnu.org>
20464
20465 * Makefile.in: *** empty log message ***
20466
204671993-07-04 Richard Stallman <rms@gnu.org>
20468
20469 * src/bison.s1: *** empty log message ***
20470
204711993-07-04 Richard Stallman <rms@gnu.org>
20472
20473 * bison.simple: *** empty log message ***
20474
204751993-06-26 David J. MacKenzie <djm@gnu.org>
20476
20477 * src/getargs.c: entered into RCS
20478
204791993-06-26 David J. MacKenzie <djm@gnu.org>
20480
20481 * doc/bison.texinfo: *** empty log message ***
20482
20483 * doc/bison.1: New file.
20484
204851993-06-25 Richard Stallman <rms@gnu.org>
20486
20487 * src/getargs.c: New file.
20488
204891993-06-16 Richard Stallman <rms@gnu.org>
20490
20491 * src/bison.s1: *** empty log message ***
20492
204931993-06-16 Richard Stallman <rms@gnu.org>
20494
20495 * bison.simple: *** empty log message ***
20496
204971993-06-03 Richard Stallman <rms@gnu.org>
20498
20499 * src/bison.s1: New file.
20500
205011993-06-03 Richard Stallman <rms@gnu.org>
20502
20503 * doc/bison.texinfo: *** empty log message ***
20504
205051993-06-03 Richard Stallman <rms@gnu.org>
20506
20507 * bison.simple: New file.
20508
205091993-05-19 Richard Stallman <rms@gnu.org>
20510
20511 * doc/bison.texinfo: New file.
20512
205131993-05-07 Noah Friedman <friedman@gnu.org>
20514
20515 * Makefile.in: *** empty log message ***
20516
205171993-04-28 Noah Friedman <friedman@gnu.org>
20518
20519 * src/reader.c: *** empty log message ***
20520
205211993-04-23 Noah Friedman <friedman@gnu.org>
20522
20523 * src/alloc.h: entered into RCS
20524
205251993-04-20 David J. MacKenzie <djm@gnu.org>
20526
20527 * src/version.c: *** empty log message ***
20528
20529 * src/files.c, src/allocate.c:
20530 entered into RCS
20531
20532 * src/reader.c: *** empty log message ***
20533
20534 * src/lex.c: entered into RCS
20535
20536 * src/conflicts.c: New file.
20537
20538 * src/symtab.c: entered into RCS
20539
20540 * src/alloc.h: New file.
20541
20542 * src/LR0.c: entered into RCS
20543
205441993-04-18 Noah Friedman <friedman@gnu.org>
20545
20546 * src/reader.c: New file.
20547
20548 * src/version.c: *** empty log message ***
20549
205501993-04-18 Noah Friedman <friedman@gnu.org>
20551
20552 * Makefile.in: *** empty log message ***
20553
205541993-04-17 Noah Friedman <friedman@gnu.org>
20555
20556 * Makefile.in: *** empty log message ***
20557
205581993-04-15 Richard Stallman <rms@gnu.org>
20559
20560 * src/main.c, src/files.c:
20561 New file.
20562
205631993-04-15 Noah Friedman <friedman@gnu.org>
20564
20565 * configure.in: entered into RCS
20566
20567 * configure.in: *** empty log message ***
20568
20569 * configure.in: New file.
20570
205711993-04-14 Richard Stallman <rms@gnu.org>
20572
20573 * Makefile.in: New file.
20574
205751993-04-13 Richard Stallman <rms@gnu.org>
20576
20577 * src/version.c: New file.
20578
205791993-03-25 Richard Stallman <rms@gnu.org>
20580
20581 * src/output.c: entered into RCS
20582
205831992-09-25 Richard Stallman <rms@gnu.org>
20584
20585 * configure.bat: entered into RCS
20586
205871992-06-22 Richard Stallman <rms@gnu.org>
20588
20589 * src/vmsgetargs.c: entered into RCS
20590
205911992-06-22 Richard Stallman <rms@gnu.org>
20592
20593 * doc/bison.rnh: entered into RCS
20594
205951992-04-20 David J. MacKenzie <djm@gnu.org>
20596
20597 * README: entered into RCS
20598
205991992-01-22 Richard Stallman <rms@gnu.org>
20600
20601 * src/machine.h: entered into RCS
20602
206031991-12-21 Richard Stallman <rms@gnu.org>
20604
20605 * src/lalr.c, src/closure.c:
20606 entered into RCS
20607
206081991-12-20 Richard Stallman <rms@gnu.org>
20609
20610 * src/state.h: entered into RCS
20611
206121991-12-18 Richard Stallman <rms@gnu.org>
20613
20614 * src/print.c, src/nullable.c, src/derives.c:
20615 entered into RCS
20616
206171991-11-03 David J. MacKenzie <djm@gnu.org>
20618
20619 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
20620 entered into RCS
20621
206221988-09-09 Richard Stallman <rms@gnu.org>
20623
20624 * src/bison.hairy: entered into RCS
20625
206261987-12-16 Richard Stallman <rms@gnu.org>
20627
20628 * REFERENCES: entered into RCS
dc546b0f 20629
f294a2c2 20630
04098407 20631 -----
f294a2c2 20632
04098407 20633 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
9126263e 20634 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
95021767 20635 Free Software Foundation, Inc.
f294a2c2 20636
04098407
PE
20637 Copying and distribution of this file, with or without
20638 modification, are permitted provided the copyright notice and this
20639 notice are preserved.