]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
Update for recent .gitignore fix in Gnulib.
[bison.git] / ChangeLog
... / ...
CommitLineData
12008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Update for recent .gitignore fix in Gnulib.
4 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
5 anchored .gitignore entries.
6
72008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
8
9 Set gnu or gnits strictness.
10 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
11 development and gnits strictness for releases. Based on Eric Blake's
12 suggestion at
13 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
14
152008-07-31 Paolo Bonzini <bonzini@gnu.org>
16
17 * NEWS: Clarify documentation of %language.
18
192008-07-31 Paolo Bonzini <bonzini@gnu.org>
20
21 Support usage of git-merge-changelog.
22 * .gitattributes: New.
23 * HACKING: Document usage of git-merge-changelog.
24 * bootstrap: Install git-merge-changelog entries in .git/config
25 if appropriate.
26
272008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
28
29 Remove remaining dependence on CVS Id keyword.
30 * ChangeLog: For the sake of people still using CVS, don't use dollars
31 when mentioning Id.
32 * data/xslt/bison.xsl: Remove Id from header comments, where it was
33 unusual anyway.
34 * data/xslt/xml2dot.xsl: Likewise.
35 * data/xslt/xml2text.xsl: Likewise.
36 * data/xslt/xml2xhtml.xsl: Likewise.
37 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
38 * doc/Makefile.am (neutralize): Remove, no longer needed.
39 (.x.1): Don't use neutralize.
40 (edit): Don't substitute for ID.
41 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
42
432008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
44
45 Fix dependence on computed configure variables.
46 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
47 $(top_srcdir)/configure.ac so that changes to computed variables, such
48 as PACKAGE_VERSION, are seen.
49 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
50
512008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
52
53 Update copyright dates for recent changes.
54 * Makefile.am: Here.
55 * src/Makefile.am: Here.
56 * src/reduce.c: Here.
57 * tests/reduce.at: Here.
58
592008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
60
61 Use git-version-gen for version names between releases.
62 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
63 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
64 * .prev-version: New.
65 * .version.in: Remove.
66 * ChangeLog: Remove the Id previously used for capturing the CVS
67 revision.
68 * GNUmakefile: Remove, now copied from Gnulib.
69 * Makefile.am: Add code suggested by comments in
70 build-aux/git-version-gen.
71 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
72 .prev-version, and .version.
73 * NEWS (2.3b+): Rename to...
74 (?.?): ... this because we're dropping the "+" version naming scheme,
75 but, in general, we still can't be sure of our next release name.
76 * bootstrap: Add a quick hack to remove from .gitignore the
77 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
78 entry. This should really be fixed in gnulib instead.
79 * bootstrap.conf (gnulib_modules): Add gnumakefile.
80 * configure.ac (AC_INIT): Set version name by invoking
81 build-aux/git-version-gen.
82 (AC_CONFIG_FILES): Remove .version, now generated by
83 build-aux/git-version-gen.
84 * maint.mk: New, copied from coreutils.
85 * doc/.cvsignore (bison.1): Add.
86 * doc/.gitignore (/bison.1): Add.
87 * doc/bison.1: Remove, generated.
88 * src/.cvsignore (revision.c): Remove.
89 * src/.gitignore (/revision.c): Remove.
90 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
91 (BUILT_SOURCES): Remove revision.c.
92 (revision.c): Remove.
93 * src/getargs.c (version): Don't print revision after the VERSION.
94 * src/revision.h: Remove.
95
962008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
97
98 Fix untranslatable composition of sentences. Reported by Goran
99 Uddeborg at
100 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
101 * THANKS (Goran Uddeborg): Add.
102 * src/reduce.c (reduce_print): Report the number of nonterminals and
103 rules useless in the grammar in separate sentences.
104 * tests/reduce.at (Useless Rules): Update output.
105 (Reduced Automaton): Likewise.
106 (Underivable Rules): Likewise.
107 (Empty Language): Likewise.
108
1092008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
110
111 Fix some .gitignore and .cvsignore problems.
112 * bootstrap (insert_sorted_if_absent): Replace all uses with...
113 (insert_vc_ignore): ... this new function, which prepends `/' to all
114 .gitignore entries before passing them to insert_sorted_if_absent.
115 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
116 .cvsignore files are maintained even though Bison developers run
117 bootstrap while using Git.
118 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
119 unneeded by Bison.
120 (gnulib): Add.
121 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
122 unneeded. Reported by Eric Blake.
123 * lib/.gitignore (/*~): Add.
124 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
125 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
126 Blake.
127 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
128
1292008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
130
131 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
132 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
133 * bootstrap.conf (gnulib_modules): Add unsetenv.
134 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
135 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
136 (/setenv.m4): Add.
137 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
138 the first argument because it may become position-dependent, and unset
139 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
140 Add comments explaining these issues in more detail.
141
1422008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
143
144 Add .gitignore everywhere based on .cvsignore.
145 * .gitignore: New.
146 * build-aux/.gitignore: New.
147 * data/.gitignore: New.
148 * doc/.gitignore: New.
149 * etc/.gitignore: New.
150 * examples/.gitignore: New.
151 * examples/calc++/.gitignore: New.
152 * lib/.gitignore: New.
153 * m4/.gitignore: New.
154 * po/.gitignore: New.
155 * runtime-po/.gitignore: New.
156 * src/.gitignore: New.
157 * tests/.gitignore: New.
158
1592008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
160
161 * NEWS (2.3b+): New section, empty for now.
162 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
163
1642008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
165
166 * NEWS (2.3b): Update release date since there has been a delay in
167 getting the announcements and tarballs out.
168
1692008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
170
171 * NEWS: Version 2.3b.
172 * configure.ac (AC_INIT): Likewise.
173 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
174
1752008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
176
177 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
178 been doing it for years.
179 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
180 (Release Procedure): Add FIXME about make alpha being unmaintained.
181
1822008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
183
184 * data/yacc.c: Reformat m4 a little for readability.
185 * src/lalr.c (build_relations): Correct comment.
186
1872008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
188
189 DJGPP specific issue.
190 * djgpp/config.sed: Fixes required to run configure scripts generated
191 by autoconf 2.62.
192
1932008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
194
195 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
196 coordinator@translationproject.org.
197
1982008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
199
200 * THANKS: Add Eric Blake.
201
2022008-04-23 Eric Blake <ebb9@byu.net>
203
204 Revert prior patch, by working around autoconf regression.
205 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
206 ("Output file name: ("): Uncomment test.
207 ("Output file name: )"): Likewise.
208 Based on an idea from Noah Misch.
209
2102008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
211
212 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
213 2.61. Reported by Juan Manuel Guerrero at
214 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
215 * tests/output.at ("Output file name: ("): Comment out test case for
216 now.
217 ("Output file name: )"): Likewise.
218
2192008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
220
221 * GNUmakefile: Update git-version-gen invocation so make dist
222 succeeds.
223
2242008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
225
226 Update to the current gnulib CVS repository, and fix trigraph handling
227 in Bison.
228 * bootstrap: Update gnulib CVS repository URL.
229 (symlink_to_dir): Encapsulate the code that guarantees the destination
230 directory exists into...
231 (check_dst_dir): ... this new function, and...
232 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
233 fail when copying files into lib/uniwidth/.
234 * src/output.c (prepare_symbols): When writing yytname muscles, where
235 symbol names will be encoded in C-string literals, tell quotearg to
236 escape trigraphs. This used to be the default in gnulib.
237 * tests/regression.at (Token definitions): Because of the change in
238 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
239 escapes trigraphs in symbol names. Thus, yytname no longer has
240 trigraphs unnecessarily doubly escaped. Update test case output.
241 Extend test case to be sure Bison's own error messages will no longer
242 have trigraphs in symbol names unnecessarily escaped once.
243
2442008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
245
246 Fix make dist infinite loop reported by Juan Manuel Guerrero at
247 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
248 * .cvsignore: Add .version.
249 * .version.in: New.
250 * bootstrap.conf (gnulib_modules): Add git-version-gen.
251 * configure.ac (AC_CONFIG_FILES): Add .version.
252 * build-aux/.cvsignore: Add git-version-gen.
253
2542008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
255
256 * NEWS (2.3a+): Mention that -g now takes an argument.
257 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
258 consistency. Update the -g and -x entries now that they take
259 arguments. Use brackets to indicate optional arguments.
260 * src/getargs.c (usage): Explain the relationship between arguments of
261 long and short options more completely. Document --defines and -d
262 separately since the former takes an argument but, for POSIX Yacc, the
263 latter does not.
264 (short_options): Let -W take an optional argument like --warnings.
265 (getargs): Sort cases.
266
2672008-02-28 Akim Demaille <demaille@gostai.com>
268
269 * doc/bison.texinfo: Fix a few typos.
270
2712008-02-28 Akim Demaille <akim@epita.fr>
272
273 * doc/bison.texinfo (Bison Options): Document -W.
274 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
275
2762008-02-28 Akim Demaille <akim@epita.fr>
277
278 * src/getargs.c (short_options): Split and sort for readability.
279 -g and -x take optional arguments, just like their long options.
280 * build-aux/cross-options.pl: Use /x to make the regexp easier to
281 understand.
282 Fix the handling of $opt which resulted in all the argument to be
283 considered as optional.
284
2852008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
286
287 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
288 say its interface is experimental.
289 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
290 Java.
291 (Bison Options): In the -L and --language entry, mention Java.
292 (Java Bison Interface): Say the interface is experimental.
293 * src/getargs.c (usage): Mention -L and --language.
294
295 * NEWS (2.3a+): Say the push parsing interface is experimental.
296 * doc/bison.texinfo (Push Decl): Likewise.
297 (Decl Summary): Likewise in the "%define api.push_pull" entry.
298 (Push Parser Function): Likewise.
299 (Pull Parser Function): Likewise.
300 (Parser Create Function): Likewise.
301 (Parser Delete Function): Likewise.
302 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
303 yypull_parse, and yypush_parse entries.
304
305 * NEWS (2.3a+): Mention XML support, and say the schema is
306 experimental.
307 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
308 * src/getargs.c (usage): Say the XML schema is experimental.
309
310 * NEWS (2.3a+): Say option instead of flag.
311
3122008-02-21 Wojciech Polak <polak@gnu.org>
313
314 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
315 text.
316
3172008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
318
319 Fix impure push parser compile error reported by Bob Rossi at
320 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
321 * data/yacc.c: Clean up whitespace in the output a little.
322 (yypstate_allocated): Define for impure push parsers regardless of
323 whether the pull interface is also requested.
324 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
325 check impure push parsers without the pull interface.
326
327 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
328 yyerror takes arguments specified by %parse-param while yypstate_new
329 does not.
330 * doc/bison.texinfo (Parser Create Function): Document that
331 yypstate_new returns 0 for multiple impure parser instances.
332 * tests/push.at (Push Parsing: Multiple impure instances): Update
333 expected stderr output.
334
3352008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
336
337 * runtime-po/POTFILES.in (push.c): Remove.
338
3392008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
340
341 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
342 * data/push.c: Rename to...
343 * data/yacc.c: ... this, overwriting it.
344 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
345 `%push-pull-parser' -> `%define api.push_pull "both"'.
346 Remove old yacc.c tests, and update push.c tests to yacc.c.
347
3482008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
349
350 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
351 `"%code top" blocks' instead of `%code "top" blocks'.
352 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
353 Clean up whitespace in the output a little.
354
3552008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
356
357 Fix documentation problems reported by Tim Josling at
358 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
359 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
360 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
361 integers. Explain the effect of literal string aliases on error
362 messages. Copy token 0 documentation from the C++ skeleton
363 documentation.
364
3652008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
366
367 Accept a token number in a %left, %right, or %nonassoc for POSIX
368 conformance. Reported by Tim Josling at
369 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
370 * NEWS (2.3a+): Mention.
371 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
372 and code numbers are treated by precedence declarations.
373 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
374 of symbols.1.
375 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
376 of symbol.
377 (symbol.prec): New, just like symbol but allows INT.
378 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
379 longer holds.
380 * tests/regression.at (Token number in precedence declaration): New
381 test case.
382
3832008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
384
385 DJGPP specific issues.
386 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
387 be changed. Copyright timestamp adjusted.
388 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
389 be changed. Copyright timestamp adjusted.
390 * djgpp/config.site: Copyright timestamp adjusted.
391 * djgpp/config_h.sed: Copyright timestamp adjusted.
392 * djgpp/djunpack.bat: Copyright timestamp adjusted.
393 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
394 filename translation list.
395 * djgpp/subpipe.c (init_subpipe): Check the environment variables
396 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
397 files shall be created. Before trying to use the temp dir where the
398 environment variable points to check that the dir really exists. If
399 not default to the cwd as temp dir. Copyright timestamp adjusted.
400 * djgpp/subpipe.h: Copyright timestamp adjusted.
401 * djgpp/testsuite.sed: Copyright timestamp adjusted.
402
4032008-01-30 Paul Eggert <eggert@cs.ucla.edu>
404
405 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
406
4072008-01-09 Paul Eggert <eggert@cs.ucla.edu>
408
409 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
410 Problem reported by Claudio Saavedra in
411 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
412
4132008-01-05 Wojciech Polak <polak@gnu.org>
414
415 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
416 document's title with the input grammar file name.
417
4182007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
419
420 Automate regression testing of the XML/XSLT implementation. Discussed
421 starting at
422 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
423 * configure.ac (XSLTPROC): New substitution.
424 * Makefile.am (maintainer-xml-check): New phony target invoking...
425 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
426 invoking make maintainer-check with BISON_TEST_XML=1.
427 * tests/atlocal.in (XSLTPROC): New.
428 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
429 not to report reachable memory when Bison is expected to have a
430 non-zero exit status and (2) to compare XML/XSLT output with --graph
431 and --report=all output for every working grammar when
432 BISON_TEST_XML=1.
433 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
434 (AT_BISON_CHECK_XML): New.
435 (AT_QUELL_VALGRIND): New.
436 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
437 (AT_CHECK): ... don't redefine this since this was the old way to
438 quell Valgrind.
439 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
440 AT_BISON_CHECK invocations.
441 * tests/c++.at: Likewise.
442 * tests/calc.at: Likewise.
443 * tests/conflicts.at: Likewise.
444 * tests/cxx-type.at: Likewise.
445 * tests/existing.at: Likewise.
446 * tests/glr-regression.at: Likewise.
447 * tests/headers.at: Likewise.
448 * tests/input.at: Likewise.
449 * tests/java.at: Likewise.
450 * tests/output.at: Likewise.
451 * tests/push.at: Likewise.
452 * tests/reduce.at: Likewise.
453 * tests/regression.at: Likewise.
454 * tests/sets.at: Likewise.
455 * tests/skeletons.at: Likewise.
456 * tests/synclines.at: Likewise.
457 * tests/torture.at: Likewise.
458 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
459 tends to hang xsltproc.
460 (Big horizontal): Likewise.
461
4622007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
463
464 In XML output, remove redundant class attribute on symbol element.
465 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
466 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
467 look up a symbol to determine whether it's a nonterminal or terminal.
468 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
469 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
470
471 Add prec/assoc information to XML output.
472 * src/gram.c (grammar_rules_print_xml): For each rule that has a
473 %prec, add a percent_prec attribute.
474 * src/print-xml.c (print_grammar): For each terminal that has a
475 precedence or associativity, add a prec or assoc attribute.
476 (xml_indent): New.
477 (xml_puts): Use xml_indent.
478 (xml_printf): Use xml_indent.
479 * src/print-xml.h (xml_indent): Prototype.
480
481 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
482 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
483
4842007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
485
486 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
487 (bison:ruleByNumber): ... this for clarity.
488 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
489 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
490 (xsl:template match="reduction"): Update.
491 (xsl:template match="item"): Update.
492 (xsl:template match="reduction"): Update.
493
494 In the XML output, don't print the list of rules where symbols appear.
495 Compute it in XSLT instead. Discussed at
496 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
497 * data/xslt/bison.xsl (bison:ruleByLhs): New.
498 (bison:ruleByRhs): New.
499 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
500 bison:ruleByRhs.
501 (xsl:template match="terminal/rule"): Remove.
502 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
503 bison:ruleByRhs.
504 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
505 Remove.
506 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
507 bison:ruleByRhs and mode="number-link" for rule template.
508 (xsl:template match="terminal/rule"): Remove.
509 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
510 bison:ruleByRhs and mode="number-link" for rule template.
511 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
512 Rewrite as...
513 (xsl:template match="rule" mode="number-link"): ... this.
514 * src/print-xml.c (print_grammar): Don't print the list of rules.
515
5162007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
517
518 Don't let --report affect XML output; always print all information.
519 Discussed at
520 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
521 * src/conflicts.c (log_resolution): Implement.
522 * src/print-xml.c (print_core): Implement.
523 (print_state): Implement.
524 (print_xml): Implement.
525
526 * NEWS (2.3a+): Fix quotes.
527 * src/parse-gram.y (prologue_declaration): For consistency with -v,
528 don't let %verbose clear the list specified by --report.
529
5302007-11-26 Akim Demaille <akim@epita.fr>
531
532 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
533
5342007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
535
536 In the XML output, list useless and unused symbols and rules with the
537 useful ones and add a "usefulness" attribute. Discussed starting at
538 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
539 * src/gram.c (grammar_rules_partial_print_xml): Remove.
540 (grammar_rules_print_xml): Print all rules instead of just those
541 useful in the grammar, and add a "usefulness" attribute.
542 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
543 * src/print-xml.c (print_rules_useless_in_parser): Remove.
544 (print_grammar): Print all nonterminals instead of just useful ones,
545 and add a "usefulness" attribute to nonterminals and terminals.
546 (print_xml): Don't print a separate "reductions" or
547 "rules-useless-in-parser" element.
548 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
549 (reduce_xml): Remove.
550 (reduce_token_unused_in_grammar): New.
551 (reduce_nonterminal_useless_in_grammar): New.
552 * src/reduce.h (reduce_xml): Remove prototype.
553 (reduce_token_unused_in_grammar): Add prototype.
554 (reduce_nonterminal_useless_in_grammar): Add prototype.
555 * data/xslt/xml2text.xsl: Update for XML changes.
556 * data/xslt/xml2xhtml.xsl: Update for XML changes.
557 * tests/reduce.at (Useless Terminals): Update output.
558 (Useless Rules): Update output.
559 (Reduced Automaton): Update output.
560
561 Say "Terminals unused in grammar" instead of "Unused terminals".
562 * NEWS (2.3a+): Update.
563 * doc/bison.texinfo (Understanding): Update example output.
564 * src/reduce.c (reduce_output): Implement.
565 * data/xslt/xml2text.xsl: Implement.
566 * data/xslt/xml2xhtml.xsl: Implement.
567
5682007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
569
570 Accept --report-file=FILE to override the default `.output' filename.
571 * NEWS (2.3a+): Mention.
572 * doc/bison.texinfo (Bison Options): Add an entry.
573 * src/files.c (compute_output_file_names): Don't override
574 spec_verbose_file if already set.
575 * src/getargs.c (usage): Document --report-file.
576 (REPORT_FILE_OPTION): New anonymous enum member.
577 (long_options): Add entry for it.
578 (getargs): Add case for it setting spec_verbose_file.
579
580 * build-aux/cross-options.pl: Don't record a short option just because
581 there's an arg.
582 * doc/.cvsignore: Add yacc.1.
583
5842007-11-14 Akim Demaille <akim@epita.fr>
585
586 * doc/yacc.1.in: New.
587 * configure.ac, doc/Makefile.am: Adjust.
588 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
589 config.h symbol.
590 Use AC_SUBST for assignments too.
591 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
592
5932007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
594
595 * src/gram.c: Remove comments that duplicate comments in gram.h.
596
597 When reporting useless rules and nonterminals, say "useless in grammar"
598 instead of "useless", and say "useless in parser" instead of "never
599 reduced". Discussed starting at
600 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
601 * NEWS (2.3a+): Mention this change.
602 * data/xslt/xml2text.xsl: Update output text and expected input XML
603 element names to match changes below.
604 * data/xslt/xml2xhtml.xsl: Likewise.
605 (xsl:template match="bison-xml-report"): Add missing entry in Table of
606 Contents: "Rules useless in parser due to conflicts".
607 * doc/bison.texinfo (Decl Summary): Reword a little.
608 (Understanding): Update example output for changes below.
609 * src/gram.c: (rule_useful_p): Rename to...
610 (rule_useful_in_grammar_p): ... this.
611 (rule_useless_p): Rename to...
612 (rule_useless_in_grammar_p): ... this.
613 (rule_never_reduced_p): Rename to...
614 (rule_useless_in_parser_p): ... this.
615 (grammar_rules_print): Update for renames.
616 (grammar_rules_print_xml): Update for renames.
617 (grammar_rules_never_reduced_report): Rename to...
618 (grammar_rules_useless_report): ... this since it is used for either
619 kind of useless rule.
620 * src/gram.h: Reword comments and update function names in prototypes.
621 * src/main.c (main): Say "rule useless in parser due to conflicts".
622 * src/print-xml.c (print_rules_never_reduced): Rename to...
623 (print_rules_useless_in_parser): ... this, and rename output XML
624 element "rules-never-reduced" to "rules-useless-in-parser".
625 (print_xml): Update for rename.
626 * src/print.c (print_results): Say "Rules useless in parser due to
627 conflicts".
628 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
629 (nonterminals_reduce): Say "nonterminal useless in grammar".
630 (reduce_output): Say "Nonterminals useless in grammar".
631 Say "Rules useless in grammar".
632 (reduce_xml): Rename output XML element "useless" to
633 "useless-in-grammar".
634 (reduce_print): Don't report the count of grammatically useless rules
635 as "rules never reduced" just because %yacc is specified.
636 In the correct report of this count, say nonterminal(s) and rule(s)
637 "useless in grammar".
638 * tests/conflicts.at (S/R in initial): Update expected output.
639 (Defaulted Conflicted Reduction): Likewise.
640 (Unreachable States After Conflict Resolution): Likewise.
641 * tests/existing.at (GNU pic Grammar): Likewise.
642 * tests/reduce.at (Useless Nonterminals): Likewise.
643 (Useless Rules): Likewise.
644 (Reduced Automaton): Likewise.
645 (Underivable Rules): Likewise.
646 (Empty Language): Likewise.
647
6482007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
649
650 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
651 here document and before the EOF so that BSD's implementation of Bourne
652 shell doesn't parse the delimiter as part of the here document.
653 * doc/.cvsignore: Add cross-options.texi.
654 * src/getargs.c (usage): Add a blank line after the warning categories.
655
6562007-11-08 Paolo Bonzini <bonzini@gnu.org>
657
658 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
659
6602007-11-05 Akim Demaille <akim@epita.fr>
661
662 Remove Id: from bison.1.
663 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
664 (perl -0777 -pi -e 's/\.PP\nId): New.
665 (.x.1): Use it to ignore the version control revision.
666
6672007-11-05 Akim Demaille <demaille@gostai.com>
668
669 * build-aux/Makefile.am: Ship cross-options.pl.
670 * doc/Makefile.am: Always refer to cross-options.texi with
671 $(srcdir).
672 (MAINTAINERCLEANFILES): Add it.
673
6742007-11-04 Akim Demaille <demaille@gostai.com>
675
676 Generate the long/short option cross-table.
677 * build-aux/cross-options.pl: New.
678 * doc/Makefile.am (cross-options.texi): New.
679 * doc/bison.texinfo: Use it.
680
6812007-11-04 Akim Demaille <demaille@gostai.com>
682
683 Generate bison.1 using help2man.
684 * doc/common.x, doc/bison.x: New.
685 * doc/Makefile.am (bison.1, .x.1): New.
686 The code is taken from autoconf-2.61/man/Makefile.am.
687 * configure.ac: Look for help2man.
688
6892007-11-04 Akim Demaille <demaille@gostai.com>
690
691 Complete --help.
692 * src/getargs.c (usage): Document -W, make it clear that -d,
693 -g and -x have optional arguments.
694
6952007-11-04 Akim Demaille <demaille@gostai.com>
696
697 Find sha1sum when named gsha1sum.
698 * bootstrap (find_tool): New.
699 ($SHA1SUM): New.
700
7012007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
702
703 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
704 at
705 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
706 * NEWS (2.3a+): Mention.
707 * data/bison.m4 (b4_pure_if): Don't define it here.
708 * data/c.m4 (b4_identification): Depend on individual skeletons to
709 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
710 values of the %define variables api.pure or api.push_pull. Define
711 YYPURE, YYPUSH, and YYPULL accordingly.
712 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
713 glr.cc has already defined b4_pure_flag.
714 * data/push.c: Define b4_pure_if based on `%define api.pure'.
715 Remove YYPUSH and YYPULL since they're back in b4_identification again.
716 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
717 * doc/bison.texinfo (Pure Decl): Update.
718 (Push Decl): Update.
719 (Decl Summary): Add api.pure to %define entry.
720 In %pure-parser entry, say it's deprecated and reference %define.
721 (Pure Calling): Update.
722 (Error Reporting): Update.
723 (C++ Scanner Interface): Update.
724 (How Can I Reset the Parser): Update.
725 (Table of Symbols): In %pure-parser entry, say it's deprecated and
726 reference %define.
727 * src/getargs.c (pure_parser): Remove global variable.
728 * src/getargs.h (pure_parser): Remove extern.
729 * src/output.c (prepare): Don't define pure_flag muscle.
730 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
731 wrapper around `%define api.pure'.
732 * tests/calc.at (Simple LALR Calculator): Update.
733 (Simple GLR Calculator): Update.
734 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
735 Update.
736 (GLR: Resolve ambiguity, pure, locations): Update.
737 (GLR: Merge conflicting parses, pure, no locations): Update.
738 (GLR: Merge conflicting parses, pure, locations): Update.
739 * tests/glr-regression.at (Uninitialized location when reporting
740 ambiguity): Update
741 * tests/input.at (Unused %define api.pure): New test case.
742 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
743 AT_PURE_IF and AT_PURE_AND_LOC_IF.
744 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
745
7462007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
747
748 %define push_pull -> %define api.push_pull. Discussed starting at
749 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
750 * data/push.c: Expect the new name.
751 * data/yacc.c: Likewise.
752 * doc/bison.texinfo (Push Decl): Update.
753 (Decl Summary): Update %define entry.
754 (Push Parser Function): Update.
755 (Pull Parser Function): Update.
756 (Parser Create Function): Update.
757 (Parser Delete Function): Update.
758 * tests/calc.at (Simple LALR Calculator): Update.
759 * tests/input.at (%define enum variables): Update.
760 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
761 (Push Parsing: Multiple impure instances): Update.
762 (Push Parsing: Unsupported Skeletons): Update.
763 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
764 (Exploding the Stack Size with Malloc): Update.
765
766 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
767 other entries some.
768
7692007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
770
771 For the XML output's terminal element, rename @number to @token-number,
772 and add @symbol-number. In the nonterminal element, rename @number to
773 @symbol-number. Discussed starting at
774 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
775 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
776 renames.
777 (xsl:template match="nonterminal"): Likewise.
778 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
779 (xsl:template match="nonterminal"): Likewise.
780 * src/print-xml.c (print_grammar): Implement.
781
7822007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
783
784 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
785 2007-10-11 change, the child elements here are items not rules.
786 (xsl:template match="item"): New.
787 (xsl:template match="rule"): Update for new reduced itemset.
788 (xsl:template match="point"): Remove.
789 (xsl:template match="empty"): For consistency with --graph, don't
790 output "/* empty */".
791 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
792 line-wrap, don't pass a negative value as first-line-length since this
793 won't work with the following changes.
794 (xsl:template name="line-wrap"): Simplify slightly.
795 (xsl:template name="ws-search"): Eliminate recursion.
796 * src/print_graph.c (print_core): Don't print a reduction's lookahead
797 set next to an item whose dot is not at the end of the RHS even if it
798 happens to be associated with the same rule.
799
8002007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
801
802 Add %define lr.keep_unreachable_states.
803 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
804 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
805 * src/main.c (main): Implement it.
806 * tests/conflicts.at (Unreachable States After Conflict Resolution):
807 Extend to test it, and fix a typo.
808
8092007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
810
811 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
812 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
813 the example .output text.
814 * tests/regression.at (Extra lookahead sets in report): Improve wording
815 of comments.
816
8172007-10-17 Wojciech Polak <polak@gnu.org>
818
819 * src/print-xml.c (print_grammar): Renamed
820 <terminal> and <nonterminal> attributes:
821 "type" to "number" and "symbol" to "name".
822 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
823 Use new attribute names.
824 (xsl:template match="nonterminal"): Likewise.
825 * data/xslt/xml2xhtml.xsl: Likewise.
826
8272007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
828
829 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
830 (Option Cross Key): Likewise.
831
832 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
833 next to an item whose dot is not at the end of the RHS even if it
834 happens to be associated with the same rule.
835 * src/print.c (print_core): Likewise.
836 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
837 (Resolved SR Conflicts): Update output.
838 * tests/regression.at (Extra lookahead sets in report): New test case.
839
8402007-10-11 Wojciech Polak <polak@gnu.org>
841
842 * src/print-xml.c (print_core): Remove item set
843 redundancy.
844 * data/xslt/bison.xsl (bison:ruleNumber): New key.
845 Improve processing time. Suggested by Joel E. Denny.
846 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
847 Write xsl:param "required" attribute as comment.
848 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
849 (xsl:template match="rule"): Support new reduced itemset.
850 (xsl:template match="point"): Remove.
851 * data/xslt/xml2xhtml.xsl: Likewise.
852
8532007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
854
855 * src/getargs.c (version): Update copyright year.
856
8572007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
858
859 Make xml2dot.xsl and --graph produce the same output.
860 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
861 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
862 escaped later.
863 (xsl:template name="output-node"): Use the new escape template instead
864 of the string-replace template directly.
865 (xsl:template name="output-edge"): Likewise.
866 (xsl:template name="escape"): New, escapes backslashes and newlines in
867 addition to quotation marks.
868 * src/graphviz.c (start_graph, output_node, output_edge): Add
869 whitespace to output for legibility.
870
871 Make xml2text.xsl and --report produce the same output, and remove the
872 XML "conflicts" element since a conflict summary is easily extracted
873 from the automaton.
874 * data/xslt/bison.xsl: New.
875 (xsl:template match="state" mode="bison:count-conflicts): New.
876 * data/xslt/xml2text.xsl: Import bison.xsl.
877 (xsl:template match="bison-xml-report"): Instead of styling the
878 "conflicts" element, style the "automaton" element with mode
879 "conflicts". Unlike the former, the latter lists S/R and R/R
880 conflicts for a state on the same line.
881 (xsl:template match="conflicts"): Remove.
882 (xsl:template match="conflict"): Remove.
883 (xsl:template match="terminal"): Line-wrap the list of rules in which
884 the terminal is used.
885 (xsl:template match="nonterminal"): Likewise for nonterminals.
886 (xsl:template match="automaton" mode="conflicts"): New.
887 (xsl:template match="state" mode="conflicts"): New.
888 (xsl:template name="line-wrap"): New.
889 (xsl:template name="ws-search"): New.
890 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
891 (xsl:template match="bison-xml-report"): Instead of styling the
892 "conflicts" element, style the "automaton" element with mode
893 "conflicts."
894 (xsl:template match="conflicts"): Remove.
895 (xsl:template match="conflict"): Remove.
896 (xsl:template match="automaton" mode="conflicts"): New.
897 (xsl:template match="state" mode="conflicts): New.
898 * src/conflicts.c (conflicts_output_xml): Remove.
899 * src/conflicts.h (conflicts_output_xml): Remove prototype.
900 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
901 * src/print.c (print_grammar): Consistently wrap at the 66th column so
902 the corresponding XSLT is easier. Also, never wrap between a word and
903 the comma that follows it.
904
9052007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
906
907 Improve C++ namespace support. Discussed starting at
908 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
909 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
910 b4_namespace_close): New macros that interpret the %define variable
911 "namespace" so its value can contain "::" to indicate nested
912 namespaces.
913 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
914 the above macros.
915 * data/lalr1.cc (b4_namespace): Likewise.
916 * data/location.cc (b4_namespace): Likewise.
917 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
918 inside a new table in the general %define entry. Document `%define
919 namespace' there as well. Point the %name-prefix entry to it since it
920 explains it more completely in the case of C++.
921 (C++ Bison Interface): Mention `%define namespace' instead of
922 %name-prefix.
923 (Table of Symbols): Remove the `%define push_pull' entry. The %define
924 entry suffices.
925 * tests/c++.at (Relative namespace references): New test case.
926 (Absolute namespace references): New test case.
927 (Syntactically invalid namespace references): New test case.
928 * tests/input.at (C++ namespace reference errors): New test case.
929
9302007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
931
932 Add syncline support and location accessor to internal %define
933 interfaces.
934 * data/bison.m4 (b4_percent_define_get_loc): New.
935 (b4_percent_define_get_syncline): New.
936 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
937 (b4_percent_define_default): Record defining location as line 1 rather
938 than 0 for the sake of synchronizing #line's, and define
939 b4_percent_define_syncline(VARIABLE).
940 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
941 * src/muscle_tab.c (muscle_syncline_grow): New.
942 (muscle_code_grow): Use muscle_syncline_grow.
943 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
944 define b4_percent_define_syncline(VARIABLE).
945 (muscle_percent_define_get_loc): New.
946 (muscle_percent_define_get_syncline): New.
947 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
948 remove some unused variables.
949 (muscle_percent_define_default): Record defining location as line 1
950 rather than 0 for the sake of synchronizing #line's, and define
951 b4_percent_define_syncline(VARIABLE).
952 (muscle_percent_define_check_values): Use
953 muscle_percent_define_get_loc.
954 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
955 (muscle_percent_define_get_syncline): Prototype.
956 * tests/skeletons.at (%define Boolean variables: invalid skeleton
957 defaults): Update output for location change.
958 (Complaining during macro argument expansion): Extend to test
959 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
960
9612007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
962
963 Fix some error-reporting macro bugs.
964 * data/bison.m4 (b4_cat): New.
965 (b4_error, b4_error_at): Use b4_cat to send error directives directly
966 to stdout so they don't become arguments to other macros. Update
967 comments and add examples.
968 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
969 add examples.
970 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
971 after printing the error directive so that M4 doesn't report subsequent
972 problems that are induced by this problem.
973 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
974 instead of just in them. Recognize @\n in both places. Both expand to
975 the empty string. Needed by b4_cat.
976 * tests/skeletons.at (Complaining during macro argument expansion):
977 New test case.
978 (Fatal errors make M4 exit immediately): New test case.
979
9802007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
981
982 Implement --print-datadir.
983 * src/getargs.c (usage): Mention.
984 (PRINT_DATADIR_OPTION): New anonymous enum member.
985 (long_options): Add entry for it.
986 (getargs): Add case for it calling compute_pkgdatadir.
987 * src/output.c (output_skeleton): Encapsulate data directory
988 computation from here...
989 (prepare): ... and from here...
990 (compute_pkgdatadir): ... into this new function.
991 * src/output.h (compute_pkgdatadir): Prototype.
992
9932007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
994
995 * src/print-xml.c (escape_bufs): New static global variable
996 replacing...
997 (xml_escape_n): ... the static local variable buf here.
998 (print_xml): Free memory for escape_bufs.
999 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
1000
10012007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
1002
1003 Replace `%push-parser' and `%push-pull-parser' with
1004 `%define push_pull "push"' and `%define push_pull "both"'.
1005 `%define push_pull "pull"' is the default.
1006 * doc/bison.texinfo (Push Decl, Push Parser Function,
1007 Pull Parser Function, Parser Create Function, Parser Delete Function):
1008 Update declarations.
1009 (Decl Summary, Table of Symbols): Replace %push-parser and
1010 %push-pull-parser entries with a %define push_pull entry.
1011 * data/bison.m4 (b4_percent_define_check_values): New macro.
1012 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
1013 definitions...
1014 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
1015 definitions...
1016 * data/push.c: ... to here and compute them from the value of the
1017 %define variable push_pull.
1018 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
1019 parsing requests here...
1020 * data/yacc.c: ... hack this to switch to push.c any time
1021 b4_use_push_pull_flag or the %define variable push_pull is set. This
1022 will go away when we mv push.c yacc.c.
1023 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
1024 push parsing is not supported since unused %define variables are
1025 reported anyway.
1026 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
1027 * src/muscle_tab.h (muscle_percent_define_check_values): Update
1028 comments for consistency with b4_percent_define_check_values.
1029 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
1030 muscles.
1031 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
1032 Remove.
1033 (prologue_declaration): Remove %push-parser and %push-pull-parser
1034 rules.
1035 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
1036 * tests/calc.at: Update declarations.
1037 * tests/input.at (%define enum variables): New test case.
1038 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
1039 declaration.
1040 (Push Parsing: Multiple impure instances): Update declaration.
1041 (Push Parsing: Unsupported Skeletons): New test case.
1042 * tests/torture.at (Exploding the Stack Size with Alloca): Update
1043 declaration.
1044 (Exploding the Stack Size with Malloc): Update declaration.
1045
10462007-09-24 Wojciech Polak <polak@gnu.org>
1047
1048 Add XSLT transformations.
1049
1050 * data/xslt/xml2dot.xsl: Transform XML into DOT.
1051 * data/xslt/xml2text.xsl: Transform XML into plain text.
1052 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
1053 * data/Makefile.am (xsltdir): New variable.
1054 (dist_xslt_DATA): Add xslt/*.xsl files.
1055
10562007-09-23 Paul Eggert <eggert@cs.ucla.edu>
1057
1058 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
1059 Problem reported by Wojciech Polak.
1060 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
1061 (xml_printf): Undo change I made on 21 September; that is,
1062 indent 2 spaces, not 1.
1063
10642007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
1065
1066 Pacify ./configure --enable-gcc-warnings.
1067 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
1068 `char const *' instead of `char *'.
1069 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
1070 local variable `sep'.
1071
10722007-09-21 Paul Eggert <eggert@cs.ucla.edu>
1073
1074 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
1075 elsewhere.
1076 * src/print-xml.c: Prefer "const" after types; that's more consistent.
1077 (xml_printf): Indent just 1 space for level.
1078 (e_char, xlate_char): Remove.
1079 (xml_escape_string): Rewrite to avoid undefined behavior (used
1080 storage that was freed from the stack).
1081 (xml_escape_n): Don't bother checking for subscript error.
1082
10832007-09-21 Wojciech Polak <polak@gnu.org>
1084
1085 Add Bison XML Automaton Report.
1086
1087 Add support for an -x option to generate an XML report.
1088 It is not documented yet.
1089 * src/print-xml.c: New file.
1090 * src/print-xml.h: Likewise.
1091 * lib/timevar.def (TV_XML): New var.
1092 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
1093 * src/conflicts.c: Include print-xml.h.
1094 (solved_conflicts_xml_obstack): New var.
1095 (log_resolution, conflicts_solve, conflicts_free):
1096 Add support for XML report.
1097 (conflicts_output_val): New function.
1098 * src/conflicts.h (conflicts_output_val): New decl.
1099 * src/files.c (spec_xml_file): New var.
1100 (compute_output_file_names, output_file_names_free): Add XML support.
1101 * src/files.h (spec_xml_file): New decl.
1102 * src/getargs.c (xml_flag): New var.
1103 (usage, short_options, long_options, getargs): Add XML support.
1104 * src/getargs.h (xml_flag): New decl.
1105 * src/gram.c: Include print-xml.h.
1106 (rule_lhs_print_xml, rule_rhs_print_xml):
1107 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
1108 New functions.
1109 * src/gram.h: Declare external ones.
1110 * src/main.c: Include print-xml.h.
1111 (main): Add XML support.
1112 * src/reduce.c: Include print-xml.h.
1113 (reduce_xml): New function.
1114 * src/reduce.h: Declare it.
1115 * src/state.c: Include print-xml.h.
1116 (state_new): Add XML support.
1117 (state_rule_lookahead_tokens_print_xml): New function.
1118 * src/state.h: Declare it.
1119 (struct state): New member solved_conflicts_xml.
1120 * src/symtab.c (symbol_class_get_string): New function.
1121 * src/symtab.h: Declare it.
1122
11232007-09-21 Paul Eggert <eggert@cs.ucla.edu>
1124
1125 * GNUmakefile: Switch to coreutils's version.
1126 * bootstrap: Likewise.
1127 * Makefile.cfg: Adjust to new GNUmakefile.
1128 * README-hacking: Likewise.
1129
1130 Import from gnulib:
1131
1132 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
1133 Bruno Haible <bruno@clisp.org>
1134
1135 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
1136 and is a script that invokes bison. Tighten the code. Add comments.
1137
11382007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
1139
1140 Spell "boolean" as "Boolean". Reported by Akim Demaille.
1141 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
1142 * doc/bison.texinfo (Decl Summary): Fix.
1143 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
1144 * tests/input.at (Boolean %define variables): Update output.
1145 * tests/skeletons.at (%define boolean variables: invalid skeleton
1146 defaults): Rename to...
1147 (%define Boolean variables: invalid skeleton defaults): ... this and
1148 update output.
1149
11502007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
1151
1152 In impure push mode, don't allow more than one yypstate to be allocated
1153 since multiple impure parsers would corrupt yynerrs.
1154 * data/push.c (yypstate_allocated): New static global variable
1155 initialized to 0.
1156 (yypull_parse): If yypstate_new returns 0, don't report it as memory
1157 exhaustion if yypstate_allocated is 1, but still return 2.
1158 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
1159 already 1. Otherwise, set it to 1.
1160 (yypstate_delete): Set it to 0.
1161 * tests/push.at (Push Parsing: Multiple impure instances): New test
1162 case.
1163
11642007-08-17 Bob Rossi <bob@brasko.net>
1165
1166 * doc/bison.texinfo (Push Decl): Document the push parser.
1167 (Table of Symbols): Ditto.
1168 (Pure Decl): Ditto.
1169 (Decl Summary): Ditto.
1170 (Multiple Parsers, Push Parser Function, Pull Parser Function,
1171 Parser Create Function, Parser Delete Function):
1172 Add new push parser symbols.
1173 (Table of Symbols): Document push-parser, push-pull-parser,
1174 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
1175
11762007-08-15 Paul Eggert <eggert@cs.ucla.edu>
1177
1178 Update to GPLv3.
1179 * doc/gpl-3.0.texi: New file.
1180 * doc/gpl.texi: Remove.
1181 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
1182 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
1183 * README-hacking, TODO, bootstrap, bootstrap.conf:
1184 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
1185 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
1186 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
1187 * data/lalr1.cc, data/lalr1.java, data/location.cc:
1188 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
1189 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
1190 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
1191 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
1192 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
1193 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
1194 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
1195 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
1196 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
1197 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
1198 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
1199 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
1200 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
1201 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
1202 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
1203 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
1204 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
1205 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
1206 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
1207 * src/complain.c, src/complain.h, src/conflicts.c:
1208 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
1209 * src/files.h, src/flex-scanner.h, src/getargs.c:
1210 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
1211 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
1212 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
1213 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
1214 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
1215 * src/print.c, src/print.h, src/print_graph.c:
1216 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
1217 * src/reduce.h, src/relation.c, src/relation.h:
1218 * src/revision.h, src/scan-code.h, src/scan-code.l:
1219 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
1220 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
1221 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
1222 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
1223 * tests/Makefile.am, tests/actions.at, tests/c++.at:
1224 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
1225 * tests/existing.at, tests/glr-regression.at:
1226 * tests/headers.at, tests/input.at, tests/java.at:
1227 * tests/local.at, tests/output.at, tests/push.at:
1228 * tests/reduce.at, tests/regression.at, tests/sets.at:
1229 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
1230 * tests/torture.at:
1231 Update to GPLv3.
1232
12332007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1234
1235 Get rid of broken %no-parser, -n, and --no-parser implementation and
1236 documentation.
1237 * TODO: Don't mention them.
1238 * doc/bison.1: Likewise.
1239 * doc/bison.texinfo (Decl Summary): Likewise.
1240 (Bison Options): Likewise.
1241 (Option Cross Key): Likewise.
1242 * src/getargs.c (no_parser_flag): Remove global variable.
1243 (usage): Don't print description of -n and --no-parser.
1244 (long_options): Remove --no-parser entry here.
1245 (getargs): Remove -n case in the switch here.
1246 * src/getargs.h (no_parser_flag): Remove extern.
1247 * tests/regression.at (Web2c Actions): Remove comment that mentions
1248 --no-parser.
1249
12502007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1251
1252 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
1253 name user variables starting with `yy'. Just pass NULL instead of a
1254 dummy local &yylval to yypush_parse.
1255 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
1256 starting with `yy'.
1257
12582007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
1259
1260 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
1261 true since it's then always used regardless of whether yyoverflow is
1262 defined. Reported by Christian Burger at
1263 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
1264 * THANKS: Add Christian Burger.
1265
1266 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1267 node names: say "Decl Summary" not "Bison Declaration Summary".
1268
12692007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
1270
1271 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
1272 determine whether this function has already complained about an invalid
1273 value for a %define boolean variable, don't check whether Bison has
1274 ever examined the value. As written, the check was a tautology.
1275 Instead, record and check for this complaint using a separate muscle.
1276
12772007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1278
1279 Fix push parsing memory leak reported by Brandon Lucia at
1280 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
1281 * THANKS: Add Brandon Lucia.
1282 * data/push.c (yypstate_delete): Free the stack if it was reallocated
1283 but the parse never completed and thus freed it.
1284 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
1285 * tests/testsuite.at: Include push.at.
1286 * test/push.at: New.
1287 (Push Parsing: Memory Leak for Early Deletion): New test case.
1288
12892007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
1290
1291 Improve handling of multiple S/R conflicts in the same state and of S/R
1292 conflicts involving multiple reductions.
1293 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
1294 set for a state here or Bison will abort if it is reassigned on a
1295 later conflicted reduction in the same state.
1296 Similarly, don't finalize and assign the solved conflicts report here
1297 or it will be lost if it is reassigned on a later conflicted reduction
1298 in the same state.
1299 (set_conflicts): Instead, assign them both here after all S/R conflicts
1300 in the state have been fully examined.
1301 * src/print.c (shift_set): Rename to...
1302 (no_reduce_set): ... this.
1303 (print_reductions): Update for rename, and add %nonassoc error action
1304 tokens to no_reduce_set so that, when printing the first remaining
1305 reduction on an error action token, the reduction is enclosed in
1306 brackets.
1307 (print_results): Update for rename.
1308 * tests/conflicts.at (Solved conflicts report for multiple reductions
1309 in a state): New test case.
1310 (%nonassoc error actions for multiple reductions in a state): New test
1311 case.
1312
1313 * src/main.c (main): Don't depend on C99 features.
1314
13152007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1316
1317 * build-aux/.cvsignore: Add compile.
1318 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
1319 uniwidth.
1320
13212007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
1322
1323 * bootstrap (slurp): Create target directories that don't exist.
1324 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
1325
13262007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1327
1328 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
1329 than item number.
1330 * closure.c (closure): Likewise.
1331 * state.h (reductions): Comment sorting of rules.
1332 (state): Comment sorting of items.
1333
13342007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
1335
1336 Fix C++ test cases after recent Gnulib changes. Discussed starting at
1337 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
1338 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
1339 definition in order to avoid Gnulib headers since we don't use config.h
1340 here.
1341 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
1342 rather than AT_DATA so that config.h is included.
1343
13442007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
1345
1346 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
1347 instead of fprintf. Guard these functions with #if YYDEBUG instead of
1348 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
1349 and so that YYFPRINTF is guaranteed to be defined here.
1350
13512007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1352
1353 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
1354 with...
1355 (muscle_percent_define_check_values): ... this more helpful function.
1356 Again, it's not used yet, but it will be.
1357 * src/muscle_tab.h: Likewise.
1358
1359 Improve some comments in parser table construction.
1360 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
1361 (generate_states): Don't mention ruleset, which is internal to closure.
1362 * src/closure.c (closure): Explain sorting of core and itemset, which
1363 is required for this function to behave correctly.
1364 * src/closure.h (closure): Mention sorting.
1365
13662007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
1367
1368 * src/lalr.c (state_lookahead_tokens_count): For code readability,
1369 move the check for disabled transitions to an aver since conflict
1370 resolution hasn't happened yet.
1371
1372 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
1373 labels a state as inconsistent just because it has error transitions.
1374 The original form of this check appeared in revision 1.1 of lalr.c,
1375 which was committed on 1991-12-21. Now (at least), changing the
1376 consistency label on such a state appears to have no useful effect in
1377 any of the places it is examined, which I enumerate below. The key
1378 point to understanding each item in this enumeration is that a state
1379 with an error transition is labelled consistent in the first place only
1380 if it has no rules, so the check cannot matter for states that have
1381 rules. (1) Labelling a state as inconsistent will cause set_conflicts
1382 to try to identify its conflicts, and a state must have *rules* to have
1383 conflicts. (2) Labelling a state as inconsistent will affect how
1384 action_row sets the default *rule* for the state. (3) Labelling a
1385 state as inconsistent will cause build_relations to add lookback edges
1386 to *rules* in that state.
1387 * src/state.h (struct state): Word the comment for member consistent
1388 more carefully.
1389
13902007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1391
1392 Don't depend on C99 features.
1393 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
1394 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
1395 * src/reader.c (check_and_convert_grammar): Fix for-loop.
1396 * src/state.c (state_mark_reachable_states): Fix for-loop.
1397 (state_remove_unreachable_states): Fix for-loop.
1398
1399 Don't widen struct state with member reachable just to temporarily
1400 record reachability. Instead, use a local bitset.
1401 * src/state.h (struct state): Remove member.
1402 * src/state.c (state_new): Don't initialize it.
1403 (state_mark_reachable_states): Rename to...
1404 (state_record_reachable_states): ... this, and use bitset.
1405 (state_remove_unreachable_states): Use bitset.
1406
14072007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
1408
1409 * src/Makefile.am (yacc): Quote target action commands properly so
1410 that the yacc script isn't corrupt. Reported by Hans Aberg at
1411 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
1412
1413 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
1414 the case of pure parsers. Reported by Frans Englich at
1415 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
1416 * THANKS: Add Frans Englich.
1417
1418 * NEWS (2.3a+): In the %code entry, reference section `Bison
1419 Declaration Summary' from the manual now since the %code summary has
1420 moved there.
1421 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
1422 in the rules section must be terminated by semicolons.
1423
14242007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1425
1426 Extend the front-end API for %define variables to more completely
1427 mirror the back-end. This will be useful in the future.
1428 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
1429 Update comments to mention the new front-end counterparts of these
1430 macros.
1431 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
1432 for muscle_string_decode and muscle_location_decode.
1433 (muscle_string_decode): New static function.
1434 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
1435 (muscle_percent_define_get, muscle_percent_define_ifdef): New
1436 functions.
1437 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
1438 muscle_percent_define_get to mimic the b4_percent_define_flag_if
1439 implementation more closely.
1440 (muscle_percent_define_invalid_value): New function.
1441 * src/muscle_tab.h (muscle_percent_define_get,
1442 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
1443 Prototype.
1444
14452007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1446
1447 * NEWS (2.3a+): Mention yesterday's state-removal change.
1448 (2.3a): Remove the %language entry, which was added after 2.3a.
1449 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
1450 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
1451 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
1452 tests/existing.at: Update copyright date.
1453
14542007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1455
1456 If conflict resolution makes states unreachable, remove those states,
1457 report rules that are then unused, and don't report conflicts in those
1458 states.
1459 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
1460 New global function.
1461 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
1462 function.
1463 * src/main.c (main): After conflict resolution, remove the unreachable
1464 states and update all data structures that reference states by number.
1465 * src/state.c (state_new): Initialize each state's reachable member to
1466 false.
1467 (state_mark_reachable_states): New static function.
1468 (state_remove_unreachable_states): New global function.
1469 * src/state.h (struct state): Add member bool reachable.
1470 (state_remove_unreachable_states): Prototype.
1471 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1472 New test case.
1473 * tests/existing.at (GNU pic Grammar): Update test case output now that
1474 an unused rule is discovered.
1475
14762007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1477
1478 Minor code cleanup in parser table construction.
1479 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
1480 (new_itemsets, save_reductions): Update for rename to nitemset.
1481 * src/closure.c (nritemset): Rename to...
1482 (nitemset): ... this since the "r" appears to meaningless and isn't
1483 used in the comments.
1484 (closure): Update for rename.
1485 * src/closure.h (nritemset): Update extern to...
1486 (nitemset): ... this.
1487 * src/lalr.c (LA): Fix a typo in comments.
1488 * src/print.c (print_core): Update for rename to nitemset.
1489 * src/print_graph.c (print_graph): Likewise.
1490 * src/state.h: Fix some typos in header comments.
1491
14922007-04-04 Paul Eggert <eggert@cs.ucla.edu>
1493
1494 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
1495 still sticks to ASCII. Sorry!
1496
1497 * README-hacking: New file, taken mostly from coreutils, with changes
1498 for Bison. Contains much of the contents of:
1499 * README-cvs: Remove.
1500 * bootstrap: Sync from gnulib.
1501 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
1502 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
1503
15042007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
1505
1506 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
1507 Setzer.
1508 (Java Differences): Fix some typos.
1509 * THANKS: Add Sebastian Setzer.
1510
15112007-03-07 Paolo Bonzini <bonzini@gnu.org>
1512
1513 * data/java.m4 (b4_single_class_if): Remove.
1514 (b4_abstract_if): Look at "%define abstract".
1515 (b4_lexer_if): New.
1516 (b4_union_name): Rename...
1517 (b4_yystype): ... to this. Map to "%define stype".
1518 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
1519 b4_maybe_throws): Fix quoting.
1520 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
1521 * data/lalr1.java (Lexer interface): Always define.
1522 (Lexer interface within parser class): Remove.
1523 (YYLexer class): New, used when "%code lexer" is present.
1524 (constructor): When "%code lexer" is used, pass %lex-param
1525 to the lexer constructor.
1526 (yylex, yyparse): Remove %lex-param from method invocations
1527 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
1528
1529 * doc/bison.texinfo (Java Bison Interface): Mention "%define
1530 abstract". Rename "%define union_name" to "%define stype".
1531 Rename method names according to previous patch.
1532 (Java Scanner Interface): Describe "%code lexer" instead of
1533 "%pure-parser" and "%define single_class".
1534 (Java Differences): Mention "%code lexer".
1535
1536 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
1537 Include scanner here, using macros from tests/local.at.
1538 (AT_DATA_CALC_Y): Remove final argument.
1539 (_AT_CHECK_JAVA_CALC): Likewise.
1540 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
1541 of %locations and %error-verbose.
1542 (main): Test with and without %lex-param.
1543 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
1544 (AT_BISON_OPTION_POPDEFS): Pop it.
1545
15462007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1547
1548 DJGPP spefic issue. Inhibit the use of disallowed characters for
1549 file name genertion on Win98, WinXP, etc. These are |<>":?*\
1550 and concern testsuite case 46.
1551 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
1552 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
1553 * djgpp/config.bat: Inhibit the use of disallowed characters.
1554
15552007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1556
1557 Miscellaneous %define and %code cleanup.
1558 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
1559 values are interpreted.
1560 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
1561 documentation a little more.
1562 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
1563 muscle_percent_define_insert, muscle_percent_code_grow): New
1564 functions/macros.
1565 * src/muscle_tab.h (muscle_percent_define_insert,
1566 muscle_percent_code_grow): Prototype.
1567 * src/parse-gram.y (prologue_declaration): Use
1568 muscle_percent_define_insert and muscle_percent_code_grow when parsing
1569 %define and %code directives.
1570
1571 Make it easy to share %define boolean variables between the front-end
1572 and back-end. Though not used yet, this will be useful in the future.
1573 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
1574 Bison uses of names rather than just skeleton uses of names.
1575 (b4_percent_define_get, b4_percent_define_ifdef): Rename
1576 b4_percent_define_skeleton_variables(VARIABLE) to
1577 b4_percent_define_bison_variables(VARIABLE).
1578 (b4_percent_code_get, b4_percent_code_ifdef): Rename
1579 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
1580 b4_percent_code_bison_qualifiers(QUALIFIER).
1581 (b4_check_user_names_wrap): Update for renames.
1582 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
1583 muscle_percent_define_default): New functions mimicking
1584 b4_percent_define_flag_if and b4_percent_define_default.
1585
1586 For %define variables, report locations for invalid values and
1587 redefinitions.
1588 * data/bison.m4 (b4_percent_define_flag_if): Read
1589 b4_percent_define_loc(VARIABLE) to report the location of an invalid
1590 value for VARIABLE.
1591 (b4_percent_define_default): Save a special location in
1592 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
1593 must later be reported as invalid.
1594 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
1595 functions.
1596 (muscle_percent_define_insert): Record the location of VARIABLE in
1597 muscle percent_define_loc(VARIABLE), and use it to report the previous
1598 location for a redefinition.
1599 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
1600 (muscle_percent_define_default): Update like b4_percent_define_default.
1601 (muscle_grow_user_name_list): Rename to...
1602 (muscle_user_name_list_grow): ... this for consistency and use
1603 muscle_location_grow.
1604 * src/muscle_tab.h (muscle_location_grow): Prototype.
1605 * tests/input.at (%define errors): Update expected output.
1606 * tests/skeletons.at (%define boolean variables: invalid skeleton
1607 defaults): New test case.
1608
16092007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
1610
1611 * src/print.c (lookahead_set, state_default_rule): Remove.
1612 (print_reductions): Replace state_default_rule invocation with
1613 equivalent use of yydefact, which was computed in token_actions in
1614 tables.c.
1615 (print_results): Don't allocate lookahead_set.
1616
16172007-02-27 Paolo Bonzini <bonzini@gnu.org>
1618
1619 * data/lalr1.java: Prefix all private members with yy.
1620
16212007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
1622
1623 Use YYFPRINTF instead of fprintf where appropriate. Reported by
1624 Sebastien Fricker at
1625 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
1626 * THANKS: Add Sebastien Fricker.
1627 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
1628 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
1629 accept a variable number of arguments.
1630
16312007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1632
1633 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
1634
16352007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1636
1637 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
1638 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
1639 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
1640
16412007-02-11 Paul Eggert <eggert@cs.ucla.edu>
1642
1643 Undo my 2007-02-07 change, switching back to the c-strcase module
1644 introduced in the 2007-02-03 change. Bruno Haible reported that
1645 the 2007-02-07 change would be dangerous in Turkish if we add a
1646 language whose name contains "i", since "i" is not lowercase "I"
1647 in Turkish.
1648 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
1649 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
1650 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
1651 * m4/.cvsignore: Remove strcase.m4.
1652 * src/getargs.c: Revert 2007-02-07 change, as follows.
1653 Include c-strcase.h.
1654 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
1655
16562007-02-11 Bruno Haible <bruno@clisp.org>
1657
1658 Enable the Java related testsuite tests when the only Java compiler
1659 found is a gcj < 4.3. Discussed at
1660 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
1661 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
1662
16632007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
1664
1665 * data/Makefile.am: Update copyright date.
1666 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
1667 yypstate_new returns NULL.
1668 (yypstate_new): Return NULL if malloc does.
1669 * src/reader.c (packgram): Move translation of rule actions from the
1670 beginning of packgram to...
1671 (check_and_convert_grammar): ... here right before packgram is invoked
1672 so it's easier to write more complete comments, and remove redundant
1673 code.
1674
16752007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
1676
1677 As in semantic actions, make @$ in %initial-action, %destructor, and
1678 %printer imply %locations.
1679 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
1680 scanning @$.
1681 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
1682 (@$ in %initial-action implies %locations,
1683 @$ in %destructor implies %locations,
1684 @$ in %printer implies %locations): ... these new test cases.
1685
16862007-02-07 Paul Eggert <eggert@cs.ucla.edu>
1687
1688 Undo most of the 2007-02-03 change, switching to the strcase module
1689 now that gnulib strcase has been fixed.
1690 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
1691 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
1692 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
1693 * m4/.cvsignore: Add strcase.m4.
1694 * src/getargs.c: Revert 2007-02-03 change, as follows.
1695 Don't include c-strcase.h.
1696 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
1697 strcasecmp has "unspecified behavior" outside the POSIX locale,
1698 but it works fine in practice if at least one argument is ASCII,
1699 as is the case in Bison.
1700
17012007-02-07 Paolo Bonzini <bonzini@gnu.org>
1702
1703 * tests/java.at: Skip tests if only one of javac/java is present.
1704 Reported by Joel E. Denny.
1705 * tests/atlocal.in: Adjust copyright years.
1706
17072007-02-05 Paolo Bonzini <bonzini@gnu.org>
1708
1709 * data/lalr1.java (Stack): Work around old verifiers that disallow
1710 access to the private fields of an inner class, from the outer class.
1711 We can make Stack's fields public because user code doesn't have access
1712 to the instance of Stack used by parse(). Reported by Paul Eggert.
1713
17142007-02-03 Paul Eggert <eggert@cs.ucla.edu>
1715
1716 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
1717 the right spot for these files?
1718 * bootstrap.conf (gnulib_modules): Add c-strcase.
1719 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
1720 c-strncasecmp.c.
1721 * src/getargs.c: Include c-strcase.h.
1722 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
1723 to avoid unspecified behavior.
1724
17252007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
1726
1727 * doc/bison.texinfo (Decl Summary): Correct typo.
1728
17292007-01-30 Paolo Bonzini <bonzini@gnu.org>
1730
1731 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
1732 Complain if the value does not match empty, "true" or "false".
1733 * data/c++.m4: Adjust default definitions of %define variables.
1734 * data/java.m4: Adjust default definitions of %define variables.
1735 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
1736 to above behavior.
1737 * tests/input.at (Boolean %define variables): Test new behavior.
1738
17392007-01-29 Paolo Bonzini <bonzini@gnu.org>
1740
1741 * NEWS: Mention java.
1742 * TODO: Remove things that are done.
1743 * bootstrap.conf: Add javacomp-script and javaexec-script.
1744 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
1745
1746 * data/Makefile.am: Add new files.
1747 * data/java-skel.m4: New.
1748 * data/java.m4: New.
1749 * data/lalr1.java: New.
1750
1751 * doc/bison.texinfo: Put "A Complete C++ Example" under
1752 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
1753 under Other Languages.
1754
1755 * src/getargs.c (valid_languages): Add Java.
1756 * src/getargs.h (struct bison_language): Update size of string fields.
1757
1758 * tests/Makefile.am: Add java.at.
1759 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
1760 * tests/java.at: New.
1761 * tests/testsuite.at: Include it.
1762
17632007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
1764
1765 Clean up.
1766 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
1767 at_directive_argv arguments so these no longer have to be global
1768 variables. Also, update the implementation for the following changes.
1769 (fail_for_at_directive_too_many_args,
1770 fail_for_at_directive_too_few_args): Add at_directive_name argument.
1771 (at_directive_name): Remove as at_directive_argv[0] will be used for
1772 this now.
1773 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
1774 for the directive name.
1775 (at_directive_argc, at_directive_argv): Make these local within
1776 skel_lex instead of global.
1777 (INITIAL): Update directive start action for above changes.
1778 (SC_AT_DIRECTIVE_ARG): Rename to...
1779 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
1780 (SC_AT_DIRECTIVE_SKIP_WS): Update.
1781 (scan_skel): Move yylex_destroy to...
1782 (skel_scanner_free): ... here.
1783 * tests/skeletons.at (installed skeleton file name): Rename to...
1784 (installed skeleton file names): ... this.
1785
17862007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
1787
1788 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1789 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
1790 Summary" not "Directives".
1791 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
1792 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
1793 since the former is now the more complete one.
1794 (Prologue Alternatives): Likewise and do the same for %defines.
1795 (Table of Symbols): Add summary of %code, add summary of %define, and
1796 move full %code documentation to...
1797 (Decl Summary): ... here for consistency with other entries in these
1798 sections.
1799 Move %define entry in order to keep this list alphabetized.
1800 Reword %define entry a little to put less emphasis on the skeleton
1801 concept, which most users shouldn't have to think about.
1802
18032007-01-26 Paul Eggert <eggert@cs.ucla.edu>
1804
1805 Adjust to recent gnulib changes.
1806 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
1807 Add string.h, string_.h, unistd_.h, wchar_.h.
1808 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
1809 * src/system.h: Don't include <stpcpy.h>; this is now done by
1810 <string.h>.
1811
18122007-01-23 Paolo Bonzini <bonzini@gnu.org>
1813
1814 Simplify implementation of unqualified %code, implement macros for
1815 uniform treatment of boolean %define flags. Document %define.
1816 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
1817 b4_percent_code_ifdef): New.
1818 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
1819 * data/c++.m4: Define default value for global_tokens_and_yystype.
1820 * data/glr.cc: Likewise.
1821 * data/location.cc: Use b4_percent_define_flag_if.
1822
1823 * doc/bison.texinfo (Decl Summary): Document %define.
1824
1825 * src/parse-gram.y (Unqualified %code): Change muscle name to
1826 b4_percent_code().
1827 (content.opt): Default to empty.
1828
18292007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1830
1831 Implement support for relative and absolute skeleton file names.
1832 Discussed starting at
1833 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
1834 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
1835 (Bison Options): Document in --skeleton entry.
1836 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
1837 full_skeleton can't necessarily hold all of pkgdatadir.
1838 If the specified skeleton file name contains a `/', don't prepend
1839 pkgdatadir.
1840 * src/parse-gram.y (prologue_declaration): If the specified skeleton
1841 file name contains a `/', prepend the grammar file directory.
1842 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
1843 * skeletons.at: New file.
1844 (relative skeleton file names): New test case.
1845 (installed skeleton file names): New test case.
1846 * tests/testsuite.at: Include skeletons.at.
1847
1848 * bootstrap: Update copyright to 2007.
1849
18502007-01-17 Paolo Bonzini <bonzini@gnu.org>
1851
1852 * bootstrap: Remove occurrences of .#bootmp from the files.
1853
18542007-01-17 Akim Demaille <akim@epita.fr>
1855
1856 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1857 nonterminals.
1858 Use per-type %printer.
1859
18602007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1861
1862 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1863 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1864 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1865 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1866 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1867 tests/glr-regression.at, tests/input.at, tests/local.at,
1868 tests/output.at, tests/torture.at: Update copyright to 2007.
1869
18702007-01-16 Akim Demaille <akim@epita.fr>
1871
1872 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1873 error code.
1874 (Calc++ Scanner): Exit with failure if we can't open the input
1875 file.
1876 Accept "-" standing for stdin.
1877 (Calc++ Top Level): Print the result only if the parsing was
1878 successful.
1879
18802007-01-16 Akim Demaille <akim@epita.fr>
1881
1882 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1883
18842007-01-15 Paolo Bonzini <bonzini@gnu.org>
1885 and Joel E. Denny <jdenny@ces.clemson.edu>
1886
1887 Clean up %define and %code implementation in M4 some. Most
1888 importantly, rename all related macros to be in the b4_percent_define
1889 and b4_percent_code namespaces. Also, complete support for `.' in
1890 %define variable names and %code qualifiers.
1891 * data/bison.m4 (b4_check_user_names): Check for special
1892 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1893 m4_foreach loops.
1894 (b4_get_percent_define, b4_get_percent_code): Rename to...
1895 (b4_percent_define_get, b4_percent_code_get): ... these.
1896 Extend documentation with examples.
1897 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1898 b4_percent_define_skeleton_variables and
1899 b4_percent_code_skeleton_qualifiers.
1900 Expect any value for the %define variable `foo' to be stored in the
1901 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1902 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1903 expect any unqualified %code blocks to be stored in a macro named
1904 `b4_percent_code_unqualified'.
1905 Use m4_indir so that %define variable names and %code qualifiers can
1906 contain `.', which is allowed by the grammar parser.
1907 (b4_percent_define_default): New macro to set a default value for a
1908 %define variable.
1909 (m4_wrap): Update wrapped code, and fix some underquoting.
1910 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1911 Expect grammar uses of %define variables and %code qualifiers to be
1912 defined in b4_percent_define_user_variables and
1913 b4_percent_code_user_qualifiers.
1914 * data/c++.m4: Use b4_percent_define_default rather than
1915 m4_define_default. Fix some underquoting. Skeleton usage of %define
1916 variable define_location_comparison now implies skeleton usage of
1917 %define variable filename_type.
1918 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1919 data/push.c, data/yacc.c: Update macro names.
1920 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1921 muscle names.
1922
19232007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1924
1925 DJGPP specific issues.
1926
1927 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1928 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1929
19302007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1931
1932 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1933 run parsers in all tests so that Valgrind is invoked during
1934 maintainer-check-valgrind.
1935 (Duplicate representation of merged trees): Free all semantic values.
1936 (Duplicated user destructor for lookahead): Likewise.
1937
19382007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1939
1940 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1941 command-line prefix.
1942 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1943 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1944 miss Valgrind messages.
1945 (Exploding the Stack Size with Malloc): Likewise.
1946
19472007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1948
1949 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1950 locals. Reported by Juan Manuel Guerrero at
1951 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1952 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1953 Fix some indentation also.
1954 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1955 explaining this issue.
1956
19572007-01-09 Paolo Bonzini <bonzini@gnu.org>
1958 and Joel E. Denny <jdenny@ces.clemson.edu>
1959
1960 Simplify union and prologue handling, and escape union and lex/parse
1961 params with digraphs.
1962 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1963 values to the empty string since these are no longer guaranteed
1964 initialized by the front-end.
1965 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1966 braces around b4_user_stype since this is no longer done by the
1967 front-end.
1968 * src/files.c, src/files.h (pre_prologue_obstack,
1969 post_prologue_obstack): Remove.
1970 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1971 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1972 with digraphs. This fixes lex params and parse params.
1973 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1974 * src/output.c (prepare): Remove muscle insertion of the prologues.
1975 (output): Remove freeing of pre_prologue_obstack and
1976 post_prologue_obstack.
1977 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1978 than prologue_augment for prologue parsing so you don't need prologue
1979 obstacks.
1980 (grammar_declaration): For %union RHS, use `braceless' instead of
1981 "{...}" so that braces are already stripped and code is escaped with
1982 digraphs.
1983 * src/reader.c (prologue_augment): Remove.
1984 (reader): Remove initialization of pre_prologue_obstack and
1985 post_prologue_obstack.
1986 * src/reader.h (prologue_augment): Remove.
1987
1988 * data/c.m4: Remove stray parenthesis.
1989
19902007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1991
1992 Remove quotes from variables names in %define directives and from
1993 qualifiers in %code directives, and restrict the characters that are
1994 allowed in them to M4-friendly ones. For %define, continue to support
1995 the quoted form as a deprecated feature. Discussed starting at
1996 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1997 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1998 %code.
1999 * doc/bison.texinfo (Prologue Alternatives): Update.
2000 (Decl Summary): In %defines entry, update mention of `%code requires'
2001 and `%code provides'.
2002 (C++ Location Values): Update %define uses.
2003 (Calc++ Parser Interface): Likewise.
2004 (Calc++ Parser): Likewise, and update `%code requires' uses.
2005 (Table of Symbols): Update %code documentation.
2006 * src/parse-gram.y (prologue_declaration): For %define variables, use
2007 `variable' instead of `STRING'.
2008 (grammar_declaration): For %code qualifiers, use `ID' instead of
2009 `STRING'.
2010 (variable): New nonterminal that takes an `ID' or a `STRING'.
2011 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
2012 and %define uses.
2013 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
2014 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
2015 (%define errors): Update %define uses.
2016
20172007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2018
2019 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
2020 instead of muscle_insert for %define values so that M4-special
2021 characters are replaced with digraphs.
2022 * tests/input.at (%define errors): Extend to check weird values.
2023
20242007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2025
2026 Instead of having skeletons declare all valid %define variables and
2027 %code qualifiers, provide macros that retrieve the associated values
2028 and build these lists automatically. Thus Bison will now warn when a
2029 variable or qualifier is not used by the skeleton in the current
2030 invocation regardless of whether it might sometimes be used by that
2031 skeleton in other invocations. Also, move all %define value macros to
2032 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
2033 form, which is replaced by %code.
2034 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
2035 (b4_check_user_names): ... this, and change the series of valid name
2036 arguments to a single list argument for names used in the skeleton
2037 similar to the existing list argument for names used in the grammar.
2038 Warn instead of complaining.
2039 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
2040 values and %code code, to format %code code properly, and to build
2041 lists of all %define variables and %code qualifiers used in the
2042 skeleton: b4_skeleton_percent_define_variables and
2043 b4_skeleton_percent_code_qualifiers.
2044 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
2045 Remove, and...
2046 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
2047 the skeleton names lists can finish building first. In place of
2048 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
2049 expect the lists b4_user_percent_define_variables and
2050 b4_user_percent_code_qualifiers.
2051 * data/c++.m4: Where setting default values for b4_parser_class_name,
2052 b4_location_type, b4_filename_type, b4_namespace, and
2053 b4_define_location_comparison, update their names to the
2054 b4_percent_define_ namespace.
2055 * data/glr.c: Don't use b4_check_percent_define_variables and
2056 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
2057 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
2058 (b4_parser_class_name, b4_namespace): Define these using
2059 b4_get_percent_define for parser_class_name and namespace.
2060 * data/location.cc: Use b4_get_percent_define.
2061 * data/push.c: Don't use b4_check_percent_define_variables and
2062 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
2063 * data/yacc.c: Likewise, and don't call m4_exit in
2064 b4_use_push_for_pull_if or m4_wrap code will never execute.
2065 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
2066 Rename to...
2067 (muscle_grow_user_name_list): ... this for consistency with the
2068 terminology used in bison.m4.
2069 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
2070 %define variable names, and rename muscle used_percent_define_variables
2071 to user_percent_define_variables.
2072 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
2073 user_percent_code_qualifiers.
2074 (content): Remove.
2075 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
2076 {CODE} form is no longer accepted.
2077 * tests/input.at (Reject bad %code qualifiers): Rename to...
2078 (Reject unused %code qualifiers): ... this, and update test output.
2079 (%define error): Update test output.
2080
20812007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
2082
2083 Check for unrecognized %define variables similar to checking for
2084 unrecognized %code qualifiers. Check for redefined %define variables.
2085 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
2086 generalizes...
2087 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
2088 (b4_check_percent_define_variables): New, also wraps it.
2089 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
2090 variables using b4_check_percent_define_variables.
2091 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
2092 all those exercised in the test suite and all those listed in the
2093 `Default values' section of c++.m4. Are there others?
2094 * data/push.c, data/yacc.c: Declare no valid %define variables.
2095 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
2096 similar to muscle_find, but it works even when the muscle stores a
2097 const value.
2098 (muscle_grow_used_name_list): New function for constructing the used
2099 name list muscles that b4_check_for_unrecognized_names requires.
2100 * src/parse-gram.y (prologue_declaration): Warn if a variable is
2101 %define'd more than once. Define the b4_used_percent_define_variables
2102 muscle with muscle_grow_used_name_list.
2103 (grammar_declaration): Abbreviate %code code with
2104 muscle_grow_used_name_list.
2105 * tests/input.at (%define errors): New.
2106
21072007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2108
2109 Provide warn_at, complain_at, and fatal_at function callbacks to the
2110 skeletons, and use this for %code qualifier complaints.
2111 * data/bison.m4 (b4_error_at): New, invoked by...
2112 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
2113 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
2114 @fatal_at(...@) directives.
2115 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
2116 qualifiers in b4_used_percent_code_qualifiers and to use
2117 b4_complain_at.
2118 * src/location.c, src/location.h (boundary_set_from_string): New global
2119 function.
2120 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
2121 function.
2122 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
2123 to b4_used_percent_code_qualifiers.
2124 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
2125 function.
2126 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
2127 (lineno): Rename to...
2128 (out_lineno): ... this so I don't misunderstand it again.
2129 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
2130 here; these newlines are in the input but not the output file.
2131 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
2132 (at_directive_perform): ... this new static function, and add handling
2133 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
2134 directives.
2135 * tests/input.at (Reject bad %code qualifiers): Update test output with
2136 locations and extend.
2137
2138 * tests/output.at (Output file name: [, Output file name: ]): Remove
2139 bogus comment about these tests failing.
2140
21412007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2142
2143 Clean up b4_check_percent_code_qualifiers a little.
2144 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
2145 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
2146 documentation and add examples.
2147 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
2148 qualifiers here.
2149
21502007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2151
2152 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
2153 unreliable -- especially when they're hidden inside another macro.
2154 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
2155 data/c.m4: Remove m4_divert(-1).
2156 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2157 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
2158 m4_divert_push(0) and m4_divert_pop(0).
2159 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
2160 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
2161 pushed and popped by m4sugar, should be first on the stack.
2162
2163 Provide warn, complain, and fatal function callbacks to the skeletons.
2164 This provides more flexibility than m4_fatal, improves the error
2165 message format, and captures messages for translation. Discussed
2166 starting at
2167 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
2168 * data/bison.m4 (b4_error): New, invoked by...
2169 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
2170 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
2171 directives. Because these M4 macros might be called when the current
2172 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
2173 the previous removal of uses of m4_divert, which caused trouble.
2174 (b4_check_percent_code_qualifiers): Use b4_complain instead of
2175 m4_fatal to report unrecognized %code qualifiers.
2176 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
2177 push parser requests.
2178 * data/glr.c: Use b4_complain instead of m4_fatal to report
2179 non-deterministic push parser requests.
2180 Update @output usage to @output(...@) form.
2181 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
2182 report missing %defines. Update @output usage to @output(...@) form.
2183 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
2184 @output(...@) form.
2185 * src/main.c (main): Invoke skel_scanner_free.
2186 * src/scan-skel.h (skel_scanner_free): Prototype new function.
2187 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
2188 obstack_for_string from flex-scanner.h.
2189 (YY_DECL): Use to declare skel_lex static.
2190 (decode_at_digraphs): Remove; now handled in the new
2191 SC_AT_DIRECTIVE_ARG start condition.
2192 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
2193 functions.
2194 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
2195 at_directive_argv): New static globals.
2196 (INITIAL): Use fail_for_invalid_at.
2197 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
2198 recognize the start of a generalized `@directive(...@)' form and
2199 start...
2200 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
2201 directive args (using the new obstack_for_string), to decode the
2202 contained @ diagraphs, and to perform the directive. It recognizes
2203 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
2204 @output(...@).
2205 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
2206 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
2207 `@,'.
2208 (scan_skel): Initialize obstack_for_string on the first call.
2209 (skel_scanner_free): New function to free obstack_for_string.
2210 * tests/input.at (Reject bad %code qualifiers): Update test output.
2211
22122007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
2213
2214 Consolidate the 4 prologue alternative directives (%code, %requires,
2215 %provides, and %code-top) into a single %code directive with an
2216 optional qualifier field. Discussed at
2217 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
2218 * NEWS (2.3a+): Rewrite the existing entry for the prologue
2219 alternatives.
2220 * doc/bison.texinfo (Prologue Alternatives): Update.
2221 (Decl Summary): Update to %code "requires" and %code "provides".
2222 (Calc++ Parser): Update to %code "requires".
2223 (Table of Symbols): Remove entries for %requires, %provides, and
2224 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
2225 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
2226 are replaced by b4_percent_code_provides and b4_percent_code_requires,
2227 which are skeleton-specific.
2228 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
2229 declare what %code qualifiers it supports and to complain if any other
2230 qualifiers were used in the grammar.
2231 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
2232 and b4_user_code([b4_percent_code_provides]) in place of
2233 b4_user_requires and b4_user_provides.
2234 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
2235 Add b4_user_code([b4_percent_code_top]) and
2236 b4_user_code([b4_percent_code]).
2237 Invoke b4_check_percent_code_qualifiers.
2238 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2239 PERCENT_REQUIRES): Remove.
2240 (grammar_declaration): Remove RHS's for %code-top, %provides, and
2241 %requires. Rewrite the %code RHS as the unqualified form defining the
2242 muscle b4_percent_code. Add another RHS for the qualified %code form,
2243 which defines muscles of the form b4_percent_code_QUALIFIER and the
2244 b4_used_percent_code_qualifiers muscle.
2245 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2246 PERCENT_REQUIRES): Remove.
2247 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
2248 %code "requires" and %code "provides".
2249 * tests/input.at (Reject bad %code qualifiers): New.
2250
22512007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2252
2253 Use the new code_props interface for destructors and printers.
2254 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
2255 printer_location members, and change the type of the destructor and
2256 printer members to code_props.
2257 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
2258 symbol_printer_get, semantic_type_destructor_set,
2259 semantic_type_printer_set, default_tagged_destructor_set,
2260 default_tagless_destructor_set, default_tagged_printer_set,
2261 default_tagless_printer_set): Use code_props in arguments and return
2262 types in place of char const * and location.
2263 (symbol_destructor_location_get, symbol_printer_location_get): Remove
2264 since the locations are now contained in the return of
2265 symbol_destructor_get and symbol_printer_get.
2266 * src/output.c (symbol_destructors_output, symbol_printers_output):
2267 Replace with...
2268 (symbol_code_props_output): ... this to eliminate duplicate code.
2269 (output_skeleton): Update to use symbol_code_props_output.
2270 * src/reader.c (symbol_should_be_used): Update use of
2271 symbol_destructor_get.
2272 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2273 Update uses of the various _destructor_set and _printer_set functions.
2274 * src/symtab.c: (default_tagged_destructor_location,
2275 default_tagless_destructor_location, default_tagged_printer_location,
2276 default_tagless_printer_location): Remove since we...
2277 (default_tagged_destructor, default_tagless_destructor,
2278 default_tagged_printer, default_tagless_printer): ... change the type
2279 of these to code_props.
2280 (symbol_new, semantic_type_new, symbol_destructor_set,
2281 semantic_type_destructor_set, symbol_destructor_get,
2282 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
2283 symbol_check_alias_consistency, default_tagged_destructor_set,
2284 default_tagless_destructor_set, default_tagged_printer_set,
2285 default_tagless_printer_set): Update.
2286 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
2287 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
2288 code_props members.
2289 (symbol_print): Use SYMBOL_CODE_PRINT.
2290
22912007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2292
2293 Use the new code_props interface for rule actions.
2294 * src/symlist.h (symbol_list): Replace action, action_location, and
2295 used members with a code_props action_props member.
2296 * src/reader.c (symbol_should_be_used, grammar_rule_check,
2297 grammar_midrule_action, grammar_current_rule_merge_set,
2298 grammar_current_rule_symbol_append, packgram): Update.
2299 * src/scan-code.h (translate_rule_action): Remove, no longer used.
2300 * src/scan-code.l (handle_action_dollar): Update.
2301 (translate_rule_action): Remove, no longer used.
2302 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
2303
23042007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2305
2306 Use the new code_props interface in parse-gram.y.
2307 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
2308 Update all uses of translate_* functions to use the new code_props
2309 interface and to use gram_scanner_last_string_free and
2310 code_scanner_last_string_free where possible.
2311 (grammar_declaration): symbol_list_destructor_set and
2312 symbol_list_printer_set now perform the translation, so don't do it
2313 here. Use gram_scanner_last_string_free where possible.
2314 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
2315 translate_code): Remove, no longer used.
2316 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
2317 symbol_list_printer_set): Perform code translation here rather than
2318 depending on the caller to do so.
2319
2320 * src/symlist.h (struct symbol_list): Correct some documentation typos.
2321 * src/scan-gram.h (gram_last_string): Remove declaration.
2322 * src/scan-gram.l (last_string): Declare it static.
2323
23242007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2325
2326 Encapsulate code properties and related functionality for the various
2327 destructors, printers, and actions into a code_props structure and
2328 interface. This patch merely implements code_props in scan-code.h and
2329 scan-code.l. Future patches will rewrite other modules to use it.
2330 Discussed starting at
2331 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
2332 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
2333 consistently initialize const structs that have an empty location
2334 field.
2335 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
2336 to ensure consistency.
2337 * src/scan-code.h (code_props): New structure.
2338 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
2339 function, macro, and const global variable for initializing a
2340 code_props with no code.
2341 (code_props_plain_init, code_props_symbol_action_init,
2342 code_props_rule_action_init, code_props_translate_code): The rest of
2343 the new code_props functional interface. Among other things, the init
2344 functions set the code_props kind field so that
2345 code_props_translate_code will know whether to behave like
2346 translate_symbol_action, translate_rule_action, or translate_code.
2347 These old translate functions must remain until all other modules are
2348 updated to use the new code_props interface.
2349 (code_scanner_last_string_free): New function similar to
2350 gram_scanner_last_string_free.
2351 (code_scanner_free): Add documentation.
2352 * src/scan-code.l: Implement the new interface.
2353 (code_lex): Make it static, add a code_props* argument, and remove the
2354 rule argument.
2355 (last_string): New static global similar to the one in scan-gram.l.
2356 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
2357 instead of rule.
2358 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
2359 code_props since Bison may one day use this information for destructors
2360 and printers.
2361 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
2362 (handle_action_dollar): Use symbol_list_n_get and set used flag
2363 directly since symbol_list_n_used_set is removed.
2364 (translate_action): Add a code_props* argument and remove the rule,
2365 action, and location arguments. Pass the code_props* on to code_lex.
2366 (translate_rule_action, translate_symbol_action, translate_code):
2367 Rewrite as wrappers around the new code_props interface.
2368 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
2369 it would eventually need to break the encapsulation of code_props.
2370
23712007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2372
2373 * etc/.cvsignore: New.
2374
23752007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2376
2377 Add maintainer-push-check to run maintainer-check using push parsing in
2378 place of pull parsing where available.
2379 * Makefile.am (maintainer-push-check): New.
2380 * data/bison.m4 (b4_use_push_for_pull_if): New.
2381 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
2382 appropriately based on their existing values.
2383 (yypush_parse): Don't print push-parser-specific diagnostics if push
2384 parsing is being used in place of pull parsing.
2385 * data/yacc.c: If push parsing should replace pull parsing, redirect to
2386 push.c.
2387 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
2388 variable, and insert b4_use_push_for_pull_flag into muscles.
2389 * tests/Makefile.am (maintainer-push-check): New.
2390
23912006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2392
2393 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
2394 (whether successful or failed) so that yypush_parse can be invoked
2395 again to start a new parse using the same yypstate.
2396 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
2397 check multiple yypull_parse invocations on the same yypstate. For pull
2398 mode, extend to check multiple yyparse invocations.
2399 (Exploding the Stack Size with Alloca): Extend to try with
2400 %push-pull-parser.
2401 (Exploding the Stack Size with Malloc): Likewise.
2402
2403 * tests/calc.at (Simple LALR Calculator): Don't specify
2404 %skeleton "push.c" since %push-pull-parser implies that now.
2405 * tests/headers.at (export YYLTYPE): Don't check for the push
2406 declarations. Otherwise, this test case can't be used to see if push
2407 mode can truly emulate pull mode.
2408 * tests/input.at (Torturing the Scanner): Likewise.
2409 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
2410 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
2411 AT_YACC_IF, which now includes the case of push mode since %skeleton
2412 need not be used for push mode. This will be more intuitive once
2413 push.c is renamed to yacc.c.
2414
24152006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2416
2417 For push mode, convert yyparse from a macro to a function, invoke yylex
2418 instead of passing a yylexp argument to yypull_parse, and don't
2419 generate yypull_parse or yyparse unless %push-pull-parser is declared.
2420 Discussed starting at
2421 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
2422 * data/bison.m4 (b4_pull_if): New.
2423 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
2424 * data/push.c: Improve M4 quoting a little.
2425 (b4_generate_macro_args, b4_parenthesize): Remove.
2426 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
2427 any time a pull parser is requested.
2428 Don't #define this as a wrapper around yypull_parse. Instead, when
2429 both push and pull are requested, make it a function that does that
2430 same thing.
2431 (yypull_parse): If there's a b4_prefix, #define this to
2432 b4_prefix[pull_parse] when both push and pull are requested.
2433 Don't define this as a function unless both push and pull are
2434 requested.
2435 Remove the yylexp argument and hard-code yylex invocation instead.
2436 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
2437 %push-parser.
2438 * src/getargs.c (pull_parser): New global initialized to true.
2439 * getargs.h (pull_parser): extern it.
2440 * src/output.c (prepare): Insert pull_flag muscle.
2441 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
2442 (prologue_declaration): Set both push_parser and pull_parser = true for
2443 %push-pull-parser. Set push_parser = true and pull_parser = false for
2444 %push-parser.
2445 * src/scan-gram.l: Don't accept %push_parser as an alternative to
2446 %push-parser since there's no backward-compatibility concern here.
2447 Scan %push-pull-parser.
2448 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
2449 instead of %push-parser.
2450 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
2451 prototype it in the module that calls yyparse.
2452 * tests/input.at (Torturing the Scanner): Likewise.
2453 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
2454
24552006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
2456
2457 Update etc/bench.pl. Optimize push mode a little (the yyn change
2458 deserves most of the credit).
2459 * Makefile.am (SUBDIRS): Add etc subdirectory.
2460 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
2461 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
2462 yytoken, yyval, and yyloc declarations to...
2463 (yyparse or yypush_parse): ... here to improve performance. For
2464 yypush_parse invocations after the first, be sure to assign yyn its old
2465 value again.
2466 (yypstate_new): Don't bother initializing the yyresult field since the
2467 initial value isn't used.
2468 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
2469 remove the #define that, in push mode, set it to yyps->NAME.
2470 * etc/Makefile.am: New.
2471 * etc/bench.pl: Remove and build it instead from...
2472 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
2473 "tests/bison" from the build directory by default rather than just
2474 invoking "bison" from $PATH.
2475 (calc_grammar): Update push parser code: don't declare yylval globally,
2476 don't define yyparse_wrapper, and don't #define yyparse.
2477 (bench_grammar): Update to check all working combinations of yacc.c,
2478 push.c, impure, pure, pull, and push.
2479
24802006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2481
2482 For push mode, add pull wrappers around yypush_parse.
2483 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
2484 (yypull_parse): New function wrapping yypush_parse.
2485 (yyparse): New #define wrapping yypull_parse.
2486 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
2487 is declared.
2488 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
2489 prototype yylex in the module that calls yyparse, and don't prototype
2490 yyparse there. Otherwise, the yyparse expansion won't compile.
2491 * tests/input.at (Torturing the Scanner): Likewise.
2492
24932006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2494
2495 Enable push parsers to operate in impure mode. Thus, %push-parser no
2496 longer implies %pure-parser. The point of this change is to move
2497 towards being able to test the push parser code by running the entire
2498 test suite as if %push-parser had been declared.
2499 * data/push.c (yypush_parse): For impure mode, remove the
2500 yypushed_char, yypushed_val, and yypushed_loc arguments.
2501 Instead, declare these as local variables initialized to the global
2502 yychar, yylval, and yylloc.
2503 For the first yypush_parse invocation only, restore the initial values
2504 of these global variables when it's time to read a token since they
2505 have been overwritten.
2506 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
2507 %push-parser.
2508 * tests/calc.at (Simple LALR(1) Calculator): Always declare
2509 %pure-parser along with %push-parser since this test case was designed
2510 for pure push parsers.
2511 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
2512 (AT_YACC_OR_PUSH_IF): New.
2513 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
2514 add a note that it's still wrong for some cases (as it has been for a
2515 while).
2516 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
2517 %push-parser no longer implies %pure-parser.
2518
25192006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2520
2521 Remove some unnecessary differences between the pull parser code and
2522 the push parser code. This patch enables yynerrs in push mode.
2523 * data/push.c: Reformat M4 a little.
2524 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
2525 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
2526 because push mode is on. Instead, if pure mode is on, move yynerrs
2527 to...
2528 (b4_declare_parser_state_variables): ... here.
2529 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
2530 to yyps->NAME so it can be used in yypush_parse.
2531 (yypush_parse): Don't omit uses of yynerrs in push mode.
2532
25332006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2534
2535 Fix bug such that the first pushed token's value and location are
2536 sometimes overwritten (sometimes by %initial-action) before being used.
2537 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
2538 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
2539 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
2540 more closely mimic the pull parser logic.
2541 Don't copy the pushed token to yychar, yylval, and yylloc until it's
2542 time to read a token, which is after any initialization of yylval and
2543 yylloc.
2544 (gottoken): Rename label to...
2545 (yyread_pushed_token): ... for clarity and to avoid infringing on the
2546 user namespace.
2547
25482006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2549
2550 Rearrange initialization of the parser state variables so that the
2551 skeleton doesn't have to have a copy for pull mode and another for push
2552 mode. This patch also fixes at least a bug such that yylloc was not
2553 initialized (with b4_location_initial_line and
2554 b4_location_initial_column) upon calling yypush_parse. However, that
2555 initialization now overwrites the first token's location;
2556 %initial-action assigning @$ already did the same thing, and both bugs
2557 will be fixed in a later patch.
2558 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
2559 (b4_declare_parser_state_variables): Remove initialization of yytoken,
2560 yyss, yyvs, yyls, and yystacksize.
2561 (yypstate_new): Remove initialization of some yypstate fields: yystate,
2562 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
2563 yylsp.
2564 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
2565 yyps->NAME so it can be used in yypush_parse.
2566 (yyparse or yypush_parse): For yypush_parse, don't print the
2567 "Starting parse" diagnostic for invocations after the first.
2568 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
2569 yypush_parse, only do it for the first invocation.
2570 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
2571 initialization to occur in yypush_parse but only on the first
2572 invocation.
2573
25742006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2575
2576 * data/push.c: Add CPP guards around push parser declarations in both
2577 the header and the code file.
2578 In the code file, move the push parser declarations to the same place
2579 they appear in the header file.
2580 Clean up the M4 some, especially the inconsistent underquoting in
2581 some b4_c_function_def and b4_c_function_decl uses.
2582
25832006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2584
2585 Encapsulate the push parser state variables into an M4 macro so the
2586 push skeleton doesn't have to list them again for pull mode's yyparse.
2587 For push mode, remove yypush_parse's local equivalents of these
2588 variables to eliminate unnecessary copying between the two sets at
2589 run-time. This patch also fixes at least a bug related to multiple
2590 %initial-action invocations in push mode.
2591 * data/push.c (b4_declare_parser_variables): Rename to...
2592 (b4_declare_scanner_communication_variables): ... this for clarity and
2593 update both uses.
2594 (b4_declare_yyparse_variables): Remove and move its contents to the one
2595 spot where it was invoked.
2596 (b4_declare_parser_state_variables): New macro containing the parser
2597 state variables required by push mode.
2598 (struct yypstate): Replace all fields but yynew with
2599 b4_declare_parser_state_variables.
2600 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
2601 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
2602 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
2603 (yyparse or yypush_parse): For yyparse in pull mode, replace local
2604 parser state variable declarations with
2605 b4_declare_parser_state_variables.
2606 Don't initialize parser state variables when calling yypush_parse since
2607 yypstate_new already does that.
2608 Invoke the user's initial action only upon the first yypush_parse
2609 invocation.
2610 Remove all code that copies between the local parser state variables
2611 and the yypstate.
2612
26132006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2614
2615 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
2616 prevent a name collision in a future patch where these names will
2617 sometimes be #define'd.
2618 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
2619 since it no longer has the same name as the existing argument.
2620 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
2621
26222006-12-19 Paolo Bonzini <bonzini@gnu.org>
2623 and Joel E. Denny <jdenny@ces.clemson.edu>
2624
2625 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2626 that the argument is case-insensitive, and there's no `=' here.
2627 For the %skeleton entry, mention that %language is better.
2628 (Bison Options): Likewise for --language and --skeleton. Move the
2629 --skeleton entry so that the `Tuning the parser' section is sorted
2630 alphabetically on long options.
2631 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
2632 %language directive in detail here; cross-reference the %language
2633 documentation instead.
2634 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
2635 `%require "2.3b"' so that the example is always up-to-date.
2636 (Table of Symbols): Add entries for %language and %skeleton.
2637 * examples/extexi (normalize): Instead of replacing every %require
2638 argument with the current Bison version, just substitute for
2639 `@value{VERSION}'. This guarantees that we're testing what actually
2640 appears in the documentation.
2641 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
2642 rather than `@VERSION@'.
2643
26442006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2645
2646 * NEWS: Reword the %language news a bit, and put it earlier.
2647
2648 * src/getargs.c (skeleton_arg): Last arg is now location const *.
2649 Rewrite to simplify the logic.
2650 (language_argmatch): Likewise.
2651 (program_name): We now own this var.
2652 * src/getargs.h (struct bison_language): Use char[] rather than
2653 const char *.
2654
2655 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
2656 Java is supported.
2657 * src/complain.c (program_name): Remove decl; no longer needed.
2658 * src/main.c (program_name): Remove; now belongs to getargs.
2659
26602006-12-18 Paolo Bonzini <bonzini@gnu.org>
2661
2662 * NEWS: Document %language.
2663
2664 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
2665
2666 * data/c-skel.m4, data/c++-skel.m4: New files.
2667 * data/glr.c: Complain on push parsers.
2668
2669 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
2670 over %skeleton.
2671 (Decl Summary): Document %language and %skeleton.
2672 (Command line): Document -L.
2673
2674 * examples/extexi: Rewrite %require directive.
2675 * examples/calc++/Makefile.am: Pass VERSION to extexi.
2676
2677 * src/files.c (compute_exts_from_gc): Look in language structure
2678 for .y extension.
2679 (compute_file_name_parts): Check whether .tab should be added.
2680 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
2681 (language, skeleton_arg, language_argmatch): New.
2682 (long_options): Add --language.
2683 (getargs): Use skeleton_arg, add -L/--language.
2684 * src/getargs.h: Include location.h.
2685 (struct bison_language, language, skeleton_arg, language_argmatch): New.
2686 * src/output.c (prepare): Pick default skeleton from struct language.
2687 Don't dispatch C skeletons here.
2688 * src/parse-gram.y (PERCENT_LANGUAGE): New.
2689 (prologue_declaration): Add "%language" rule, use skeleton_arg.
2690 * src/scan-gram.l ("%language"): New rule.
2691
2692 * tests/calc.at: Test %skeleton and %language.
2693 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
2694 (AT_GLR_IF): Look for %skeleton "glr.cc".
2695 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
2696 (AT_YACC_IF): Reject %language.
2697
26982006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2699
2700 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
2701 since it wasn't used; only the typedef name 'semantic_type' is needed.
2702 Also, omit trailing white space.
2703
2704 * bootstrap: Sync from coreutils.
2705 (gnulib_extra_files): Add build-aux/announce.gen.
2706 (slurp): Adjust .gitignore files like .cvsignore files.
2707 * build-aux/announce-gen: Remove from CVS, since bootstrap
2708 now creates this.
2709
27102006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
2711
2712 Make %push-parser imply %pure-parser. This fixes several bugs; see
2713 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
2714 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
2715 pure_parser = true.
2716 * data/push.c: Don't bother testing b4_push_if when deciding whether
2717 to expand b4_declare_parser_variables globally.
2718 (yypush_parse): Likewise in here.
2719
2720 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
2721 (yy_reduce_print): Reformat M4 for readability.
2722
27232006-12-15 Bob Rossi <bob@brasko.net>
2724 and Joel Denny <jdenny@ces.clemson.edu>
2725
2726 * data/push.c (yypstate): Add typedef, and update all uses of
2727 struct yypstate to just yypstate.
2728 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
2729
27302006-12-14 Bob Rossi <bob@brasko.net>
2731
2732 * data/push.c (yypush_parse): Declare prototype regardless of
2733 %locations option.
2734
27352006-12-14 Bob Rossi <bob@brasko.net>
2736
2737 * data/push.c (yyparse): Remove the prototype and the #define when in
2738 push-parser mode.
2739
27402006-12-13 Bob Rossi <bob@brasko.net>
2741
2742 * data/push.c (yypstate_init): Rename to...
2743 (yypstate_new): ... this and use b4_c_function_def.
2744 (yypstate_delete): New.
2745 (yypush_parse): Change parameters yynval and yynlloc to be const.
2746 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
2747 yypstate_delete functions.
2748
27492006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
2750
2751 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
2752 strange test case titles. Reported by Bob Rossi.
2753
27542006-12-13 Paul Eggert <eggert@cs.ucla.edu>
2755
2756 * TODO: Add pointer to Sylvain Schmitz's work on static detection
2757 of potential ambiguities in GLR grammers.
2758
27592006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
2760
2761 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
2762 `bison ', use m4_index instead of m4_substr since chopping up a string
2763 containing M4-special characters causes problems here.
2764
2765 Fix a couple of bugs related to special characters in user-specified
2766 file names, and make it easier for skeletons to compute output file
2767 names with the same file name prefix as Bison-computed output file
2768 names.
2769 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
2770 b4_parser_file_name and b4_spec_defines_file instead of
2771 @output_parser_name@ and @output_header_name@, which are now redundant.
2772 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
2773 b4_parser_file_name, b4_spec_defines_file, and the new
2774 @basename(FILENAME@) instead of @output_parser_name@ and
2775 @output_header_name@, which inappropriately escaped the file names as
2776 C string literals.
2777 * src/files.c (all_but_ext): Remove static qualifier.
2778 (compute_output_file_names): Move `free (all_but_ext)' to...
2779 (output_file_names_free): ... here since all_but_ext is needed later.
2780 * src/files.h (all_but_ext): Extern.
2781 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
2782 exactly what MUSCLE_INSERT_STRING used to do.
2783 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
2784 characters are escaped properly.
2785 * src/output.c (prepare): Define muscle file_name_all_but_ext as
2786 all_but_ext.
2787 For pkgdatadir muscle, maintain previous functionality by using
2788 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
2789 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
2790 digraphs would never be expanded. Hopefully no one has M4-special
2791 characters in his Bison installation path.
2792 * src/scan-skel.l: Don't parse @output_header_name@ and
2793 @output_parser_name@ anymore since they're now redundant.
2794 In @output, use decode_at_digraphs.
2795 Parse a new @basename command that invokes last_component.
2796 (decode_at_digraphs): New.
2797 (BASE_QPUTS): Remove unused.
2798 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
2799 (Output file name): New tests.
2800
28012006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
2802
2803 Warn about output files that are generated by the skeletons and that
2804 conflict with other output files.
2805 * data/glr.c: Don't generate the header file here when glr.cc does.
2806 * src/files.c (file_names, file_names_count): New static globals.
2807 (compute_output_file_names): Invoke output_file_name_check for files
2808 not generated by the skeletons and remove existing checks.
2809 (output_file_name_check): New function that warns about conflicting
2810 output file names.
2811 (output_file_names_free): Free file_names.
2812 * src/files.h (output_file_name_check): Declare.
2813 * src/scan-skel.l: Invoke output_file_name_check for files generated by
2814 the skeletons.
2815 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
2816 (Conflicting output files): New tests.
2817
28182006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2819
2820 * doc/bison.texinfo: Fix a couple of typos.
2821
28222006-12-08 Bob Rossi <bob@brasko.net>
2823
2824 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
2825 Rename to...
2826 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
2827 update all uses.
2828 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
2829 (yypush_parse): Rename yypvars argument to yyps and remove redundant
2830 local pv.
2831 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
2832 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
2833
28342006-12-07 Bob Rossi <bob@brasko.net>
2835 and Joel Denny <jdenny@ces.clemson.edu>
2836
2837 * data/push.c (yypvarsinit): Change return type from void* to struct
2838 yypvars*. No longer cast to void* on return.
2839 (struct yypvars): Remove yylen since it need not be remembered between
2840 yypushparse invocations.
2841 (yypushparse): Don't copy between yylen and pv->yylen.
2842
28432006-12-05 Bob Rossi <bob@brasko.net>
2844
2845 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
2846 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
2847 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
2848 (struct yypvars): Remove b4_declare_parser_variables.
2849 (yypvarsinit): Remove init code for removed variables.
2850 (global scope): Do not declare b4_declare_parser_variables if
2851 push or pure mode.
2852 (yypushparse): Add b4_declare_parser_variables.
2853 Init new local variables, and remove init code for removed
2854 yypvars variables.
2855 (yyparse): Delete.
2856 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2857 and yyparse for other modes.
2858 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2859 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2860 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2861 (AT_PURE_LEX_IF): True if pure or push parser.
2862
28632006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2864
2865 Document Yacc prologue alternatives and default %destructor's and
2866 %printer's as experimental. Don't mention Java yet. Discussed at
2867 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2868 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2869 (2.3a): Annotate this entry to say the old forms of these features were
2870 also experimental.
2871 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
2872 Table of Symbols): Say they're experimental. Comment out any mention
2873 of Java (we'll want this back eventually).
2874
28752006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2876
2877 Support a file name argument to %defines. Deprecate `=' in
2878 %file-prefix, %name-prefix, and %output. Discussed at
2879 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2880 * NEWS (2.3a+): Mention.
2881 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
2882 form of %defines, and remove `=' from entries for %file-prefix,
2883 %name-prefix, and %output.
2884 * src/parse-gram.y (prologue_declaration): Implement.
2885 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2886 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2887 all but one occurrence of %name-prefix.
2888 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2889 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2890 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2891 occurrence of each of %file-prefix and %output. Add check for %defines
2892 with argument.
2893 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2894 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2895 Remove the `=' from %output.
2896
28972006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2898
2899 Don't escape $ in test case titles since Autoconf 2.61 now does that
2900 correctly.
2901 * tests/actions.at (Default %printer and %destructor are not for error
2902 or $undefined): Here.
2903 (Default %printer and %destructor are not for $accept): Here.
2904 * tests/input.at (Invalid $n and @n): Here.
2905
29062006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2907
2908 Rename <!> to <>. Discussed starting at
2909 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2910 * NEWS (2.3a+): Update.
2911 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
2912 Update.
2913 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2914 * src/scan-gram.l (INITIAL): Implement.
2915 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2916 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2917 comment.
2918 * tests/actions.at (Default tagless %printer and %destructor,
2919 Default tagged and per-type %printer and %destructor,
2920 Default %printer and %destructor are not for error or $undefined,
2921 Default %printer and %destructor are not for $accept,
2922 Default %printer and %destructor for mid-rule values): Update.
2923 * tests/input.at (Default %printer and %destructor redeclared,
2924 Unused values with default %destructor): Update.
2925
29262006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2927
2928 Don't let %prec take a nonterminal.
2929 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2930 token.
2931 * tests/input.at (%prec takes a token): New test checking that %prec
2932 won't take a nonterminal.
2933
29342006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2935
2936 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2937 it was double-quoted.
2938 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2939 grammar is maintained with Bison's highest standards.
2940 * src/getargs.c: Fix some typos in Doxygen comments.
2941
29422006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2943
2944 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2945 later. Reported by Paul Eggert in
2946 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2947 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2948 * src/scan-code.l (translate_action): Don't bother invoking
2949 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2950 (code_scanner_free): Instead of invoking
2951 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2952 which frees more.
2953 * src/scan-gram.l (gram_scanner_free): Likewise.
2954 * src/scan-skel.l (scan_skel): Likewise.
2955
29562006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2957
2958 * src/files.c (tr): Change return type to void.
2959 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2960 has been called previously for the same key.
2961 (muscle_find): Return storage instead of value so that
2962 --enable-gcc-warnings doesn't produce warnings that the return discards
2963 const. aver that the value and storage are the same since storage
2964 could potentially be NULL when value is not.
2965 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2966 same as 0.
2967
29682006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2969
2970 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2971 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2972 us a slightly cleaner distribution, and also works.
2973 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2974 gnulib changes.
2975
29762006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2977 and Paul Eggert <eggert@cs.ucla.edu>
2978
2979 Don't let Bison leak memory except when it complains.
2980 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2981 (spec_defines_file, dir_prefix): Now char *, not const char *,
2982 since they are freed.
2983 * src/files.c: Likewise.
2984 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2985 Likewise.
2986 (tr): Now operates in-place. All uses changed.
2987 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2988 values.
2989 (compute_file_name_parts, compute_output_file_names): Don't store
2990 read-only data in variables that will be freed.
2991 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2992 src_extension, and header_extension.
2993 (output_file_names_free): New public function to free
2994 spec_verbose_file, spec_graph_file, spec_defines_file,
2995 parser_file_name, and dir_prefix.
2996 * src/getargs.c (getargs): Don't store read-only data in variables that
2997 will be freed.
2998 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2999 (which previously existed but was unused), and quotearg_free.
3000 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
3001 * src/muscle_tab.c: Likewise.
3002 (muscle_entry): Make the value char const *,
3003 and add a new storage member that is char * and can be freed.
3004 (muscle_entry_free): New private function.
3005 (muscle_init): Use it instead of free.
3006 (muscle_insert, muscle_grow): Update and use new storage member.
3007 (muscle_code_grow): Free the string passed to muscle_grow
3008 since it's not needed anymore.
3009 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
3010 add a new `char *code' member.
3011 ("{...}"): Declare semantic type as code.
3012 * src/scan-code.h (translate_rule_action):
3013 (translate_symbol_action, translate_code, translate_action): Return
3014 `char const *' rather than `char *' since external code should not free
3015 these strings.
3016 * src/scan-code.l: Likewise.
3017 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
3018 which is "{...}" in the parser.
3019 * tests/Makefile.am (maintainer-check-valgrind): Set
3020 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
3021 Valgrind.
3022 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
3023 complain.
3024 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
3025 expecting a non-zero exit status sets --leak-check=summary and
3026 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
3027 this case, and we don't want to hear about it.
3028
30292006-11-08 Paul Eggert <eggert@cs.ucla.edu>
3030
3031 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
3032 instead of from the template, to simplify configuration a bit.
3033 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
3034 and m4/wint_t.m4, as they are needed with the latest gnulib.
3035
30362006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3037
3038 Disable unset/unused mid-rule value warnings by default, and recognize
3039 --warnings=midrule-values to enable them. Discussed starting at
3040 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
3041 * NEWS (2.3a+): Mention.
3042 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
3043 warnings): Add entry for midrule-values subargument.
3044 * src/reader.c (symbol_should_be_used): Don't return true just because
3045 the value is a set/used mid-rule value unless
3046 --warnings=midrule-values was specified.
3047 * tests/input.at (Unused values, Unused values before symbol
3048 declarations): Run tests with and without --warnings=midrule-values.
3049
3050 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
3051 than LIST_FREE directly.
3052
30532006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3054
3055 Finish implementing --warnings=error, which should not be implied by
3056 --warnings=all (or by its synonyms -W and --warnings without
3057 subarguments).
3058 * src/complain.c (set_warning_issued): New function to report that
3059 warnings are being treated as errors and to record an error if so.
3060 Invoke...
3061 (warn_at, warn): ... here.
3062 * src/getargs.c (warnings_args, warnings_types): Reorder so that
3063 "error - warnings are errors" does not appear above "all - all of the
3064 above".
3065 (getargs): For -W and --warnings without subarguments, don't let
3066 FLAGS_ARGMATCH set warnings_error in warnings_flag.
3067 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
3068
30692006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3070
3071 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
3072 empty subargument list. For example: `bison --warnings= parser.y'.
3073
30742006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3075
3076 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
3077 the parser header file so that gcc doesn't warn.
3078
30792006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3080
3081 Split the default %destructor/%printer into two kinds: <*> and <!>.
3082 Discussed starting at
3083 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
3084 * NEWS (2.3a+): Mention.
3085 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
3086 previous change today related to mid-rules.
3087 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3088 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
3089 (TYPE_TAG_ANY): Add as <*>.
3090 (TYPE_TAG_NONE): Add as <!>.
3091 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
3092 for <*> and <!>.
3093 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
3094 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
3095 * src/symlist.c (symbol_list_default_new): Split into tagged and
3096 tagless versions.
3097 (symbol_list_destructor_set, symbol_list_printer_set): Split
3098 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
3099 SYMLIST_DEFAULT_TAGLESS.
3100 * src/symlist.h: Update symbol_list_default*_new prototypes.
3101 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
3102 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
3103 * src/symtab.c (default_destructor, default_destructor_location,
3104 default_printer, default_printer_location): Split each into tagged and
3105 tagless versions.
3106 (symbol_destructor_get, symbol_destructor_location_get,
3107 symbol_printer_get, symbol_printer_location_get): Implement tagged
3108 default and tagless default cases.
3109 (default_destructor_set, default_printer_set): Split each into tagged
3110 and tagless versions.
3111 * src/symtab.h: Update prototypes.
3112 * tests/actions.at (Default %printer and %destructor): Rename to...
3113 (Default tagless %printer and %destructor): ... this, and extend.
3114 (Per-type %printer and %destructor): Rename to...
3115 (Default tagged and per-type %printer and %destructor): ... this, and
3116 extend.
3117 (Default %printer and %destructor for user-defined end token): Extend.
3118 (Default %printer and %destructor are not for error or $undefined):
3119 Update.
3120 (Default %printer and %destructor are not for $accept): Update.
3121 (Default %printer and %destructor for mid-rule values): Extend.
3122 * tests/input.at (Default %printer and %destructor redeclared): Extend.
3123 (Unused values with default %destructor): Extend.
3124
31252006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3126
3127 Don't apply the default %destructor/%printer to an unreferenced midrule
3128 value. Mentioned at
3129 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
3130 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
3131 like $@n instead of just @n so that the default %destructor/%printer
3132 logic doesn't see them as user-defined symbols.
3133 (symbol_is_dummy): Check for both forms of the name.
3134 * src/reader.c (packgram): Remove the `$' from each midrule symbol
3135 name for which the midrule value is referenced in any action.
3136 * tests/actions.at (Default %printer and %destructor for mid-rule
3137 values): New test.
3138 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
3139 for change to dummy symbol names.
3140
31412006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
3142
3143 Warn about unset midrule $$ if the corresponding $n is used.
3144 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
3145 $n usage.
3146 (packgram): Before invoking grammar_rule_check on any rule, make sure
3147 all actions have already been scanned in order to set `used' flags.
3148 Otherwise, checking that a midrule's $$ is set will not always work
3149 properly because the midrule check must forward-reference the midrule's
3150 parent rule.
3151 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
3152 warning.
3153
31542006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
3155
3156 More improvements to the documentation of the prologue alternatives:
3157 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
3158 Bison manual.
3159 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
3160 some text to clarify the relative importance of the new directives and
3161 to show how these directives may be viewed as code labels.
3162
31632006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
3164
3165 Similar to the recently removed %before-header, add %code-top as the
3166 alternative to the pre-prologue. Mentioned at
3167 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
3168 Also, let the prologue alternatives appear in the grammar section.
3169 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
3170 (prologue_declaration): Move the existing prologue alternatives to...
3171 (grammar_declaration): ... here and add %code-top.
3172 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
3173
3174 Clean up and extend documentation for the prologue alternatives.
3175 * NEWS (2.3a+): Describe prologue alternatives.
3176 * doc/bison.texinfo (Prologue): Move discussion of prologue
3177 alternatives to...
3178 (Prologue Alternatives): ... this new section, and extend it to discuss
3179 all 4 directives in detail.
3180 (Table of Symbols): Clean up discussion of prologue alternatives and
3181 add %code-top.
3182
31832006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3184
3185 DJGPP specific issues.
3186
3187 * djgpp/config.bat: config.hin has been moved to lib. Adjust
3188 config.bat accordingly.
3189 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
3190 * djgpp/config.site: Likewise.
3191
31922006-10-16 Paolo Bonzini <bonzini@gnu.org>
3193
3194 Replace %*-header with %provides, %requires, %code. See discussion at
3195 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
3196
3197 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
3198 (b4_user_start_header): Remove.
3199 * data/glr.c: Use new macros instead of b4_*start_header
3200 and b4_*end_header.
3201 * data/glr.cc: Likewise.
3202 * data/lalr1.cc: Likewise.
3203 * data/push.c: Likewise.
3204 * data/yacc.c: Likewise.
3205
3206 * doc/bison.texinfo: Remove %before-header, rename
3207 %{start,end,after}-header to %requires, %provides, %code.
3208
3209 * src/parse-gram.y: Likewise (also rename token names accordingly).
3210 * src/scan-gram.l: Likewise.
3211 * tests/actions.at: Likewise.
3212
32132006-10-14 Paul Eggert <eggert@cs.ucla.edu>
3214
3215 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
3216 Problem reported by Joel E. Denny.
3217
32182006-10-14 Jim Meyering <jim@meyering.net>
3219
3220 (Sync from coreutils.)
3221 Work also when the working directory (with e.g. coreutils sources)
3222 is version controlled with git, rather than CVS.
3223 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
3224 rather than CVS.
3225 In messages and comments, say e.g., "checked-out sources",
3226 rather than "CVS sources".
3227 (version_controlled_file): New function. Work for git as well as
3228 for CVS. Don't use grep's -q option.
3229 (slurp): Call it here, in place of CVS-specific code.
3230
32312006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
3232
3233 Fix testsuite for ./configure --enable-gcc-warnings:
3234 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
3235 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
3236 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
3237 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
3238 * test/regression.at (Diagnostic that expects two alternatives):
3239 Likewise.
3240
32412006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3242
3243 * bootstrap.conf (gnulib_modules): Add config-h.
3244 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
3245 worry about HAVE_CONFIG_H.
3246 * lib/abitset.c: Likewise.
3247 * lib/bitset.c: Likewise.
3248 * lib/bitset_stats.c: Likewise.
3249 * lib/bitsetv-print.c: Likewise.
3250 * lib/bitsetv.c: Likewise.
3251 * lib/ebitset.c: Likewise.
3252 * lib/get-errno.c: Likewise.
3253 * lib/lbitset.c: Likewise.
3254 * lib/subpipe.c: Likewise.
3255 * lib/timevar.c: Likewise.
3256 * lib/vbitset.c: Likewise.
3257 * lib/bitset.c: Include "bitset.h" first, to test interface.
3258 * lib/bitset_stats.c: Include "bitset_stats.h" first.
3259 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
3260 * lib/bitsetv.c: Include "bitsetv.h" first.
3261 * lib/get-errno.c: Include "get-errno.h" first.
3262 * m4/.cvsignore: Add config-h.m4.
3263 * tests/actions.at (Default %printer and %destructor for ...):
3264 Adjust expected line numbers in output to reflect removal of #if
3265 HAVE_CONFIG_H lines.
3266 * tests/glr-regression.at (Missed %merge type warnings when ...):
3267 Likewise.
3268 * tests/regression.at (Braced code in declaration in rules section):
3269 Likewise.
3270 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
3271 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
3272 Include <config.h> unconditionally.
3273
3274 * bootstrap: Sync from coreutils, as follows:
3275
3276 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3277
3278 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
3279 variable was sometimes used without being initialized. This
3280 messed up the installation of the INSTALL file in some cases.
3281
3282 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3283
3284 * bootstrap (usage, main program, symlink_to_gnulib): Add option
3285 --copy. Inspired by a suggestion from Bruno Haible.
3286
3287 2006-10-03 Jim Meyering <jim@meyering.net>
3288
3289 * bootstrap: Undo last change to this file, since now gnulib-tool
3290 sticks with the automake default in generating dependencies.
3291
32922006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3293
3294 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
3295 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
3296
3297 * doc/bison.1: Add copyright notice.
3298
3299 * data/glr.c: Don't include <stdarg.h>; not used.
3300
3301 * NEWS: The -g and --graph options now output graphs in Graphviz
3302 DOT format, not VCG format.
3303 * doc/bison.1: Likewise.
3304 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
3305 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
3306 of this change in
3307 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
3308 * TODO: Remove Graphviz entry.
3309 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
3310 remove vcg.c, vcg.h, vcg_defaults.h.
3311 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
3312 * src/graphviz.c, src/graphviz.h: New files.
3313 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
3314 * src/files.h: Make comment more generic.
3315 * src/main.c (main): Likewise.
3316 * src/print_graph.h: Likewise.
3317 * src/getargs.c (usage): Make usage description more generic.
3318 * src/print_graph.c: Include graphviz.h rather than vcg.h.
3319 (static_graph, fgraph): Remove. All uses changed to pass
3320 arguments instead of sharing a static var.
3321 (print_core, print_actions, print_state, print_graph):
3322 Output graphviz format rather than VCG format.
3323 * tests/.cvsignore: Remove *.vcg; add *.dot.
3324 * tests/output.at: Expect *.dot files, not *.vcg files.
3325
3326 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
3327 accommodates the 2006-10-08 change.
3328
33292006-10-11 Bob Rossi <bob@brasko.net>
3330
3331 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
3332 (b4_yyssa, b4_yyerror_range): New macros.
3333 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
3334 (yypvarsinit): Remove init of removed fields.
3335 (yypushparse): Remove use of removed fields; use new macros instead.
3336
33372006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3338
3339 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
3340 in a push parser. Reindent slightly to match yacc.c better.
3341
33422006-10-11 Bob Rossi <bob@brasko.net>
3343
3344 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
3345 yymsg_alloc fields.
3346 (yypvarsinit, yypushparse): Remove init of removed fields.
3347 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
3348
33492006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3350
3351 * THANKS: Add Paolo Bonzini and Bob Rossi.
3352
33532006-10-08 Paolo Bonzini <bonzini@gnu.org>
3354
3355 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
3356 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
3357 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
3358 b4_define_user_cde and uses): Remove.
3359 (b4_comment, b4_prefix, b4_sync_start): New.
3360 * data/bison.m4: New file, with most of the content removed from c.m4.
3361 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
3362 * src/output.c (output_skeleton): Pass bison.m4.
3363 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
3364 only if specified.
3365
33662006-10-05 Paul Eggert <eggert@cs.ucla.edu>
3367
3368 Fix test failure reported by Tom Lane in
3369 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
3370 and try to make such failures easier to catch in the future.
3371 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
3372 that's now the caller's responsibility.
3373 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
3374 Set yychar = YYEOF if it's negative.
3375 * tests/actions.at (yylex): Abort if asked to read past EOF.
3376 * tests/conflicts.at (yylex): Likewise.
3377 * tests/cxx-type.at (yylex): Likewise.
3378 * tests/glr-regression.at (yylex): Likewise.
3379 * tests/input.at (yylex): Likewise.
3380 * tests/regression.at (yylex): Likewise.
3381 * tests/torture.at (yylex): Likewise.
3382
33832006-10-01 Paul Eggert <eggert@cs.ucla.edu>
3384
3385 Fix problems with translating English-language diagnostics.
3386 * bootstrap: Fix bug introduced in recent bootstrap changes, with
3387 respect to bison-runtime pot generation. The YY_ stuff
3388 wasn't being captured.
3389 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
3390 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
3391 * runtime-po/POTFILES.in: Add data/push.c.
3392
33932006-09-29 Paul Eggert <eggert@cs.ucla.edu>
3394
3395 Merge bootstrap changes from coreutils.
3396
3397 2006-09-28 Jim Meyering <jim@meyering.net>
3398
3399 Automatically generated dependencies are important even
3400 when all of the sources in a directory come from gnulib.
3401 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
3402 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
3403
3404 2006-09-23 Jim Meyering <jim@meyering.net>
3405
3406 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
3407
3408 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3409
3410 * bootstrap: Add support for --force.
3411 (usage): New function. Describe usage less tersely.
3412 (CVS_only_file): New var.
3413
34142006-09-21 Paul Eggert <eggert@cs.ucla.edu>
3415
3416 * data/push.c (YYPUSH_MORE): Make it an enum instead.
3417 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
3418 Adjust white space and comments to match GNU style better.
3419
34202006-09-20 Bob Rossi <bob@brasko.net>
3421
3422 * data/push.c (yyresult_get): Remove function.
3423 (YYPUSH_MORE): Add #define.
3424 (yypushparse): Modify return value.
3425
34262006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3427
3428 * stamp-h.in: Remove; no longer needed.
3429 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
3430 Remove config.h, config.hin, intl (no longer created).
3431 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
3432 stamp-h1.
3433
3434 Sync bootstrap from coreutils, as follows:
3435
3436 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
3437
3438 * bootstrap (symlink_to_gnulib): New function.
3439 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
3440 to copies-of-gnulib.
3441 (cp_mark_as_generated, slurp, gnulib_files):
3442 Avoid making a copy if it's the same as the old version.
3443 (gnulib_files): Add support for this variable (used by Bison).
3444
34452006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3446
3447 * src/getargs.c (usage): Rework to use conventions similar to
3448 coreutils, to make translation a bit easier and the code a bit
3449 smaller. Problem reported by Tim Van Holder.
3450
34512006-09-15 Paul Eggert <eggert@cs.ucla.edu>
3452
3453 Use some of gnulib's new modules, taken from coreutils.
3454
3455 * bootstrap: Sync from coreutils, except add support for gnulib_files.
3456 * bootstrap.conf: New file.
3457 (gnulib_modules): Add configmake, inttypes, unistd.
3458 (XGETTEXT_OPTIONS): Add complain, complain_at,
3459 fatal, fatal_at, warn, warn_at, unexpected_end.
3460 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
3461 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
3462 (gl_EARLY): Add.
3463 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
3464 (gl_INIT): Add
3465 (GNULIB_AUTOCONF_SNIPPET): Remove.
3466 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
3467 the pickiest.
3468 * lib/.cvsignore: Add inttypes_.h.
3469 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
3470 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
3471 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
3472 no-longer-necessary initializations.
3473 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
3474 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
3475 use the unistd module.
3476 * src/system.h: Likewise.
3477 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
3478 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
3479 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
3480 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
3481 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
3482 * src/system.h: Include inttypes.h unconditionally, now that we
3483 use the inttypes module. Don't bother to include stdint.h, since
3484 inttypes.h now does that for us.
3485 (LOCALEDIR): Remove, now that we use the configmake module.
3486 * src/getargs.c: Include configmake.h.
3487 * src/main.c: Likewise.
3488 * src/output.c: Likewise.
3489 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
3490 not from $abs_top_builddir, since config.h moved.
3491
3492
3493 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
3494 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
3495
3496 * src/parse-gram.y (symbol_declaration): Don't put statements
3497 before declarations; it's not portable to C89.
3498 * src/scan-code.l (handle_action_at): Likewise.
3499
3500 * src/scan-code.l: Always initialize braces_level; the old code
3501 left it uninitialized and therefore had undefined behavior.
3502
3503 Don't attempt to redefine 'assert', since it runs afoul of
3504 systems where standard headers (mistakenly) include <assert.h>.
3505 Instead, define and use our own alternative, called 'aver'.
3506 * src/reader.c: Don't include assert.h, since we no longer
3507 use assert.
3508 * src/scan-code.l: Likewise.
3509 * src/system.h (assert): Remove, replacing with....
3510 (aver): New function, taking a bool arg. All uses changed.
3511 * src/tables.c (pack_vector): Ensure that aver arg is bool,
3512 not merely an integer.
3513
35142006-09-15 Bob Rossi <bob@brasko.net>
3515
3516 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
3517 * data/c.m4 (YYPUSH): New.
3518 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
3519 * src/getargs.c (push_parser): New var.
3520 * src/getargs.h (push_parser): New declaration.
3521 * src/output.c (prepare): Add macro insertion of `push_flag'.
3522 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
3523 (prologue_declaration): Parse %push-parser.
3524 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
3525 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
3526 list of removed lines from the traces observed.
3527 (AT_CHECK_CALC_LALR): Added push parser tests.
3528
35292006-09-13 Paul Eggert <eggert@cs.ucla.edu>
3530
3531 * NEWS: Version 2.3a.
3532 * configure.ac (AC_INIT): Likewise.
3533
3534 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
3535 "#define YYSTYPE int" that caused "make maintainer-check" to fail
3536 due to header ordering dependencies. I don't know why the #define
3537 was there.
3538
3539 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
3540 runtime cost when YYDEBUG is not defined, and so that some tests
3541 that used to fail now work. Problem and initial suggestion by
3542 Paolo Bonzini.
3543 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
3544 * data/glr.cc (b4_parser_class_name):
3545 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
3546 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
3547 (yydebug_) [YYDEBUG]: New member.
3548 (yycdebug_): Now defined only if YYDEBUG.
3549 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
3550 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
3551 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
3552 if YYYDEBUG.
3553 (debug_stream, set_debug_stream, debug_level, set_debug_level):
3554 Define only if YYDEBUG.
3555 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
3556 set_debug_level.
3557 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
3558 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
3559 AT_CHECK_CALC_GLR_CC that are working now.
3560
35612006-09-12 Paul Eggert <eggert@cs.ucla.edu>
3562
3563 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
3564 We don't need them in glr.cc, and glr.c defines them.
3565 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
3566 assumes that defining it to anything is the same as defining
3567 it to 1. Problem reported by Paolo Bonzini.
3568
35692006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
3570
3571 * data/c.m4 (b4_null, b4_case): Define.
3572 * src/output.c (prepare_symbols): Use b4_null.
3573 (user_actions_output): Use b4_case.
3574
35752006-09-11 Paul Eggert <eggert@cs.ucla.edu>
3576
3577 * data/glr.c (b4_shared_declarations): Put start-header first,
3578 before any #includes that we generate, so that feature-test
3579 macros work. Problem reported by Michael Deutschmann in
3580 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
3581 * data/lalr1.cc: Likewise.
3582 * doc/bison.texinfo (Prologue): Document that feature-test macros
3583 should be defined before any Bison declarations.
3584 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
3585 that depend on location.hh after, not before, Bison decls, since
3586 we now include location.hh after the first user prologue.
3587
3588 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
3589 Sander Brandenburg in
3590 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
3591 Also, fix minor white space and comment issues.
3592 (Prologue): Mention that it's better to define feature-test macros
3593 before Bison declarations. Problem reported by Michael Deutschmann.
3594
3595 * README-cvs: Fix typo: "&" should be "&&". Problem reported
3596 by Jim Meyering.
3597 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
3598 This adjusts to recent gnulib changes.
3599
36002006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3601
3602 Finish implementation of per-type %destructor/%printer. Discussed
3603 starting at
3604 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
3605 and
3606 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
3607 * NEWS (2.3+): Add a description of this feature to the default
3608 %destructor/%printer description.
3609 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
3610 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3611 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
3612 list node contains a semantic type.
3613 * src/symtab.c, src/symtab.h: Extend with a table that associates
3614 semantic types with their %destructor's and %printer's.
3615 (semantic_type_from_uniqstr, semantic_type_get,
3616 semantic_type_destructor_set, semantic_type_printer_set): New functions
3617 composing the public interface of that table.
3618 (symbol_destructor_get, symbol_destructor_location_get,
3619 symbol_printer_get, symbol_printer_location_get): If there's no
3620 per-symbol %destructor/%printer, look up the per-type before trying
3621 the default.
3622 * tests/actions.at (Per-type %printer and %destructor): New test case.
3623 * tests/input.at (Default %printer and %destructor redeclared):
3624 Extend to check that multiple occurrences of %symbol-default in a
3625 single %destructor/%printer declaration is an error.
3626 (Per-type %printer and %destructor redeclared, Unused values with
3627 per-type %destructor): New test cases.
3628
36292006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3630
3631 Require default %destructor/%printer to be declared using
3632 %symbol-default instead of an empty symbol list, and start working on
3633 new per-type %destructor/%printer. Discussed at
3634 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
3635 * NEWS (2.3+): Add %symbol-default to example.
3636 * bison.texinfo (Freeing Discarded Symbols): Likewise.
3637 (Table of Symbols): Add entry for %symbol-default.
3638 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
3639 (generic_symlist, generic_symlist_item): New nonterminals for creating
3640 a list in which each item is a symbol, semantic type, or
3641 %symbol-default.
3642 (grammar_declaration): Use generic_symlist in %destructor and %printer
3643 declarations instead of symbols.1 or an empty list.
3644 (symbol_declaration, precedence_declaration, symbols.1): Update actions
3645 for changes to symbol_list.
3646 * src/reader.c: Update for changes to symbol_list.
3647 * src/scan-code.l: Likewise.
3648 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
3649 * src/symlist.c, src/symlist.h: Extend such that a list node may
3650 represent a semantic type or a %symbol-default in addition to just an
3651 ordinary symbol. Add switched functions for setting %destructor's and
3652 %printer's.
3653 * tests/actions.at, tests/input.at: Add %symbol-default to all default
3654 %destructor/%printer declarations.
3655
36562006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
3657
3658 Whether the default %destructor/%printer applies to a particular symbol
3659 isn't a question of whether the user *declares* that symbol (in %token,
3660 for example). It's a question of whether the user by any means
3661 *defines* the symbol at all (by simply using a char token, for
3662 example). $end is defined by Bison whereas any other token with token
3663 number 0 is defined by the user. The error token is always defined by
3664 Bison regardless of whether the user declares it with %token, but we
3665 may one day let the user define error as a nonterminal instead.
3666 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
3667 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
3668 the meaning of "user-defined".
3669 * tests/actions.at (Default %printer and %destructor for user-declared
3670 end token): Rename to...
3671 (Default %printer and %destructor for user-defined end token): ...
3672 this.
3673
3674 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
3675 computation of whether to apply the default, don't maintain a list of
3676 every Bison-defined symbol. Instead, just check for a first character
3677 of '$', which a user symbol cannot have, and check for the error token.
3678
36792006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
3680
3681 Don't apply the default %destructor or %printer to the error token,
3682 $undefined, or $accept. This change fits the general rule that the
3683 default %destructor and %printer are only for user-declared symbols,
3684 and it solves several difficulties that are described in the new test
3685 cases listed below.
3686 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
3687 * tests/actions.at (Default %printer and %destructor are not for error
3688 or $undefined, Default %printer and %destructor are not for $accept):
3689 New test cases.
3690
36912006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
3692
3693 Allow %start after the first rule.
3694 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
3695 when parsing the first rule.
3696 (check_and_convert_grammar): Search for it here after all grammar
3697 declarations have been parsed. Skip midrules, which have dummy LHS
3698 nonterminals.
3699 * src/symtab.c (symbol_is_dummy): New function.
3700 * src/symtab.h (symbol_is_dummy): Declare it.
3701 * tests/input.at (%start after first rule): New test.
3702
37032006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3704
3705 Redo some of the previous commit: add back the ability to use
3706 non-aliased/undeclared string literals since it might be useful to
3707 those declaring %token-table.
3708 * src/reader.c (check_and_convert_grammar): Undo changes in previous
3709 commit: don't worry about complaints from symbols_pack.
3710 * src/symtab.c (symbol_new, symbol_class_set,
3711 symbol_check_alias_consistency): Undo changes in previous commit: count
3712 each string literal as a new symbol and token, assign it a symbol
3713 number, and don't complain about non-aliased string literals.
3714 (symbols_pack): Since symbol_make_alias still does not decrement symbol
3715 and token counts but does still set aliased tokens to the same number,
3716 symbol_pack_processor now leaves empty slots in the symbols array.
3717 Remove those slots.
3718 * tests/regression.at (Undeclared string literal): Remove test case
3719 added in previous commit since non-aliased string literals are allowed
3720 again.
3721 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
3722 remove unnecessary string literal declarations.
3723 * tests/sets.at (Firsts): Likewise.
3724
37252006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3726
3727 Don't allow an undeclared string literal, but allow a string literal to
3728 be used before its declaration.
3729 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
3730 symbols_pack complained.
3731 * src/symtab.c (symbol_new): Don't count a string literal as a new
3732 symbol.
3733 (symbol_class_set): Don't count a string literal as a new token, and
3734 don't assign it a symbol number since symbol_make_alias does that.
3735 (symbol_make_alias): It's not necessary to decrement the symbol and
3736 token counts anymore. Don't assume that an alias declaration occurs
3737 before any uses of the identifier or string, and thus don't assert that
3738 one of them has the highest symbol number so far.
3739 (symbol_check_alias_consistency): Complain if there's a string literal
3740 that wasn't declared as an alias.
3741 (symbols_pack): Bail if symbol_check_alias_consistency failed since
3742 symbol_pack asserts that every token has been assigned a symbol number
3743 although undeclared string literals have not.
3744 * tests/regression.at (String alias declared after use, Undeclared
3745 string literal): New test cases.
3746 (Characters Escapes, Web2c Actions): Declare string literals as
3747 aliases.
3748 * tests/sets.at (Firsts): Likewise.
3749
37502006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
3751
3752 In the grammar scanner, STRING_FINISH unclosed constructs and return
3753 them to the parser in order to improve error messages.
3754 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
3755 SC_BRACED_CODE, SC_PROLOGUE): Implement.
3756 * tests/input.at (Unclosed constructs): New test case.
3757 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
3758 seen.
3759
3760 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
3761 unused global.
3762
37632006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
3764
3765 Handle string aliases for character tokens correctly.
3766 * src/symtab.c (symbol_user_token_number_set): If the token has an
3767 alias, check and set its alias's user token number instead of its own,
3768 which is set to indicate the alias. Previously, every occurrence of
3769 the character token in the grammar overwrote that alias indicator with
3770 the character code.
3771 * tests/input.at (String aliases for character tokens): New test.
3772
37732006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
3774
3775 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
3776
37772006-08-11 Paul Eggert <eggert@cs.ucla.edu>
3778
3779 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
3780 to prevent failures when building on older platforms.
3781 Check for autopoint failure.
3782 Set XGETTEXT_OPTIONS to values that check for C format strings,
3783 so that translators are warned about them (this also helps
3784 prevent core dumps).
3785
3786 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
3787 function, since it simplifies our code a bit.
3788
3789 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
3790 rather than -W, so we don't get bogus warnings about sign comparisons.
3791 Add -Wpointer-arith, since that warning is useful (it reports code
3792 that does not conform to C89 and that some compilers reject).
3793 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
3794 since it's no longer needed.
3795
37962006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
3797
3798 Clean up scanners a bit.
3799 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
3800 definitions so gcc won't warn when obstack_for_string is unused.
3801 * src/scan-code.l: config.h and system.h are already #include'd by
3802 scan-code-c.c, so get rid of them here.
3803 * src/scan-gram.l: Likewise.
3804 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
3805 definitions rather than duplicating the rest of it.
3806 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
3807
38082006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
3809
3810 Suppress signed/unsigned comparison warnings for yycheck.
3811 * data/c.m4 (b4_safest_int_type): New macro.
3812 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
3813 a signed int type, cast it to b4_safest_int_type first.
3814 * data/yacc.c: Likewise.
3815 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
3816 also overwritten.
3817
38182006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3819
3820 * doc/bison.texinfo: Fix some typos.
3821
38222006-08-02 Paul Eggert <eggert@cs.ucla.edu>
3823
3824 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
3825 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
3826
3827 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
3828 the latest gnulib does this a different way.
3829 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
3830 translation was patched, so stop omitting it.
3831
38322006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3833
3834 Enable declaration of default %printer/%destructor. Make the parser
3835 use these for all user-declared grammar symbols for which the user does
3836 not declare a specific %printer/%destructor. Thus, the parser uses it
3837 for token 0 if the user declares it but not if Bison generates it as
3838 $end. Discussed starting at
3839 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
3840 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
3841 and
3842 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
3843 * NEWS (2.3+): Mention.
3844 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
3845 declare a %destructor for a mid-rule's semantic value. It's just
3846 impossible to declare one specific to it.
3847 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
3848 code. Describe default %destructor form.
3849 * src/parse-gram.y (grammar_declaration): Parse default
3850 %printer/%destructor declarations.
3851 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
3852 and symbol_destructor_location_get rather than accessing the destructor
3853 and destructor_location members of struct symbol.
3854 (symbol_printers_output): Likewise but for %printer's.
3855 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3856 again.
3857 * src/symtab.c (default_destructor, default_destructor_location,
3858 default_printer, default_printer_location): New static global
3859 variables to record the default %destructor and %printer.
3860 (symbol_destructor_get, symbol_destructor_location_get,
3861 symbol_printer_get, symbol_printer_location_get): New functions to
3862 compute the appropriate %destructor and %printer for a symbol.
3863 (default_destructor_set, default_printer_set): New functions to set the
3864 default %destructor and %printer.
3865 * src/symtab.h: Prototype all those new functions.
3866 * tests/actions.at (Default %printer and %destructor): New test to
3867 check that the right %printer and %destructor are called, that they're
3868 not called for $end, and that $$ and @$ work correctly.
3869 (Default %printer and %destructor for user-declared end token): New
3870 test to check that the default %printer and %destructor are called for
3871 a user-declared end token.
3872 * tests/input.at (Default %printer and %destructor redeclared, Unused
3873 values with default %destructor): New tests to check related grammar
3874 warnings and errors.
3875
38762006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3877
3878 Clean up handling of %destructor for the end token (token 0).
3879 Discussed starting at
3880 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3881 and
3882 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3883
3884 Make the skeletons consistent in how they pop the end token and invoke
3885 its %destructor.
3886 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3887 state, which has token number 0, since this would invoke the
3888 %destructor for the end token.
3889 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3890 until after shifting the end token, or else it won't be popped.
3891 * data/yacc.c (yyparse): Likewise.
3892
3893 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3894 it's the end token. Upon termination, destroy an unshifted lookahead
3895 even when it's the end token.
3896 * data/lalr1.cc (yy::parser::parse): Likewise.
3897 * data/yacc.c (yyparse): Likewise.
3898
3899 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3900 value warnings for the end token when the user gives the end token a
3901 %destructor.
3902
3903 * tests/actions.at (Printers and Destructors): Test all the above.
3904
39052006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3906
3907 Update to latest gnulib and gettext versions.
3908 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3909 Add fopen-safer.
3910 (gnulib_files): Add m4/warning.m4. Don't worry about files
3911 overwritten by autopoint.
3912 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3913 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3914 rejects them.
3915 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3916 so that we can remove the intl files at a better time.
3917 (intl_files_to_remove): Remove aclocal.m4, since it gets
3918 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3919 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3920 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3921 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3922 Remove datarootdir hack; no longer needed.
3923 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3924 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3925 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3926 strdup.h.
3927 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3928 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3929
39302006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3931
3932 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3933 it with --assume-autoconf='latest-stable'.
3934
39352006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3936
3937 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3938 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3939 YYSTYPE' and `{'.
3940 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3941 those from muscle_tab.c since the old ones are misleading.
3942
39432006-07-13 Akim Demaille <akim@epita.fr>
3944
3945 Support %define "KEY" {VALUE}.
3946 * src/scan-code.h, src/scan-code.l (translate_action)
3947 (translate_rule_action, translate_symbol_action, translate_code):
3948 Return char *, not const char *.
3949 * src/parse-gram.y (declaration): Rename as...
3950 (prologue_declaration): this.
3951 (string_content): Remove this nonterminal, use STRING.
3952 (braceless, content, content.opt): New nonterminal.
3953 Use them.
3954 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3955 as value.
3956 * src/scan-gram.l (getargs.h): Don't include it.
3957
39582006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3959
3960 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3961 rather than a for-loop that declares a local bool variable. This
3962 should work around a compatibility problem with a Cray x1e C++
3963 compiler reported by Hung Nguyen in
3964 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3965 The for-loop was introduced in the 2004-11-17 change but I don't
3966 know why it was needed.
3967
39682006-07-12 Akim Demaille <akim@epita.fr>
3969
3970 * data/c.m4: Comment changes.
3971
39722006-07-10 Akim Demaille <akim@lrde.epita.fr>
3973
3974 * src/complain.c (error_message, ERROR_MESSAGE): New.
3975 To factor...
3976 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3977 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3978
39792006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3980
3981 * NEWS: Instead of %union, you can define and use your own union type
3982 YYSTYPE if your grammar contains at least one <type> tag.
3983 Your YYSTYPE need not be a macro; it can be a typedef.
3984 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3985 (Union Decl, Decl Summary): Document this.
3986 * data/glr.c (YYSTYPE): Implement this.
3987 * data/glr.cc (YYSTYPE): Likewise.
3988 * data/lalr1.cc (YYSTYPE): Likewise.
3989 * data/yacc.c (YYSTYPE): Likewise.
3990 * src/output.c (prepare): Output tag_seen_flag.
3991 * src/parse-gram.y (declaration, grammar_declaration):
3992 Use 'union_seen' rather than 'typed' to determine whether
3993 %union has been seen, since grammars can now be typed without
3994 %union.
3995 (symbol_declaration, type.opt, symbol_def):
3996 Keep track of whether a tag has been seen.
3997 * src/reader.c (union_seen, tag_seen): New vars.
3998 (typed): remove.
3999 * src/reader.h (union_seen, tag_seen, typed): Likewise.
4000 * src/scan-code.l (untyped_var_seen): New variable.
4001 (handle_action_dollar): Adjust to above changes.
4002 (handle_action_dollar, handle_action_at):
4003 Improve overflow checking for outlandish numbers.
4004 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
4005 avoid new diagnostics generated by above changes.
4006 * tests/regression.at (YYSTYPE typedef): Add test to check
4007 for type tags without %union.
4008
4009 * src/symlist.c (symbol_list_length): Return int, not unsigned
4010 int, since callers expect int. This may need to get revisited
4011 once we have proper integer overflow checking.
4012
4013 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
4014 object is now static.
4015
4016 * src/getargs.c (flags_argmatch): Return void, not int,
4017 to pacify ./configure --enable-gcc-warnings.
4018
4019 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
4020 since last_string is already defined to FLEX_PREFIX (last_string).
4021
40222006-07-09 Akim Demaille <akim@lrde.epita.fr>
4023
4024 Implement --warnings/-W.
4025 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
4026 replaced by...
4027 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
4028 Adjust callers.
4029 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
4030 (warnings_args, warnings_types): New.
4031 (getargs, short_options, long_options): Accept -W/--warnings.
4032 Sort the options by alphabetical order, upper case letter right
4033 before its lower case.
4034
40352006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4036
4037 Change %merge result type clash warnings to errors. Discussed at
4038 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
4039 * src/reader.c (record_merge_function_type): Use complain_at.
4040 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4041 declared later): Update test case results.
4042
40432006-07-09 Akim Demaille <akim@lrde.epita.fr>
4044
4045 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
4046 to be in alphabetical order.
4047 (trace_args): Spelling fixes.
4048
40492006-07-09 Paul Eggert <eggert@cs.ucla.edu>
4050
4051 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
4052 so they don't collide with user-defined macros.
4053 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
4054 this was never guaranteed, and now that we're using gnulib stdint,
4055 which defines int_fast16_t to long int, the problem is exposed.
4056
40572006-07-08 Paul Eggert <eggert@cs.ucla.edu>
4058
4059 * data/c.m4 (b4_basename): Simplify a bit, since we don't
4060 need the full POSIX semantics (and weren't implementing them
4061 anyway).
4062
4063 Adjust to Autoconf 2.60 and today's gnulib.
4064 * bootstrap (gnulib_modules): Add stdint.
4065 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
4066 no longer copies it.
4067 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
4068 since stdint needs the former and wcwidth (which is now required
4069 by mbswidth) needs the latter.
4070 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
4071 work around a compatibility glitch between gettext 0.14.6 and
4072 Autoconf 2.60.
4073 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
4074 Do not check for uintptr_t, since new stdint module does the right
4075 thing.
4076 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
4077 Add stdint.h, stdint_.h, wcwidth.h.
4078 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
4079 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
4080 stdint.m4, wchar_t.m4, wcwidth.m4.
4081 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
4082 usual order for ../lib/*.h files.
4083 (file_name_split): Use last_component, not base_name, to adjust
4084 to gnulib changes.
4085 * src/parse-gram.h: Include <strverscmp.h> in the usual order
4086 for ../lib/*.h files.
4087 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
4088 Define unconditionally, since we now assume the stdint module.
4089 * src/scan-skel.l: Include <dirname.h>.
4090 (BASE_QPUTS): Use last_component, not base_name.
4091 * src/system.h: Include <unlocked-io.h> in the usual order
4092 for ../lib/*.h files. Include <stdint.h> unconditionally,
4093 since we now use the stdint module.
4094 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
4095 HAVE_UINTPTR_T, since we now use the stdint module.
4096 (base_name): Remove decl, since files now include <dirname.h>
4097 to get the decl.
4098
40992006-07-08 Akim Demaille <akim@lrde.epita.fr>
4100
4101 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
4102 New, default to 1.
4103 * data/yacc.c, data/glr.c, data/location.cc: Use them.
4104 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
4105 default.
4106 * tests/calc.at: Adjust.
4107
41082006-07-08 Akim Demaille <akim@lrde.epita.fr>
4109
4110 * data/c.m4 (b4_basename): New.
4111 (b4_syncline): Also output the location of its invocation (from
4112 the skeleton).
4113 (b4_user_action, b4_define_user_action, b4_user_actions)
4114 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
4115 (b4_user_stype): New.
4116 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
4117
41182006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
4119
4120 In the grammar file, the first column is 1 not 0 on the first line as
4121 on every other line.
4122 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
4123 * tests/input.at (Torturing the Scanner): Update output.
4124
4125 * src/scan-gram.l (scanner_cursor): Declare it static.
4126
41272006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
4128
4129 In warnings, say "previous declaration" rather than "first
4130 declaration".
4131 * src/symtab.c (redeclaration): Do that here.
4132 * src/reader.c (record_merge_function_type): In the case of a result
4133 type clash, report the previous declaration rather than the very first
4134 one in the grammar file.
4135 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4136 declared later): Add a third declaration to check this behavior.
4137 * tests/input.at (Incompatible Aliases): Update output.
4138
41392006-06-27 Akim Demaille <akim@epita.fr>
4140
4141 * doc/Doxyfile.in: New.
4142 * doc/Makefile.am: Use it.
4143 * src/lalr.h, src/symtab.h: Initial doxygenation.
4144
41452006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4146
4147 Don't miss %merge result type warnings just because the LHS types are
4148 declared after the %merge. This continues the effort of the previous
4149 patch.
4150 * src/reader.c (get_merge_function): Don't set the merger type yet.
4151 (record_merge_function_type): New function for setting the merger type
4152 and checking for clashes.
4153 (grammar_current_rule_merge_set): Set the location of the %merge for
4154 the current rule.
4155 (packgram): Invoke record_merge_function_type for each rule now that
4156 all symbol type declarations have been parsed.
4157 * src/reader.h (merger_list.type_declaration_location): New member
4158 storing the location of the first %merge from which the type for this
4159 merging function was derived.
4160 * src/symlist.h (symbol_list.merger_declaration_location): New member
4161 storing the location of a rule's %merge, if any.
4162 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4163 declared later): New test to catch the error fixed by the above patch.
4164
41652006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4166
4167 Get action warnings (grammar_rule_check) right even when symbol
4168 declarations appear after the rules. Discussed at
4169 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
4170 and
4171 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
4172 Don't mistake the type of $$ in a midrule to be that of its parent
4173 rule's $$.
4174 * src/reader.c (grammar_current_rule_end): Don't invoke
4175 grammar_rule_check yet since not all symbol declarations may have been
4176 parsed yet.
4177 (grammar_midrule_action): Likewise.
4178 Don't record whether the midrule's $$ has been used yet since actions
4179 haven't been translated yet.
4180 Record the midrule's parent rule and its RHS index within the parent
4181 rule.
4182 (grammar_current_rule_action_append): Don't translate the action yet
4183 since not all symbol declarations may have been parsed yet and, thus,
4184 warnings about types for $$, $n, @$, and @n can't be reported yet.
4185 (packgram): Translate the action and invoke grammar_rule_check now that
4186 all symbol declarations have been parsed.
4187 * src/scan-code.l (handle_action_dollar): Now that this is invoked
4188 after parsing the entire grammar file, the symbol list here in the case
4189 of a midrule is actually the midrule's empty RHS, so reference its
4190 parent rule's RHS where necessary.
4191 On the other hand, now that you can already know it's a midrule, you
4192 aren't forced to think $$ has the same type as its parent rule's $$.
4193 (handle_action_at): In the case of a midrule, reference the parent rule
4194 where necessary.
4195 * src/symlist.c (symbol_list_new): Initialize new midrule-related
4196 members.
4197 (symbol_list_length): Now that this is invoked after all rules have
4198 been parsed, a NULL symbol (rather than a NULL symbol list node)
4199 terminates a rule. symbol_list_print already does this correctly.
4200 * src/symlist.h (symbol_list.midrule_parent_rule,
4201 symbol_list.midrule_parent_rhs_index): New members so that midrules can
4202 remember their relationships with their parents.
4203 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
4204 fixed by the above patch.
4205 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
4206 implementing...
4207 (Unused values): ... this old test case and...
4208 (Unused values before symbol declarations): ... this new test case.
4209 This one is the same as `Unused values' except that all symbol
4210 declarations appear after the rules in order to catch the rest of the
4211 errors fixed by the above patch.
4212
42132006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4214
4215 More cleanup.
4216 * src/reader.c (current_rule): Declare it static since it's no longer
4217 used outside this file.
4218 (grammar_current_rule_action_append): Remove redundant arguments from
4219 translate_rule_action invocation.
4220 * src/reader.h (current_rule): Remove this unused extern.
4221 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
4222 * src/scan-code.l (translate_rule_action): Likewise.
4223
42242006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
4225
4226 Clean up yesterday's patch.
4227 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
4228 to...
4229 * src/reader.c (grammar_current_rule_action_append): ... here for
4230 consistency with grammar_current_rule_symbol_append.
4231 * tests/regression.at (Braced code in declaration in rules section):
4232 Make yyerror and yylex static as usual.
4233
42342006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
4235
4236 Fix bug that mistakes braced code in a declaration in the rules section
4237 to be a rule action. Mentioned at
4238 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
4239 * src/scan-gram.l: Move midrule action detection from the start of the
4240 scanning of any braced code to...
4241 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
4242 action. For readability, use $2 and @2 rather than the equivalent
4243 global variables.
4244 * tests/regression.at (Braced code in declaration in rules section):
4245 New test to catch the error fixed by the above patch.
4246
4247 Work on code readability some.
4248 * src/scan-code.l (current_rule): Get rid of this misleading and
4249 redundant declaration: it's actually extern'ed in reader.h.
4250 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
4251 translate_action): Add a rule argument and use it instead of the global
4252 current_rule.
4253 (translate_rule_action): This already receives current_rule through an
4254 argument, so pass it on to translate_action instead of assigning
4255 current_rule to current_rule.
4256 (translate_symbol_action, translate_code): Pass rule = NULL to
4257 translate_action.
4258
42592006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
4260
4261 Rename %before-definitions to %start-header and %after-definitions to
4262 %end-header. Don't use these declarations to separate pre-prologue
4263 blocks from post-prologue blocks. Add new order-independent
4264 declarations %before-header and %after-header as alternatives to the
4265 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
4266 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
4267 * NEWS (2.3+): Update for these changes.
4268 * data/glr.c (b4_before_definitions): Update to...
4269 (b4_start_header): ... this.
4270 (b4_after_definitions): Update to...
4271 (b4_end_header): ... this.
4272 * data/glr.cc: Likewise.
4273 * data/lalr1.cc: Likewise.
4274 * data/yacc.c: Likewise.
4275 * doc/bison.texinfo (The prologue): Update names, and replace remaining
4276 prologue blocks with %*-header declarations.
4277 (Calc++ Parser): Likewise.
4278 (Decl Summary): Update names.
4279 (Table of Symbols): Update description.
4280 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
4281 (PERCENT_END_HEADER): ... this.
4282 (PERCENT_BEFORE_DEFINITIONS): Update to...
4283 (PERCENT_START_HEADER): ... this.
4284 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4285 (declaration): Update token names and m4 macro names.
4286 When parsing %end-header and %start-header, invoke translate_code
4287 before muscle_code_grow, and no longer set global booleans to remember
4288 whether these declarations have been seen.
4289 Parse new %after-header and %before-header.
4290 * src/reader.c (before_definitions, after_definitions): Remove.
4291 (prologue_augment): Accept a new bool argument to specify whether to
4292 augment the pre-prologue or post-prologue.
4293 * src/reader.h (before_definitions, after_definitions): Remove these
4294 extern's.
4295 (prologue_augment): Add new bool argument.
4296 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
4297 (PERCENT_END_HEADER): ... this.
4298 (PERCENT_BEFORE_DEFINITIONS): Update to...
4299 (PERCENT_START_HEADER): ... this.
4300 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4301 * tests/actions.at (Printers and Destructors): Update names.
4302
43032006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
4304
4305 Add comparison operators for C++ location classes. Discussed at
4306 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
4307 * data/c++.m4 (b4_define_location_comparison): New boolean %define
4308 declaration indicating whether filename_type has an operator==. If
4309 filename_type is `std::string', it defaults to `1', `0' otherwise.
4310 * data/location.cc: Iff b4_define_location_comparison is `1', add
4311 operator== and operator!= for class position and for class location.
4312
4313 Some minor fixes.
4314 * src/scan-action.l: Remove unused file.
4315 * src/symtab.c (symbol_printer_set): Use printer_location not
4316 destructor_location.
4317 * src/symtab.h (struct symbol): Replace incorrect source comment for
4318 printer members.
4319 * tests/input.at (Incompatible Aliases): Update output with correct
4320 printer location.
4321
43222006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
4323
4324 Don't put the pre-prologue in the header file. For the yacc.c code
4325 file and the glr.c header and code files, move the pre-prologue before
4326 the token definitions. Add new %before-definitions and
4327 %after-definitions to declare code that will go in both the header file
4328 and code file. Discussed at
4329 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
4330 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
4331 and
4332 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
4333 * NEWS (2.3+): Describe these changes.
4334 * data/glr.c (b4_pre_prologue): Move from within to before...
4335 (b4_shared_declarations): ... this.
4336 Add new b4_before_definitions before b4_token_enums.
4337 Add new b4_after_definitions at the end.
4338 * data/glr.cc (b4_pre_prologue): Replace with...
4339 (b4_before_definitions): ... this in the header file.
4340 (b4_after_definitions): New near the end of the header file.
4341 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
4342 code file right before including the header file.
4343 (b4_before_definitions): New in the previous position of
4344 b4_pre_prologue in the header file.
4345 (b4_after_definitions): New near the end of the header file.
4346 * data/yacc.c: Clean up some m4 quoting especially in the header file.
4347 (b4_token_enums_defines): In the code file, move to right before
4348 YYSTYPE for consistency with the header file.
4349 (b4_before_definitions): New right before b4_token_enums_defines in
4350 both the header and code file.
4351 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
4352 header and code file.
4353 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
4354 of prologues for %union dependencies.
4355 (Decl Summary): In %defines description, mention the effect of
4356 %before-definitions and %after-definitions on the header file.
4357 (Calc++ Parser): Forward declare driver in a %before-definitions rather
4358 than in the pre-prologue so that make check succeeds.
4359 (Table of Symbols): Add entries for %before-definitions and
4360 %after-definitions.
4361 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
4362 %before-definitions.
4363 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
4364 (declaration): Parse those declarations and append to
4365 b4_before_definitions and b4_after_definitions, respectively.
4366 * src/reader.c (before_definitions, after_definitions): New bools to
4367 track whether those declarations have been seen.
4368 (prologue_augment): Add to the post-prologue if %union,
4369 %before-definitions, or %after-definitions has been seen.
4370 * src/reader.h (before_definitions, after_definitions): New extern's.
4371 * src/scan-gram.l: Scan the new declarations.
4372 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
4373 prologue block in a %before-definitions or a %after-definitions based
4374 on whether the %union is declared.
4375 * tests/regression.at (Early token definitions with --yacc, Early token
4376 definitions without --yacc): Move tests for token definitions into the
4377 post-prologue since token names are no longer defined in the
4378 pre-prologue.
4379
43802006-06-20 Akim Demaille <akim@epita.fr>
4381
4382 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
4383 (symbol_get): Use it.
4384 * src/parse-gram.y: Use it.
4385
43862006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
4387
4388 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
4389 build succeeds when configured with --enable-gcc-warnings.
4390
43912006-06-19 Paul Eggert <eggert@cs.ucla.edu>
4392
4393 * src/parse-gram.y (char_name): New function.
4394 (CHAR, STRING, string_content): For %printer, properly escape.
4395 (ID): Prefer fputs to fprintf.
4396 (id): Reindent to be consistent with other rules.
4397 Properly quote char.
4398
4399 The Translation Project changed its way of publishing translations
4400 to maintainers. I haven't received any responses to my request
4401 for supporting the old way, or for documenting the new way. I
4402 have modified 'bootstrap' to use screen scraping
4403 (in this case, HTML scraping). This is unreliable and inelegant,
4404 but I don't see any better way. Yuck.
4405 * bootstrap (TP_URL, WGET_COMMAND): New vars.
4406 (get_translations): New function, which uses HTML scraping to
4407 deduce locations of latest translations.
4408 Use this function to grab both bison and bison-runtime .po files.
4409 Don't bother priming the pump for the runtime-po domain any more,
4410 as it's now translated better than bison is.
4411
44122006-06-19 Akim Demaille <akim@epita.fr>
4413
4414 * src/scan-gram.l: No longer "parse" things after `%union' until
4415 `{'. Rather, return a single "%union" token.
4416 No longer make symbols: return strings, and leave the conversion
4417 to symbols to the parser.
4418 (SC_PRE_CODE, token_type): Remove.
4419 * src/parse-gram.y (%union): New field `character'.
4420 Sort tokens.
4421 (CHAR): New token.
4422 (ID, ID_COLON): Now that the scanner no longer makes them
4423 identifiers, adjust all uses to invoke symbol_get.
4424 (id_colon): New, wraps the conversion from string to symbol.
4425 (%union): Accept a possible union_name.
4426 (symbol): Now can be a char.
4427 * data/c.m4 (b4_union_name): Leave a default value.
4428 * data/glr.c, data/yacc.c: Use it.
4429
44302006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
4431
4432 For associating token numbers with token names for "yacc.c", don't use
4433 #define statements unless `--yacc' is specified; always use enum
4434 yytokentype. Most important discussions start at:
4435 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
4436 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
4437 and
4438 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
4439 * NEWS (2.3+): Mention.
4440 * data/c.m4 (b4_yacc_if): New.
4441 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
4442 token #define's.
4443 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
4444 on token name definitions.
4445 * src/getargs.c (usage): Capitalize `Yacc' in English.
4446 * src/output.c (prepare): Define b4_yacc_flag.
4447 * tests/regression.at (Early token definitions): Test that tokens names
4448 are defined before the pre-prologue not just before the post-prologue.
4449 Remove this test case and copy to...
4450 (Early token definitions with --yacc): ... this to test #define's.
4451 (Early token definitions without --yacc): ... and this to test enums.
4452
44532006-06-11 Paul Eggert <eggert@cs.ucla.edu>
4454
4455 * NEWS: Reword the post-2.3 change to not be so optimistic about
4456 removing the old "look-ahead" spelling.
4457 Update previous look-ahead/lookahead change reports.
4458 * REFERENCES: look-ahead -> lookahead (since that's
4459 what he actually wrote).
4460 * doc/refcard.tex: look ahead -> lookahead,
4461 look-ahead -> lookahead
4462
44632006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
4464
4465 For consistency, use `lookahead' instead of `look-ahead' or
4466 `look_ahead'. Discussed starting at
4467 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
4468 and then at
4469 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
4470 * NEWS: For the next release, note the change to `--report'.
4471 * TODO, doc/bison.1: Update English.
4472 * doc/bison.texinfo: Update English.
4473 (Understanding Your Parser, Bison Options): Document as
4474 `--report=lookahead' rather than `--report=look-ahead'.
4475 * src/conflicts.c: Update English in comments.
4476 (lookahead_set): Rename from look_ahead_set.
4477 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
4478 (resolve_sr_conflict): Rename local look_ahead_tokens to
4479 lookahead_tokens, and update other uses.
4480 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
4481 count_rr_conflicts, conflicts_free): Update uses.
4482 * src/getargs.c (report_args): Move "lookahead" before alternate
4483 spellings.
4484 (report_types): Update uses.
4485 (usage): For `--report' usage description, state `lookahead' spelling
4486 rather than `look-ahead'.
4487 * src/getargs.h (report.report_lookahead_tokens): Rename from
4488 report_look_ahead_tokens.
4489 * src/lalr.c: Update English in comments.
4490 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
4491 (state_lookahead_tokens_count): Rename from
4492 state_look_ahead_tokens_count.
4493 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4494 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
4495 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4496 Update other uses.
4497 Update English in output.
4498 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
4499 * src/print.c: Update English in comments.
4500 (lookahead_set): Rename from look_ahead_set.
4501 (print_reduction): Rename argument lookahead_token from
4502 look_ahead_token.
4503 (print_core, state_default_rule, print_reductions, print_results):
4504 Update uses.
4505 * src/print_graph.c: Update English in comments.
4506 (print_core): Update uses.
4507 * src/state.c: Update English in comments.
4508 (reductions_new): Update uses.
4509 (state_rule_lookahead_tokens_print): Rename from
4510 state_rule_look_ahead_tokens_print, and update other uses.
4511 * src/state.h: Update English in comments.
4512 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
4513 (state_rule_lookahead_tokens_print): Rename from
4514 state_rule_look_ahead_tokens_print.
4515 * src/tables.c: Update English in comments.
4516 (conflict_row, action_row): Update uses.
4517 * tests/glr-regression.at
4518 (Incorrect lookahead during deterministic GLR,
4519 Incorrect lookahead during nondeterministic GLR): Rename
4520 print_look_ahead to print_lookahead.
4521 * tests/torture.at: Update English in comments.
4522 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
4523 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
4524 (Many lookahead tokens): Update uses.
4525 * data/glr.c: Update English in comments.
4526 * lalr1.cc: Likewise.
4527 * yacc.c: Likewise.
4528 * src/conflicts.h: Likewise.
4529 * src/lalr.h: Likewise.
4530 * src/main.c: Likewise.
4531 * src/output.c: Likewise.
4532 * src/parse-gram.c: Likewise.
4533 * src/tables.h: Likewise.
4534 * tests/calc.at: Likewise.
4535
45362006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
4537
4538 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
4539
45402006-06-07 Paul Eggert <eggert@cs.ucla.edu>
4541
4542 * TODO: Add request from Nelson H. F. Beebe to be able to install
4543 Bison without installing the yacc script.
4544
45452006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4546
4547 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
4548 and yytext if they're already #define'd.
4549 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
4550 * src/scan-code-c.c: ... here.
4551 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
4552 <config.h>.
4553
45542006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4555
4556 Get Bison to build again when configured with --enable-gcc-warnings.
4557 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
4558 missing #include's.
4559 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
4560 loc argument as it shadows a global.
4561 * src/scan-gram.l: Remove stray comma that prevents boundary_set
4562 invocation.
4563
4564 * src/.cvsignore: Add scan-code.c.
4565
45662006-06-07 Akim Demaille <akim@epita.fr>
4567
4568 * src/scan-gram.l: Move the "add a trailing ; to actions" code
4569 to...
4570 * src/scan-code.l: here.
4571 * tests/input.at (Torturing the Scanner): Fix another location
4572 error.
4573
45742006-06-07 Akim Demaille <akim@epita.fr>
4575
4576 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
4577
45782006-06-06 Akim Demaille <akim@epita.fr>
4579
4580 Extract the parsing of user actions from the grammar scanner.
4581 As a consequence, the relation between the grammar scanner and
4582 parser is much simpler. We can also split "composite tokens" back
4583 into simple tokens.
4584 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
4585 * src/scan-gram.l (add_column_width, adjust_location): Move to and
4586 rename as...
4587 * src/location.h, src/location.c (add_column_width)
4588 (location_compute): these.
4589 Fix the column count: the initial column is 0.
4590 (location_print): Be robust to ending column being 0.
4591 * src/location.h (boundary_set): New.
4592 * src/main.c: Adjust to scanner_free being renamed as
4593 gram_scanner_free.
4594 * src/output.c: Include scan-code.h.
4595 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
4596 Use boundary_set.
4597 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
4598 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
4599 which is now, again, a separate token.
4600 Adjust all dependencies.
4601 Whereever actions with $ and @ are used, use translate_code.
4602 (action): Remove this nonterminal which is now useless.
4603 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
4604 (grammar_current_rule_action_append): Use translate_code.
4605 (packgram): Bound check ruleno, itemno, and rule_length.
4606 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
4607 (last_string, last_braced_code_loc, max_left_semantic_context)
4608 (scanner_initialize, scanner_free, scanner_last_string_free)
4609 (gram_out, gram_lineno, YY_DECL_): Move to...
4610 * src/scan-gram.h: this new file.
4611 (YY_DECL): Rename as...
4612 (GRAM_DECL): this.
4613 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
4614 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4615 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4616 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4617 Move these declarations, and...
4618 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
4619 these to...
4620 * src/flex-scanner.h: this new file.
4621 * src/scan-gram.l (rule_length, rule_length_overflow)
4622 (increment_rule_length): Remove.
4623 (last_braced_code_loc): Rename as...
4624 (gram_last_braced_code_loc): this.
4625 Adjust to the changes of the parser.
4626 Move all the handling of $ and @ into...
4627 * src/scan-code.l: here.
4628 * src/scan-gram.l (handle_dollar, handle_at): Remove.
4629 (handle_action_dollar, handle_action_at): Move to...
4630 * src/scan-code.l: here.
4631 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
4632 scan-code.h, scan-code-c.c, scan-gram.h.
4633 (EXTRA_bison_SOURCES): Add scan-code.l.
4634 (BUILT_SOURCES): Add scan-code.c.
4635 (yacc): Be robust to white spaces.
4636
4637 * tests/conflicts.at, tests/input.at, tests/reduce.at,
4638 * tests/regression.at: Adjust the column numbers.
4639 * tests/regression.at: Adjust the error message.
4640
46412006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4642
4643 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4644 Use Akim's wording from
4645 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
4646
46472006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4648
4649 Between Bison releases, manually append `+' to the previous Bison
4650 release number, and use that as a signal to automatically print the
4651 ChangeLog's CVS Id keyword from --version. Discussed starting at
4652 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
4653 * ChangeLog: Add Id header.
4654 * configure.ac (AC_INIT): Append `+' to `2.3'.
4655 * src/.cvsignore: Add revision.c.
4656 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
4657 (BUILT_SOURCES): Add revision.c.
4658 (revision.c): New target rule. This file defines a new global variable
4659 named revision. It initializes it with either the Id from ChangeLog
4660 or, if VERSION doesn't contain `+', with the empty string.
4661 * src/getargs.c (version): Print the value of revision.
4662 * src/revision.h: Extern revision.
4663
46642006-06-05 Paul Eggert <eggert@cs.ucla.edu>
4665
4666 * NEWS: Version 2.3.
4667 * configure.ac (AC_INIT): Likewise.
4668
46692006-05-30 Paul Eggert <eggert@cs.ucla.edu>
4670
4671 * data/glr.c (YYRECOVERING): Define to be a function-like macro
4672 with no arguments, not as an object-like macro. This is for
4673 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
4674 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
4675 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
4676 Document this.
4677
46782006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
4679
4680 * src/getargs.c (usage): Back out yesterday's modification of the
4681 --help output so that we don't have to wait for translation before
4682 releasing 2.3.
4683
46842006-05-29 Paul Eggert <eggert@cs.ucla.edu>
4685
4686 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
4687 Problem reported by Akim Demaille.
4688
46892006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4690
4691 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4692
46932006-05-26 Paul Eggert <eggert@cs.ucla.edu>
4694
4695 * data/yacc.c (yy_reduce_print): Omit trailing white space in
4696 generated source code. Problem reported by Frans Englich in
4697 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
4698
46992006-05-22 Paul Eggert <eggert@cs.ucla.edu>
4700
4701 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
4702 shell, not within 'make', so that 'make' by an ordinary builder
4703 (using GNU make) does not worry about configuring gzip. This also
4704 works around a bug reported independently by Keith Thompson and by
4705 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
4706 stderr rather than stdout, messing up the build logs.
4707
47082006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4709
4710 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
4711 to make sure that YYID will never be unused. This fixes a 'make
4712 maintainer-check' failure caused by the recent changes to the 'Trivial
4713 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
4714 not used.
4715 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
4716
47172006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4718
4719 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
4720 state before an empty RHS is always resolved here. Only the location
4721 of that state is guaranteed to be resolved, and that's enough. This
4722 fixes the remaining bug reported by Derek M. Jones in
4723 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4724 * tests/glr-regression.at (Uninitialized location when reporting
4725 ambiguity): Test the above case.
4726 Also, the embedded comments in this test case claim it checks the case
4727 of an empty RHS that has inherited the initial location. However, the
4728 corresponding LHS was already resolved, so yyresolveLocations didn't
4729 actually have reason to modify it. Fix this by forcing
4730 nondeterministic operation at the beginning of the parse.
4731
47322006-05-20 Paul Eggert <eggert@cs.ucla.edu>
4733
4734 * data/c.m4 (b4_yy_symbol_print_generate):
4735 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
4736 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
4737 of the bugs reported today by Derek M Jones in
4738 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4739 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
4740 defined to be a type name without parens or brackets.
4741 (Location Type): Similarly for YYLTYPE.
4742 * tests/regression.at (Trivial grammars): Put in a test for this
4743 bug that will be caught by 'make maintainer-check' (though not,
4744 alas, by 'make check' unless your compiler is picky).
4745
47462006-05-19 Paul Eggert <eggert@cs.ucla.edu>
4747
4748 * NEWS: Version 2.2.
4749 * configure.ac (AC_INIT): Likewise.
4750
47512006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
4752
4753 * data/glr.c (yyreportTree): Make room in yystates for the state
4754 preceding the RHS. This fixes the segmentation fault reported by Derek
4755 M. Jones in
4756 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
4757 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
4758 to the user. Reported for yyreportTree by Derek M. Jones later in the
4759 same thread.
4760 * THANKS: Add Derek M. Jones.
4761 Update my email address.
4762 Fix typo in Steve Murphy's name.
4763
47642006-05-14 Paul Eggert <eggert@cs.ucla.edu>
4765
4766 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
4767 checking against YYLAST that caused the parser to miss a potential
4768 alternative in its diagnostic.
4769 Problem reported by Maria Jose Moron Fernandez in
4770 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
4771 * data/lalr1.cc (yysyntax_error_): Likewise.
4772 * data/yacc.c (yysyntax_error): Likewise.
4773 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
4774 tokens, in case we run into an older C compiler.
4775 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
4776 Use them to check for the off-by-one error fixed above.
4777
4778 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
4779 YYSIZE_T, not size_t.
4780 * tests/regression.at (Trivial grammars): New test, to catch
4781 the error fixed by the above patch.
4782
47832006-05-14 Akim Demaille <akim@lrde.epita.fr>
4784
4785 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
4786 scheme.
4787 Reported by Steve Murphy.
4788
47892006-05-14 Akim Demaille <akim@lrde.epita.fr>
4790
4791 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
4792 * data/glr.cc: b4_location_flag is now b4_locations_flag.
4793
47942006-05-14 Akim Demaille <akim@lrde.epita.fr>
4795
4796 Implement --trace=m4.
4797 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
4798 * src/output.c (output_skeleton): When set, pass -dV to m4.
4799
4800 Factor the handling of flags in m4.
4801 * src/output.c (prepare): Rename the muscle names debug, defines,
4802 error_verbose to debug_flag, defines_flag, error_verbose_flag.
4803 * data/c.m4: Adjust.
4804 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
4805 Use b4_define_flag_if to define other b4_FLAG_if macros.
4806 (b4_location_if): As a consequence, rename as...
4807 (b4_locations_if): this, for consistency.
4808 Adjust all the skeletons.
4809
48102006-05-14 Akim Demaille <akim@lrde.epita.fr>
4811
4812 * etc/bench.pm: Shorten bench names.
4813
48142006-05-14 Akim Demaille <akim@lrde.epita.fr>
4815
4816 * src/output.h, src/output.c (error_verbose): Move to...
4817 * src/getargs.h, src/getargs.c: here.
4818 Sort the flags.
4819 Adjust dependencies.
4820
48212006-05-13 Paul Eggert <eggert@cs.ucla.edu>
4822
4823 * data/c.m4 (b4_copyright): Put the special exception for Bison
4824 skeletons here, so we don't have to put it in each skeleton. All
4825 uses changed. Suggested by Akim Demaille. Also, wrap the
4826 copyright notice, in case it is longer than 80 columns. Replace
4827 comma by newline after title.
4828
48292006-05-11 Paul Eggert <eggert@cs.ucla.edu>
4830
4831 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
4832 incompatibility, not a bug. Mention that it wasn't fixed as of
4833 flex 2.5.33.
4834
48352006-05-11 Akim Demaille <akim@lrde.epita.fr>
4836
4837 * examples/extexi: Enforce the precedence of concatenation over
4838 >>.
4839 Reported by Tommy Nordgren.
4840
48412006-05-11 Akim Demaille <akim@lrde.epita.fr>
4842
4843 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
4844 with the member "token".
4845 Reported by Martin Nylin.
4846
48472006-05-08 Paul Eggert <eggert@cs.ucla.edu>
4848
4849 * data/glr.c: Switch to Bison 2.2 special-exception language in
4850 the copyright notice. Use more-regular format for titles and
4851 copyright notices.
4852 * data/glr.cc: Likewise.
4853 * data/location.cc: Likewise.
4854 * data/yacc.cc: Likewise.
4855 * doc/bison.texinfo (Conditions): Document this.
4856 * NEWS: likewise. Upgrade version to 2.2.
4857
48582006-04-27 Akim Demaille <akim@lrde.epita.fr>
4859
4860 * data/glr.cc: Remove dead code.
4861
48622006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4863
4864 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4865 that variable and the line breaks the bootstrap. Problem reported
4866 by Juan M. Guerrero.
4867
48682006-04-24 Akim Demaille <akim@lrde.epita.fr>
4869
4870 * doc/bison.texinfo (Multiple start-symbols): New.
4871
48722006-04-24 Akim Demaille <akim@lrde.epita.fr>
4873
4874 * etc/README, etc/bench.pl: New.
4875
48762006-04-03 Akim Demaille <akim@lrde.epita.fr>
4877
4878 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4879 rule.
4880 Reported by Mickael Labau.
4881 * tests/input.at (Torturing the Scanner): Test it.
4882
48832006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4884
4885 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4886 Problem reported by Bob Rossi.
4887
48882006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4889
4890 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4891 and didn't really work.
4892 For the index, use @ifnotinfo, not @iftex.
4893 Minor cleanups of spacing and terminology.
4894
48952006-03-12 Akim Demaille <akim@lrde.epita.fr>
4896
4897 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4898 of AT_NAME_PREFIX when %name-prefix is not used.
4899
49002006-03-12 Akim Demaille <akim@lrde.epita.fr>
4901
4902 Apply --prefix to C++ skeletons too: they change the namespace.
4903 The test suite already exercize these cases.
4904 * data/c++.m4 (b4_namespace): New.
4905 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4906 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4907 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4908 * doc/bison.texinfo: Document it.
4909 (Option Cross Key): Use @multitable in all formats. It looks
4910 nicer, even in TeX outputs.
4911 (Rules): Use the same code whatever the output type is.
4912 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4913 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4914 * tests/calc.at: Use it, instead of hard coding `yy'.
4915
49162006-03-10 Akim Demaille <akim@lrde.epita.fr>
4917
4918 * TODO: Remove dead items.
4919
49202006-03-10 Akim Demaille <akim@lrde.epita.fr>
4921
4922 * doc/FAQ: Remove, merged into...
4923 * doc/bison.texinfo (FAQ): this.
4924 * doc/Makefile.am (EXTRA_DIST): Adjust.
4925
49262006-03-10 Akim Demaille <akim@lrde.epita.fr>
4927
4928 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4929 even if empty.
4930 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4931 * doc/bison.texinfo (Calc++ Scanner): Use it.
4932
49332006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4934
4935 Fix two nits reported by twlevo, plus one more that I discovered.
4936
4937 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4938 this is the usual Bison style.
4939 * src/location.h (location_print): Likewise.
4940
4941 * src/reader.h (token_name): Likewise.
4942
49432006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4944
4945 Fix some nits reported by twlevo.
4946 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4947 and "POSIX". Use more-modern syntax for URLs. Mention C++
4948 and ask for Java. Don't hardwire OS version numbers. Add
4949 copyright notice.
4950 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4951 * src/conflicts.c (solved_conflicts_obstack): Now static.
4952
49532006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4954
4955 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4956 page. Say "you can use it" not "you may use it" as on the web page;
4957 we're describing capabilities not granting permission.
4958
49592006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4960
4961 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4962 shadowing warnings. Use usual patter for iterating through RHS.
4963 * tests/glr-regression.at
4964 (Uninitialized location when reporting ambiguity):
4965 Modify yylex so that it uses its argument, rather than trying
4966 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4967 const char -> char const.
4968
4969 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4970 Don't use tabs inside commands; it messes up 'ps'.
4971 Problem reported by twlevo.
4972
49732006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4974
4975 * tests/glr-regression.at (Uninitialized location when reporting
4976 ambiguity): New test case.
4977 * data/glr.c (yyresolveLocations): New function, which uses
4978 YYLLOC_DEFAULT.
4979 (yyresolveValue): Invoke yyresolveLocations before reporting an
4980 ambiguity.
4981 * doc/bison.texinfo (Default Action for Locations): Note
4982 YYLLOC_DEFAULT's usage for ambiguity locations.
4983 (GLR Semantic Actions): Cross-reference those notes.
4984
49852006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4986
4987 * tests/glr-regression.at (Leaked semantic values when reporting
4988 ambiguity): Remove unnecessary union and type declarations.
4989 (Leaked lookahead after nondeterministic parse syntax error): New test
4990 case.
4991 * data/glr.c (yyparse): Check for zero stacks remaining before
4992 attempting to shift the lookahead so that you don't lose it.
4993
49942006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4995
4996 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4997 * tests/glr-regression.at (Leaked semantic values when reporting
4998 ambiguity): New test case.
4999 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
5000 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
5001 now unnecessary yystackp parameter.
5002 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
5003 destructors can be called.
5004
5005 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
5006 in existing testcases.
5007
50082006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5009
5010 Don't leak semantic values for parent RHS when a user action cuts the
5011 parser, and clean up related code a bit.
5012 * tests/glr-regression.at (Leaked merged semantic value if user action
5013 cuts parse): Rename to...
5014 (Leaked semantic values if user action cuts parse): ... this. Add check
5015 for leaked parent RHS values.
5016 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
5017 between an unresolved state (non-empty chain of semantic options) and
5018 an incomplete one (signaled by an empty chain).
5019 (yyresolveStates): Document the interface. Move all manipulation of a
5020 successfully or unsuccessfully resolved yyGLRState to...
5021 (yyresolveValue): ... here so that yyresolveValue always leaves a
5022 yyGLRState with consistent data and thus is easier to understand.
5023 Remove the yyvalp and yylocp parameters since they are always just
5024 taken from the yys parameter. When reporting a discarded merged value
5025 in debugging output, note that it is incompletely merged. Document the
5026 interface.
5027 (yyresolveAction): If resolving any of the RHS states fails, destroy
5028 them all rather than leaking them. Thus, as long as user actions are
5029 written to clean up the RHS correctly, yyresolveAction always cleans up
5030 the RHS of a semantic option. Document the interface.
5031
50322006-02-27 Paul Eggert <eggert@cs.ucla.edu>
5033
5034 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
5035 led to a segmentation fault in GNU Pascal. Problem reported
5036 by Waldek Hebisch.
5037
50382006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
5039
5040 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
5041 mid-rule action inside a nonterminal symbol in order to declare a
5042 destructor for its semantic value.
5043
50442006-02-16 Paul Eggert <eggert@cs.ucla.edu>
5045
5046 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
5047 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
5048 __cplusplus && ! defined _STDLIB_H && !
5049 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
5050 defined free))]: Include <stdlib.h> rather than rolling our own
5051 declarations of malloc and free, to avoid problems with
5052 incompatible declarations (using 'throw') C++'s stdlib.h. This
5053 should fix Debian bug 340012
5054 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
5055 reported by Guillaume Melquiond.
5056
50572006-02-13 Paul Eggert <eggert@cs.ucla.edu>
5058
5059 * NEWS: Clarify symbols versus types in unused-value warnings.
5060
5061 * configure.ac (AC_INIT): Bump version number.
5062
50632006-02-13 Paul Eggert <eggert@cs.ucla.edu>
5064
5065 * NEWS: Version 2.1a.
5066 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
5067 since C99 requires this.
5068
50692006-02-11 Paul Eggert <eggert@cs.ucla.edu>
5070
5071 * m4/c-working.m4: New file.
5072 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
5073
50742006-02-10 Paul Eggert <eggert@cs.ucla.edu>
5075
5076 * Makefile.maint: Merge from coreutils.
5077
50782006-02-09 Paul Eggert <eggert@cs.ucla.edu>
5079
5080 More portability fixes for problems summarized by Nelson H. F. Beebe.
5081
5082 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
5083 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
5084 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
5085 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
5086 messes up because C++ code is compiled in 32-bit mode but linked
5087 in 64-bit mode.
5088
50892006-02-08 Paul Eggert <eggert@cs.ucla.edu>
5090
5091 More portability fixes for problems summarized by Nelson H. F. Beebe.
5092
5093 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
5094 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
5095
5096 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
5097 nodist_PROGRAMS, since we don't need to actually compile the
5098 example if we're just doing a plain 'make'. This avoids bothering
5099 the installer unnecessarily about problems due to weird C++
5100 compilers.
5101
51022006-02-06 Paul Eggert <eggert@cs.ucla.edu>
5103
5104 More portability fixes for problems summarized by Nelson H. F. Beebe.
5105
5106 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
5107 than #include "...", and compile with -I'.'. The old method was
5108 not portable, according to Posix and the C standard, and it does
5109 not work with Sun C 5.7, where previous #line directives affect
5110 the working directory used in later #include "..." directives.
5111
51122006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5113
5114 Various DJGGP specific issues in /djgpp
5115
51162006-02-02 Paul Eggert <eggert@cs.ucla.edu>
5117
5118 More portability fixes for problems summarized by Nelson H. F. Beebe.
5119
5120 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
5121 '#include <map>' works and that you can apply ++ to iterators.
5122
51232006-02-01 Paul Eggert <eggert@cs.ucla.edu>
5124
5125 Work around portability problems summarized by Nelson H. F. Beebe in
5126 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
5127
5128 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5129 that '#include <string>' works.
5130
5131 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
5132 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
5133 "warning: sorry: semantics of inline function static data `const
5134 unsigned char translate_table[262]' are wrong (you'll wind up with
5135 multiple copies)".
5136
5137 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
5138 or, xor to not_, and_, or_, and xor_, respectively. This works
5139 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
5140 random system header somewhere that includes the equivalent of
5141 <iso646.h>.
5142
5143 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
5144 -E" works; it apparently doesn't work with PathScale EKO Compiler
5145 Suite Version 2.0.
5146
51472006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
5148
5149 During deterministic GLR operation, user actions should be able to
5150 influence the parse by changing yychar. To make this easier to fix and
5151 to make glr.c easier to evolve in general, don't maintain yytoken in
5152 parallel with yychar; just compute yytoken when needed.
5153 * tests/glr-regression.at (Incorrect lookahead during deterministic
5154 GLR): Check that setting yychar in a user action has the intended
5155 effect.
5156 * data/glr.c (yyGLRStack): Remove yytokenp member.
5157 (yyclearin): Don't set *yytokenp.
5158 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
5159 yychar rather than *yytokenp to determine the current lookahead.
5160 Compute yytoken locally when needed.
5161 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
5162 point to.
5163
5164 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
5165 after `--report' documentation.
5166
51672006-01-30 Paul Eggert <eggert@cs.ucla.edu>
5168
5169 * src/parse-gram.y (grammar_declaration): Location of printer
5170 symbol is @1, not list->location. Bug reported by twlevo.
5171 * tests/input.at (Incompatible Aliases): Adjust to above change.
5172
51732006-01-29 Paul Eggert <eggert@cs.ucla.edu>
5174
5175 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
5176 all the test at once. This makes the output easier to read in the
5177 normal case.
5178
5179 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
5180 got from <http://bro-ids.org/download.html>. The bug is that
5181 when two actions appeared in succession, the second one was
5182 scanned before the first one was added to the grammar rule
5183 as a midrule action. Bison then output the incorrect warning
5184 "parse.y:905.17-906.36: warning: unused value: $3".
5185 * src/parse-gram.y (BRACED_CODE, action): These are no longer
5186 associated with a value.
5187 (rhs): Don't invoke grammar_current_rule_action_append.
5188 (action): Invoke it here instead.
5189 * src/reader.c (grammar_midrule_action): Now extern.
5190 (grammar_current_rule_action_append): Don't invoke
5191 grammar_midrule_action; that is now the scanner's job.
5192 * src/reader.h (last_string, last_braced_code_loc):
5193 (grammar_midrule_action): New decls.
5194 * src/scan-gram.l (last_string): Now extern, sigh.
5195 (last_braced_code_loc): New extern variable.
5196 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
5197 rule already has an action.
5198 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
5199 * tests/input.at (AT_CHECK_UNUSED_VALUES):
5200 Add some tests to check that the above changes fixed the bug.
5201
52022006-01-27 Paul Eggert <eggert@cs.ucla.edu>
5203
5204 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
5205 All used changed. Check whether the symbol has a destructor,
5206 not whether it is typed.
5207 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
5208 that the values are still reported as unused. All line numbers
5209 adjusted.
5210
52112006-01-23 Paul Eggert <eggert@cs.ucla.edu>
5212
5213 Work around a bug in bro 0.8, which underparenthesizes its
5214 definition of YYLLOC_DEFAULT.
5215 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
5216 their arguments.
5217 * data/lalr1.cc: Likewise.
5218 * data/yacc.cc: Likewise.
5219
52202006-01-22 Paul Eggert <eggert@cs.ucla.edu>
5221
5222 Work around a bug in Pike 7.0, and give the Pike folks a
5223 better way to override the usual int widths.
5224 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
5225 user can override the types.
5226 (short): #undef, to work around a bug in Pike 7.0.
5227 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
5228 (union yyalloc.yyss): Use yytype_int16 rather than short.
5229 All uses changed.
5230 (yysigned_char): Remove.
5231 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
5232 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
5233 * tests/regression.at (Web2c Actions): Adjust to above changes.
5234
5235 * src/reader.c (check_and_convert_grammar): New function.
5236 (reader): Close the input file even if something went wrong during
5237 parsing. Minor file descriptor leak reported by twlevo.
5238
5239 * src/assoc.c (assoc_to_string): Use a default: abort (); case
5240 to pacify gcc -Wswitch-default.
5241 * src/scan-gram.l (adjust_location): Use a default: break; case
5242 to pacify gcc -Wswitch-default.
5243 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
5244 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5245 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5246 Move these decls to scan-skel.l, since they don't need to be
5247 visible elsewhere.
5248 * src/scan-skel.l: Accept the above decls.
5249 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
5250 is used.
5251
52522006-01-21 Paul Eggert <eggert@cs.ucla.edu>
5253
5254 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
5255 since we don't want to insist on a version number at the start
5256 of the changelog every time.
5257 * Makefile.maint: Sync from coreutils a bit better.
5258 (sc_trailing_blank): Renamed from sc_trailing_space.
5259 All uses changed.
5260 (sc_no_if_have_config_h, sc_require_config_h):
5261 (sc_prohibit_assert_without_use): New rules.
5262 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
5263 (sc_dd_max_sym_length): Fix leading spaces in rule.
5264 (sc_system_h_headers): Prefix with @.
5265 (sc_useless_cpp_parens, m4-check): Output line numbers.
5266 (changelog-check): Allow version only in head.
5267 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
5268 satisfy new Makefile.maint rule.
5269 * data/glr.c: Likewise.
5270 * data/glr.cc: Likewise.
5271 * data/lalr1.cc: Likewise.
5272 * data/yacc.c: Likewise.
5273 * lib/ebitsetv.c: Likewise.
5274 * lib/lbitset.c: Likewise.
5275 * lib/subpipe.c: Likewise.
5276 * lib/timevar.c: Likewise.
5277 * src/system.h: Likewise.
5278 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
5279 * djgpp/Makefile.maint: Add copyright notice.
5280 * djgpp/README.in: Likewise.
5281 * djgpp/config.bat: Likewise.
5282 * djgpp/config.site: Likewise.
5283 * djgpp/config_h.sed: Likewise.
5284 * djgpp/djunpack.bat: Likewise.
5285 * djgpp/config.sed: Fix copyright notice to match standard format.
5286 * djgpp/subpipe.h: Likewise.
5287 * lib/bitsetv-print.c: Likewise.
5288 * lib/bitsetv.c: Likewise.
5289 * lib/subpipe.h: Likewise.
5290 * lib/timevar.c: Likewise.
5291 * lib/timevar.h: Likewise.
5292 * djgpp/subpipe.c: Use standard recipe for config.h.
5293 * lib/abitset.c: Likewise.
5294 * lib/bitset.c: Likewise.
5295 * lib/bitset_stats.c: Likewise.
5296 * lib/bitsetv-print.c: Likewise.
5297 * lib/bitsetv.c: Likewise.
5298 * lib/ebitsetv.c: Likewise.
5299 * lib/get-errno.c: Likewise.
5300 * lib/lbitset.c: Likewise.
5301 * lib/subpipe.c: Likewise.
5302 * lib/timevar.c: Likewise.
5303 * lib/vbitset.c: Likewise.
5304 * tests/local.at: Likewise.
5305 * src/scan-gram.l: Don't include verify.h, since system.h does
5306 that for us.
5307 * .x-sc_require_config_h: New file.
5308 * .x-sc_unmarked_diagnostics: New file.
5309
53102006-01-20 Paul Eggert <eggert@cs.ucla.edu>
5311
5312 Be a bit more systematic about using 'abort'.
5313 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
5314 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
5315 Put 'default: abort ();' before some other case, to satisfy older
5316 pedantic compilers.
5317 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5318 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
5319 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
5320 * src/conflicts.c (resolve_sr_conflict): Likewise.
5321 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
5322 (get_decision_str, get_orientation_str, get_node_alignment_str):
5323 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
5324 (get_linestyle_str, get_arrowstyle_str): Likewise.
5325 * src/conflicts.c (resolve_sr_conflict):
5326 Use a default case rather than one for the one remaining enum
5327 value, to catch invalid enum values as well.
5328 * src/lalr.c (set_goto_map, map_goto):
5329 Prefer "assert (FOO);" to "if (!FOO) abort ();".
5330 * src/nullable.c (nullable_compute, token_definitions_output):
5331 Likewise.
5332 * src/reader.c (packgram, reader): Likewise.
5333 * src/state.c (transitions_to, state_new, state_reduction_find):
5334 Likewise.
5335 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
5336 (symbol_pack): Likewise.
5337 * src/tables.c (conflict_row, pack_vector): Likewise.
5338 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
5339 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
5340 * src/system.h: Don't include <assert.h>.
5341 (assert): New macro.
5342
5343 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
5344 (Destructor Decl, Parser Function, Pure Calling):
5345 Describe rules for braces inside C code more carefully.
5346
53472006-01-19 Paul Eggert <eggert@cs.ucla.edu>
5348
5349 Fix some porting glitches found by Nelson H. F. Beebe.
5350 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
5351 compilers that don't understand that abort () does not return.
5352 * src/state.c (transitions_to): Likewise.
5353 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5354 that '#include <cstdlib>' works.
5355 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
5356 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
5357 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
5358 for the benefit of some pre-C99 compilers.
5359
5360 * bootstrap: Undo changes to gnulib files that autoreconf made.
5361
5362 Minor fixups to get 'make maintainer-check' to work.
5363 * configure.ac: Don't use -Wnested-externs, as it's incompatible
5364 with the new verify.h implementation.
5365 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
5366 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
5367 * data/yacc.c (YYUSE): Likewise.
5368 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
5369 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
5370 * src/parse-gram.y (declaration): Don't pass a string constant
5371 to a function that expects char *, since GCC might complain
5372 about the constant value.
5373 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
5374 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
5375 before #defining them.
5376 * tests/glr-regression.at
5377 (Incorrectly initialized location for empty right-hand side in GLR):
5378 In yyerror, use the msg arg.
5379 (Corrupted semantic options if user action cuts parse):
5380 (Incorrect lookahead during deterministic GLR):
5381 (Incorrect lookahead during nondeterministic GLR):
5382 Don't name a local var 'index'; it shadows string.h's 'index'.
5383
53842006-01-19 Akim Demaille <akim@epita.fr>
5385
5386 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
5387 location, not just parts of it.
5388
53892006-01-18 Paul Eggert <eggert@cs.ucla.edu>
5390
5391 * NEWS: Document the fact that multiple %unions are now allowed.
5392 * doc/bison.texinfo (Union Decl): Likewise.
5393 * TODO: This feature is now implemented, so remove it from
5394 the wishlist.
5395
5396 * Makefile.maint: Merge with coreutils Makefile.maint.
5397 (CVS_LIST): Use build-aux version if available.
5398 (VERSION_REGEXP): New macro.
5399 (syntax-check-rules): Add sc_no_if_have_config_h,
5400 sc_prohibit_assert_without_use, sc_require_config_h,
5401 sc_useless_cpp_parens.
5402 (sc_obsolete_symbols): Check for O_NDELAY.
5403 (sc_dd_max_sym_length): Track coreutils.
5404 (sc_unmarked_diagnostics): Look in all files, not just *.c.
5405 (sc_useless_cpp_parens): New rule.
5406 (news-date-check): Look for version or today's date.
5407 (changelog-check): Don't require version number near head.
5408 (copyright-check): Use current year instead of hardwiring 2005.
5409 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
5410 (announcement): Add --gpg-key-ID.
5411
5412 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
5413 with "file system".
5414
5415 Avoid undefined behavior that addressed just before the start of an
5416 array. Problem reported by twlevo.
5417 * src/reader.c (packgram): Prepend a new sentinel before ritem.
5418 * src/lalr.c (build_relations): Rely on new sentinel.
5419 * src/gram.c (gram_free): Adjust to new sentinel.
5420
54212006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
5422
5423 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
5424 yylookaheadNeeds. All uses updated.
5425 (yysplitStack): Rename local yynewLookaheadStatuses to
5426 yynewLookaheadNeeds.
5427 * data/glr-regression.at (Incorrect lookahead during nondeterministic
5428 GLR): In comments, change `lookahead status' to `lookahead need'.
5429
54302006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5431
5432 * data/glr.c (yysplitStack): A little stylistic rewrite.
5433
54342006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5435
5436 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
5437
54382006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
5439
5440 * doc/bison.texinfo: Fix some typos.
5441 (GLR Semantic Actions): New subsection discussing special
5442 considerations because GLR semantic actions might be deferred.
5443 (Actions): Mention look-ahead usage of yylval.
5444 (Actions and Locations): Mention look-ahead usage of yylloc.
5445 (Special Features for Use in Actions): Add YYEOF entry and mention it
5446 in the yychar entry.
5447 In the yychar entry, remove mention of the local yychar case (pure
5448 parser) since this is irrelevant information when writing semantic
5449 actions and since it's already discussed in `Table of Symbols' where
5450 yychar is otherwise described as an external variable.
5451 In the yychar entry, don't call it the `current' look-ahead since it
5452 isn't when semantic actions are deferred.
5453 In the yychar and yyclearin entries, add note about deferred semantic
5454 actions.
5455 Add yylloc and yylval entries discussing look-ahead usage.
5456 (Look-Ahead Tokens): When discussing yychar, don't call it the
5457 `current' look-ahead, and do mention yylval and yylloc.
5458 (Error Recovery): Cross-reference `Action Features' when mentioning
5459 yyclearin.
5460 (Table of Symbols): In the yychar entry, don't call it the `current'
5461 look-ahead.
5462 In the yylloc and yylval entries, mention look-ahead usage.
5463
54642006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5465
5466 * tests/glr-regression.at: Update copyright year to 2006.
5467
54682006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5469
5470 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
5471 use during nondeterministic operation to track which stacks have
5472 actually needed the current lookahead.
5473 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
5474 Allocate, deallocate, resize, and otherwise shuffle space for
5475 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
5476 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
5477 appropriately during nondeterministic operation.
5478 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
5479 members to store the current lookahead to be used by the deferred
5480 user action.
5481 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
5482 from which the RHS is taken. Set the lookahead members of the new
5483 yySemanticOption according to the lookahead status for stack yyk.
5484 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
5485 yyaddDeferredAction.
5486 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
5487 members of yySemanticOption before invoking yyuserAction, and then set
5488 them back to their current values afterward.
5489 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
5490 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
5491 * tests/glr-regression.at: Remove `.' from the ends of recent test case
5492 titles for consistency.
5493 (Leaked merged semantic value if user action cuts parse): In order to
5494 suppress lint warnings, use arguments in merge function, and assign
5495 char value < 128 in main.
5496 (Incorrect lookahead during deterministic GLR): New test case.
5497 (Incorrect lookahead during nondeterministic GLR): New test case.
5498
54992006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5500
5501 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
5502 !yyvaluep as signal that no semantic value is available to print.
5503 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
5504 to print a semantic value.
5505
55062006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5507
5508 * tests/glr-regression.at: For consistency with my newer test cases,
5509 don't thank myself.
5510
55112006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5512
5513 * data/glr.c (yyresolveValue): When merging semantic options, if at
5514 least one user action succeeds but a later one cuts the parse, then
5515 destroy the semantic value before returning rather than leaking it.
5516 (yyresolveStates): If a user action cuts the parse and thus
5517 yyresolveValue fails, ignore the (unset) semantic value rather than
5518 corrupting the yyGLRState, and empty the semantic options list since
5519 the user actions should have called all necessary destructors.
5520 Simplify code with YYCHK.
5521 * tests/glr-regression.at (Corrupted semantic options if user action
5522 cuts parse): New test case.
5523 (Undesirable destructors if user action cuts parse): New test case.
5524 Before applying any of this patch, this test case never actually failed
5525 for me... but only because the corrupted semantic options usually
5526 masked this bug.
5527 (Leaked merged semantic value if user action cuts parse): New test
5528 case.
5529
55302006-01-05 Akim Demaille <akim@epita.fr>
5531
5532 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
5533
55342006-01-04 Paul Eggert <eggert@cs.ucla.edu>
5535
5536 * data/c.m4 (b4_c_modern): New macro, with a new provision for
5537 _MSC_VER. Problem reported by Cenzato Marco.
5538 (b4_c_function_def): Use it.
5539 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
5540 b4_c_modern.
5541 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
5542 than rolling our own.
5543
55442006-01-04 Akim Demaille <akim@epita.fr>
5545
5546 Also warn about non-used mid-rule values.
5547 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
5548 member.
5549 (symbol_list_new): Adjust.
5550 * src/reader.c (symbol_typed_p): New.
5551 (grammar_rule_check): Use it.
5552 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
5553 Check its rule.
5554 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
5555 Use it.
5556 * tests/actions.at (Exotic Dollars): Adjust.
5557
55582006-01-04 Akim Demaille <akim@epita.fr>
5559
5560 * src/reader.c (grammar_midrule_action): If $$ is set in a
5561 mid-rule, move the `used' bit to its lhs.
5562 * tests/input.at (Unused values): New.
5563 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
5564
55652006-01-03 Paul Eggert <eggert@cs.ucla.edu>
5566
5567 * doc/bison.texinfo (Bison Options): Say more accurately what
5568 --yacc does.
5569 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
5570 about declarations in the grammar when in Yacc mode, as POSIX does
5571 not require a diagnostic when the grammar uses extensions.
5572
5573 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
5574
5575 Warn about dubious constructions like "%token T T".
5576 Reported by twlevo.
5577 * src/symtab.h (struct symbol.declared): New member.
5578 * src/symtab.c (symbol_new): Initialize it to false.
5579 (symbol_class_set): New arg DECLARING, specifying whether
5580 this is a declaration that we want to warn about, if there
5581 is more than one of them. All uses changed.
5582
5583 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
5584 Allow multiple %union directives, whose contents concatenate.
5585 * src/parse-gram.y (grammar_declaration): Likewise.
5586 Use muscle_code_grow, so that we don't need stype_line any more.
5587 All uses changed.
5588
5589 * src/muscle_tab.c (muscle_grow): Fix comment.
5590
5591 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
5592 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
5593 Update copyright year to 2006.
5594
55952006-01-03 Akim Demaille <akim@epita.fr>
5596
5597 Have glr.cc pass (some of) the calc.at tests.
5598 * data/glr.cc (b4_parse_param_orig): New.
5599 (b4_parse_param): Improve its definition, and bound it more
5600 clearly in the skeleton.
5601 (b4_epilogue): Append, instead of prepending, in order to keep
5602 #line consistency.
5603 Simplify the generation of auxiliary functions: locations and
5604 purity are mandated.
5605 (b4_global_tokens_and_yystype): Honor it.
5606 * data/location.cc (c++.m4): Don't include it.
5607 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
5608 and AT_SKEL_CC_IF.
5609 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
5610 AT_LALR1_CC_IF.
5611 Be sure to initialize the first position's filename.
5612 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
5613 mandated anyway.
5614 (AT_CHECK_CALC_GLR_CC): New.
5615 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
5616
56172006-01-02 Akim Demaille <akim@epita.fr>
5618
5619 * src/output.c (output_skeleton): Don't hard wire the inclusion of
5620 c.m4.
5621 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
5622 * data/glr.cc: Do not include stack.hh.
5623
56242006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5625
5626 * data/glr.c: Reformat whitespace with tabs.
5627 (b4_lpure_formals): Remove this unused m4 macro.
5628 * tests/cxx-type.at: Reformat whitespace with tabs.
5629 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
5630 since it's a member. Rename type to isNterm for clarity.
5631
56322005-12-29 Akim <akim@sulaco.local>
5633
5634 Let glr.cc catch up with symbol_value_print.
5635 * data/glr.cc (b4_yysymprint_generate): Replace by...
5636 (b4_yy_symbol_print_generate): this.
5637 (yy_symbol_print, yy_symbol_value_print): Declare them.
5638
56392005-12-28 Paul Eggert <eggert@cs.ucla.edu>
5640
5641 * src/location.h (boundary): Note that a line or column equal
5642 to INT_MAX indicates an overflow.
5643 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
5644 (rule_length_overflow, increment_rule_length, add_column_width):
5645 New functions.
5646 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
5647 (<SC_BRACED_CODE>"}"):
5648 Use increment_rule_length rather than incrementing it by hand.
5649 (adjust_location, handle_syncline): Diagnose overflow.
5650 (handle_action_dollar, handle_action_at):
5651 Fix bug with monstrosities like $-2147483648.
5652 Remove now-unnecessary checks.
5653 (scan_integer): Verify assumptions and remove now-unnecessary checks.
5654 (convert_ucn_to_byte): Verify assumptions.
5655 (handle_syncline): New arg LOC. All callers changed.
5656 Don't store through a value derived from char const * pointer.
5657
5658 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
5659 GCC warnings.
5660
56612005-12-27 Paul Eggert <eggert@cs.ucla.edu>
5662
5663 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
5664 Remove unnecessary forward static decls.
5665
56662005-12-27 Akim Demaille <akim@epita.fr>
5667
5668 * src/reader.c (grammar_current_rule_check): Also check that $$
5669 is used.
5670 Take the rule to check as argument, hence rename as...
5671 (grammar_rule_check): this.
5672 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
5673 Rename as...
5674 (grammar_rule_begin, grammar_rule_end): these, for consistency.
5675 (grammar_midrule_action, grammar_symbol_append): Now static.
5676 * tests/torture.at (input): Don't rely on the default action
5677 being always performed.
5678 * tests/calc.at: "Set" $$ even when the action is "cut" with
5679 YYERROR or other.
5680 * tests/actions.at (Exotic Dollars): Instead of using unused
5681 values, check that the warning is issued.
5682
56832005-12-22 Paul Eggert <eggert@cs.ucla.edu>
5684
5685 * NEWS: Improve wording for unused-value warnings.
5686
56872005-12-22 Akim Demaille <akim@epita.fr>
5688
5689 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
5690 (b4_yysymprint_generate): Rename as...
5691 (b4_yy_symbol_print_generate): this.
5692 Generate yy_symbol_print instead of yysymprint.
5693 Generate also yy_symbol_value_print, and use it.
5694
56952005-12-22 Akim Demaille <akim@epita.fr>
5696
5697 * NEWS: Warn about unused values.
5698 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
5699 a `used' member.
5700 (symbol_list_n_get, symbol_list_n_used_set): New.
5701 (symbol_list_n_type_name_get): Use symbol_list_n_get.
5702 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
5703 * src/reader.c (grammar_current_rule_check): Check that values are
5704 used.
5705 * src/symtab.c (symbol_print): Accept 0.
5706 * tests/existing.at: Remove the type information.
5707 Empty the actions.
5708 Remove useless actions (beware of mid-rule actions: perl -000
5709 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
5710 * tests/actions.at (Exotic Dollars): Use unused values.
5711 * tests/calc.at: Likewise.
5712 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5713 Likewise.
5714
5715 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
5716 rule_useful_p.
5717
57182005-12-21 Paul Eggert <eggert@cs.ucla.edu>
5719
5720 Undo 2005-12-01 tentative license wording change. The wording is
5721 still being reviewed by the lawyers, and we don't want to wait for
5722 them before publishing a test release. For now, revert to the
5723 previous wording.
5724 * NEWS: Undo 2005-12-01 change.
5725 * data/glr.c: Revert to previous license wording.
5726 * data/glr.cc: Likewise.
5727 * data/lalr1.cc: Likewise.
5728 * data/location.cc: Likewise.
5729 * data/yacc.c: Likewise.
5730
5731 * NEWS: Reword %destructor vs YYABORT etc.
5732 * data/glr.c: Use American spacing, for consistency.
5733 * data/glr.cc: Likewise.
5734 * data/lalr1.cc: Likewise.
5735 * data/yacc.c: Likewise.
5736 * data/yacc.c: Reformat comments slightly.
5737 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
5738 for consistency. Fix some spelling errors and reword recently-included
5739 text slightly.
5740 * tests/cxx-type.at: Cast results of malloc, for C++.
5741
57422005-12-21 Joel E. Denny <address@hidden>
5743
5744 * tests/cxx-type.at: Construct a tree, count the parents of shared
5745 nodes, and free each node once and only once. Previously, the memory
5746 for semantic values was leaked instead.
5747
57482005-12-21 Joel E. Denny <address@hidden>
5749
5750 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
5751 (yylval, yylloc): If pure, #define to yystackp->yyval and
5752 yystackp->yyloc similar to yychar and yynerrs.
5753 (yyparse): If pure, remove local yylval and yylloc. Add local
5754 yystackp to accommodate pure definitions of yylval and yylloc.
5755 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
5756 yylvalp and yyllocp to &yylval and &yylloc.
5757 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
5758 namespace. Previously, nerrs and char were missing, but lval and lloc
5759 weren't necessary.
5760 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
5761 yylvalp and yyllocp parameters since, if pure, these are now always
5762 accessible through yystackp. If not pure, they are still accessible
5763 globally.
5764 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
5765 `if (YYID (N))' to pacify lint.
5766
57672005-12-21 Akim Demaille <akim@epita.fr>
5768
5769 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
5770 destroy the RHS symbols of a rule.
5771 * data/yacc.c (yylen): Initialize to 0.
5772 Keep its value to the number of items to possibly shift.
5773 In particular, a regular successful parse that ends on YYFINAL by
5774 a (internal) YYACCEPT must not have yylen != 0.
5775 (yyerrorlab, yyreturn): Pop the RHS.
5776 Reorder a bit to emphasize the `shifting' bits of code.
5777 (YYPOPSTACK): Now accept a number of items to pop.
5778 * data/lalr1.cc: Likewise.
5779 * data/glr.c: Formatting changes.
5780 Use goto instead of fall through.
5781 * doc/bison.texinfo (Destructor Decl): Complete.
5782
57832005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5784
5785 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5786 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
5787 * djgpp/config.bat: Replace every occurence of the file name
5788 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5789 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5790 * djgpp/config.sed: Replace every occurence of the file name
5791 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5792 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5793 * djgpp/djunpack.bat: DJGPP specific file.
5794 * djgpp/fnchange.lst: DJGPP specific file.
5795 * djgpp/README.in: Add new information about how to unpack the bison
5796 source on MSDOS and other systems which have 8.3 file name restrictions
5797 using djunpack.bat and fnchange.lst.
5798
57992005-12-12 Paul Eggert <eggert@cs.ucla.edu>
5800
5801 * bootstrap (build_cvs_prefix): Remove; unused.
5802 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
5803 when getting gnulib.
5804
58052005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
5806
5807 * data/glr.c: Reorder typedef declarations for structs to match order
5808 of struct declarations.
5809 Rename yystack everywhere to yystackp except in yyparse where it's not
5810 a pointer.
5811 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
5812 consistency.
5813 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
5814 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
5815 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
5816 lint.
5817
58182005-12-09 Paul Eggert <eggert@cs.ucla.edu>
5819
5820 * tests/sets.at (Accept): Fix typos in regular expression used to
5821 sed out the final state number.
5822
5823 Work around portability problem on Solaris 10: flex-generated
5824 files include <stdio.h> before <config.h>, which messes up
5825 because the latter defines __EXTENSIONS__. Address the problem
5826 by creating two new little files that include <config.h> first,
5827 then include the flex-generated files. Rewrite everyone else
5828 to include <config.h> first, as well.
5829 * lib/timevar.c: Always include "config.h".
5830 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
5831 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
5832 (EXTRA_bison_SOURCES): New macro.
5833 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
5834 * src/system.h: Don't include config.h.
5835 * src/LR0.c: Include <config.h> first.
5836 * src/assoc.c: Likewise.
5837 * src/closure.c: Likewise.
5838 * src/complain.c: Likewise.
5839 * src/conflicts.c: Likewise.
5840 * src/derives.c: Likewise.
5841 * src/files.c: Likewise.
5842 * src/getargs.c: Likewise.
5843 * src/gram.c: Likewise.
5844 * src/lalr.c: Likewise.
5845 * src/location.c: Likewise.
5846 * src/main.c: Likewise.
5847 * src/muscle_tab.c: Likewise.
5848 * src/nullable.c: Likewise.
5849 * src/output.c: Likewise.
5850 * src/parse-gram.y: Likewise.
5851 * src/print.c: Likewise.
5852 * src/print_graph.c: Likewise.
5853 * src/reader.c: Likewise.
5854 * src/reduce.c: Likewise.
5855 * src/relation.c: Likewise.
5856 * src/state.c: Likewise.
5857 * src/symlist.c: Likewise.
5858 * src/symtab.c: Likewise.
5859 * src/tables.c: Likewise.
5860 * src/uniqstr.c: Likewise.
5861 * src/vcg.c: Likewise.
5862
5863 * src/parse-gram.y: Fix minor problems uncovered by lint.
5864 (current_lhs, current_lhs_location): Now static.
5865 (current_assoc): Remove unused variable.
5866
5867 Cleanups so that Bison-generated parsers have less lint.
5868 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5869 Prepend /*ARGSUSED*/, for lint's sake.
5870 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5871 definition if 'lint' is defined.
5872 (YYID): New macro (or function, if lint).
5873 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5874 * data/yacc.c: Likewise.
5875 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5876 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5877 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5878 is C++ only.
5879 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5880 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5881 Use YYID(0) rather than 0, for lint.
5882 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5883 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5884
58852005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5886
5887 * tests/glr-regression.at
5888 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5889 Close memory leak reported by twlevo.
5890
58912005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5892
5893 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5894 all stacks.
5895 (yyparse): Iterate another stack in order to call user destructors.
5896 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5897 New test case.
5898 (Duplicated user destructor for lookahead): This test now is expected
5899 to succeed.
5900
59012005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5902
5903 * NEWS: Document the following change.
5904 * data/yacc.c: Say "parser skeleton" rather than "file", since
5905 it's no longer just a file.
5906 * data/glr.c: Grant a special exception for C GLR parsers, that
5907 reads like the already-existing exception for C LALR(1) parsers.
5908 * data/glr.cc: Likewise.
5909 * data/lalr1.cc: Likewise.
5910 * data/location.cc: Likewise.
5911 * data/yacc.c: Reword the "written by" statement to clarify that
5912 it was the parser skeleton, not the entire output file.
5913 * data/glr.c: Written by Paul Hilfinger.
5914 * data/glr.cc: Written by Akim Demaille.
5915 * data/lalr1.cc: Likewise.
5916
59172005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5918
5919 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5920 Fix typos in previous change that broke 'make check'.
5921 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5922 supported in C.
5923 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5924 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5925 We can revert this once things settle down.
5926
5927 * src/conflicts.c (conflicts_print): Don't print file name twice
5928 when %expect fails because there were no conflicts.
5929 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5930 change.
5931 * tests/conflicts.at (%expect not enough, %expect too much):
5932 (%expect with reduce conflicts): Adjust to new behavior.
5933
59342005-11-18 Akim Demaille <akim@epita.fr>
5935
5936 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5937 errors.
5938 * NEWS: Document this.
5939 * doc/bison.texinfo (Expect Decl): Likewise.
5940
59412005-11-16 Akim Demaille <akim@epita.fr>
5942
5943 Generalize the display of semantic values and locations in traces.
5944 * data/glr.c (yy_reduce_print): Fix indices (again).
5945 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5946 literal integers.
5947 * data/lalr1.cc (yyreduce_print): Rename as...
5948 (yy_reduce_print): this.
5949 Display values and locations.
5950 * data/yacc.c (yy_reduce_print): Likewise.
5951 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5952 (yysymprint): Move higher to be visible from yy_reduce_print).
5953 (yyparse): Adjust.
5954 * tests/calc.at: Adjust the expected length of the traces.
5955
59562005-11-14 Akim Demaille <akim@epita.fr>
5957
5958 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5959 from 1 to N, while values and location start at 0.
5960 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5961
59622005-11-14 Akim Demaille <akim@epita.fr>
5963
5964 * data/glr.c (yy_reduce_print): Fix the $ number.
5965
59662005-11-14 Akim Demaille <akim@epita.fr>
5967
5968 "Use" parse parameters.
5969 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5970 * data/glr.c, data/glr.cc: Use them.
5971 * data/glr.c (YYUSE): Have a C++ definition that supports
5972 non-pointer types.
5973
59742005-11-14 Akim Demaille <akim@epita.fr>
5975
5976 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5977
59782005-11-14 Akim Demaille <akim@epita.fr>
5979
5980 * data/glr.cc: New.
5981 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5982
59832005-11-12 Akim Demaille <akim@epita.fr>
5984
5985 Let position and location be PODs.
5986 * data/location.cc (position::initialize, location::initialize): New.
5987 (position::position, location::location): Define only if
5988 b4_location_constructors is defined.
5989 * data/lalr1.cc (b4_location_constructors): Define it for backward
5990 compatibility.
5991 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5992
59932005-11-12 Akim Demaille <akim@epita.fr>
5994
5995 * data/lalr1.cc: Move the body of the ctor and dtor into the
5996 parser file (instead of the header).
5997 Wrap the implementations in a "namespace yy".
5998
59992005-11-12 Akim Demaille <akim@epita.fr>
6000
6001 Have glr.c include its header file when created.
6002 * data/glr.c (b4_shared_declarations): New.
6003 Output them verbatim in the parser if !%defines, otherwise
6004 output then in the header file, and include it instead.
6005
60062005-11-11 Akim Demaille <akim@epita.fr>
6007
6008 * data/glr.c: Comment changes.
6009
60102005-11-11 Akim Demaille <akim@epita.fr>
6011
6012 When yydebug, report semantic and location values for reductions.
6013 * data/glr.c (yy_reduce_print): Report the semantic values and the
6014 locations.
6015 (YY_REDUCE_PRINT): Adjust.
6016 (yyglrReduce): Use them.
6017 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
6018 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
6019 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
6020 traces.
6021
60222005-11-10 Akim Demaille <akim@epita.fr>
6023
6024 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
6025 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
6026 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
6027
60282005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
6029
6030 * m4/cxx.m4, examples/Makefile.am: Don't build
6031 examples/calc++ if no C++ compiler is available. (trivial change)
6032
60332005-11-09 Akim Demaille <akim@epita.fr>
6034
6035 * src/scan-skel.l: Use a couple of asserts.
6036
60372005-11-03 Akim Demaille <akim@epita.fr>
6038
6039 In some (weird) cases, the final state number is incorrect.
6040 Reported by Alexandre Duret-Lutz.
6041 * src/LR0.c (state_list_append): Remove the computation of
6042 final_state.
6043 (save_reductions): Do it here.
6044 (get_state): Alpha conversion.
6045 (generate_states): Use a for loop.
6046 * src/gram.h (item_number_is_rule_number)
6047 (item_number_is_symbol_number): New.
6048 * src/state.c: Use assert.
6049 * src/system.h: Include assert.h.
6050 * tests/sets.at (Accept): New.
6051
60522005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6053
6054 * data/glr.c (yyfill): Adjust comment.
6055 (yyresolveAction): Initialize default location properly
6056 for empty right-hand sides.
6057 (yydoAction): Ditto.
6058 Add comment explaining apparently dead code.
6059 * tests/glr-regression.at
6060 (Incorrectly initialized location for empty right-hand side in GLR):
6061 New test.
6062
60632005-10-30 Paul Eggert <eggert@cs.ucla.edu>
6064
6065 * bootstrap (cleanup_gnulib): New function. Use it to clean up
6066 gnulib when interrupted. This fixes some race conditions and
6067 works around some portability problems (one noted by Paul
6068 Hilfinger).
6069
60702005-10-22 Akim <akim@epita.fr>
6071
6072 * Makefile.cfg: Adjust to config -> build-aux.
6073 Reported by twledo.
6074
60752005-10-21 Akim Demaille <akim@epita.fr>
6076
6077 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
6078 the %parse-params.
6079 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
6080 * data/yacc.c (b4_Pure_if): Rename as...
6081 (b4_yacc_pure_if): this.
6082 (YY_SYMBOL_PRINT, yyparse): Adjust.
6083 * doc/bison.texinfo: Formatting changes.
6084
60852005-10-21 Akim Demaille <akim@epita.fr>
6086
6087 Finish the transition config -> build-aux.
6088 * configure.ac, Makefile.am: Use build-aux.
6089 * config/prev-version, config/announce-gen, config/Makefile.am:
6090 Move to...
6091 * build-aux/prev-version, build-aux/announce-gen,
6092 * build-aux/Makefile.am: here.
6093
60942005-10-14 Akim Demaille <akim@epita.fr>
6095
6096 * examples/calc++/test: Use set -x only when VERBOSE.
6097
60982005-10-13 Paul Eggert <eggert@cs.ucla.edu>
6099
6100 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
6101 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
6102
61032005-10-13 Akim Demaille <akim@epita.fr>
6104
6105 * src/scan-skel.l: Output the base name parts of the parser and
6106 header file names.
6107 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
6108 additional checks.
6109 Use this to exercise C++ outputs in subdirs.
6110 Reported by Oleg Smolsky.
6111
61122005-10-12 Paul Eggert <eggert@cs.ucla.edu>
6113
6114 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
6115 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
6116 Problem reported by John P. Hartmann.
6117 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
6118 already defined it.
6119
61202005-10-12 Akim Demaille <akim@epita.fr>
6121
6122 * src/parse-gram.y (version_check): Exit 63 to please missing
6123 (stands for "version mismatch).
6124 * tests/input.at, doc/bison.texinfo: Adjust.
6125
61262005-10-10 Paul Eggert <eggert@cs.ucla.edu>
6127
6128 Work around portability problems with Visual Age C compiler
6129 (xlc and xlC_r) reported by John P. Hartmann.
6130 * data/location.cc (initial_column, initial_line): Remove.
6131 All uses replaced by 0 and 1.
6132 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
6133 that xlc complains about.
6134 * src/scan-skel.l (skel_wrap): Likewise.
6135 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
6136 as __STDC__.
6137 * data/yacc.c (YYMODERN_C): New macro, which also looks at
6138 __STDC_VERSION__. Use it everywhere instead of looking at
6139 __STDC__ and __cplusplus.
6140
61412005-10-10 Akim Demaille <akim@epita.fr>
6142
6143 * examples/calc++/test: Be quiet unless VERBOSE.
6144
61452005-10-05 Paul Eggert <eggert@cs.ucla.edu>
6146
6147 * data/c.m4 (yydestruct, yysymprint):
6148 Use YYUSE instead of casting to void.
6149 * data/glr.c (YYUSE): New macro.
6150 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6151 Use it instead of rolling our own.
6152 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
6153 (YYCHK1):
6154 Use /*CONSTCOND*/ to suppress lint warnings.
6155 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
6156 (YY_STACK_PRINT): Use 'false' not '0'.
6157 (YYUSE): New macro.
6158 (yysymprint_, yydestruct_): Use it instead of rolling our own.
6159 * data/yacc.c (YYUSE): New macro.
6160 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
6161 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
6162 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
6163
6164
6165 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
6166 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
6167
61682005-10-04 Paul Eggert <eggert@cs.ucla.edu>
6169
6170 Undo the parts of the unlocked-I/O change that substituted
6171 putc or puts for printf. This might hurt performance a bit,
6172 but some people prefer the printf style.
6173 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
6174 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
6175 All uses replaced by YYFPRINTF and YYDPRINTF.
6176 * data/yacc.c: Likewise.
6177 * lib/bitset.c (bitset_print): Likewise.
6178 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
6179 putc and puts.
6180 * lib/lbitset.c (debug_lbitset): Likewise.
6181 * src/closure.c (print_firsts, print_fderives): Likewise.
6182 * src/gram.c (grammar_dump): Likewise.
6183 * src/lalr.c (look_ahead_tokens_print): Likewise.
6184 * src/output.c (escaped_output): Likewise.
6185 (user_actions_output): Break apart two printfs.
6186 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
6187 * src/reduce.c (reduce_print): Likewise.
6188 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
6189 * src/system.h: Include unlocked-io.h rathe than stdio.h.
6190
6191 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6192 Use assignments rather than casts-to-void to suppress
6193 unused-variable warnings. This pacifies 'lint'.
6194 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
6195 unused-variable warnings.
6196
61972005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6198
6199 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
6200
62012005-10-02 Paul Eggert <eggert@cs.ucla.edu>
6202
6203 Use unlocked I/O for a minor performance improvement on hosts like
6204 GNU/Linux and Solaris that support unlocked I/O. The basic idea
6205 is to use the gnlib unlocked-io module, and to prefer putc and
6206 puts to printf when either will work (since the latter doesn't
6207 come in an unlocked flavor).
6208 * bootstrap (gnulib_modules): Add unlocked-io.
6209 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
6210 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
6211 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
6212 and similarly for puts and putc and printf.
6213 * data/yacc.c: Likewise.
6214 * lib/bitset.c (bitset_print): Likewise.
6215 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
6216 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
6217 to printf.
6218 * lib/lbitset.c (debug_lbitset): Likewise.
6219 * src/closure.c (print_firsts, print_fderives): Likewise.
6220 * src/gram.c (grammar_dump): Likewise.
6221 * src/lalr.c (look_ahead_tokens_print): Likewise.
6222 * src/output.c (escaped_output): Likewise.
6223 (user_actions_output): Coalesce two printfs.
6224 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
6225 * src/reduce.c (reduce_print): Likewise.
6226 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
6227 * src/system.h: Include unlocked-io.h rather than stdio.h.
6228
6229 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
6230 this confuses xgettext.
6231
62322005-10-02 Akim Demaille <akim@epita.fr>
6233
6234 * bootstrap (gnulib_modules): Add strverscmp.
6235 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
6236 * m4/.cvsignore: Add strverscmp.m4.
6237 * src/parse-gram.y (%require): New token, new rule.
6238 (version_check): New.
6239 * src/scan-gram.l (%require): Adjust.
6240 * tests/input.at (AT_REQUIRE): New.
6241 Use it.
6242 * doc/bison.texinfo (Require Decl): New.
6243 (Calc++ Parser): Use %require.
6244
62452005-10-02 Akim Demaille <akim@epita.fr>
6246
6247 * data/location.cc: New.
6248
62492005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
6250 Akim Demaille <akim@epita.fr>
6251
6252 Make sure -odir/foo.cc creates dir/location.hh etc.
6253 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
6254 (spec_file_prefix, spec_verbose_file, spec_graph_file)
6255 (spec_defines_file): Now const.
6256 (dir_prefix): New.
6257 (short_base_name): Remove.
6258 * src/files.c: Adjust.
6259 (dirname.h): Include.
6260 (base_name): Don't prototype it.
6261 (finput): Remove, duplicates gram_in.
6262 (full_base_name, short_base_name): Replace by...
6263 (all_but_ext, all_but_tab_ext): these.
6264 (compute_base_names): Rename as...
6265 (compute_file_name_parts): this.
6266 Update to compute the new variables, including dir_prefix.
6267 Adjust dependencies.
6268 * src/output.c (prepare): Output them.
6269 * src/reader.c: Adjust to use gram_in, not finput.
6270 * src/scan-skel.l (@dir_prefix@): New.
6271
62722005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6273
6274 * lib/subpipe.c: New function end_of_output_subpipe() added
6275 to allow support for non-posix systems. This is a no-op function
6276 for posix systems.
6277
6278 * lib/subpipe.h: New function end_of_output_subpipe() added
6279 to allow support for non-posix systems. This is a no-op function
6280 for posix systems.
6281
6282 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
6283 handle the lack of pipe/fork functionality on non-posix systems.
6284
6285 * djgpp/Makefile.maint: DJGPP specific file.
6286
6287 * djgpp/README.in: DJGPP specific file.
6288
6289 * djgpp/config.bat: DJGPP specific configuration file.
6290
6291 * djgpp/config.sed: DJGPP specific configuration file.
6292
6293 * djgpp/config.site: DJGPP specific configuration file.
6294
6295 * djgpp/config_h.sed: DJGPP specific configuration file.
6296
6297 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
6298
6299 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
6300
63012005-10-02 Akim Demaille <akim@epita.fr>
6302
6303 * data/location.cc: New, extract from...
6304 * data/lalr1.cc: here.
6305 (location.hh): Include it after the user prologue, in case the
6306 filename type is defined by the user.
6307 Forward declation location and position before the pre-prologue.
6308 (yyresult_): Rename as...
6309 (yyresult): this, it's a local variable, not an attribute.
6310 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
6311
63122005-10-01 Akim Demaille <akim@epita.fr>
6313
6314 * examples/extexi: Restore the #line generation.
6315
63162005-09-30 Akim Demaille <akim@epita.fr>,
6317 Alexandre Duret-Lutz <adl@gnu.org>
6318
6319 Move the token type and YYSTYPE in the parser class.
6320 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
6321 (parser::token): New, from the moved free definition of tokens.
6322 (parser::semantic_value): Now a full definition instead of an
6323 indirection to YYSTYPE.
6324 (b4_post_prologue): No longer included in the header file, but
6325 in the implementation file.
6326 * doc/bison.texi (C+ Language Interface): Update.
6327 * src/parse-gram.y: Support unary %define.
6328 * tests/actions.at: Define global_tokens_and_yystype for backward
6329 compatibility until we update the tests.
6330 * tests/calc.at: Idem.
6331 (first_line, first_column, last_line, last_column): Define for lalr1.cc
6332 to simplify the code.
6333
63342005-09-29 Paul Eggert <eggert@cs.ucla.edu>
6335
6336 Port to SunOS 4.1.4, which lacks strtoul and strerror.
6337 Ah, the good old days! Problem reported by Peter Klein.
6338 * bootstrap (gnulib_modules): Add strerror, strtoul.
6339 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
6340 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
6341
63422005-09-29 Akim Demaille <akim@epita.fr>
6343
6344 * data/c.m4 (b4_error_verbose_if): New.
6345 * data/lalr1.cc: Use it.
6346 (YYERROR_VERBOSE_IF): Remove.
6347 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
6348 parser members, replaced by...
6349 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
6350 local variables.
6351 (yysyntax_error_): Takes the state number as argument.
6352 (yyreduce_print_): Use the argument yyrule, not the former
6353 attribute yyn_.
6354
63552005-09-26 Paul Eggert <eggert@cs.ucla.edu>
6356
6357 * bootstrap (gnulib_modules): Add verify.
6358 * lib/.cvsignore: Add verify.h.
6359 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
6360 * src/system.h (verify): Remove.
6361 Include verify.h instead.
6362 * src/tables.c (tables_generate): Use new API for 'verify'.
6363
63642005-09-21 Paul Eggert <eggert@cs.ucla.edu>
6365
6366 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
6367 local variables whose names begin with 'yy'.
6368 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
6369 Trivial changes from Joel E. Denny.
6370
6371 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
6372 it itself.
6373 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
6374 don't use alloca any more.
6375
6376 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
6377 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
6378 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
6379 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
6380 to match yacc.c, to test more hosts.
6381
63822005-09-20 Paul Eggert <eggert@cs.ucla.edu>
6383
6384 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
6385 doesn't affect behavior.
6386 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
6387 Solaris, AIX, MSC.
6388 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
6389 This works a bit better with glibc, if user code has already included
6390 stdlib.h.
6391 * doc/bison.texinfo (Bison Parser): Document that users can't
6392 arbitrarily use malloc and free for other purposes. Document
6393 that <alloca.h> and <malloc.h> might be included.
6394 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
6395 user must declare alloca.
6396
6397 * HACKING (release): Forwarn the Translation Project about
6398 stable releses.
6399
64002005-09-20 Akim Demaille <akim@epita.fr>
6401
6402 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
6403
64042005-09-19 Paul Eggert <eggert@cs.ucla.edu>
6405
6406 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
6407 (YYSTACK_ALLOC_MAXIMUM): Use it.
6408 (yysyntax_error): New function.
6409 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
6410 multiple syntax errors are reported, and alloca is being used.
6411 Instead, reallocate buffers twice as big each time, so that
6412 we waste at most half the allocated memory. Start with a small
6413 (128-byte) buffer that will suffice in most cases anyway.
6414 Use yysyntax_error to do most of the work.
6415
6416 * doc/bison.texinfo (Error Reporting, Table of Symbols):
6417 yynerrs is the number of errors reported, not the number of
6418 errors encountered.
6419
6420 * tests/glr-regression.at (Duplicated user destructor for lookahead):
6421 Mark it as expected to fail.
6422 Cast result of malloc; problem reported by twlevo@xs4all.nl.
6423 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
6424 Don't start user-code symbols with "yy", to avoid name space problems.
6425
64262005-09-19 Akim Demaille <akim@epita.fr>
6427
6428 Remove the traits, failed experiment.
6429 It never proved useful, and anyway because of the current
6430 definition, it was not possible to have several specialization of
6431 this traits, making it useless.
6432 * data/lalr1.cc (yy:traits): Remove.
6433 Inline its definitions in the parser class.
6434
64352005-09-19 Akim Demaille <akim@epita.fr>
6436
6437 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
6438 least Mac OSX with a /usr/local install of gettext.
6439
64402005-09-19 Akim Demaille <akim@epita.fr>
6441
6442 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
6443 and yytoken for similarity with the other skeletons.
6444
64452005-09-19 Akim Demaille <akim@epita.fr>
6446
6447 * NEWS, configure.ac: update version number to 2.1a.
6448
64492005-09-16 Paul Eggert <eggert@cs.ucla.edu>
6450
6451 * NEWS: Version 2.1.
6452
6453 * NEWS: Remove notice of yytname change, since it was never in an
6454 official release.
6455 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
6456 diagnostic.
6457 * src/output.c (prepare): Likewise.
6458 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
6459 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
6460 is not defined. This is an awful hack, but it's enough for now.
6461 All callers changed.
6462 * tests/glr-regression-at (make_value): Args are const pointers now,
6463 to avoid GCC warning.
6464 (Duplicated user destructor for lookahead): New test. Currently
6465 skipped. It fails on my host but I'm not sure it'll always fail.
6466
64672005-09-16 Akim Demaille <akim@epita.fr>
6468
6469 * src/symtab.h (struct symbol): Declare the printer and destructor
6470 as const, to avoid accidental calls to free.
6471 (symbol_destructor_set, symbol_printer_set): Adjust.
6472 * src/symtab.c: Adjust.
6473
64742005-09-16 Akim Demaille <akim@epita.fr>
6475
6476 * data/c.m4 (b4_token_enums): New.
6477 (b4_token_defines): Rename as...
6478 (b4_token_enums_defines): this.
6479 (b4_token_defines): New, output only the #defines.
6480 * data/yacc.c, data/glr.c: Adjust.
6481 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
6482 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
6483 as default values.
6484
64852005-09-16 Akim Demaille <akim@epita.fr>
6486
6487 * data/lalr1.cc (yylex_): Remove, inline its code.
6488 (yyreport_syntax_error_): Remove, replaced by...
6489 (yysyntax_error_): this which returns a string and leaves to the
6490 caller the call to the users' error function.
6491 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
6492 Move from members of the parser object...
6493 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
6494 to local variables of the parse function.
6495
64962005-09-16 Akim Demaille <akim@epita.fr>
6497
6498 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
6499 since it's in Bison's name space.
6500
65012005-09-15 Paul Eggert <eggert@cs.ucla.edu>
6502
6503 * data/glr.c (yyresolveValue): Add default case to pacify
6504 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
6505
6506 * NEWS: Document when yyparse started to return 2.
6507 * doc/bison.texinfo (Parser Function): Document when yyparse
6508 returns 2.
6509
6510 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
6511 (b4_filename_type): Renamed back from b4_file_name_type. All uses
6512 changed.
6513 (class position): file_name -> filename (reverting). All uses changed.
6514
65152005-09-14 Paul Eggert <eggert@cs.ucla.edu>
6516
6517 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
6518 do anything if $@ exists. This reverts part of the 2005-07-07
6519 patch.
6520
65212005-09-11 Paul Eggert <eggert@cs.ucla.edu>
6522
6523 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
6524 contains obsolete information and isn't worth distributing as a
6525 separate file anyway.
6526 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
6527 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
6528 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
6529 (yyparse): Abort if user code uses longjmp to throw an unexpected
6530 value.
6531
65322005-09-09 Paul Eggert <eggert@cs.ucla.edu>
6533
6534 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
6535 Suggested by twlevo@xs4all.nl.
6536
6537 * data/glr.c (YYCHK1): Do not assume YYE is in range.
6538 This avoids a diagnostic from gcc -Wswitch-enum.
6539 Problem reported by twlevo@xs4all.nl.
6540
6541 * doc/bison.texinfo: Don't use "filename", as per GNU coding
6542 standards. Use "file name" or "file" or "name", depending on
6543 the context.
6544 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
6545 not to hack/foo.tab.c.
6546 (Calc++ Top Level): 2nd arg of main is not const.
6547 * data/glr.c: b4_filename -> b4_file_name.
6548 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
6549 All uses changed.
6550 (class position): filename -> file_name. All uses changed.
6551 * data/yacc.c: b4_filename -> b4_file_name.
6552 * lib/bitset.h: filename -> file_name in local vars.
6553 * lib/bitset_stats.c: Likewise.
6554 * src/files.c: Likewise.
6555 * src/scan-skel.l ("@output ".*\n): Likewise.
6556 * src/files.c (file_name_split): Renamed from filename_split.
6557 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
6558
65592005-09-08 Paul Eggert <eggert@cs.ucla.edu>
6560
6561 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
6562 to accommodate latest gnulib.
6563
6564 * tests/glr-regression.at (Duplicate representation of merged trees):
6565 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
6566
6567 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
6568 needed.
6569
65702005-08-26 Paul Eggert <eggert@cs.ucla.edu>
6571
6572 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
6573 All uses changed. Invoke user destructor after an error during a
6574 split parse (trivial change from Joel E. Denny).
6575
6576 * tests/glr-regression.at
6577 (User destructor after an error during a split parse): New test case.
6578 Problem reported by Joel E. Denny in:
6579 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
6580
65812005-08-25 Paul Eggert <eggert@cs.ucla.edu>
6582
6583 * README-cvs: Give URLs for recommended tools.
6584 Mention Gzip version problem, and bootstrapping issues.
6585 Remove troubleshooting section, as it's somewhat obsolete.
6586
6587 * bootstrap (no_cache): New var, to accommodate different wget
6588 variants. Use it instead of '-C off'. Problem reported by
6589 twlevo@xs4all.nl.
6590
6591 * data/glr.c (yydestroyStackItem): New function.
6592 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
6593 debugging information. Problem reported by Joel E. Denny.
6594
65952005-08-25 Akim Demaille <akim@epita.fr>
6596
6597 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
6598
65992005-08-24 Paul Eggert <eggert@cs.ucla.edu>
6600
6601 * data/glr.c (yyrecoverSyntaxError, yyreturn):
6602 Don't invoke destructor on unresolved entries.
6603 * tests/glr-regression.at
6604 (User destructor for unresolved GLR semantic value): New test case.
6605 Problem reported by Joel E. Denny in:
6606 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
6607
66082005-08-21 Paul Eggert <eggert@cs.ucla.edu>
6609
6610 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
6611 Add strnlen.c.
6612 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
6613 lib-prefix.m4, po.m4.
6614
6615 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
6616 in yydestruct diagnostic, since it might not be an error.
6617 Problem reported by Joel Denny near end of
6618 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6619 * data/lalr1.cc (yyerturn): Likewise.
6620 * data/yacc.c (yyreturn): Likewise.
6621 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
6622
6623 * src/files.c: Remove obsolete FIXME comment.
6624
6625 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
6626 with the other templates, and to fix bogus run-on messages such
6627 as the one reported at the end of
6628 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6629 All callers changed to avoid the newline.
6630 (yyprocessOneStack): Output two lines rather than one, to accommodate
6631 the above change. This changes the debug output format slightly.
6632
6633 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
6634 reported by Joel E. Denny in
6635 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
6636 (trivial change).
6637 * tests/glr-regression.at (Duplicate representation of merged trees):
6638 New test, from Joel E. Denny in:
6639 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
6640 * THANKS: Add Joel E. Denny.
6641
6642 * configure.ac (AC_INIT): Bump to 2.0c.
6643
66442005-07-24 Paul Eggert <eggert@cs.ucla.edu>
6645
6646 * NEWS: Version 2.0b.
6647
6648 * Makefile.am (SUBDIRS): Put examples before tests, so that
6649 "make check" doesn't finish with "All 1 tests passed".
6650
6651 * tests/regression.at (Token definitions): Don't rely on
6652 AT_PARSER_CHECK for data that contains backslashes. It currently
6653 uses 'echo', and 'echo' isn't portable if its argument contains
6654 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
6655 that the byte '\0xff' is not printable in the C locale; it is,
6656 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
6657 not printable, so use '\0x81' to test.
6658
6659 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
6660 version of GCC, since the macro is used with non-GCC compilers.
6661
6662 Fix core dump reported by Pablo De Napoli in
6663 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
6664 * tests/regression.at (Invalid inputs with {}): New test.
6665 * src/parse-gram.y (token_name): Translate type before using
6666 it as an index.
6667
6668 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
6669 the user's name space. All uses changed to __attribute__
6670 ((__unused__)).
6671 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
6672 Add __attribute__ ((__noreturn__)).
6673
6674 * etc/clcommit: Remove. We weren't using it, and it failed
6675 "make maintainer-distcheck".
6676 * Makefile.maint: Merge from coreutils.
6677 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
6678 (syntax-check-rules): Change list of rules as described below.
6679 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
6680 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
6681 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
6682 (sc_trailing_space): New rules.
6683 (sc_xalloc_h_in_src): Remove.
6684 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
6685 (sc_space_tab, sc_error_exit_success, sc_changelog):
6686 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
6687 (makefile-check, po-check, author_mark_check):
6688 (makefile_path_separator_check, copyright-check):
6689 Use grep -n, to make it easier to find violations.
6690 Use CVS_LIST and CVS_LIST_EXCEPT.
6691 (header_regexp, h_re): Remove.
6692 (dd_c): New macro.
6693 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
6694 (my-distcheck): Use more-modern GCC flags.
6695 (signatures, %.asc): Remove.
6696 (rel-files, announcement): Remove signatures.
6697 Restore old updating code, even though we don't use it, so
6698 that we're the same as coreutils.
6699 (alpha, beta, major): Depend on news-date-check.
6700 Make the upload commands.
6701
6702 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
6703 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
6704 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
6705 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
6706 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
6707 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
6708 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
6709 * tests/sets.at: Likewise.
6710
6711 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
6712 we comment out the Autoconf version number.
6713 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
6714 it's error-prone and "make maintainer-distcheck" rejects it.
6715
6716 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
6717 Indent calls to "error" to pacify "make maintainer-distcheck",
6718 when the calls are not intended to be translated.
6719 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
6720
6721 * src/Makefile.am (DEFS): Use +=, to pacify
6722 "make maintainer-distcheck".
6723 (bison_SOURCES): Add scan-skel.h.
6724 (sc_tight_scope): New rule, from coreutils.
6725
6726 * src/files.c (src_extension, header_extension):
6727 Now static, not extern.
6728 * src/getargs.c (short_options): Likewise.
6729 * src/muscle_tab.c (muscle_table): Likewise.
6730 * src/parse-gram.y (current_class, current_type, current_prec):
6731 Likewise.
6732 * src/reader.c (grammar_end, previous_rule_end): Likewise.
6733 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
6734 * src/main.c (main): Cast bindtextdomain and textdomain calls to
6735 void, to avoid warning when NLS is disabled.
6736 * src/output.c: Include scan-skel.h.
6737 (scan_skel): Remove decl, since scan-skel.h does this.
6738 (output_skeleton):
6739 Indent calls to "error" to pacify "make maintainer-distcheck".
6740 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
6741 * src/reader.h (gram_end, gram_lineno): New decls to pacify
6742 "make maintainer-distcheck".
6743 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
6744 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
6745 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
6746 (skel_lex_destroy, scan_skel): Move these decls to...
6747 * src/scan-skel.h: New file.
6748 * src/uniqstr.c (uniqstr_assert):
6749 Indent calls to "error" to pacify "make maintainer-distcheck".
6750
6751 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
6752 not @VAR@.
6753
6754 * tests/torture.at: Revamp to avoid misuse of atoi that
6755 "make maintainer-distcheck" complained about.
6756
6757 * examples/extexi (message): Don't print a message more than once,
6758 and omit line-number decoration that makes Emacs compile think
6759 that informative messages are worth worrying about.
6760
67612005-07-22 Paul Eggert <eggert@cs.ucla.edu>
6762
6763 * configure.ac: Update version number.
6764
6765 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
6766 accidentally.
6767 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
6768 autogenerated by the maintainer.
6769 * examples/calc++/.cvsignore: Add *.yy.
6770
6771 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
6772 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6773 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6774
6775 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
6776
6777 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
6778 from maintainer-distcheck about casting the argument of 'free'.
6779
6780 * NEWS: Mention recent yytname changes.
6781 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
6782
6783 * bootstrap: For translations that have not yet been upgraded to
6784 the new runtime-po domain, prime the pump by extracting the
6785 relevant strings from the obsolete translations. This code can be
6786 removed once the bison-runtime domain has been translated by each
6787 team.
6788
6789 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
6790 now that token names are already quoted.
6791
6792 Fix problem reported by Anthony Heading.
6793 * data/glr.c (YYTOKEN_TABLE): New macro.
6794 (yytname): Define if YYTOKEN_TABLE.
6795 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
6796 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
6797 (YYERROR_VERBOSE): Define the same way the other skeletons do.
6798 * src/output.c (prepare_symbols): Output token_table_flag.
6799
68002005-07-21 Paul Eggert <eggert@cs.ucla.edu>
6801
6802 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
6803 again if the first call fails.
6804
6805 * data/glr.c (yytnamerr): New function.
6806 (yyreportSyntaxError): Use it to dequote most string literals.
6807 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
6808 with other skeletons. All uses changed.
6809 (yytnameerr_): New function.
6810 (yyreport_syntax_error): Use it to dequote most string literals.
6811 * data/yacc.c (yytnamerr): New function.
6812 (yyerrlab): Use it to decode most string literals.
6813 * doc/bison.texinfo (Decl Summary, Calling Convention):
6814 Clarify quoting convention of yytname.
6815 * src/output.c (prepare_symbols): Quote all names. This undoes
6816 the 2005-04-17 change, which is now accomplished (mostly) via
6817 changes in the parsers as described above.
6818 * tests/regression.at (Token definitions, Web2c Actions):
6819 Undo most 2005-04-17 change here, too.
6820
68212005-07-20 Paul Eggert <eggert@cs.ucla.edu>
6822
6823 Fix more problems reported by twlevo@xs4all.nl.
6824 * tests/cxx-type.at: Don't pipe output of ./types through sed to
6825 remove trailing spaces. This loses the exit status of ./types,
6826 and isn't needed since ./types shouldn't be emitting trailing
6827 spaces.
6828 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
6829 as the stack isn't valid in that case.
6830
6831 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6832 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6833 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6834 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
6835 is used.
6836 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
6837 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6838 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6839 Likewise.
6840
6841 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
6842 overly-picky compilers that reject 'char *foo = "bar";'.
6843
6844 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
6845 to FILE * parameter, not to stderr. This fixes a typo introduced
6846 in the 2005-07-12 change.
6847
6848 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
6849 warnings from GCC 4.
6850
6851 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
6852 (yyglrShiftDefer, yysplitStack):
6853 Remove unused parameters b4_pure_formals. All uses changed.
6854 (yyglrShift): Remove unused parameters b4_user_formals.
6855 All uses changed.
6856 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6857
68582005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6859
6860 Destructor cleanups and regularization among the three skeletons.
6861 * NEWS: Document the behavior changes.
6862 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6863 stack before failing, as the cleanup code will do it for us now.
6864 * data/lalr1.cc (yyerrlab): Likewise.
6865 * data/glr.c (yyparse): Pop everything off the stack before
6866 freeing it, so that destructors get called properly.
6867 * data/lalr1.cc (yyreturn): Likewise.
6868 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6869 This is more consistent.
6870 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6871 why destructors might be called. 1.875 -> 2.1.
6872 (Destructor Decl, Decl Summary, Table of Symbols):
6873 Some English-language cleanups for %destructor.
6874 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6875 Add output line for destructor of start symbol.
6876 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6877 because of that same extra output line.
6878
6879 * NEWS: Document minor wording changes in diagnostics of
6880 Bison-generated parsers.
6881 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6882 Remove unused formals. All uses changed.
6883 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6884 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6885 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6886 Rename yyoverflowab to yyexhaustedlab.
6887 When memory exhaustion occurs during syntax-error reporting,
6888 report it separately rather than in a single diagnostic; this
6889 eases translation.
6890 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6891 (Memory Exhausted): Renamed from Parser Stack Overflow.
6892 Revamp wording slightly to prefer "memory exhaustion".
6893 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6894
6895 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6896
6897 Add i18n support to the GLR skeleton. Partially fix the C++
6898 skeleton; a C++ expert needs to finish this. Remove debugging
6899 msgids; there's little point to having them translated, since they
6900 can be understood only by someone who can read the
6901 (English-language) source code.
6902
6903 Generate runtime-po/bison-runtime.pot automatically, so that we
6904 don't have to worry about garbage getting in that file. We'll
6905 make sure after the next official release that old msgids don't
6906 get lost. See
6907 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6908
6909 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6910 Now auto-generated.
6911 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6912 Fix typos in explanations of the runtime file.
6913 * bootstrap: Change gettext keyword from YYI18N to YY_.
6914 Use standard Makefile.in.in in runtime-po, since we'll arrange
6915 for backward-compatible bison-runtime.po files in a different way.
6916 * data/glr.c (YY_): New macro, from yacc.c.
6917 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6918 Translate messages intended for users.
6919 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6920 the wording in the other skeletons. We don't know that the memory
6921 is virtual.
6922 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6923 Use same method that yacc.c uses.
6924 Don't translate debugging messages.
6925 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6926 it doesn't work (yet), and requires C++ expertise to fix.
6927 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6928 Move defn to a more logical place, to be consistent with other
6929 skeletons.
6930 Don't translate debugging messages.
6931 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6932 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6933 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6934 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6935
6936 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6937 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6938 void, not int.
6939 * tests/glr-regression.at (Badly Collapsed GLR States):
6940 Likewise.
6941 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6942 yylex should return 0 at EOF rather than aborting.
6943
6944 Improve tests for stack overflow in GLR parser.
6945 Problem reported by twlevo@xs4all.nl.
6946 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6947 All uses removed.
6948 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6949 can handle the problem.
6950 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6951 (yyparse): New local variable yyresult to record the result.
6952 Use result of setjmp to set it, rather than storing itinto
6953 struct.
6954 (yyDone): Remove label.
6955 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6956 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6957 if YYABORT is used).
6958 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6959 yyparse status; put status > 1 into diagnostic.
6960 Check that status==2 works.
6961 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6962 Use exit status 3 for failure to open (which shouldn't happen).
6963
69642005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6965
6966 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6967 1 on syntax error; just let yyparse do its thing.
6968 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6969 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6970 (Exploding the Stack Size with Alloca):
6971 (Exploding the Stack Size with Malloc):
6972 Expect exit status 2, not 1, since the parser is supposed to blow
6973 its stack. Problem reported by twlevo@xs4all.nl.
6974
6975 * data/glr.c (yyparse): Don't assume that the initial calls
6976 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6977 Print a stack-overflow message and fail instead.
6978 Initialize the line-number information before creating the stack,
6979 so that the stack-overflow message can report line zero safely.
6980
69812005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6982
6983 Fix problems reported by twlevo@xs4all.nl.
6984 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6985 (yyuserMerge): Provide a default case if b4_mergers is empty.
6986 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6987 * tests/glr-regression.at
6988 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6989 Add casts to pacify C++ compilers.
6990 * tests/glr-regression.at (Improper merging of GLR delayed action
6991 sets): Declare yylex before using it.
6992 * tests/Makefile.am (maintainer-check-g++): Fix a stray
6993 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6994 test for valgrind; valgrind is independent of g++.
6995 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6996 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6997 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6998 Use a destructor, so that we can expand the stack. Change
6999 YYSTYPE to char * so that we can free it. Cast result of malloc.
7000
70012005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7002
7003 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
7004 a valgrind failure. Problem reported by twlevo@xs4all.nl.
7005
70062005-07-13 Paul Eggert <eggert@cs.ucla.edu>
7007
7008 * PACKAGING: New file, suggested by Bruno Haible and taken from
7009 similar wording in gettext's PACKAGING file.
7010 * NEWS: Mention PACKAGING.
7011 * Makefile.am (EXTRA_DIST): Add PACKAGING.
7012
70132005-07-12 Paul Eggert <eggert@cs.ucla.edu>
7014
7015 * NEWS: Document recent i18n improvements.
7016 * bootstrap: Get runtime translations into runtime-po.
7017 Create runtime-po files automatically, if possible.
7018 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
7019 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
7020 does not infringe on the user's name space.
7021 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
7022 * doc/bison.texinfo (Internationalization): Revamp the English
7023 and Texinfo syntax a bit, to try to make it clearer.
7024 (Bison Options, Option Cross Key): Mention --print-localedir.
7025 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
7026 YYENABLE_NLS. Quote a bit more.
7027 * runtime-po/.cvsignore: New file.
7028 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
7029 * runtime-po/Rules-quot: Remove; now created by bootstrap.
7030 * runtime-po/quot.sed: Likewise.
7031 * runtime-po/boldquot.sed: Likewise.
7032 * runtime-po/en@quot.header: Likewise.
7033 * runtime-po/en@boldquot.header: Likewise.
7034 * runtime-po/insert-header.sin: Likewise.
7035 * runtime-po/remove-potcdate.sin: Likewise.
7036 * runtime-po/Makevars: Likewise.
7037 * runtime-po/LINGUAS: Likewise.
7038 * runtime-po/de.po: Likewise; we will rely on the translation project
7039 to maintain this, so "bootstrap" should get it.
7040 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
7041 its value.
7042 * src/main.c (main): Bind the bison-runtime domain, too.
7043
70442005-07-12 Bruno Haible <bruno@clisp.org>
7045
7046 * data/yacc.c: Include <libintl.h> when NLS is enabled.
7047 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
7048 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
7049 * runtime-po: New directory.
7050 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
7051 $(DOMAIN).pot-update rule, so that old messages are never dropped.
7052 * runtime-po/Rules-quot: New file, copied from po/.
7053 * runtime-po/quot.sed: Likewise.
7054 * runtime-po/boldquot.sed: Likewise.
7055 * runtime-po/en@quot.header: Likewise.
7056 * runtime-po/en@boldquot.header: Likewise.
7057 * runtime-po/insert-header.sin: Likewise.
7058 * runtime-po/remove-potcdate.sin: Likewise.
7059 * runtime-po/Makevars: New file.
7060 * runtime-po/POTFILES.in: New file.
7061 * runtime-po/LINGUAS: New file.
7062 * runtime-po/bison-runtime.pot: New file.
7063 * runtime-po/de.po: New file.
7064 * m4/bison.m4: New file.
7065 * Makefile.am (SUBDIRS): Add runtime-po.
7066 (aclocaldir, aclocal_DATA): New variables.
7067 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
7068 Define aclocaldir.
7069 * src/getargs.c (usage): Document --print-localedir option.
7070 (PRINT_LOCALEDIR_OPTION): New enum item.
7071 (long_options): Add --print-localedir option.
7072 (getargs): Handle --print-localedir option.
7073 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
7074 (Internationalization): New section.
7075
70762005-07-12 Akim Demaille <akim@epita.fr>
7077
7078 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
7079 for consistency with the rest of the code.
7080 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
7081 Add separators.
7082
70832005-07-12 Akim Demaille <akim@epita.fr>
7084
7085 * src/parse-gram.y: Use %printer instead of YYPRINT.
7086
70872005-07-12 Akim Demaille <akim@epita.fr>
7088
7089 * src/symtab.h, src/symtab.c (symbol_print): New.
7090 * src/symlist.h, src/symlist.c (symbol_list_print): New.
7091 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
7092
70932005-07-12 Akim Demaille <akim@epita.fr>
7094
7095 * data/glr.c (b4_syncline): Fix (swap) the definitions of
7096 b4_at_dollar and b4_dollar_dollar.
7097
70982005-07-11 Paul Eggert <eggert@cs.ucla.edu>
7099
7100 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
7101 and Pennello's paper.
7102
71032005-07-09 Paul Eggert <eggert@cs.ucla.edu>
7104
7105 * data/yacc.c (yyparse): Undo previous patch. Instead,
7106 set yylsp[0] and yyvsp[0] only if the initial action
7107 sets yylloc and yylval, respectively.
7108
7109 * data/yacc.c (yyparse): In the initial action, set
7110 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
7111 This avoids the use of undefined variables if the initial
7112 action does not set yylloc and/or yylval.
7113
71142005-07-07 Paul Eggert <eggert@cs.ucla.edu>
7115
7116 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
7117 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
7118 Remove from CVS. These files are automatically generated.
7119 * examples/extexi: Clarify that this file is now part of Bison,
7120 not GNU M4, and that it works with any POSIX-compatible Awk.
7121 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
7122 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
7123 so that we also get calc++-parser.yy. Geneate it.
7124 Use $(AWK), not gawk, since any conforming Awk will do.
7125 Put comment before action, since older 'make' can't handle comment
7126 in action.
7127 $(BUILT_SOURCES): List all built sources, not just some of them.
7128 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
7129 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
7130 $($(calc_sources_generated)): Remove unnecessary test for existence
7131 of target. (This had a shell syntax error anyway; a stray "x".)
7132 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
7133 calc++-parser.yy.
7134 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
7135
7136 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
7137 implied by the other modules.
7138
71392005-07-06 Akim Demaille <akim@epita.fr>
7140
7141 Bind examples/calc++ to the package.
7142 * examples/calc++/Makefile: Remove, replaced by...
7143 * examples/calc++/Makefile.am: ... this new file.
7144 * examples/calc++/test: Remove input.
7145 * examples/calc++/compile: Remove.
7146 * examples/Makefile.am: New.
7147 * configure.ac, Makefile.am: Adjust.
7148 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
7149
71502005-07-05 Paul Eggert <eggert@cs.ucla.edu>
7151
7152 * data/glr.c (yyFail): Drastically simplify; since the format argument
7153 never had any % directives, we can simply pass it to yyerror.
7154 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
7155 be modified later, as that is the usual style in glr.c.
7156 Problems reported by Paul Hilfinger.
7157
7158 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
7159 and size overflow errors.
7160 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
7161 in case the user prolog sets feature-test macros like _GNU_SOURCE.
7162 (YYSIZEMAX): New macro.
7163 (yystpcpy): New function, taken from yacc.c.
7164 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
7165 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
7166 so that we don't have to maintain their signatures.
7167 (yyFail): Check for buffer overflow, by using vsnprintf rather
7168 than vsprintf. Allocate a bigger buffer if possible.
7169 Report an error if buffer allocation fails.
7170 (yyStackOverflow): New function.
7171 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
7172 the initialization was successful. It might fail if storage was
7173 exhausted.
7174 (yyexpandGLRStack): Add more checks for storage allocation failure.
7175 Use yyStackOverflow to report failures.
7176 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
7177 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
7178 Don't assume stack number fits in int.
7179 (yysplitStack): Check for storage allocation failure.
7180 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
7181 can print diagnostics on storage allocation failure. All callers
7182 changed.
7183 (yyresolveValue): Use yybool for boolean.
7184 (yyreportSyntaxError): Check for size-calculation overflow.
7185 This code is taken from yacc.c.
7186 (yyparse): Check for storage allocation errors when allocating
7187 the initial stack.
7188
71892005-07-05 Akim Demaille <akim@epita.fr>
7190
7191 Extract calc++ from the documentation.
7192 * doc/bison.texinfo (Calc++): Add the extraction marks.
7193 * examples/extexi: New, from the aborted GNU Programming 2E.
7194 Separate the different paragraph of a file with empty lines.
7195 * examples/Makefile: Use it to extract the whole calc++ example.
7196
71972005-06-24 Akim Demaille <akim@epita.fr>
7198
7199 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
7200 class typedefs.
7201
72022005-06-22 Akim Demaille <akim@epita.fr>
7203
7204 * doc/bison.texinfo (C++ Language Interface): First stab.
7205 (C++ Parsers): Remove.
7206
72072005-06-22 Akim Demaille <akim@epita.fr>
7208
7209 * data/lalr1.cc (yylex_): Honor %lex-param.
7210
72112005-06-22 Akim Demaille <akim@epita.fr>
7212
7213 Start a set of simple examples.
7214 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
7215 * examples/calc++/calc++-driver.hh,
7216 * examples/calc++/calc++-parser.yy,
7217 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
7218 * examples/calc++/compile, examples/calc++/test: New.
7219
72202005-06-09 Paul Eggert <eggert@cs.ucla.edu>
7221
7222 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
7223 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
7224 which stems from the 2005-05-27 patch.
7225
72262005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7227
7228 * data/glr.c: Modify treatment of unused parameters to permit use
7229 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
7230
72312005-05-30 Paul Eggert <eggert@cs.ucla.edu>
7232
7233 Fix infringement on user name space reported by Janos Zoltan Szabo.
7234 * data/yacc.c (yyparse): strlen -> yystrlen.
7235
72362005-05-30 Akim Demaille <akim@epita.fr>
7237
7238 * data/lalr1.cc (_): New.
7239 Translate the various messages.
7240
72412005-05-27 Paul Eggert <eggert@cs.ucla.edu>
7242
7243 Fix infringement on user name space reported by Bruno Haible.
7244 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
7245 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
7246 the user's name space.
7247 (alloca): Include <stdlib.h> to get it, if it's not built in.
7248 (YYMALLOC, YYFREE): Define only if needed.
7249 (malloc, free): Declare, but only if needed, as this infringes on
7250 the user name space.
7251
72522005-05-25 Paul Eggert <eggert@cs.ucla.edu>
7253
7254 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
7255 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
7256 with %d format.
7257 * lib/ebitset.c (min, max): Undef before defining.
7258 * lib/vbitset.c (min, max): Likewise.
7259 * lib/subpipe.c (create_subpipe): Save local variables in case
7260 vfork clobbers them.
7261
72622005-05-24 Bruno Haible <bruno@clisp.org>
7263
7264 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
7265 error message syntax used by gcc-4.0.
7266
72672005-05-23 Paul Eggert <eggert@cs.ucla.edu>
7268
7269 * README: Mention m4 1.4.3. Remove obsolete advice about
7270 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
7271
7272 * bootstrap: Remove workaround for problem I encountered with
7273 gettext 0.14.1; it seems to be fixed now.
7274
72752005-05-22 Paul Eggert <eggert@cs.ucla.edu>
7276
7277 * NEWS: Version 2.0a.
7278
7279 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
7280 the previous change.
7281
7282 Various maintainer cleanups.
7283 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
7284 conftest*, for benefit of CVS commands run at the same time as
7285 "configure". Add build-aux, since "bootstrap" now creates it and
7286 its subfiles.
7287 * Makefile.cfg (move_if_change): Remove.
7288 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
7289 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
7290 (po_repo, do-po-update, po-update, wget_files, get-targets):
7291 (config.guess-url_prefix, config.sub-url_prefix):
7292 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
7293 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
7294 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
7295 Remove.
7296 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
7297 this is now the recommended name.
7298 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
7299 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
7300 ylwrap. These files now go into build-aux.
7301 * config/move-if-change: Remove.
7302 * config/prev-version.txt: Bump from 1.75 to 2.0.
7303
7304 * bootstrap: Add stdio-safer, unistd-safer modules.
7305 Remove m4/glibc2.m4 (introduced by latest gnulib, but
7306 we don't need it).
7307 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
7308 fopen-safer.c, stdio-safer.h, unistd-safer.h.
7309 * lib/subpipe.c: Include "unistd-safer.h".
7310 (create_subpipe): Make sure all the newly-created
7311 file descriptors are > 2, so that diagnostics don't
7312 get sent down them (which might cause Bison to hang, in theory).
7313 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
7314 * src/files.c (xfopen): Use fopen_safer, not fopen.
7315
7316 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
7317 yesterday's yacc.c fix.
7318
73192005-05-21 Paul Eggert <eggert@cs.ucla.edu>
7320
7321 * data/glr.c, data/lalr1.cc: Update copyright date.
7322
7323 Fix a destructor bug reported by Wolfgang Spraul in
7324 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
7325 * data/yacc.c (yyabortlab): Don't call destructor, and
7326 don't set yychar to EMPTY.
7327 (yyoverflowlab): Don't call destructor.
7328 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
7329 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
7330 since we no longer output the message "discarding lookahead token
7331 end of input ()".
7332
73332005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7334
7335 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
7336 fix a small glitch in debugging output.
7337 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
7338 after YY_SYMBOL_PRINT where needed.
7339
7340 (struct yyGLRState): Add some comments.
7341 (struct yySemanticOption): Add some comments.
7342 (union yyGLRStackItem): Add comment.
7343
7344 (yymergeOptionSets): Correct this to properly perform the union,
7345 avoiding infinite reported by Michael Rosien.
7346 Update comment.
7347
7348 * tests/glr-regression.at: Add test for GLR merging error reported
7349 by M. Rosien.
7350
73512005-05-13 Paul Eggert <eggert@cs.ucla.edu>
7352
7353 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
7354 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
7355 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
7356 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
7357 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
7358 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
7359 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
7360 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
7361 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
7362 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
7363 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
7364 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
7365 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
7366 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
7367 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
7368 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
7369 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
7370 src/derives.h, src/files.c, src/files.h, src/getargs.c,
7371 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
7372 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
7373 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
7374 src/output.h, src/parse-gram.c, src/parse-gram.h,
7375 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
7376 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
7377 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
7378 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
7379 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
7380 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
7381 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
7382 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
7383 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
7384 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
7385 tests/reduce.at, tests/regression.at, tests/sets.at,
7386 tests/synclines.at, tests/testsuite.at, tests/torture.at:
7387 Update FSF postal mail address.
7388
73892005-05-11 Paul Eggert <eggert@cs.ucla.edu>
7390
7391 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
7392 Problem reported by Ralf Menzel.
7393
73942005-05-01 Paul Eggert <eggert@cs.ucla.edu>
7395
7396 * tests/actions.at: Test that stack overflow invokes destructors.
7397 From Marcus Holland-Moritz.
7398 * data/yacc.c (yyerrlab): Move the code that destroys the stack
7399 from here....
7400 (yyreturn): to here. That way, destructors are called properly
7401 even if the stack overflows, or the user calls YYACCEPT or
7402 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
7403 (yyoverflowlab): Destroy the lookahead.
7404
74052005-04-24 Paul Eggert <eggert@cs.ucla.edu>
7406
7407 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
7408
74092005-04-17 Paul Eggert <eggert@cs.ucla.edu>
7410
7411 * NEWS: Bison-generated C parsers no longer quote literal strings
7412 associated with tokens.
7413 * src/output.c (prepare_symbols): Don't escape strings,
7414 since users don't want to see C escapes.
7415 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
7416 in diagnostics.
7417 * tests/input.at (Torturing the Scanner): Likewise.
7418 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
7419
74202005-04-16 Paul Eggert <eggert@cs.ucla.edu>
7421
7422 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
7423 the data size is known to be too small and we can't increase it.
7424 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
7425
74262005-04-15 Paul Eggert <eggert@cs.ucla.edu>
7427
7428 * src/parse-gram.y: Include quotearg.h.
7429 (string_as_id): Quote $1 before using it as a key, since the
7430 lexer no longer quotes it for us.
7431 (string_content): Don't strip quotes, since lexer no longer
7432 quotes it for us.
7433 * src/scan-gram.l: Include quotearg.h.
7434 ("\""): Omit quote.
7435 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
7436 a key, since the rest of the lexer doesn't quote it.
7437 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
7438 * tests/regression.at (Token definitions): Check for backslashes
7439 in token strings.
7440
7441 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
7442 (YYSIZE_T): Define to unsigned long int when using an older compiler.
7443 (yyparse): Revamp code to generate long syntax error message, to
7444 make it easier to translate, and to avoid problems with arithmetic
7445 overflow. Change "virtual memory" to "memory" in diagnostic, since
7446 we don't know whether the memory is virtual.
7447
74482005-04-13 Paul Eggert <eggert@cs.ucla.edu>
7449
7450 * NEWS: Bison-generated C parsers now use the _ macro to
7451 translate strings.
7452 * data/yacc.c (_) [!defined _]: New macro.
7453 All English strings wrapped inside this macro.
7454 * doc/bison.texinfo (Bison Parser): Document _.
7455 * po/POTFILES.in: Include src/parse-gram.c, since it now
7456 includes translateable strings that parse-gram.y doesn't.
7457
74582005-04-12 Paul Eggert <eggert@cs.ucla.edu>
7459
7460 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
7461 reverting the 2004-10-11 change to this function.
7462 (symbol_check_alias_consistency): Don't call symbol_type_set
7463 if the type name is already correct.
7464 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
7465
74662005-03-25 Paul Eggert <eggert@cs.ucla.edu>
7467
7468 * tests/regression.at (Token definitions): Don't use a token named
7469 c, as that generates a "#define c ..." that runs afoul of buggy
7470 stdlib.h that uses the identifier c as a member of struct
7471 drand48_data. Problem reported by Horst Wente.
7472
74732005-03-21 Paul Eggert <eggert@cs.ucla.edu>
7474
7475 * bootstrap: Change translation URL from
7476 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
7477 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
7478 redirection glitches. Problem reported by twlevo@xs4all.nl.
7479
74802005-03-20 Paul Eggert <eggert@cs.ucla.edu>
7481
7482 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
7483 after operands; POSIX says this isn't portable for the c99 command.
7484
74852005-03-18 Paul Eggert <eggert@cs.ucla.edu>
7486
7487 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
7488 immediately if a data overrun has occurred; this may help us track
7489 down what may be a spurious failure on MacOS.
7490
74912005-03-17 Paul Eggert <eggert@cs.ucla.edu>
7492
7493 Respond to problems reported by twlevo@xs4all.nl.
7494
7495 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
7496
7497 * src/vcg.h: Comment fix.
7498 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
7499 (G_CMAX): Change to -1 instead of INT_MAX.
7500
7501 * data/yacc.c (yyparse): Omit spaces before #line.
7502
75032005-03-15 Paul Eggert <eggert@cs.ucla.edu>
7504
7505 * src/tables.c (state_number_to_vector_number): Put it inside an
7506 "#if 0", since it's not currently used. Problem reported by
7507 Roland McGrath.
7508
75092005-03-06 Paul Eggert <eggert@cs.ucla.edu>
7510
7511 * src/output.c (escaped_output): Renamed from
7512 escaped_file_name_output, since we now use it for symbol tags as
7513 well. All uses changed.
7514 (symbol_destructors_output, symbol_printers_output):
7515 Escape symbol tags too.
7516 Problem reported by Matyas Forstner in
7517 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
7518
7519 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
7520 not needed.
7521 * src/output.c (user_actions_output, token_definitions_output,
7522 symbol_destructors_output, symbol_printers_output): Likewise.
7523 * src/reader.c (prologue_augment): Likewise.
7524 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
7525
7526 * src/vcg.c (output_edge): Don't quote linestyle arg.
7527 Problem reported by twlevo@xs4all.nl.
7528
75292005-02-28 Paul Eggert <eggert@cs.ucla.edu>
7530
7531 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
7532 example, reported by Derek M Jones. Also, make the example even
7533 more outrageous, to better illustrate how bad the problem is.
7534
75352005-02-24 Paul Eggert <eggert@cs.ucla.edu>
7536
7537 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
7538 putsym. Typo reported by Sebastian Piping.
7539
75402005-02-23 Paul Eggert <eggert@cs.ucla.edu>
7541
7542 * doc/bison.texinfo (Language and Grammar): some -> same
7543 (Epilogue): int he -> in the
7544 Typos reported by Sebastian Piping via Justin Pence.
7545
75462005-02-07 Paul Eggert <eggert@cs.ucla.edu>
7547
7548 * tests/glr-regression.at (Improper handling of embedded actions
7549 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
7550 embedded actions and $-N in GLR parsers", work around an Autoconf bug
7551 with dollar signs in test names.
7552 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
7553 for a similar reason.
7554
75552005-01-28 Paul Eggert <eggert@cs.ucla.edu>
7556
7557 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
7558 wants to redefine G_VIEW.
7559
75602005-01-27 Paul Eggert <eggert@cs.ucla.edu>
7561
7562 * src/vcg.c (get_view_str): Remove case for normal_view.
7563 Problem reported by twlevo@xs4all.nl.
7564
75652005-01-24 Paul Eggert <eggert@cs.ucla.edu>
7566
7567 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
7568 Problem reported by twlevo@xs4all.nl.
7569
7570 * doc/bison.texinfo: Change @dircategory from "GNU programming
7571 tools" to "Software development". Requested by Richard Stallman
7572 via Karl Berry.
7573
75742005-01-23 Paul Eggert <eggert@cs.ucla.edu>
7575
7576 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
7577 Problem reported by twlevo@xs4all.nl.
7578
75792005-01-21 Paul Eggert <eggert@cs.ucla.edu>
7580
7581 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
7582 keyword; it's not needed with modern compilers, and it doesn't
7583 affect correctness with older compilers. Suggested by
7584 twlevo@xs4all.nl.
7585
75862005-01-17 Paul Eggert <eggert@cs.ucla.edu>
7587
7588 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
7589 gcc -Wswitch-default.
7590 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7591 * data/yacc.c (yyparse): Likewise.
7592
75932005-01-12 Paul Eggert <eggert@cs.ucla.edu>
7594
7595 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
7596 already. Let config.h define any nonstandard values.
7597
75982005-01-10 Paul Eggert <eggert@cs.ucla.edu>
7599
7600 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
7601 for the benefit of slower hosts. Problem reported by
7602 Nelson H. F. Beebe.
7603
76042005-01-07 Paul Eggert <eggert@cs.ucla.edu>
7605
7606 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
7607 being defined and not used.
7608 * data/lalr1.cc (yyparse): Likewise.
7609 Use "if (false)" rather than "if (0)".
7610
76112005-01-05 Paul Eggert <eggert@cs.ucla.edu>
7612
7613 * TODO: Mention that we should allow NUL bytes in tokens.
7614
76152005-01-02 Paul Eggert <eggert@cs.ucla.edu>
7616
7617 * src/scan-skel.l (<<EOF>>): Don't close standard output.
7618 Problem reported by Hans Aberg.
7619
76202005-01-01 Paul Eggert <eggert@cs.ucla.edu>
7621
7622 * src/getargs.c (version): Happy new year; update overall
7623 program copyright date from 2004 to 2005.
7624
7625 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
7626 Problem reported by Hans Aberg.
7627 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
7628 (Output file names.): Add a test for the case when standard output
7629 is closed.
7630
76312004-12-26 Paul Eggert <eggert@cs.ucla.edu>
7632
7633 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
7634 to fix an oversight in the Bison 2.0 manual.
7635
76362004-12-25 Paul Eggert <eggert@cs.ucla.edu>
7637
7638 * NEWS: Version 2.0. Reformat the existing news items since
7639 1.875, so that related items are grouped together.
7640 * configure.ac (AC_INIT): Bump version to 2.0.
7641 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
7642
7643 * tests/torture.at (Exploding the Stack Size with Alloca): Set
7644 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
7645 otherwise, we're not testing alloca. Unfortunately there's no
7646 simple way to consult HAVE_ALLOCA here.
7647
7648 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
7649 for yymsg, too.
7650
7651 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
7652 hand. This avoids a warning about comparing int to size_t when
7653 GCC warnings are enabled.
7654
76552004-12-22 Paul Eggert <eggert@cs.ucla.edu>
7656
7657 * NEWS: Bison-generated parsers no longer default to using the
7658 alloca function (when available) to extend the parser stack, due
7659 to widespread problems in unchecked stack-overflow detection.
7660 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
7661 responsibility to set it to a positive value. This lets the user
7662 specify a value that is not a preprocessor constant.
7663 * data/yacc.c (YYMAXDEPTH): Likewise.
7664 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
7665 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
7666 to be a compile-time constant. However, explain the constraints on it.
7667 Also, explain the constraints on YYINITDEPTH.
7668 (Table of Symbols): Explain that alloca is no longer the default.
7669 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
7670 to 1.
7671
7672 * doc/bison.texinfo (Location Default Action): Mention that n must
7673 be zero when k is zero. Suggested by Frank Heckenbach.
7674
76752004-12-22 Akim Demaille <akim@epita.fr>
7676
7677 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
7678 (parser::state_type, parser::semantic_type, parser::location_type):
7679 Private, not public.
7680 (parser::parse): Return ints, not bool.
7681 Returning a bool introduces a problem: 0 corresponds to false, and
7682 it seems weird to return false on success. Returning true changes
7683 the conventions for yyparse.
7684 Alternatively we could return void and send an exception.
7685 There is no clear consensus (yet?).
7686 (state_stack, semantic_stack, location_stack): Rename as...
7687 (state_stack_type, semantic_stack_type, location_stack_type): these.
7688 Private, not public.
7689 * tests/c++.at: New.
7690 * tests/testsuite.at, tests/Makefile.am: Adjust.
7691
76922004-12-21 Akim Demaille <akim@epita.fr>
7693
7694 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
7695
76962004-12-21 Akim Demaille <akim@epita.fr>
7697
7698 Don't impose std::string for filenames.
7699
7700 * data/lalr1.cc (b4_filename_type): New.
7701 (position::filename): Use it.
7702 (parser.hh): Move the inclusion of stack.hh and location.hh below
7703 the user code, so that needed headers for the filename type can be
7704 included first.
7705 Forward declare them before the user code.
7706 * tests/Makefile.am (check-local, installcheck-local): Pass
7707 TESTSUITEFLAGS to the TESTSUITE.
7708
77092004-12-20 Akim Demaille <akim@epita.fr>
7710
7711 Use more STL like names: my_class instead of MyClass.
7712
7713 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
7714 (SemanticStack, SemanticType, StateStack, StateType)
7715 (TokenNumberType, Stack, Slice, Traits, Parser::location)
7716 (Parser::value): Rename as...
7717 (location_stack, location_type, rhs_number_type, semantic_stack)
7718 (semantic_type, state_stack, state_type, token_number_type, stack)
7719 (slice, traits, parser::yylloc, parser::yylval): these.
7720
7721 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
7722
77232004-12-19 Paul Eggert <eggert@cs.ucla.edu>
7724
7725 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
7726 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7727
77282004-12-17 Paul Eggert <eggert@cs.ucla.edu>
7729
7730 Remove uses of 'short int' and 'unsigned short int'. This raises
7731 some arbitrary limits. It uses more memory but nowadays that's
7732 not much of an issue.
7733
7734 This change does not affect the generated parsers; that's a different
7735 task, as some users will want to conserve memory there.
7736
7737 Ideally we should use size_t to represent all object counts, and
7738 something like ptrdiff_t to represent signed differences of object
7739 counts; but that will require more code-cleanup than I have the
7740 time to do right now.
7741
7742 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
7743 Use size_t, not int or short int, to count objects.
7744 * src/closure.c (nritemset, closure): Likewise.
7745 * src/closure.h (nritemset, closure): Likewise.
7746 * src/nullable.c (nullable_compute): Likewise.
7747 * src/print.c (print_core): Likewise.
7748 * src/print_graph.c (print_core): Likewise.
7749 * src/state.c (state_compare, state_hash): Likewise.
7750 * src/state.h (struct state): Likewise.
7751 * src/tables.c (default_goto, goto_actions): Likewise.
7752
7753 * src/gram.h (rule_number, rule): Use int, not short int.
7754 * src/output.c (prepare_rules): Likewise.
7755 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
7756 errs, reductions): Likewise.
7757 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
7758 Likewise.
7759 * src/tables.c (vector_number, tally, action_number,
7760 ACTION_NUMBER_MINIMUM): Likewise.
7761 * src/output.c (muscle_insert_short_int_table): Remove.
7762
77632004-12-17 Akim Demaille <akim@epita.fr>
7764
7765 * data/lalr1.cc: Extensive Doxygenation.
7766 (error_): Rename as...
7767 (error): this, since it is visible to the user.
7768 Adjust callers.
7769 (Parser::message): Now an automatic variable from...
7770 (Parser::yyreport_syntax_error_): here.
7771 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
7772 Parser::error.
7773 * tests/input.at: Escape $.
7774
77752004-12-16 Paul Eggert <eggert@cs.ucla.edu>
7776
7777 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
7778 Parenthesize rhs to avoid obscure problems with mistakes like
7779 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
7780 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7781 b4_rhs_location): Likewise.
7782 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7783 b4_rhs_location): Likewise.
7784
77852004-12-16 Akim Demaille <akim@epita.fr>
7786
7787 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
7788 yacc.c: be sure to stay within yycheck_.
7789 * tests/actions.at: Re-enable C++ tests.
7790
77912004-12-16 Akim Demaille <akim@epita.fr>
7792
7793 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
7794 real.
7795
77962004-12-16 Akim Demaille <akim@epita.fr>
7797
7798 Use #define to handle the %name-prefix.
7799
7800 * data/glr.c, data/yacc.c: Comment changes.
7801 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
7802 so that one can refer to yylex in the parser file, and have it
7803 renamed, as is the case with other skeletons.
7804
78052004-12-16 Akim Demaille <akim@epita.fr>
7806
7807 Move lalr1.cc internals into yy*.
7808
7809 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
7810 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
7811 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
7812 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
7813 (empty_, final_, terror_, errcode_, ntokens_)
7814 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
7815 (looka_, ilooka_, error_range_, nerrs_):
7816 Rename as...
7817 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
7818 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
7819 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
7820 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
7821 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
7822 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
7823 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
7824 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
7825 these.
7826
78272004-12-15 Paul Eggert <eggert@cs.ucla.edu>
7828
7829 Fix some problems reported by twlevo at xs4all.
7830 * src/symtab.c (symbol_new): Report an error if the input grammar
7831 contains too many symbols. This is better than calling abort() later.
7832 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
7833 (struct node, struct graph):
7834 Rename member expand to stretch. All uses changed.
7835 (struct graph): Remove member layoutalgorithm. All uses removed.
7836 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
7837 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
7838 All uses changed.
7839 (N_STRETCH): Rename from N_EXPAND. All uses changed.
7840
78412004-12-15 Akim Demaille <akim@epita.fr>
7842
7843 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
7844 Add more Doxygen comments.
7845 (symprint_, stack_print_, reduce_print_, destruct_, pop)
7846 (report_syntax_error_, translate_): Rename as...
7847 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
7848 (yypop_, yyreport_syntax_error_, yytranslate_): this.
7849
78502004-12-15 Akim Demaille <akim@epita.fr>
7851
7852 * data/lalr1.cc (lex_): Rename as...
7853 (yylex_): this.
7854 Move the trace here.
7855 Take the %name-prefix into account.
7856 Reported by Alexandre Duret-Lutz.
7857
78582004-12-15 Akim Demaille <akim@epita.fr>
7859
7860 Simplify the C++ parser constructor.
7861
7862 * data/lalr1.cc (debug_): Rename as...
7863 (yydebug_): so that the parser's internals are always in the yy*
7864 pseudo namespace.
7865 Adjust uses.
7866 (b4_parse_param_decl): Remove the leading comma as it is now only
7867 called as unique argument list.
7868 (Parser::Parser): Remove the constructor accepting a location and
7869 an initial debugging level.
7870 Remove from the other ctor the argument for the debugging level.
7871 (debug_level_type, debug_level, set_debug_level): New.
7872
7873 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7874 constructor calls.
7875
78762004-12-15 Akim Demaille <akim@epita.fr>
7877
7878 Remove b4_root related material: failure experiment
7879 (which goal was to allow to derive from a class).
7880
7881 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7882 definitions and uses.
7883
78842004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7885
7886 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7887 not 2, since it's not portable to subtract 1 from the start of an
7888 array. The new item 0 is never set or used. All uses changed.
7889
7890 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7891 the default definition of YYLLOC_DEFAULT. Problem reported
7892 by Frank Heckenbach.
7893
78942004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7895
7896 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7897 the normal case and one for the error case. Just use the
7898 first one uniformly. Problem reported by Frank Heckenbach.
7899 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7900 use exactly the same macro in both places.
7901 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7902 so that the normal-case YYRHSLOC works for the error case too.
7903 All uses changed.
7904 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7905 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7906 * doc/bison.texinfo (Location Default Action): Don't claim that
7907 we have an array of locations. Use the same macro for both glr
7908 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7909 the index is 0.
7910
79112004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7912
7913 * HACKING: Update email addresses to send announcements to.
7914
7915 * configure.ac (AC_INIT): Bump version to 1.875f.
7916
79172004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7918
7919 * NEWS: Version 1.875e.
7920 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7921
7922 * src/scan-skel.l: Include "complain.h", for "fatal".
7923
7924 * src/relation.h (relation_print, relation_digraph):
7925 Relation sizes are of type relation_node, not size_t (this is
7926 merely a doc fix, since the two types are equivalent).
7927 (relation_transpose): Relation sizes are of type relation_node,
7928 not int.
7929 * src/relation.c: Likewise.
7930 (top, infinity): Now of type relation_node, not int.
7931 (traverse, relation_transpose): Use relation_node, not int.
7932
7933 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7934 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7935 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7936
7937 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
7938 specifying whether the test should be skipped. Use it tp
7939 specify that the [%defines %skeleton "lalr1.cc"] tests currently
7940 fail on some hosts, and should be skipped.
7941
79422004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7943
7944 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7945 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7946 unless otherwise specified below.
7947
7948 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7949 to allocate kernel_base, kernel_items, kernel_size, since
7950 they needn't be initialized to 0.
7951 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7952 * src/closure.c (new_closure): Likewise, for itemset.
7953 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7954 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7955 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7956 (build_relations): Likewise for edge, states1, includes.
7957 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7958 * src/reader.c (packgram): Likewise, for ritem, rules.
7959 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7960 * src/relation.c (relation_digraph): Likewise for VERTICES.
7961 (relation_transpose): Likewise for new_R, end_R.
7962 * src/symtab.c (symbols_token_translations_init): Likewise for
7963 token_translations.
7964 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7965 (token_actions): Likewise for yydefact, actrow, conflrow,
7966 conflict_list.
7967 (save_column): Likewise for froms[symno], tos[symno].
7968 (goto_actions): Likewise for state_count.
7969 (pack_table): Likewise for base, pos, check.
7970 (tables_generate): Likewise for width.
7971
7972 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7973 for initial core. Just have a separate core, so we needn't worry
7974 about whether kernel_size and kernel_base are initialized.
7975
7976 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7977 kernel_size, kernel_items): Remove unnecessary initialization.
7978 * src/conflicts.c (conflicts): Likewise.
7979 * src/derives.c (derives): Likewise.
7980 * src/muscle_tablc (muscle_insert): Likewise.
7981 * src/relation.c (relation_digraph): Likewise.
7982 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7983 conflrow, conflict_table, conflict_list, table, check):
7984 Likewise.
7985
7986 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7987 This is because all callers pass unsigned int.
7988 * src/closure.h (new_closure): Likewise.
7989
7990 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7991 (build_relations): Initialize includes[i] in all cases.
7992 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7993 and rules[ruleno].precsym. Initialize members in order.
7994 * src/relation.c (relation_transpose): Always initialize new_R[i]
7995 and end_R[i].
7996 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7997
7998 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7999 conflict_list[0] was always 0, but now it isn't initialized.
8000
8001 * src/table.c (table_grow): When conflict_table grew, the grown
8002 area wasn't cleared. Fix this.
8003
8004 * lib/.cvsignore: Add strdup.c, strdup.h.
8005 * m4/.cvsignore: Add strdup.m4.
8006
80072004-12-07 Paul Eggert <eggert@cs.ucla.edu>
8008
8009 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
8010 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
8011 GOTO_NUMBER_MAXIMUM, since we occasionally compute
8012 ngotos + 1 without checking for overflow.
8013 (build_relations): Use END_NODE, not -1, to denote end of edges.
8014 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
8015 build_relations): Use goto_number, not int, for goto numbers.
8016 * src/tables.c (save_column, default_goto): Likewise.
8017
80182004-11-23 Akim Demaille <akim@epita.fr>
8019
8020 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
8021 of #defining from yystype.
8022 Don't typedef yystype, C++ does not need it.
8023 This lets it possible to forward declare it as union.
8024
80252004-11-23 Paul Eggert <eggert@cs.ucla.edu>
8026
8027 * bootstrap (gnulib_modules): Add extensions.
8028 Problem reported by Jim Meyering.
8029
80302004-11-22 Paul Eggert <eggert@cs.ucla.edu>
8031
8032 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
8033 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
8034 src/system.h, src/tables.c: XFREE -> free, to accommodate
8035 recent change to gnulib xalloc.h.
8036 Problem reported by Jim Meyering.
8037
80382004-11-17 Akim Demaille <akim@epita.fr>
8039
8040 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
8041
80422004-11-17 Akim Demaille <akim@epita.fr>,
8043 Alexandre Duret-Lutz <adl@gnu.org>
8044
8045 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
8046 changes.
8047 (YYCDEBUG): Adjust.
8048 Use it instead of cdebug_.
8049 (Parser::debug_stream, Parser::set_debug_stream): New.
8050 (Parser::symprint_): Define cdebug_ for temporary backward
8051 compatibility.
8052 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
8053 debug_stream ().
8054
80552004-11-17 Akim Demaille <akim@epita.fr>
8056
8057 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
8058 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
8059 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
8060 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8061
80622004-10-27 Paul Eggert <eggert@cs.ucla.edu>
8063
8064 * data/glr.c (yyloc_default): Remove; not used.
8065 Problem reported by Frank Heckenbach.
8066
80672004-10-25 Akim Demaille <akim@epita.fr>
8068
8069 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
8070 Introduce another definition to address simple location arrays.
8071 (yyGLRStack): New member: yyerror_range.
8072 (yyrecoverSyntaxError, yyparse): Update it.
8073 (yyrecoverSyntaxError): Use it when shifting the error token to
8074 have an accurate range, equivalent to the one computed by both
8075 yacc.c and lalr1.cc.
8076 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
8077 that column numbers start at column 0, as per GNU Coding
8078 Standards, the others tests, and the doc.
8079 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
8080 Adjust to the above change (first column is 0).
8081 And adjust the location of the "<error>", now covering the whole
8082 line.
8083
80842004-10-22 Akim Demaille <akim@epita.fr>
8085 and Paul Eggert <eggert@cs.ucla.edu>
8086
8087 Remove some arbitrary limits on goto numbers and relations.
8088 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
8089 initial values, since they're never used.
8090 (set_goto_map): ngotos is now unsigned, so test for overflow
8091 by seeing whether it wraps around to zero.
8092 * src/lalr.h (goto_number): Now size_t, not short int.
8093 (GOTO_NUMBER_MAXIMUM): Remove.
8094 * src/relation.c (relation_print, traverse, relation_transpose):
8095 Check for END_NODE rather than looking at sign.
8096 * src/relation.h (END_NODE): New macro.
8097 (relation_node): Now size_t, not short int.
8098
80992004-10-22 Paul Eggert <eggert@cs.ucla.edu>
8100
8101 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
8102 keyword, not an identifier. Problem reported by Baron Schwartz in
8103 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
8104
81052004-10-11 Akim Demaille <akim@epita.fr>
8106
8107 * src/symtab.c (symbol_check_alias_consistency): Also check
8108 type names, destructors, and printers.
8109 Reported by Alexandre Duret-Lutz.
8110 Recode the handling of associativity and precedence in terms
8111 of symbol_precedence_set.
8112 Accept no redeclaration at all, not even equal to the previous
8113 value.
8114 (redeclaration): New.
8115 Use it to factor redeclaration complaints.
8116 (symbol_make_alias): Don't set the type of the alias, let
8117 symbol_check_alias_consistency do it as for other features.
8118 * src/symtab.h (symbol): Add new member prec_location, and
8119 type_location.
8120 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
8121 * tests/input.at (Incompatible Aliases): New.
8122
81232004-10-09 Paul Eggert <eggert@cs.ucla.edu>
8124
8125 .cvsignore fixes to accommodate gnulib changes,
8126 and the practice of naming build directories "_build".
8127 * .cvsignore: Add "_*". Sort.
8128 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
8129 * m4/.cvsignore: Add "*_gl.m4".
8130
81312004-10-06 Akim Demaille <akim@epita.fr>
8132
8133 * src/parse-gram.y (add_param): Fix the truncation of trailing
8134 spaces.
8135
81362004-10-05 Akim Demaille <akim@epita.fr>
8137
8138 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
8139 whether the reducion was empty or not. This leaves room to
8140 improve the use of YYLLOC_DEFAULT in such a case.
8141 lalr1.cc is still experimental, so changing this is acceptable.
8142 And finally, there are probably not many users who changed the
8143 handling of locations in GLR, so changing is admissible too.
8144
8145 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
8146 empty reduction, set @$ to an empty location ending the previously
8147 stacked symbol.
8148 Adjust uses to make sure the code is triggered on empty
8149 reductions.
8150 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
8151 expected output: empty reductions have empty locations.
8152
81532004-09-29 Akim Demaille <akim@epita.fr>
8154
8155 * data/lalr1.cc: Move towards a more standard C++ coding style
8156 for templates: Class < T > -> Class<T>.
8157
81582004-09-29 Akim Demaille <akim@epita.fr>
8159
8160 * data/lalr1.cc: Reinstall the former ctor, for sake of
8161 compatibility, but warn it will be removed.
8162 Move towards a more standard C++ coding style (i.e., type *var ->
8163 type* var).
8164
81652004-09-27 Paul Eggert <eggert@cs.ucla.edu>
8166
8167 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
8168 since it's less likely to work if NULs are involved in the future.
8169
81702004-09-27 Akim Demaille <akim@epita.fr>
8171
8172 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
8173
81742004-09-27 Akim Demaille <akim@epita.fr>
8175
8176 * data/lalr1.cc (b4_parse_param_decl_1): New.
8177 (b4_parse_param_decl): Use it to have different names between attribute
8178 and argument names.
8179 (b4_cc_constructor_call): Likewise.
8180
81812004-09-24 Akim Demaille <akim@epita.fr>
8182
8183 * src/parse-gram.y (add_param): Strip the leading and trailing
8184 blanks from a formal argument declaration.
8185 (YY_LOCATION_PRINT): New.
8186
81872004-09-24 Akim Demaille <akim@epita.fr>
8188
8189 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
8190 after the location.
8191
81922004-09-24 Akim Demaille <akim@epita.fr>
8193
8194 * doc/bison.texinfo (Table of Symbols): Sort.
8195
81962004-09-21 Akim Demaille <akim@epita.fr>
8197
8198 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
8199 the useless parentheses.
8200 Suggested by Paul Eggert.
8201
82022004-09-20 Akim Demaille <akim@epita.fr>
8203
8204 Let the initial-action act on the look-ahead, and use it for the
8205 "initial push" (corresponding to an hypothetical beginning-of-file).
8206 And let lalr1.cc honor %initial-action.
8207
8208 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
8209 example.
8210 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
8211 (Parser::Parser): Remove the ctor that used to initialize it.
8212 (Parser::parse): Like in the other skeletons, issue the "starting
8213 parse" message before any action.
8214 Honor %initial-action.
8215 Initialize the stacks with the lookahead.
8216 * data/yacc.c: Let $$ and @$ in %initial-action designate the
8217 look-ahead.
8218 Push them in the stacks.
8219 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
8220
82212004-09-20 Akim Demaille <akim@epita.fr>
8222
8223 * doc/bison.texinfo (Initial Action Decl): New.
8224
82252004-09-20 Akim Demaille <akim@epita.fr>
8226
8227 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
8228 clearer criterion to define it.
8229 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
8230 When reducing on an empty RHS, use the latest stacked location as
8231 location.
8232 yylloc is not always available.
8233 * data/glr.c: Likewise.
8234 Also, honor initial-actions.
8235
82362004-09-20 Akim Demaille <akim@epita.fr>
8237
8238 * data/yacc.c (YY_LOCATION_PRINT): New.
8239 Define when we know YYLTYPE's structure, i.e., when the default
8240 YYLLOC_DEFAULT is used.
8241 * data/c.m4 (b4_yysymprint_generate): Use it.
8242 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
8243 value of the result.
8244 (error_start_): Replace with...
8245 (error_range_): this location array.
8246 This allows to replace code relying on the implementation of
8247 locations by portable code.
8248 * data/yacc.c (yylerrsp): Replace with...
8249 (yyerror_range): this.
8250 Every time a token is popped, update yyerror_range[0], to have an
8251 accurate location for the error token.
8252 * data/glr.c (YY_LOCATION_PRINT): New.
8253 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
8254 deference a pointer.
8255 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
8256 report the location in %printers.
8257
8258 * src/scan-skel.l: Instead of abort, report error messages to ease
8259 understanding skeleton scanning failures.
8260
82612004-09-16 Akim Demaille <akim@epita.fr>
8262
8263 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
8264 (iterator, const_iterator): these, to be more in the C++ spirit.
8265 Also, return reverse iterators so that when displaying the stack
8266 we display its bottom first.
8267 (Parser::stack_print_, Parser::reduce_print_): Match the messages
8268 from yacc.c.
8269 We should probably use vector here though.
8270
82712004-09-16 Akim Demaille <akim@epita.fr>
8272
8273 Have more complete shift traces.
8274
8275 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
8276 to report Shifts instead of ad hoc YYDPRINTF invocations,
8277 including for the error token.
8278 * data/lalr1.cc (symprint_): Output the location.
8279 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
8280 output the location within the %printer.
8281 Activate GLR tests, at least to make sure they compile properly.
8282 They still don't pass though.
8283 * tests/calc.at: Adjust expect verbose output, since now "Entering
8284 state..." is on a different line than the "Shifting" message.
8285
82862004-09-08 Akim Demaille <akim@epita.fr>
8287
8288 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
8289 Bison directive from the Bison file to the invocation of this
8290 macro, so that these directives are passed to
8291 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
8292 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
8293 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
8294 the extra Bison directives instead of the whole series.
8295 Change the grammar so that there are recoverable errors, and
8296 unrecoverable errors. Now we can have the parser give up before
8297 consuming the whole input. As a result we now can observe that
8298 the lookahead is freed when needed.
8299 Change the parser source to parse argv[1] instead of a hard coded
8300 string.
8301 Simplify yylex, and give a value and location to EOF.
8302 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
8303 passed directives already coded in the file.
8304 Add some tests to check the location of "error".
8305 For some tests, the C++ parser is correct, and not yacc.c.
8306 For other tests, they provide different, but unsatisfying, values,
8307 so keep the C++ value so that at least one parser is "correct"
8308 according to the test suite.
8309 (Actions after errors): Remove, this is subsumed by the
8310 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
8311
83122004-09-06 Akim Demaille <akim@epita.fr>
8313
8314 * data/lalr1.cc: Adjust the indentation of the labels.
8315 (Parser::pop): New.
8316 Use it.
8317
83182004-09-06 Akim Demaille <akim@epita.fr>
8319
8320 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
8321 argument, an informative message.
8322 Call YY_SYMBOL_PRINT.
8323 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
8324 * data/lalr1.cc (destruct_): Likewise.
8325 In addition, no longer depend on b4_yysymprint_generate and
8326 b4_yydestruct_generate to generate these functions, do it "by
8327 hand".
8328
83292004-09-03 Akim Demaille <akim@epita.fr>
8330
8331 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
8332 invoked, yydestruct the lookahead.
8333 * tests/calc.at (Calculator $1): Update the expected lengths of
8334 traces: there is an added line for the discarded lookahead.
8335 * doc/bison.texinfo (Destructor Decl): Some rewording.
8336 Define "discarded" symbols.
8337
83382004-09-02 Akim Demaille <akim@epita.fr>
8339
8340 * data/lalr1.cc (translate_, destruct_): No reason to be static.
8341
83422004-09-02 Akim Demaille <akim@epita.fr>
8343
8344 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
8345 (YYDSYMPRINTF): Rename as...
8346 (YY_SYMBOL_PRINT): this.
8347 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
8348 two.
8349 Use it instead of direct symprint_ calls.
8350 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
8351 one.
8352
83532004-09-02 Akim Demaille <akim@epita.fr>
8354
8355 * data/lalr1.cc (b4_yysymprint_generate): New.
8356 (symprint_): New member function, defined when YYDEBUG.
8357 Use it consistently instead of token/nterm debugging output by
8358 hand.
8359 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
8360 %printer calls to use cdebug_ when using lalr1.cc.
8361
83622004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
8363
8364 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
8365 with #ifdef YYDEBUG.
8366
83672004-08-26 Akim Demaille <akim@epita.fr>
8368
8369 * doc/bison.texinfo (Implementing Loops): Rename as...
8370 (Implementing Gotos/Loops): this.
8371
83722004-08-13 Paul Eggert <eggert@cs.ucla.edu>
8373
8374 Adjust to latest gnulib.
8375 * bootstrap (gnulib_modules): Add xalloc-die.
8376 Set LC_ALL=C so that file names sort consistently.
8377 Prefer the gnulib copies of gettext.m4, glibc21.m4,
8378 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
8379 uintmax_t.m4, ulonglong.m4.
8380 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
8381 po.m4 since we are now using _gl.m4 instead.
8382
83832004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
8384
8385 * src/scan-action.l: Remove. Scanning of semantic actions is
8386 handled in scan-gram.l.
8387
83882004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
8389
8390 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
8391
8392 * src/location.h (struct): The file member is a uniqstr.
8393 (equal_boundaries): Use UNIQSTR_EQ for comparison.
8394
83952004-07-22 Paul Eggert <eggert@cs.ucla.edu>
8396
8397 Fix bug with non-%union parsers that have printers or destructors,
8398 which led to a Bison core dump. Reported by Peter Fales in
8399 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
8400
8401 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
8402 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
8403 not to our own type.
8404 * src/output.c (symbol_destructors_output, symbol_printers_output):
8405 Don't assume %union.
8406 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
8407 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
8408 UNION-FLAG. All callers changed.
8409 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
8410 Use type char, not unsigned int, when declaring an array of char;
8411 this lets us remove a cast.
8412 (Printers and Destructors): Add non-%union test cases.
8413
84142004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8415
8416 * doc/bison.texinfo: Minor editorial changes, mostly to the new
8417 GLR writeups. E.g., avoid frenchspacing and the future tense,
8418 change "lookahead" to "look-ahead", and change "wrt" to "with
8419 respect to".
8420
84212004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8422
8423 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
8424 New sections, split off from the GLR Parsers section. Put the new
8425 Simple GLR Parser near the start of the GLR section, for clarity.
8426 Rewrite connective text.
8427
84282004-06-21 Frank Heckenbach <frank@g-n-u.de>
8429
8430 * doc/bison.texinfo (Simple GLR Parsers): New section.
8431
84322004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8433
8434 * NEWS, TODO, doc/bison.texinfo:
8435 Use "look-ahead" instead of "lookahead", to be consistent.
8436 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
8437 while we're fixing "look-ahead".
8438 * src/conflicts.c (shift_set): Renamed from shiftset.
8439 (look_ahead_set): Renamed from lookaheadset.
8440 * src/print.c: Likewise.
8441 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
8442 name for "lookahead".
8443 (report_types, usage): Likewise.
8444 * src/getargs.h (report_look_ahead_tokens): Renamed from
8445 report_lookaheads.
8446 * src/lalr.c (compute_look_ahead_tokens): Renamed from
8447 compute_lookaheads.
8448 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
8449 (look_ahead_tokens_print): Renamed from lookaheads_print.
8450 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
8451 state_rule_lookaheads_print.
8452 * src/state.h: Likewise.
8453 (reductions.look_ahead_tokens): Renamed from lookaheads.
8454 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
8455 AT_DATA_LOOKAHEADS_GRAMMAR.
8456
84572004-06-03 Paul Eggert <eggert@cs.ucla.edu>
8458
8459 * README: Update location of patched M4 distribution.
8460
84612004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
8462
8463 Don't assume the C++ compiler takes the same arguments as the C compiler
8464 (trivial change).
8465 * configure.ac (O0CXXFLAGS): New var.
8466 * tests/atlocal.in (CXXFLAGS): Use it.
8467
84682004-05-29 Paul Eggert <eggert@cs.ucla.edu>
8469
8470 Fix some "make check" problems with C++ reported by
8471 Albert Chin-A-Young for Tru64 C++ in this thread:
8472 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
8473
8474 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
8475 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8476 Output to a .cc file for C++, not to a .c file.
8477 * tests/calc.at (AT_CHECK_CALC): Likewise.
8478 * tests/regression.at (AT_CHECK_DANCER): Likewise.
8479 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
8480
84812004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
8482
8483 * tests/calc.at, tests/actions.at: Workaround for SGI
8484 C++ compiler. (trivial change)
8485
84862004-05-27 Paul Eggert <eggert@cs.ucla.edu>
8487
8488 Spent a few hours checking out which prerequisite versions the
8489 current sources actually require. I went all the way back to
8490 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
8491 a seemingly endless set of combinations of versions more recent
8492 than that. The bottom line is that the current sources require
8493 fairly recent versions of the build tools, and it'll be some work
8494 to change this.
8495 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
8496 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
8497 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
8498 Add comments explaining why those particular versions are
8499 currently needed.
8500
8501 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
8502 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
8503 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
8504
8505 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
8506 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
8507
85082004-05-26 Paul Eggert <eggert@cs.ucla.edu>
8509
8510 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
8511 0.11.5. Suggested by Bruno Haible.
8512 * bootstrap: Remove gettext version checking.
8513
8514 * doc/bison.texinfo (Decl Summary): Also mention that %union
8515 can depend on prerequisite types. Problem reported by Tim
8516 Van Holder.
8517
85182004-05-25 Paul Eggert <eggert@cs.ucla.edu>
8519
8520 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
8521 * README-alpha: Don't tell people not to package this.
8522
8523 * bootstrap: Don't assume $(...) works; use `...` instead.
8524 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
8525 gettext better.
8526
8527 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
8528 put into the -d output file, and mention what to do if YYSTYPE is
8529 defined as a macro.
8530
85312004-05-24 Paul Eggert <eggert@cs.ucla.edu>
8532
8533 Undo change made earlier today: it caused autopoint to not bring
8534 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
8535 autopoint's.
8536
8537 * bootstrap: Check that gettext version matches what's in
8538 configure.ac. Warn users to ignore robots.txt ERROR 404.
8539 * bootstrap: Undo today's earlier change (logged below).
8540 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
8541
8542 The gettext version checking is causing more trouble than it's
8543 curing; remove it. Problem reported by Paul Hilfinger.
8544
8545 * bootstrap: Issue a warning that one can expect a message
8546 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
8547 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
8548
85492004-05-23 Paul Eggert <eggert@cs.ucla.edu>
8550
8551 Ensure that the C++ compiler used for testing actually works on a
8552 simple test program; if not, skip the C++-related tests. Problem
8553 reported by Vin Shelton in:
8554 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
8555
8556 * m4/cxx.m4: New file.
8557 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
8558 * tests/atlocal.in (BISON_CXX_WORKS): Add.
8559 * tests/local.at (AT_COMPILE_CXX): Use it.
8560
85612004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8562
8563 * data/glr.c (yylloc): Output this macro even if locations are not
8564 being generated, as the GLR parser needs it even in that case.
8565 Problem reported by Troy A. Johnson
8566 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
8567
8568 * configure.ac (AC_INIT): Update to 1.875e.
8569
85702004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8571
8572 * NEWS: Version 1.875d.
8573 * configure.ac (AC_INIT): Likewise.
8574 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
8575
8576 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
8577 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
8578 lalr1.cc runs afoul of the first, and the last two are no longer
8579 supported by GCC 3.4.0.
8580 * README: Mention GNU m4 1.4 or later; mention m4 patches.
8581 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
8582
85832004-05-06 Paul Eggert <eggert@cs.ucla.edu>
8584
8585 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
8586 unsigned int, for compatibility with latest gnulib hash module.
8587 * src/state.c (state_hash, state_hasher): Likewise.
8588 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
8589 * src/uniqstr.c (hash_uniqstr): Likewise.
8590
85912004-05-03 Paul Eggert <eggert@cs.ucla.edu>
8592
8593 * NEWS: Unescaped newlines are no longer allowed in char & strings.
8594
8595 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
8596 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
8597 character and string literals.
8598 (unexpected_end): New function.
8599 (unexpected_eof): Use it.
8600 (unexpected_newline): New function.
8601 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
8602 actions.
8603
8604 * NEWS: Document %expect-rr.
8605
8606 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
8607 Fix typo by replacing $1 with $option.
8608 Remove more 'intl'-related files.
8609 Don't DEFUN AM_INTL_SUBDIR twice.
8610
8611 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
8612 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
8613 strtoul.c.
8614 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
8615 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
8616 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
8617 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
8618 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
8619 * src/.cvsignore: Add *.output.
8620
8621 * src/parse-gram.y: Put copyright notice inside %{ %} so it
8622 gets copied to the output file.
8623
86242004-04-28 Paul Eggert <eggert@twinsun.com>
8625
8626 Get files from the gnulib and po repositories, instead of relying
8627 on them being in our CVS. Upgrade to latest versions of gnulib
8628 and Automake.
8629
8630 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
8631 * bootstrap: Bootstrap from gnulib and po repositories.
8632 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
8633 * README-cvs: Document these changes. Remove version numbers from
8634 mentions of build tools, since they change so often. Mention Flex.
8635
8636 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
8637 (gl_USE_SYSTEM_EXTENSIONS): Add.
8638 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
8639 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
8640 does this for us.
8641 (AC_ISC_POSIX): Remove; we no longer support this
8642 ancient OS, as it gets in the way of latest Autoconf & gnulib.
8643 (AC_HEADER_STDC): Remove: we now assume C89 or better.
8644 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
8645 Do not check for C89 headers, except for locale.h which is used
8646 by the Yacc library and must port to K&R hosts.
8647 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
8648 Do not check for C89 functions, except for setlocale which is
8649 used by the Yacc library.
8650 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
8651 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
8652 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
8653 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
8654 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
8655 AM_GNU_GETTEXT): Remove; now done by:
8656 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
8657 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
8658 for us.
8659
8660 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
8661 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
8662 Define to empty, as gnulib.mk will do the rest for us.
8663 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
8664 for us.
8665 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
8666 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
8667
8668 * src/files.c: Include gnulib's xstrndup.h.
8669
8670 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
8671 (REALLOC): Use xnrealloc, for likewise.
8672 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
8673 (strnlen, memrchr): Remove decls; functions no longer used.
8674 Include <stpcpy.h>.
8675
8676 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
8677 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
8678 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
8679 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
8680 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
8681 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
8682 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
8683 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
8684 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
8685 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
8686 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
8687 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8688 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
8689 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
8690 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
8691 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
8692 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
8693 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
8694 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
8695 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
8696 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
8697 Remove, as these files are now generated automatically
8698 by bootstrap or automake.
8699
8700 * po/ChangeLog: Remove: all but one entry was a duplicate
8701 of this file, and I moved that 2000-11-02 entry here.
8702
8703 * config/.cvsignore: Add Makefile, depcomp, install-sh.
8704 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
8705 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
8706 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
8707 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
8708 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
8709 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
8710 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
8711 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
8712 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
8713 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
8714 xstrndup.h.
8715 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
8716 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
8717 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
8718 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
8719 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
8720 * src/.cvsignore: Remove *_.c.
8721
8722
8723 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
8724 support it. (The latest stable gzip doesn't.)
8725
87262004-04-27 Paul Eggert <eggert@twinsun.com>
8727
8728 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
8729 case, as stos_ is now used by destructors due to the 2004-02-09
8730 change.
8731
8732 Remove more K&R C support.
8733 * lib/libiberty.y (PARAMS): Remove. All uses removed.
8734 * lib/subpipe.c (errno): Remove decl.
8735 Include <stdlib.h> unconditionally.
8736 (EXIT_FAILURE): Remove macro.
8737 * src/complain.c (vfprintf, strerror): Remove.
8738 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
8739 unconditionally.
8740 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
8741 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
8742 (strchr, strspn, memchr): Remove decls.
8743 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
8744 unconditionally. Do not declare perror.
8745 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
8746 unconditionally.
8747
8748 * src/complain.c (_): Remove useless defn, as system.h defines this.
8749
8750 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
8751 with latest obstack.h.
8752 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
8753 to procedure types, as obstack.h now does that for us.
8754 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
8755
8756 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
8757 so that this include file can stand alone.
8758 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
8759 does this now. Include subpipe.h first after config.h, to
8760 test whether it can stand alone.
8761
8762 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
8763 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
8764 unused declaration.
8765
8766 * tests/synclines.at (%union synch line): Put a dummy member in
8767 the union, because empty unions aren't allowed in C. Caught
8768 by GCC 3.4.0.
8769
87702004-04-13 Jim Meyering <jim@meyering.net>
8771
8772 * src/conflicts.c (conflicts_print): Correct format string typo:
8773 use `%%' to produce literal `%'. (trivial change)
8774
87752004-03-30 Paul Eggert <eggert@twinsun.com>
8776
8777 * src/getargs.c (version): Update copyright year to 2004.
8778
8779 * data/c.m4 (b4_int_type): Use 'short int' rather than
8780 'short', and similarly for 'long', 'unsigned', etc.
8781 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
8782 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
8783 yy_yypstack, yydumpstack): Likewise.
8784 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
8785 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
8786 Likewise.
8787 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
8788 yy_stack_print, yyparse): Likewise.
8789 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
8790 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
8791 * lib/bitset.c (bitset_print): Likewise.
8792 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
8793 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8794 * lib/bitsetv.c (bitsetv_dump): Likewise.
8795 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
8796 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
8797 Likewise.
8798 * src/LR0.c (allocate_itemsets): Likewise.
8799 * src/gram.h (rule_number, rule): Likewise.
8800 * src/lalr.h (goto_number): Likewise.
8801 * src/nullable.c (nullable_compute): Likewise.
8802 * src/output.c (prepare_rules): Likewise.
8803 * src/relation.c (relation_print, relation_digraph): Likewise.
8804 * src/relation.h (relation_node): Likewise.
8805 * src/state.h (state_number, transitions, errs, reductions,
8806 struct state): Likewise.
8807 * src/symtab.h (symbol_number, struct symbol): Likewise.
8808 * src/tables.c (vector_number, tally, action_number,
8809 default_goto, goto_actions): Likewise.
8810 * tests/existing.at (GNU Cim Grammar): Likewise.
8811 * tests/regression.at (Web2c Actions): Likewise.
8812
8813 * src/output.c (muscle_insert_short_int_table): Renamed from
8814 muscle_insert_short_table. All uses changed.
8815
88162004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8817
8818 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
8819 (declaration): Replace expected_conflicts with expected_sr_conflicts.
8820 Add %expect-rr rule.
8821
8822 * src/scan-gram.l: Recognize %expect-rr.
8823
8824 * src/conflicts.h (expected_sr_conflicts): Rename from
8825 expected_conflicts.
8826 (expected_rr_conflicts): Declare.
8827
8828 * src/conflicts.c (expected_sr_conflicts): Rename from
8829 expected_conflicts.
8830 (expected_rr_conflicts): Define.
8831 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
8832 for GLR parsers.
8833 Use expected_sr_conflicts in place of expected_conflicts.
8834 Warn if expected_rr_conflicts used in non-GLR parser.
8835
8836 * doc/bison.texinfo: Add documentation for %expect-rr.
8837
88382004-03-08 Paul Eggert <eggert@gnu.org>
8839
8840 Add support for hex token numbers. Suggested by Odd Arild Olsen in
8841 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
8842
8843 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
8844 in lalr1.cc.
8845 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
8846 * src/scan-gram.l (scan_integer): New function.
8847 ({int}): Use it.
8848 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
8849 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
8850 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
8851 Say "long int", not "long", for uniformity with GNU style.
8852
88532004-02-25 Paul Eggert <eggert@twinsun.com>
8854
8855 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8856 compilers. This fixes a problem with Intel's C++ compiler being
8857 chatty, reported by Guido Trentalancia in
8858 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
8859
88602004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8861
8862 Support %destructor and merge error locations in lalr1.cc.
8863
8864 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8865 (Parser::stos_): Define unconditionally.
8866 (Parser::destruct_): New method. Generate its body with
8867 b4_yydestruct_generate.
8868 (Parser::error_start_): New attribute.
8869 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8870 token which are discarded.
8871 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8872 error_start_ when erroneous token are discarded.
8873 (Parser::parse) <yyerrlab1>: Compute the location of the error
8874 token so that it covers all the discarded tokens.
8875 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8876 it can be called with `%skeleton "lalr1.cc"', and do that.
8877
88782004-02-02 Paul Eggert <eggert@twinsun.com>
8879
8880 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8881 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8882 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8883 There's no need to mention top_builddir since Automake does that
8884 for us.
8885 (INCLUDES): Remove, as Automake says it's obsolescent.
8886 Contents migrated into AM_CPPFLAGS as described above.
8887 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8888
88892004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8890
8891 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8892 (yyreportSyntaxError): Handle case where lookahead token is
8893 YYEMPTY.
8894
88952004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8896
8897 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8898 resulting parsers are compilable with C++.
8899
89002003-12-23 Paul Eggert <eggert@twinsun.com>
8901
8902 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8903 * src/output.c (output_skeleton): Rename local var.
8904 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8905 Bison tokens, as this runs afoul of the 2003-10-07 change that
8906 disallowed NUL bytes in character constants or string literals.
8907
8908 * tests/local.at: Require Autoconf 2.59's Autotest.
8909 * tests/testsuite.at: Don't include local.at, since we now assume
8910 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8911 including it.
8912 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8913 multiple inclusion warnings.
8914
89152003-12-02 Akim Demaille <akim@epita.fr>
8916
8917 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8918 conditions.
8919 From Bruno Haible.
8920
89212003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8922
8923 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8924
89252003-10-07 Paul Eggert <eggert@twinsun.com>
8926
8927 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8928 if testsuite doesn't exist.
8929
8930 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8931 literals, unfortunately.
8932 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8933 Complain about NUL bytes in character constants or string literals.
8934
89352003-10-05 Paul Eggert <eggert@twinsun.com>
8936
8937 * NEWS: Don't document %no-default-prec, as it's still
8938 too experimental.
8939 * doc/bison.texinfo: Document %no-default-prec only if
8940 the defaultprec flag is set. Normally it's not.
8941
89422003-10-04 Paul Eggert <eggert@twinsun.com>
8943
8944 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8945 non-modifiable lvalue, instead of a modifiable one.
8946 * doc/bison.texinfo (Actions): Document that $$ can
8947 be assigned to. Do not claim that $$ and $N are
8948 array element references: user code should not rely on this.
8949
89502003-10-01 Paul Eggert <eggert@twinsun.com>
8951
8952 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8953 (grammar_declaration): Use it.
8954 * src/scan-gram.l: New token %no-default-prec.
8955 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8956 * NEWS, doc/bison.texinfo: Document the above.
8957
89582003-10-01 Akim Demaille <akim@epita.fr>
8959
8960 VCG no longer supports long_straight_phase.
8961
8962 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8963 * src/print_graph.c (print_graph): Adjust.
8964
89652003-09-30 Frank Heckenbach <frank@g-n-u.de>
8966 and Paul Eggert <eggert@twinsun.com>
8967
8968 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8969 Table of Symbols): Document %default-prec.
8970 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8971 (grammar_declaration): Set default_prec on %default-prec.
8972 * src/scan-gram.l (%default-prec): New token.
8973 * src/reader.h (default_prec): New flag.
8974 * src/reader.c: Likewise.
8975 (packgram): Handle it.
8976 * tests/conflicts.at (%default-prec without %prec,
8977 %default-prec with %prec, %default-prec 1): New tests.
8978
89792003-09-30 Paul Eggert <eggert@twinsun.com>
8980
8981 * tests/testsuite.at: Include local.at, not input.at, fixing
8982 a typo in the 2003-08-25 patch.
8983
89842003-08-27 Akim Demaille <akim@epita.fr>
8985
8986 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8987 GCC warnings.
8988
89892003-08-26 Akim Demaille <akim@epita.fr>
8990
8991 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8992 "<\#" to avoid magic from Gnus when posting parts of this script.
8993
89942003-08-26 Akim Demaille <akim@epita.fr>
8995
8996 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8997 (Parser::parse): here.
8998 Adjust: nerrs and errstatus is now replaced by...
8999 (Parser::nerrs_, Parser::errstatus_): New.
9000
90012003-08-25 Akim Demaille <akim@epita.fr>
9002
9003 * config/announce-gen, Makefile.cfg: New.
9004 * Makefile.am: Adjust.
9005 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
9006 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
9007
90082003-08-25 Akim Demaille <akim@epita.fr>
9009
9010 When reducing initial empty rules, Bison parser read an initial
9011 location that is not defined. This results in garbage, and that
9012 affects Bison's own parser. Therefore we need (i) to extend Bison
9013 to support a means to initialize this location, and (ii) to use
9014 this CVS Bison to fix CVS Bison's parser.
9015
9016 * src/reader.h, reader.c (epilogue_augment): Remove, replace
9017 with...
9018 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
9019 * src/parse-gram.y: Adjust.
9020 (%initial-action): New.
9021 (%error-verbose): Since we require CVS Bison, there is no reason
9022 not to use it.
9023 * src/scan-gram.l: Adjust.
9024 * src/Makefile.am (YACC): New, to make sure we use our own parser.
9025 * data/yacc.c (yyparse): Use b4_initial_action.
9026
90272003-08-25 Akim Demaille <akim@epita.fr>
9028
9029 * doc/bison.texinfo: Don't promote stdout for error messages.
9030
90312003-08-25 Akim Demaille <akim@epita.fr>
9032
9033 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
9034 From Alexandre Duret-Lutz.
9035
90362003-08-25 Akim Demaille <akim@epita.fr>
9037
9038 Version 1.875c.
9039
90402003-08-25 Akim Demaille <akim@epita.fr>
9041
9042 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
9043 Use them.
9044
90452003-08-25 Akim Demaille <akim@epita.fr>
9046
9047 * data/lalr1.cc (Parser::reduce_print_): New.
9048 Use it.
9049
90502003-08-25 Akim Demaille <akim@epita.fr>
9051
9052 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
9053 error recovery loops. This patch is based on
9054 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
9055 Also, augment the similarity between lalr1.cc and yacc.c.
9056 Note: the locations of error recovery rules are not correct yet.
9057
9058 * data/lalr1.cc: Comment changes to augment the similarity between
9059 lalr1.cc and yacc.c.
9060 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
9061 (yyerrlab1): Remove, but where it used to be (now the bottom part of
9062 yyerrlab), when hitting EOF, pop the whole stack here instead of
9063 merely falling thru the default error handling mechanism.
9064 (yyerrorlab): New label, with the old contents of YYERROR,
9065 plus the following change: pop the stack of rhs corresponding
9066 to the production that invoked YYERROR. That is how Yacc
9067 behaves (required by POSIX).
9068 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
9069 fail.
9070
90712003-08-25 Akim Demaille <akim@epita.fr>
9072
9073 Tune local.at so that people can "autom4te -l autotest calc.at -o
9074 calc" for instance, to extract a sub test suite.
9075
9076 * tests/testsuite.at: Move the initialization, Autotest version
9077 requirement, and AT_TESTED invocation into...
9078 * tests/local.at: here.
9079 * tests/testsuite.at: Include it for compatibility with Autoconf
9080 2.57.
9081 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
9082 be ignore.
9083
90842003-08-04 Paul Eggert <eggert@twinsun.com>
9085
9086 Rework code slightly to avoid gcc -Wtraditional warnings.
9087 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
9088 The returned value is now stored in *YY0. All callers changed.
9089 * src/output.c (merge_output): Adjust to the above change.
9090
90912003-07-26 Paul Eggert <eggert@twinsun.com>
9092
9093 * data/glr.c (YYASSERT): New macro.
9094 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
9095 yyresolveStates, yyprocessOneStack):
9096 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
9097 Derived from a suggestion by Frank Heckenbach.
9098
90992003-07-25 Paul Eggert <eggert@twinsun.com>
9100
9101 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
9102 for portability to K&R C (after ansi2knr, presumably). See
9103 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
9104 by Frank Heckenbach, though I have omitted the structure-initialization
9105 part of his glr-knr.diff patch since I recall that the Portable
9106 C Compiler didn't require that change.
9107
9108 Let the user specify how to allocate and free memory.
9109 Derived from a suggestion by Frank Heckenbach in
9110 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
9111 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
9112 All uses of free, malloc, realloc changed to use these macros,
9113 and unnecessary casts removed.
9114 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
9115
91162003-07-06 Matthias Mann <MatthiasMann@gmx.de>
9117
9118 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
9119 use s.empty() rather than s == "" to test for empty string; see
9120 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
9121 (trivial change)
9122
91232003-06-25 Akim Demaille <akim@epita.fr>
9124
9125 * config/depcomp, config/install-sh: Update from masters.
9126
91272003-06-20 Paul Eggert <eggert@twinsun.com>
9128
9129 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
9130 and return properly parenthesized result.
9131 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
9132 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9133 Remove unnecessary parentheses from uses.
9134 * doc/bison.texinfo (Location Default Action): Describe the
9135 conventions for parentheses.
9136
91372003-06-19 Paul Eggert <eggert@twinsun.com>
9138
9139 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
9140 yyreportTree): Do not assume that size_t is the same width as int,
9141 when printing sizes. Print sizes using an unsigned format.
9142 Problem reported by Frank Heckenbach in
9143 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
9144
9145 Port to Forte Developer 7 C compiler.
9146 * data/glr.c (struct YYLTYPE): If locations are not being used,
9147 declare a single dummy member, as empty structs do not conform
9148 to the C standard.
9149 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
9150 the Forte Developer 7 C compiler complains that end-of-loop
9151 code is not reached.
9152
91532003-06-17 Paul Eggert <eggert@twinsun.com>
9154
9155 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
9156 avoid warnings from picky compilers about redefinition of PARAMS.
9157
91582003-06-17 Paul Eggert <eggert@twinsun.com>
9159
9160 Version 1.875b.
9161
9162 * NEWS: Document 1.875b.
9163
9164 * lib/bbitset.h: Do not include config.h; that's the includer's job.
9165 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
9166 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
9167 Don't use 'index' in comments, as it's a builtin fn on some hosts.
9168 * lib/bitset_stats.c: Include gettext.h unconditionally, as
9169 per recent gettext manual's suggestion.
9170 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
9171 Use prototypes, not old-style definitions.
9172 * lib/lbitset.c (lbitset_unused_clear): Likewise.
9173 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
9174 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
9175 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
9176 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
9177 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
9178 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
9179 vbitset_or_and_cmp, vbitset_copy): Likewise.
9180
9181 * lib/libiberty.h: Do not include config.h; that's the includer's job.
9182 Do not include <stdlib.h>.
9183 (PARAMS): Define unconditionally for C89.
9184 (ATTRIBUTE_NORETURN): Remove.
9185 (ATTRIBUTE_UNUSED): Define unconditionally.
9186
9187 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
9188 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
9189 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
9190 * lib/vbitset.c, lib/vbitset.h: New files.
9191 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9192 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
9193 from libbitset.
9194
9195 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
9196 `How Can I Reset @code{yyparse}', since texinfo does not allow
9197 arbitrary @ in node names.
9198
9199 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
9200 shouldn't be needed according to the gettext 0.12.1 documentation
9201 but which seem to be needed anyway: codeset.m4 glibc21.m4
9202 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
9203 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
9204 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
9205
9206 * lib/.cvsignore: Add stdbool.h.
9207 * m4/.cvsignore: Add nls.m4, po.m4.
9208
9209 Upgrade to CVS gnulib.
9210 * stdbool_.h: File renamed from stdbool.h.in.
9211 * configure.ac (AM_STDBOOL_H): Invoke this instead of
9212 AC_HEADER_STDBOOL.
9213 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
9214 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
9215 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
9216 (MOSTLYCLEANFILES): New var.
9217 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
9218 (stdbool.h): New rule.
9219 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
9220 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
9221 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
9222 m4/quote.m4: Upgrade to today's gnulib.
9223
9224 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
9225 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
9226 the tests right now.
9227 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
9228 yyerror are declared before use; C99 requires this.
9229
92302003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9231
9232 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
9233 first.
9234 (yyrecoverSyntaxError): Correct the logic for setting and testing
9235 yyerrState.
9236 Correct comment on handling EOF.
9237 Allow states with only a default reduction, rather than failing
9238 (I can't quite reconstruct why these were not allowed before).
9239
9240 Fixes to avoid problem that $-N rules in GLR parsers can cause
9241 buffer overruns, corrupting state.
9242
9243 * src/output.c (prepare_rules): Output max_left_semantic_context
9244 definition.
9245 * src/reader.h (max_left_semantic_context): New variable declaration.
9246 * src/scan-gram.l (max_left_semantic_context): Define.
9247 (handle_action_dollar): Update max_left_semantic_context.
9248 * data/glr.c (YYMAXLEFT): New definition.
9249 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
9250 (yyresolveAction): Ditto.
9251
9252 Fixes to problems with location handling in GLR parsers reported by
9253 Frank Heckenbach (2003/06/05).
9254
9255 * data/glr.c (YYLTYPE): Make trivial if locations not used.
9256 (YYRHSLOC): Add parentheses, and define only if locations used.
9257 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
9258 locations not used.
9259 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
9260 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
9261
9262 * tests/cxx-type.at: Exercise location information; update tests
9263 to differentiate output with and without locations.
9264 Remove forward declarations of yylex and yyerror---caused errors
9265 because default YYLTYPE not yet defined.
9266 Change semantic actions to compute strings, rather than printing
9267 them directly (to test proper passing of semantics values). Change
9268 output to prefix notation and update test data and expected results.
9269 (yylex): Track locations.
9270 (stmtMerge): Return value rather than printing, and include arguments
9271 in value.
9272
92732003-06-03 Paul Eggert <eggert@twinsun.com>
9274
9275 Avoid warnings generated by GCC 2.95.4 when Bison is
9276 configured with --enable-gcc-warnings.
9277 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
9278 yy::]b4_parser_class_name[::translate_,
9279 yy::Stack::operator[] (unsigned),
9280 yy::Stack::operator[] (unsigned) const,
9281 yy::Slice::operator[] (unsigned),
9282 yy::Slice::operator[] (unsigned) const):
9283 Rename local vars to avoid warnings.
9284 * tests/glr-regression.at (Improper handling of embedded actions
9285 and $-N in GLR parsers): Remove unused local variable from yylex.
9286 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
9287 (void) as arg when not pure, since we now assume C89 when building
9288 Bison. Pacify GCC by using parameter.
9289
92902003-06-02 Paul Eggert <eggert@twinsun.com>
9291
9292 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
9293 yy::Location::lines, yy::Location::columns): Rename arguments
9294 to avoid shadowing; this removes a warning generated by GCC 3.3.
9295
92962003-06-01 Paul Eggert <eggert@twinsun.com>
9297
9298 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
9299 to g++, as GCC 3.3 complains if you do it.
9300 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
9301 everything that WARNING_CFLAGS has, except omit warnings
9302 not suitable for C++.
9303 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
9304 * tests/atlocal.in (CXXFLAGS): New var.
9305 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
9306
9307 Fix a GLR parser bug I reported in February; see
9308 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
9309 The problem was that GLR parsers did not conform to the C standard,
9310 because actions like { $1 = $2 + $3; } expanded to expressions
9311 that invoked YYFILL in separate subexpressions, and YYFILL assigned
9312 to a local variable. The C standard says that expressions
9313 like (var = f ()) + (var = f ()) have undefined behavior.
9314 Another problem was that GCC sometimes issues warnings that
9315 yyfill and its parameters are unused.
9316
9317 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
9318 as possibly unused.
9319 (yyfill): New function.
9320 (YYFILL): Use it.
9321 (yyuserAction): Change type of yynormal to bool, so that it matches
9322 the new yyfill signature. Mark it as possibly unused.
9323
9324
9325 Follow up on a bug I reported in February, where a Bison-generated
9326 parser can loop. Provide a test case and a fix for yacc.c. I
9327 don't have a fix for lalr1.cc or for glr.c, unfortunately.
9328 The original bug report is in:
9329 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
9330
9331 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
9332 macro's size was becoming unwieldy.
9333 (yyerrlab): Do not discard an empty lookahead symbol, as this
9334 might destroy garbage.
9335 (yyerrorlab): New label, with the old contents of YYERROR,
9336 plus the following change: pop the stack of rhs corresponding
9337 to the production that invoked YYERROR. That is how Yacc
9338 behaves, and POSIX requires this behavior.
9339 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
9340 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
9341 Define 'alarm' to do nothing if unistd.h is not available.
9342 Add a new rule "exp: '-' error;" to test the above change to
9343 data/yacc.c. Use 'alarm' to abort any test taking longer than
9344 10 seconds, as it's probably looping.
9345 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
9346 Also, the new yacc.c generates two fewer diagnostics for an
9347 existing test.
9348
93492003-05-24 Paul Eggert <eggert@twinsun.com>
9350
9351 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
9352 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
9353 This fixes a problem reported by John Bowman when the Compaq/HP
9354 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
9355 -ansi -Wall -gall).
9356 * data/yacc.c (union yyalloc): Likewise.
9357 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
9358
9359 Switch from 'int' to 'bool' where that makes sense.
9360
9361 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
9362 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
9363 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
9364 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
9365 Return or accept bool, not int. All callers changed.
9366 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
9367 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
9368 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
9369 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
9370 bitset_or_and_cmp_): Likewise.
9371 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
9372 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
9373 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
9374 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
9375 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
9376 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
9377 bitset_stats_or_and_cmp): Likewise.
9378 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
9379 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
9380 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
9381 ebitset_xor_cmp): Likewise.
9382 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
9383 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
9384 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
9385 lbitset_xor_cmp): Likewise.
9386 * lib/bbitset.h: Include <stdbool.h>.
9387 (struct bitset_vtable): The following members now return bool, not
9388 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
9389 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
9390 or_and_cmp).
9391 * src/conflicts.c (count_rr_conflicts): Likewise.
9392 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
9393 All uses changed.
9394 * lib/ebitset.c (ebitset_obstack_init): Likewise.
9395 * lib/lbitset.c (lbitset_obstack_init): Likewise.
9396 * src/getargs.c (debug_flag, defines_flag, locations_flag,
9397 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9398 graph_flag): Likewise.
9399 * src/getargs.h (debug_flag, defines_flag, locations_flag,
9400 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9401 graph_flag): Likewise.
9402 * src/output.c (error_verbose): Likewise.
9403 * src/output.h (error_verbose): Likewise.
9404 * src/reader.c (start_flag, typed): Likewise.
9405 * src/reader.h (typed): Likewise.
9406 * src/getargs.c (LOCATIONS_OPTION): New constant.
9407 (long_options, getargs): Use it.
9408 * src/lalr.c (build_relations): Use bool, not int.
9409 * src/nullable.c (nullable_compute): Likewise.
9410 * src/print.c (print_reductions): Likewise.
9411 * src/tables.c (action_row, pack_vector): Likewise.
9412 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
9413 * src/output.c (prepare): Use it.
9414 * src/output.c (token_definitions_output,
9415 symbol_destructors_output, symbol_destructors_output): Use string,
9416 not boolean integer, to keep track of whether to output separator.
9417 * src/print_graph.c (print_core): Likewise.
9418 * src/state.c (state_rule_lookaheads_print): Likewise.
9419
9420 * config/install-sh: Sync from automake 1.7.5.
9421
94222003-05-14 Paul Eggert <eggert@twinsun.com>
9423
9424 * src/parse-gram.y (rules_or_grammar_declaration): Require a
9425 semicolon after a grammar declaration, in the interest of possible
9426 future changes to the Bison input language.
9427 Do not allow a stray semicolon at the start of the grammar.
9428 (rhses.1): Allow one or more semicolons after any rule, including
9429 just before "|" as required by POSIX.
9430 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
9431 grammar.
9432
94332003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
9434
9435 %parse-param support for lalr1.cc.
9436
9437 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
9438 b4_cc_constructor_calls, b4_cc_constructor_call,
9439 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
9440 definitions.
9441 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
9442 parse-param arguments.
9443 (yy::b4_parser_class_name): Declare instance variables to
9444 hold parse-param arguments.
9445 * tests/calc.at: s/value/semantic_value/ because value clashes
9446 with a member of yy::b4_parser_class_name. Adjust C++ code
9447 to handle %parse-param. Enable %parse-param test in C++.
9448
94492003-05-12 Paul Eggert <eggert@twinsun.com>
9450
9451 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
9452 English a bit. Fix fclose typo. Change "const char" to "char
9453 const", and use ANSI C rather than K&R for "main". Suggest
9454 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
9455 and suggest yy_switch_to_buffer.
9456
94572003-05-05 Paul Eggert <eggert@twinsun.com>
9458
9459 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
9460 C89. This avoids a diagnostic on compilers that define __STDC__
9461 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
9462 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
9463
94642003-05-03 Paul Eggert <eggert@twinsun.com>
9465
9466 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
9467 Do not overrun array bounds.
9468 This should fix a bug reported today by Olatunji Oluwabukunmi in
9469 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
9470
94712003-04-29 Akim Demaille <akim@epita.fr>
9472
9473 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
9474 * src/getargs.c, src/getargs.h: here, as bool, not int.
9475 (nondeterministic_parser): New.
9476 * src/parse-gram.y, src/scan-gram.l: Support
9477 %nondeterministic-parser.
9478 * src/output.c (prepare): Use nondeterministic_parser instead
9479 of glr_parser where appropriate.
9480 * src/tables.c (conflict_row, action_row, save_row)
9481 (token_actions, token_actions, pack_vector): Ditto.
9482
94832003-04-29 Akim Demaille <akim@epita.fr>
9484
9485 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
9486
94872003-04-29 Akim Demaille <akim@epita.fr>
9488
9489 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
9490 with %pure-parser and %locations to exercise the patch from Yakov
9491 Markovitch below.
9492
94932003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
9494
9495 * data/yacc.c: (b4_lex_param): Corrected for the case where
9496 %lex-param is provided and %pure-parser isn't.
9497
94982003-04-27 Paul Eggert <eggert@twinsun.com>
9499
9500 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
9501 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
9502 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
9503 if it is not defined.
9504 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
9505
95062003-04-26 Paul Eggert <eggert@twinsun.com>
9507
9508 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
9509 Declare to be of type suitable for the ninf value itself, not of
9510 type suitable for the corresponding table, since the latter might
9511 be unsigned but the ninf value might be negative. This fixes a
9512 bug reported by Alexandre Duret-Lutz in
9513 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
9514
9515 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
9516 invokes it. We shouldn't invoke it twice because it will attempt
9517 to put error.o in the archive twice. This fixes a glitch reported
9518 by Martin Mokrejs in
9519 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
9520
95212003-04-21 Paul Eggert <eggert@twinsun.com>
9522
9523 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
9524 to gnulib.
9525
95262003-04-21 Yakov Markovitch <Markovitch@iso.ru>
9527
9528 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
9529 Fix obvious typo that results in uncompilable GLR parsers
9530 when both %pure-parser and %locations are used. (trivial change)
9531
95322003-04-17 Paul Eggert <eggert@twinsun.com>
9533
9534 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
9535 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
9536 Do not insert the expected token via unput, as this runs afoul
9537 of a POSIX-compatibility bug in flex 2.5.31.
9538 All uses changed to BEGIN the parent state,
9539 since we no longer insert the expected token via unput.
9540 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
9541 that is no longer emitted after the above change.
9542
9543 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
9544 the first one. This change is from Paul Hilfinger, and it fixes
9545 regression reported by Werner Lemberg in
9546 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
9547
9548 (resolve_sr_conflict): Don't invoke state_errs_set
9549 unless one or more tokens have been explicitly made errors.
9550 Otherwise, the above change causes Bison to abort.
9551
9552 * tests/existing.at (GNU pic Grammar): New test case, taken from
9553 Lemberg's email.
9554
95552003-03-31 Akim Demaille <akim@epita.fr>
9556
9557 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
9558
95592003-03-31 Akim Demaille <akim@epita.fr>
9560
9561 * src/output.c (prepare_symbols): Avoid trailing spaces in the
9562 output.
9563
95642003-03-31 Akim Demaille <akim@epita.fr>
9565
9566 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
9567 From Paul Hilfinger.
9568
95692003-03-29 Akim Demaille <akim@epita.fr>
9570
9571 * m4/error.m4: Do not put under dynamic conditions some code which
9572 expansion is under static control.
9573
95742003-03-29 Akim Demaille <akim@epita.fr>
9575
9576 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
9577
95782003-03-29 Akim Demaille <akim@epita.fr>
9579
9580 * doc/bison.texinfo (Strings are Destroyed): New.
9581
95822003-03-13 Paul Eggert <eggert@twinsun.com>
9583
9584 * .cvsignore: Add configure.lineno.
9585 * src/.cvsignore: Add yacc.
9586 * tests/.cvsignore: Add testsuite.log.
9587 * doc/fdl.texi: Sync with latest FSF version.
9588
95892003-03-12 Paul Eggert <eggert@twinsun.com>
9590
9591 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
9592 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
9593 cursor, instead of leaving it undefined. This fixes a bug
9594 reported by Tim Van Holder in
9595 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
9596 * tests/input.at (Torturing the Scanner): Test the scanner on
9597 an empty input file, which was Tim Van Holder's test case.
9598
9599 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
9600 <sys/resource.h> can be included, include sys/time.h and
9601 sys/times.h first, if available. This works around the SunOS
9602 4.1.4 porting bug reported by Bruce Becker in
9603 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
9604
9605 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
9606 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
9607 AC_HEADER_SYS_WAIT.
9608
9609 Merge changes from gnulib. This was prompted because the CVS
9610 snapshot didn't build on Solaris 7 due to strnlen problems.
9611
9612 These changes need to be merged back into gnulib:
9613 * lib/hash.c: Include <stdbool.h> unconditionally.
9614 * m4/onceonly.m4 (m4_quote): New macro.
9615 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
9616 Quote AC_FOREACH variable-expansions properly.
9617 The 2003-01-03 obstack.h change also needs merging.
9618 {end of changes requiring merging}
9619
9620 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9621 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
9622 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
9623 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
9624 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
9625 New files, imported from gnulib.
9626 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
9627 above.
9628
9629 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
9630 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
9631 gnulib sources.
9632
9633 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
9634 Add.
9635 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
9636 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
9637 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
9638 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
9639 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
9640 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
9641 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
9642 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
9643 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
9644 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
9645 (jm_PREREQ_ARGMATCH): Remove.
9646 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
9647 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
9648
9649 * src/system.h: Include <stdbool.h> unconditionally.
9650
9651 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
9652 assuming at least C89 in the bitset code for some time now.
9653
96542003-03-03 Akim Demaille <akim@epita.fr>
9655
9656 * ro.po: New.
9657
96582003-03-02 Akim Demaille <akim@epita.fr>
9659
9660 * doc/bison.texinfo (Table of Symbols): Reactivate the
9661 documentation for %lex-param, and %parse-param.
9662
96632003-03-02 Akim Demaille <akim@epita.fr>
9664
9665 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
9666 generate verbose error messages.
9667 Use the number of tokens as an upper bound in yytname, as it
9668 cannot be a non terminal.
9669
96702003-03-02 Akim Demaille <akim@epita.fr>
9671
9672 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
9673 message.
9674
96752003-03-02 Akim Demaille <akim@epita.fr>
9676
9677 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
9678 Use them to exercise yycheck overrun.
9679 Based on Andrew Suffield's grammar.
9680
96812003-03-02 Akim Demaille <akim@epita.fr>
9682
9683 Create tests/local.at for Bison generic testing macros.
9684
9685 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
9686 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
9687 This new file.
9688 * tests/calc.at (AT_CHECK_CALC): Adjust.
9689 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
9690 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
9691 * tests/local.at: here.
9692 (AT_COMPILE_CXX): Tags the tests using it as c++.
9693 Ignore the test if CXX is not functional.
9694
96952003-03-01 Paul Eggert <eggert@twinsun.com>
9696
9697 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
9698 not loc->end, since loc->end might contain garbage and this leads
9699 to undefined behavior on some platforms.
9700 (id_loc, token_start): Use (IF_LINTed) initial values that do not
9701 depend on *loc, so that the reader doesn't give the the false
9702 impression that *loc is initialized.
9703 (<INITIAL>"%%"): Do not bother setting code_start, since its value
9704 does not survive the return.
9705
97062003-03-01 Akim Demaille <akim@epita.fr>
9707
9708 * src/scan-gram.l (code_start): Always initialize it when entering
9709 into yylex, as SC_EPILOGUE is activated *before* the corresponding
9710 yylex invocation. An alternative would be making it static, but
9711 then it starts with the second %%'s beginning, instead of its end.
9712
97132003-02-28 Paul Eggert <eggert@twinsun.com>
9714
9715 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
9716 around a UnixWare 7.1.1 porting bug reported by John Hughes in
9717 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
9718
97192003-02-26 Paul Eggert <eggert@twinsun.com>
9720
9721 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
9722 Remove Sequent/Pyramid discussion (nobody uses them any more).
9723 Merge VMS and MS-DOS discussion; these ports may well be dead
9724 but let's keep mentioning them for now. Put <> around email
9725 addresses. Add copyright notice.
9726
97272003-02-24 Paul Eggert <eggert@twinsun.com>
9728
9729 * data/glr.c (yy_reduce_print): yylineno -> yylno,
9730 to avoid collision with flex use of yylineno.
9731 Problem reported by Bruce Lilly in
9732 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
9733 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9734 * data/yacc.c (yy_reduce_print): Likewise.
9735
9736 * config/depcomp: Sync with Automake 1.7.3.
9737
97382003-02-21 Akim Demaille <akim@epita.fr>
9739
9740 * data/lalr1.cc: Use temporary variables instead of casts to
9741 change integer types.
9742 Suggested by Paul Eggert.
9743
97442003-02-21 Akim Demaille <akim@epita.fr>
9745
9746 * doc/bison.texinfo: Use "location" consistently to refer to @n,
9747 to avoid confusions with lalr1.cc's notion of Position.
9748 Suggested by Paul Eggert.
9749
97502003-02-20 Akim Demaille <akim@epita.fr>
9751
9752 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
9753 before initial_columns.
9754 (location.hh): Use consistent variable names when defining the
9755 operator<<.
9756 Use "last" so that we subtract from Positions, not from unsigned.
9757
97582003-02-20 Akim Demaille <akim@epita.fr>
9759
9760 * data/lalr1.cc (position.hh): New subfile, including the extended
9761 and Doxygen'ed documentation of class Position.
9762 (location.hh): Use it.
9763 Document a` la Doxygen.
9764 With the help of Benoit Perrot.
9765
97662003-02-20 Akim Demaille <akim@epita.fr>
9767
9768 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
9769 AT_YACC_IF.
9770 Redefine AT_YYERROR_SEES_LOC_IF using it.
9771 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
9772 not defined.
9773 Don't use the location in yy::Parser::error_ and
9774 yy::Parser::print_ when not %locations.
9775 Activate more lalr1.cc tests.
9776
97772003-02-19 Akim Demaille <akim@epita.fr>
9778
9779 * data/lalr1.cc: When displaying a line number, be sure to make it
9780 an int.
9781
97822003-02-19 Akim Demaille <akim@epita.fr>
9783
9784 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
9785 Remove, useless.
9786 (YYABORT, YYACCEPT, YYERROR): New.
9787 * tests/calc.at: Renable the lalr1.cc test.
9788
97892003-02-19 Akim Demaille <akim@epita.fr>
9790
9791 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
9792 error recovery, mixing with/without pops and discarding of the
9793 lookahead.
9794 Exercise YYERROR.
9795 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
9796
97972003-02-17 Paul Eggert <eggert@twinsun.com>
9798
9799 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
9800 * tests/testsuite.at (AT_COMPILE): Use them.
9801 This fixes the testsuite problem reported by Robert Lentz in
9802 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
9803
98042003-02-12 Paul Eggert <eggert@twinsun.com>
9805
9806 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
9807 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
9808 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
9809 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
9810 Check for malloc failure, for consistency with yacc.c.
9811 (yytname_size): Remove, for consistency with yacc.c.
9812
9813 The bug still remains in data/lalr1.cc, as I didn't have time
9814 to fix it there.
9815
98162003-02-06 Akim Demaille <akim@epita.fr>
9817
9818 * configure.ac (GXX): Rename as...
9819 (CXX): this, to keep the original Autoconf semantics.
9820 Require 2.57.
9821 * data/lalr1.cc: Fix b4_copyright invocations.
9822 If YYDEBUG is not defined, don't depend upon name_ being defined.
9823 (location.hh): Include string and iostream.
9824 (Position::filename): New member.
9825 (Position::Position ()): New.
9826 (operator<< (Position)): New.
9827 (operator- (Position, int)): New.
9828 (Location::first, Location::last): Rename as...
9829 (Location::begin, Location::end): these, to mock the conventional
9830 iterator names.
9831 (operator<< (Location)): New.
9832 * tests/atlocal.in (CXX): New.
9833 * tests/testsuite.at (AT_COMPILE_CXX): New.
9834 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
9835 locations in a more synthetic way.
9836 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
9837 lalr1.cc is used.
9838 Adjust the C locations to match those from Emacs: first column is
9839 column 0.
9840 Change all the expected results.
9841 Conform to the GCS: simplify the locations when applicable.
9842 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
9843 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
9844 these CPP macros with the m4 macros new defined by...
9845 (AT_CHECK_PUSHDEFS): this, i.e.:
9846 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
9847 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
9848 New macros.
9849 (AT_CHECK_POPDEFS): Undefine them.
9850 (AT_CHECK_CALC_LALR1_CC): New.
9851 Use it for the first lalr1.cc test.
9852
98532003-02-04 Akim Demaille <akim@epita.fr>
9854
9855 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9856 Location as is defined.
9857
98582003-02-04 Akim Demaille <akim@epita.fr>
9859
9860 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9861 name_ being defined.
9862
98632003-02-03 Paul Eggert <eggert@twinsun.com>
9864
9865 * src/gram.h (start_symbol): Remove unused decl.
9866
9867 Use more-consistent naming conventions for local vars.
9868
9869 * src/derives.c (derives_compute): Change type of local var from
9870 int to rule_number.
9871 * src/gram.c (grammar_rules_partial_print): Likewise.
9872 * src/print.c (print_core): Likewise.
9873 * src/reduce.c (reduce_grammar_tables): Likewise.
9874
9875 * src/gram.c (grammar_dump): Change name of item_number *
9876 local var from r to rp.
9877 * src/nullable.c (nullable_compute): Likewise.
9878
9879 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9880
9881 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9882 for symbol or symbol_number var.
9883 * src/reader.c (grammar_start_symbol_set): Likewise.
9884 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9885 Likewise.
9886 * src/state.c (transitions_to): Likewise.
9887 * src/state.h: Likewise.
9888 * src/tables.c (symbol_number_to_vector_number): Likewise.
9889
9890 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9891 char * var.
9892
9893 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9894 var.
9895
9896 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9897 var.
9898
9899 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9900 Use str, not s, for char * var. Use ch, not c, for character var.
9901 Use size for size var.
9902
9903 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9904 char * var.
9905 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9906 uniqstr var.
9907 * src/uniqstr.h: Likewise.
9908
9909 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9910 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9911 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9912 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9913 param to have same name as that of enum, so that we don't use
9914 "s" to stand for a non-state.
9915
99162003-02-02 Akim Demaille <akim@epita.fr>
9917
9918 * src/scan-skel.l: Scan more than one inert character per yylex
9919 invocation.
9920
99212003-02-01 Paul Eggert <eggert@twinsun.com>
9922
9923 Version 1.875a.
9924
9925 * po/LINGUAS: Add ms.
9926
99272003-01-30 Akim Demaille <akim@epita.fr>
9928
9929 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9930
99312003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9932
9933 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9934 of $1.
9935
9936 Changes in response to error report by S. Eken: GLR mode does not
9937 handle negative $ indices or $ indices in embedded rules correctly.
9938 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
9939
9940 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9941 (b4_rhs_location): Ditto.
9942 (yyfill): New function to copy from stack tree into array
9943 incrementally.
9944 (yyuserAction): Modify to allow incremental move of semantic values
9945 to rhs array when in GLR mode.
9946 Define YYFILL to use in user-defined actions to fill semantic array
9947 as needed.
9948 Remove dummy use of yystack, as there is now a guaranteed use.
9949 (yydoAction): Modify to allow incremental move of semantic values
9950 to rhs array when in GLR mode.
9951 (yyresolveAction): Ditto.
9952 (yyglrShiftDefer): Update comment.
9953 (yyresolveStates): Use X == NULL for pointers, not !X.
9954 (yyglrReduce): Ditto.
9955 (yydoAction): Ditto
9956
9957 * tests/glr-regr1.at: Rename to ...
9958 * tests/glr-regression.at: Add new regression test for the problems
9959 described above (adapted from S. Eken).
9960 Update copyright notice.
9961 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9962 * tests/Makefile.am: Ditto.
9963
99642003-01-28 Paul Eggert <eggert@twinsun.com>
9965
9966 * data/lalr1.cc: Do not use @output_header_name@ unless
9967 b4_defines_flag is set. This fixes two bugs reported by
9968 Tim Van Holder in
9969 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9970 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
9971
99722003-01-21 Paul Eggert <eggert@twinsun.com>
9973
9974 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9975 we don't need to worry about yyerrlab1 being reported as an
9976 "unused label" by non-GCC C compilers. The downside is that if
9977 locations are used then a couple of statements are duplicated each
9978 time YYERROR is invoked, but the upside is that the warnings
9979 should vanish.
9980 (yyerrlab1): Move code to YERROR.
9981 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9982 This reverts some of the 2002-12-27 change.
9983
99842003-01-17 Paul Eggert <eggert@twinsun.com>
9985
9986 * src/output.c (symbol_printers_output): Fix typo that led
9987 to core dump. Problem reported by Antonio Rus in
9988 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
9989
99902003-01-13 Akim Demaille <akim@epita.fr>,
9991 Quoc Peyrot <chojin@lrde.epita.fr>,
9992 Robert Anisko <anisko_r@lrde.epita.fr>
9993
9994 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9995 when the stacks contain one element, as the loop would otherwise
9996 free the last state, and then use the top state (the one we just
9997 popped). This means that the initial elements will not be freed
9998 explicitly, as is the case in yacc.c; it is not a problem, as
9999 these elements have fake values.
10000
100012003-01-11 Paul Eggert <eggert@twinsun.com>
10002
10003 * NEWS: %expect-violations are now just warnings, reverting
10004 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
10005 bootstrapping problem reported by Matthias Klose; see
10006 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
10007 * src/conflicts.c (conflicts_print): Likewise.
10008 * tests/conflicts.at (%expect not enough, %expect too much,
10009 %expect with reduce conflicts): Likewise.
10010 * doc/bison.texinfo (Expect Decl): Document this. Also mention
10011 that the warning is enabled if the number of conflicts changes
10012 (not necessarily increases).
10013
10014 * src/getargs.c (version): Update copyright year.
10015
100162003-01-09 Akim Demaille <akim@epita.fr>
10017
10018 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
10019
100202003-01-08 Paul Eggert <eggert@twinsun.com>
10021
10022 * Makefile.maint (WGETFLAGS):
10023 New macro, containing "-C off" to disable proxy caches.
10024 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
10025 (rel-check): Use $(WGET) instead of wget.
10026
100272003-01-06 Paul Eggert <eggert@twinsun.com>
10028
10029 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
10030 the GLR paper of Scott, Johnstone and Hussain.
10031
100322003-01-04 Paul Eggert <eggert@twinsun.com>
10033
10034 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
10035 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
10036 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
10037 (EXTRA_LIBRARIES): New var, for liby.a.
10038 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
10039 (EXTRA_SCRIPTS): New var, for yacc.
10040
10041 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
10042 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
10043 Problem reported by Nelson H. F. Beebe.
10044
100452003-01-03 Paul Eggert <eggert@twinsun.com>
10046
10047 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
10048 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
10049 when compiling Bison 1.875's `bitset bset = obstack_alloc
10050 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
10051
10052 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
10053 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
10054 grow to a huge size with typical invocation.
10055
10056 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
10057 Use the pattern recommended by Autoconf 2.57, except also protect
10058 against double-definition.
10059 * src/system.h: Likewise.
10060 Portability issues reported by Nelson H. F. Beebe.
10061
10062 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
10063 All uses changed. Provide a definition in both C and C++.
10064 (yytrue, yyfalse): Define even if defined (__cplusplus).
10065
10066 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
10067 Reported by Nelson H. F. Beebe.
10068
10069 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
10070
100712003-01-02 Paul Eggert <eggert@twinsun.com>
10072
10073 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
10074 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
10075 Bug reported by Nelson H. F. Beebe.
10076
100772003-01-01 Paul Eggert <eggert@twinsun.com>
10078
10079 * Version 1.875.
10080
100812002-12-30 Paul Eggert <eggert@twinsun.com>
10082
10083 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
10084 Moved here from...
10085 (<INITIAL>","): Here. This causes stray "," to be treated
10086 more uniformly.
10087
10088 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
10089 last brace in braced code when not in Yacc mode, for compatibility
10090 with Bison 1.35. This resurrects the 2001-12-15 patch to
10091 src/reader.c.
10092
10093 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
10094 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
10095
100962002-12-28 Paul Eggert <eggert@twinsun.com>
10097
10098 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
10099 that of SYM's type. This fixes Debian bug 168069, reported by
10100 Thomas Olsson.
10101
101022002-12-28 Paul Eggert <eggert@twinsun.com>
10103
10104 Version 1.75f.
10105
10106 Switch back to the Yacc style of conflict reports, undoing some
10107 of the 2002-07-30 change.
10108 * doc/bison.texinfo (Understanding): Use Yacc style for
10109 conflict reports. Also, use new way of locating rules.
10110 * src/conflicts.c (conflict_report):
10111 Renamed from conflict_report_yacc, removing the old
10112 'conflict_report'. Translate the entire conflict report at once,
10113 so that we don't assume that "," has the same interpretation in
10114 all languages.
10115 (conflicts_output): Use Yacc-style conflict report for each state,
10116 instead of our more-complicated style.
10117 (conflicts_print): Use Yacc-style conflict report, except print
10118 the input file name when not emulating Yacc.
10119 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
10120 Conflicted Reduction, %expect not enough, %expect too much,
10121 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
10122 * tests/existing.at (GNU Cim Grammar): Likewise.
10123 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
10124
10125 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
10126 fatal): Don't invoke fflush; it's not needed and it might even be
10127 harmful for stdout, as stdout might not be open.
10128 * src/reduce.c (reduce_print): Likewise.
10129
101302002-12-27 Paul Eggert <eggert@twinsun.com>
10131
10132 Fix a bug where error locations were not being recorded correctly.
10133 This problem was originally reported by Paul Hilfinger in
10134 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
10135
10136 * data/yacc.c (yyparse): New local var yylerrsp, to record the
10137 top of the location stack's error locations.
10138 (yyerrlab): Set it. When discarding a token, push its location
10139 onto yylerrsp so that we don't lose track of the error's end.
10140 (yyerrlab1): Now is only the target of YYERROR, so that we can
10141 properly record the location of the action that failed. For GCC
10142 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
10143 GCC warning about yyerrlab1 being unused if YYERROR is unused.
10144 (yyerrlab2): New label, which yyerrlab now falls through to.
10145 Compute the error's location by applying YYLLOC_DEFAULT to
10146 the locations of all the symbols that went into the error.
10147 * doc/bison.texinfo (Location Default Action): Mention that
10148 YYLLOC_DEFAULT is also invoked for syntax errors.
10149 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10150 Error locations include the locations of all the tokens that were
10151 discarded, not just the last token.
10152
101532002-12-26 Paul Eggert <eggert@twinsun.com>
10154
10155 * src/files.c: Include quote.h.
10156 (compute_output_file_names): Warn if we detect conflicting
10157 outputs to the same file. This should catch the misunderstanding
10158 exemplified by Debian Bug 165349, reported by Bruce Stephens..
10159
10160 * src/conflicts.c (conflicts_print): If the user specifies
10161 "%expect N", report an error if there are any reduce/reduce
10162 conflicts. This is what the manual says should happen.
10163 This fixes Debian bug 130890, reported by Anthony DeRobertis.
10164 * tests/conflicts.at (%expect with reduce conflicts): New test.
10165
10166 Don't use m4_include on relative file names, as it doesn't work as
10167 desired if there happens to be a file with that name under ".".
10168
10169 * m4sugar/version.m4: Remove; it was included but it wasn't used.
10170 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
10171 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
10172 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
10173 * src/output.c (output_skeleton): Use full path names when
10174 specifying a file to include; don't rely on include path, as
10175 it's unreliable when the working file contains a file with
10176 that name.
10177
101782002-12-25 Paul Eggert <eggert@twinsun.com>
10179
10180 Remove obsolete references to bison.simple and bison.hairy.
10181 Problem mentioned by Aubin Mahe in
10182 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
10183 * data/glr.c: Comment fix.
10184 * doc/bison.1: Remove references. Also, mention "yacc".
10185
10186 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
10187 with -g option.
10188
10189 * src/parse-gram.y (declaration): Use enum "report_states" rather
10190 than its numeric value 1.
10191
10192 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
10193 opening a new one. This fixes Debian bug 165349, reported by
10194 Bruce Stephens.
10195
101962002-12-24 Paul Eggert <eggert@twinsun.com>
10197
10198 Version 1.75e.
10199
10200 * Makefile.maint (cvs-update): Don't assume that the shell
10201 supports $(...), as Solaris sh doesn't.
10202
10203 * src/parse-gram.y (lloc_default): Remove test for empty
10204 nonterminals at the end, since it didn't change the result.
10205
102062002-12-24 Paul Eggert <eggert@twinsun.com>
10207
10208 If the user does not define YYSTYPE as a macro, Bison now declares it
10209 using typedef instead of defining it as a macro. POSIX requires this.
10210 For consistency, YYLTYPE is also declared instead of defined.
10211
10212 %union directives can now have a tag before the `{', e.g., the
10213 directive `%union foo {...}' now generates the C code
10214 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
10215 The default union tag is `YYSTYPE', for compatibility with Solaris 9
10216 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
10217 instead of `yyltype'.
10218
10219 `yystype' and `yyltype' are now obsolescent macros instead of being
10220 typedefs or tags; they are no longer documented and will be
10221 withdrawn in a future release.
10222
10223 * data/glr.c (b4_location_type): Remove.
10224 (YYSTYPE): Renamed from yystype.
10225 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
10226 (struct YYLTYPE): Renamed from struct yyltype.
10227 (YYLTYPE): Renamed from yyltype.
10228 (yyltype, yystype): New (and obsolescent) macros,
10229 for backward compatibility.
10230 * data/yacc.c: Likewise.
10231
10232 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
10233 does not specify a union tag. This is for compatibility with
10234 Solaris 9 yacc.
10235
10236 * src/parse-gram.y (add_param): 2nd arg is now char * not char
10237 const *, since it is now modified by stripping surrounding { }.
10238 (current_braced_code): Remove.
10239 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
10240 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
10241 trailing " {...}". Now of type <chars>.
10242 (grammar_declaration): Adjust to bundled tokens.
10243 (code_content): Remove; stripping is now done by add_param.
10244 (print_token_value): Print contents of bundled tokens.
10245 (token_name): New function.
10246
10247 * src/reader.h (braced_code, current_braced_code): Remove.
10248 (token_name): New decl.
10249
10250 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
10251 token_type, not braced_code code_kind. All uses changed.
10252 (SC_PRE_CODE): New state, for scanning after a keyword that
10253 has (or usually has) an immediately-following braced code.
10254 (token_type): New local var, to keep track of which token type
10255 to return when scanning braced code.
10256 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
10257 <INITIAL>"%parse-param", <INITIAL>"%printer",
10258 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
10259 instead of returning a token type immediately.
10260 (<INITIAL>"{"): Set token type.
10261 (<SC_BRACED_CODE>"}"): Use it.
10262 (handle_action_dollar, handle_action_at): Now returns bool
10263 indicating success. Fail if ! current_rule; this prevents a core dump.
10264 (handle_symbol_code_dollar, handle_symbol_code_at):
10265 Remove; merge body into caller.
10266 (handle_dollar, handle_at): Complain in invalid contexts.
10267
10268 * NEWS, doc/bison.texinfo: Document the above.
10269 * NEWS: Fix years and program names in copyright notice.
10270
102712002-12-17 Paul Eggert <eggert@twinsun.com>
10272
10273 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
10274 Reporting, Table of Symbols): Omit mentions of %lex-param and
10275 %parse-param from the documentation for now.
10276
102772002-12-15 Paul Eggert <eggert@twinsun.com>
10278
10279 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
10280 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
10281 lookahead symbol, and which sets yychar in parser actions) and it
10282 disagreed with the Bison documentation. Bug
10283 reported by Andrew Walrond.
10284
10285 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
10286 as the caller now does that.
10287 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
10288 (YYEMPTY): Parenthesize right hand side, since others use it.
10289 (yyparse): Don't assume that our generated code is the only code
10290 that sets yychar.
10291
102922002-12-13 Paul Eggert <eggert@twinsun.com>
10293
10294 Version 1.75d.
10295
10296 POSIX requires a "yacc" command.
10297 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
10298 (MOSTLYCLEANFILES): Add yacc.
10299 (yacc): New rule.
10300 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
10301 as an alias for bison y.
10302
10303 * po/LINGUAS: Add da.
10304
10305 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
10306 problem with latest <getopt.h>.
10307 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
10308
10309 * doc/fdl.texi: Upgrade to 1.2.
10310 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
10311 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
10312 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
10313 gnulib.
10314 * config/install-sh: Sync with autotools.
10315
10316 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
10317 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
10318 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
10319 locations are requested.
10320 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
10321 locations are requested.
10322
103232002-12-12 Paul Eggert <eggert@twinsun.com>
10324
10325 Remove unportable casts and storage allocation tricks.
10326 While we're at it, remove almost all casts, since they
10327 usually aren't needed and are a sign of trouble.
10328
10329 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
10330
10331 * src/derives.c (derives_compute): Do not subtract NTOKENS from
10332 the pointer DSET returned by malloc; this isn't portable.
10333 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
10334 Similarly for DERIVES.
10335 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
10336 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
10337 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
10338
10339 * src/derives.c (derives_compute): Do not bother invoking
10340 int_of_rule_number, since rule numbers are integers.
10341
10342 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
10343 rather than XMALLOC (char, N).
10344
10345 * src/files.c (filename_split): Rewrite to avoid cast.
10346
10347 * src/gram.h (symbol_number_as_item_number,
10348 item_number_as_symbol_number, rule_number_as_item_number,
10349 item_number_as_rule_number):
10350 Now inline functions rather than macros, to avoid casts.
10351 * src/state.h (state_number_as_int): Likewise.
10352 * src/tables.c (state_number_to_vector_number,
10353 symbol_number_to_vector_number): Likewise.
10354
10355 * src/gram.h (int_of_rule_number): Remove; no longer used.
10356
10357 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
10358 since the resulting storage is always stored into.
10359
10360 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
10361 where it's needed.
10362
10363 * src/muscle_tab.c (muscle_m4_output):
10364 Now inline. Return bool, not int.
10365 * src/state.c (state_compare): Likewise.
10366 * src/symtab.c (symbol_check_defined,
10367 symbol_check_alias_consistency, symbol_pack, symbol_translation,
10368 hash_compare_symbol, hash_symbol):
10369 Likewise.
10370 * src/uniqstr.c (uniqstr_print): Likewise.
10371 * src/muscle_tab.c (muscle_m4_output_processor):
10372 New function, to avoid casts.
10373 * src/state.c (state_comparator, stage_hasher): Likewise.
10374 * src/symtab.c (symbol_check_defined_processor,
10375 symbol_check_alias_consistency_processor, symbol_pack_processor,
10376 symbol_translation_processor, hash_symbol_comparator,
10377 hash_symbol_hasher): Likewise.
10378 * src/uniqstr.c (uniqstr_print_processor): Likewise.
10379 * src/muscle_tab.c (muscles_m4_output):
10380 Use new functions instead of casting old functions unportably.
10381 * src/state.c (state_hash_new): Likewise.
10382 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
10383 symbols_token_translations_init):
10384 Likewise.
10385 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
10386
10387 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
10388 var instead of casting to long, to avoid casts.
10389 (prepare_states): Use MALLOC rather than alloca, so that we don't
10390 have to worry about alloca.
10391 * src/state.c (state_hash_lookup): Likewise.
10392
10393 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
10394 local var instead of casting to unsigned char, to avoid casts.
10395
10396 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
10397 STATE_ALLOC): Remove.
10398 (transitions_new, errs_new, reductions_new, state_new): Use malloc
10399 rather than calloc, and use offsetof to avoid allocating slightly
10400 too much storage.
10401 (state_new): Initialize all members.
10402
10403 * src/state.c (state_hash): Use unsigned accumulator, not signed.
10404
10405 * src/symtab.c (symbol_free): Remove; unused.
10406 (symbol_get): Remove cast in lhs of assignment.
10407 (symbols_do): Now static. Accept generic arguments, not
10408 hashing-related ones.
10409
10410 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
10411 (symbol_processor): Remove.
10412 (symbols_do): Remove decl; now static.
10413
10414 * src/system.h (alloca): Remove; decl no longer needed.
10415 (<stddef.h>): Include, for offsetof.
10416 (<inttypes.>, <stdint.h>): Include if available.
10417 (uintptr_t): New type, if system lacks it.
10418 (CALLOC, MALLOC, REALLOC): New macros.
10419 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
10420 new macros.
10421
10422 * src/tables.c (table_size): Now int, to pacify GCC.
10423 (table_grow, table_ninf_remap): Use signed table size.
10424 (save_row): Don't bother initializing locals when not needed.
10425 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
10426 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
10427
10428 * src/vcg.h: Correct misspellings.
10429
10430 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
10431
10432
10433 * src/getargs.c (getargs): Don't assume EOF == -1.
10434
104352002-12-09 Paul Eggert <eggert@twinsun.com>
10436
10437 Change identifier spellings to avoid collisions with names
10438 that are reserved by POSIX.
10439
10440 Don't use names ending in _t, since POSIX reserves them.
10441 For consistency, remove _e and _s endings -- they're weren't
10442 needed to remove ambiguity. All uses changed.
10443 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
10444 turn was just renamed from struniq_t.
10445 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
10446 which in turn was just renamed from struniq_processor_t.
10447 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
10448 in turn was renamed from hash_compare_struniq_t.
10449 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
10450 (state_list): Renamed from state_list_t.
10451 * src/assoc.h (assoc): Renamed from assoc_t.
10452 * src/conflicts.c (enum conflict_resolution): Renamed from
10453 enum conflict_resolution_e.
10454 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
10455 (rule_list): Renamed from rule_list_t.
10456 * src/getargs.h (enum trace): Renamed from enum trace_e.
10457 (enum report): Renamed from enum report_e.
10458 * src/gram.h (item_number): Renamed from item_number_t.
10459 (rule_number): Renamed from rule_number_t.
10460 (struct rule_s): Remove the "rule_s" part; not used.
10461 (rule): Renamed from rule_t.
10462 (rule_filter): Renamed from rule_filter_t.
10463 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
10464 (goto_list): Renamed from goto_list_t.
10465 * src/lalr.h (goto_number): Renamed from goto_number_t.
10466 * src/location.h (location): Renamed from location_t.
10467 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
10468 and moved here from:
10469 * src/muscle_tab.h (muscle_entry_t): here.
10470 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
10471 (rule_list): Renamed from rule_list_t.
10472 * src/print_graph.c (static_graph): Renamed from graph.
10473 * src/reader.h (braced_code): Renamed from braced_code_t.
10474 Remove brace_code_e tag.
10475 * src/relation.h (relation_node): Renamed from relation_node_t.
10476 (relation_nodes): Renamed from relation_nodes_t.
10477 (relation): Renamed from relation_t.
10478 * src/state.h (state_number): Renamed from state_number_t.
10479 (struct state): Renamed from struct state_s.
10480 (state): Renamed from state_t.
10481 (transitions): Renamed from transitions_t. Unused (and
10482 misspelled) transtion_s tag removed.
10483 (errs): Renamed from errs_t. Unused errs_s tag removed.
10484 (reductions): Renamed from reductions_t. Unused tag
10485 reductions_s removed.
10486 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
10487 (struct symbol_list): Renamed from struct symbol_list_s.
10488 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
10489 (struct symbol): Renamed from struct symbol_s.
10490 (symbol): Renamed from symbol_t.
10491 * src/tables.c (vector_number): Renamed from vector_number_t.
10492 (action_number): Renamed from action_t.
10493 * src/tables.h (base_number): Renamed from base_t.
10494 * src/vcg.h (enum color): Renamed from enum color_e.
10495 (enum textmode): Renamed from enum textmode_e.
10496 (enum shape): Renamed from enum shape_e.
10497 (struct colorentry): Renamed from struct colorentry_s.
10498 (struct classname): Renamed from struct classname_s.
10499 (struct infoname): Renamed from struct infoname_s.
10500 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
10501 (enum decision): Renamed from enum decision_e.
10502 (enum orientation): Renamed from enum orientation_e.
10503 (enum alignment): Renamed from enum alignment_e.
10504 (enum arrow_mode): Renamed from enum arrow_mode_e.
10505 (enum crossing_type): Renamed from enum crossing_type_e.
10506 (enum view): Renamed from enum view_e.
10507 (struct node): Renamed from struct node_s.
10508 (node): Renamed from node_t.
10509 (enum linestyle): Renamed from enum linestyle_e.
10510 (enum arrowstyle): Renamed from enum arrowstyle_e.
10511 (struct edge): Renamed from struct edge.
10512 (edge): Renamed from edge_t.
10513 (struct graph): Renamed from struct graph_s.
10514 (graph): Renamed from graph_t.
10515 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
10516 Rename value_t -> value.
10517 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
10518 value_t_as_yystype -> value_as_yystype.
10519
10520 Don't include <errno.h> in the mainstream code, since it
10521 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
10522 * lib/get-errno.c, lib/get-errno.h: New files.
10523 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
10524 get-errno.c.
10525 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
10526 * src/output.c (output_skeleton): Likewise.
10527 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
10528 instead of errno.
10529 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
10530 Likewise.
10531 (handle_action_dollar, handle_action_at): Likewise.
10532 * src/system.h: Do not include <errno.h>.
10533 (TAB_EXT): Renamed from EXT_TAB.
10534 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
10535
10536 Avoid str[a-z]*, since <string.h> reserves that name space.
10537 Change all instances of "struniq" in names to "uniqstr", and
10538 likewise for "STRUNIQ" and "UNIQSTR".
10539 * src/uniqstr.c: Renamed from src/struniq.c.
10540 * src/uniqstr.h: Renamed from src/struniq.h.
10541 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
10542 * src/files.c (strsuffix): Remove; unused.
10543 (concat2): Renamed from stringappend. Now static.
10544 * src/files.h (strsuffix, stringappend): Remove; unused.
10545 * src/parse-gram.y (<chars>): Renamed from <string>.
10546 (<uniqstr>): Renamed from <struniq>.
10547 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
10548 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
10549 (struct graph_s.expand): Renamed from struct graph_s.stretch.
10550 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
10551 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
10552 (N_EXPAND): Renamed from N_STRETCH.
10553
10554 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
10555 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
10556 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
10557 Remove; unused.
10558 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
10559 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
10560 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
10561 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
10562 (BASE_MAXIMUM): Renamed from BASE_MAX.
10563 (BASE_MINIMUM): Renamed from BASE_MIN.
10564 (ACTION_MAX): Remove; unused.
10565 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
10566 Unnecessary casts removed from above defines.
10567
10568
10569 Fix misspelling in names.
10570 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
10571 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
10572 G_NODE_ALIGNEMENT.
10573
10574
10575 * lib/timevar.c (timevar_report): Renamed from time_report,
10576 for consistency with other names.
10577 * lib/timevar.h (timevar_report): New decl.
10578 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
10579
10580
10581 Sort include-file uses.
10582
10583 Reorder all include files under src to be in the order "system.h".
10584 then the ../lib include files in angle brackets (alphabetized),
10585 then the . include files in double-quotes (alphabetized). Fix
10586 dependency breakages encountered in this process, as follows:
10587 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
10588 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
10589 * src/state.h: Include "symtab.h".
10590
105912002-12-08 Paul Eggert <eggert@twinsun.com>
10592
10593 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
10594 since this causes problems when __file__ contains character
10595 sequences like "@" that are treated specially by src/scan-skel.l.
10596 Instead, just use the file's basename. This fixes the bug
10597 reported by Martin Mokrejs in
10598 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
10599
106002002-12-06 Paul Eggert <eggert@twinsun.com>
10601
10602 Add support for rules that do not have trailing semicolons, as
10603 POSIX requires. Improve the quality of locations in Bison
10604 diagnostics.
10605
10606 * src/location.c: Include <quotearg.h>.
10607 (empty_location): Now const.
10608 (location_print): New function. Follow the recommendation of the
10609 GNU Coding Standards for locations that span file boundaries.
10610 * src/location.h: Do not include <quotearg.h>; no longer needed.
10611 (boundary): New type.
10612 (location_t): Use it. This allows locations to span file boundaries.
10613 All member uses changed: file -> start.file or end.file (as needed),
10614 first_line -> start.line, first_column -> start.column,
10615 last_line -> end.line, last_column -> end.column.
10616 (equal_boundaries): New function.
10617 (LOCATION_RESET, LOCATION_STEP): Remove.
10618 (LOCATION_PRINT): Remove. All callers changed to use location_print.
10619 (empty_location): Now const.
10620 (location_print): New decl.
10621 * src/parse-gram.y (lloc_default): New function, which handles
10622 empty locations more accurately.
10623 (YYLLOC_DEFAULT): Use it.
10624 (%token COLON): Remove.
10625 (%token ID_COLON): New token.
10626 (rules): Use it.
10627 (declarations, rules): Remove trailing semicolon.
10628 (declaration, rules_or_grammar_declaration):
10629 Allow empty (";") declaration.
10630 (symbol_def): Remove empty actions; no longer needed.
10631 (rules_or_grammar_declaration): Remove trailing semicolon.
10632 (semi_colon.opt): Remove.
10633 * src/reader.h: Include location.h.
10634 (scanner_cursor): New decl.
10635 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
10636 rolling our own.
10637 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
10638 of *loc.
10639 (STEP): Remove. No longer needed, now that adjust_location does
10640 the work. All uses removed.
10641 (scanner_cursor): New var.
10642 (adjust_location): Renamed from extend_location. It now sets
10643 *loc and adjusts the scanner cursor. All uses changed.
10644 Don't bother testing for CR.
10645 (handle_syncline): Remove location arg; now updates scanner cursor.
10646 All callers changed.
10647 (unexpected_end_of_file): Now accepts start boundary of token or
10648 comment, not location. All callers changed. Update scanner cursor,
10649 not the location.
10650 (SC_AFTER_IDENTIFIER): New state.
10651 (context_state): Renamed from c_context. All uses changed.
10652 (id_loc, code_start, token_start): New local vars.
10653 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
10654 processing of Yacc white space and equivalents here.
10655 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
10656 instead of returning ID immediately, since we need to search for
10657 a subsequent colon.
10658 (<INITIAL>"'", "\""): Save token_start.
10659 (<INITIAL>"%{", "{", "%%"): Save code_start.
10660 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
10661 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
10662 BEGIN context_state at end, not INITIAL.
10663 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
10664 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
10665 Return correct token start.
10666 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
10667 the start of a character, string or multiline comment is found.
10668 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
10669 Reduction): Adjust reported locations to match the more-precise
10670 results now expected.
10671 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
10672 * tests/reduce.at (Useless Rules, Reduced Automaton,
10673 Underivable Rules): Likewise.
10674 * tests/regression.at (Invalid inputs): No longer `expecting ";"
10675 or "|"' now that so many other tokens are allowed by the new grammar.
10676
10677 * src/complain.h (current_file): Remove duplicate decl;
10678 current_file is now owned by files.h.
10679 * src/complain.c, src/scan-gram.l: Include files.h.
10680
106812002-12-06 Paul Eggert <eggert@twinsun.com>
10682
10683 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
10684 promotes to int; it might be unsigned int.
10685 * data/yacc.c (yy_reduce_print): Likewise.
10686
10687 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
10688 be #defined in the prologue, not in the Bison declarations.
10689 This fixes Debian Bug 102878, reported by Shaul Karl.
10690
106912002-12-02 Paul Eggert <eggert@twinsun.com>
10692
10693 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
10694 * lib/strtoul.c: New file, from gnulib.
10695 This fixes a porting bug reported by Peter Klein in
10696 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
10697
106982002-11-30 Paul Eggert <eggert@twinsun.com>
10699
10700 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
10701 and put only a forward declaration in the prologue. This is for
10702 consistency with the other scanner helper functions.
10703
10704 Type clashes now generate warnings, not errors, since it
10705 appears that POSIX may allow some grammars with type clashes.
10706 * src/reader.c (grammar_current_rule_check): Warn about
10707 type clashes instead of complaining.
10708 * tests/input.at (Type Clashes): Expect warnings, not complaints.
10709
10710 Add Yacc library, since POSIX requires it.
10711 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
10712 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
10713 * lib/main.c, lib/yyerror.c: New files.
10714
10715 gram_error can be static; it need not be extern.
10716 * src/reader.h (gram_error): Remove decl.
10717 * src/parse-gram.y (gram_error): Now static. Add static decl.
10718 (print_token_value): Omit parameter names from forward decl,
10719 for consistency.
10720
107212002-11-29 Paul Eggert <eggert@twinsun.com>
10722
10723 * doc/bison.texinfo: Emphasize that yylex and yyerror must
10724 be declared before being used. E.g., one should typically
10725 declare them in the prologue. Use GNU coding style in examples.
10726 Put "const" consistently after the type it modifies. Mention
10727 that C99 supports "inline". Mention that yyerror traditionally
10728 returns "int".
10729
10730 %parse-param and %lex-param now take just one argument, the
10731 declaration; the argument name is deduced from the declaration.
10732
10733 * doc/bison.texinfo (Parser Function, Pure Calling, Error
10734 Reporting, Table of Symbols): Document this.
10735 * src/parse-gram.y (add_param): New function.
10736 (COMMA): Remove.
10737 (declaration): Implement new rule for %parse-param and %lex-param.
10738 * src/scan-gram.l: "," now elicits a warning, rather than being
10739 a token; this is more compatible with byacc.
10740 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
10741
107422002-11-27 Paul Eggert <eggert@twinsun.com>
10743
10744 Rename identifiers to avoid real and potential collisions.
10745
10746 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
10747 to avoid collision with lex macro described by Bruce Lilly in
10748 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
10749 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10750 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
10751 * src/parse-gram.y (print_token_value): Renamed from yyprint.
10752 All uses changed.
10753 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
10754 The name "yycontrol" violates the name space rules, and this stuff
10755 wasn't being used anyway.
10756 (input): Remove action; this stuff wasn't being used.
10757 (gram_error): Rename local variable yylloc -> loc.
10758 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
10759 (YY_DECL): Don't use "yy" at start of local variables.
10760 All uses changed, e.g., yylloc -> loc.
10761 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
10762 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
10763 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
10764 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
10765
10766 * src/parse-gram.y (gram_error): loc is now const *.
10767 * src/reader.h (gram_error): Likewise.
10768
107692002-11-24 Paul Eggert <eggert@twinsun.com>
10770
10771 Version 1.75c.
10772
10773 * tests/actions.at (Actions after errors): Use an output format
10774 more similar to that of the Printers and Destructors test.
10775 Test the position of the ';' token too.
10776 (Printers and Destructors): Likewise.
10777 (Printers and Destructors: %glr-parser): Remove for now, to avoid
10778 unnecessarily alarming people when the test fails.
10779
10780 * data/yacc.c (yyerrlab1): Move this label down, so that the
10781 parser does not discard the lookahead token if the user code
10782 invokes YYERROR. This change is required for POSIX conformance.
10783
10784 * lib/error.c: Sync with gnulib.
10785
107862002-11-22 Paul Eggert <eggert@twinsun.com>
10787
10788 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
10789 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
10790 * lib/xmalloc.c: Likewise.
10791
107922002-11-20 Paul Eggert <eggert@twinsun.com>
10793
10794 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
10795
107962002-11-20 Paul Eggert <eggert@twinsun.com>
10797
10798 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
10799 should use `if (! x) abort ();' rather than `assert (x);', and
10800 anyway it's one less thing to worry about configuring.
10801
10802 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
10803 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
10804 and replace all instances of assert with abort.
10805 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10806 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
10807
10808 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
10809 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
10810 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
10811 hash_find_entry, hash_rehash, hash_insert): Likewise.
10812 * src/conflicts.c (resolve_sr_conflict): Likewise.
10813 * src/lalr.c (set_goto_map, map_goto): Likewise.
10814 * src/nullable.c (nullable_compute): Likewise.
10815 * src/output.c (prepare_rules, token_definitions_output): Likewise.
10816 * src/reader.c (packgram, reader): Likewise.
10817 * src/state.c (state_new, state_free, state_transitions_set,
10818 state_reduction_find): Likewise.
10819 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
10820 symbol_pack): Likewise.
10821 * src/tables.c (conflict_row, pack_vector): Likewise.
10822 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10823 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10824 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
10825 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
10826
10827 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
10828 (ARGMATCH_CONSTRAINT): New macro.
10829 (ARGMATCH_ASSERT): Use it.
10830
10831 * src/system.h (verify): New macro.
10832 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
10833 rather than assert.
10834 * src/tables.c (tables_generate): Likewise.
10835
10836 * src/struniq.c (struniq_assert): Now returns void, and aborts
10837 if the assertion is false.
10838 (struniq_assert_p): Remove.
10839 * src/struniq.h: Likewise.
10840
108412002-11-18 Paul Eggert <eggert@twinsun.com>
10842
10843 * data/glr.c (yygetLRActions): Replace `yyindex' with
10844 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
10845 This fixes the regression with Sun ONE Studio 7 cc that I reported in
10846 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
10847
108482002-11-18 Akim Demaille <akim@epita.fr>
10849
10850 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
10851 space.
10852 From Tim Van Holder.
10853
108542002-11-17 Paul Eggert <eggert@twinsun.com>
10855
10856 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10857 to "SyntaxError" for consistency with my 2002-11-15 change.
10858
10859 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10860 not define to {}, since this breaks the common use of `YYDPRINTF
10861 ((...));' if a single statement is desired (e.g. before `else').
10862 Work around GCC warnings by surrounding corresponding calls with
10863 {} if needed.
10864 (yyhasResolvedValue): Remove unused function.
10865 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10866 loop body.
10867 (yyreportSyntaxError): Renamed from yyreportParseError.
10868 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10869 All uses changed.
10870 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10871 extern when possible. Remove unused initializations.
10872
108732002-11-16 Akim Demaille <akim@epita.fr>
10874
10875 Augment the similarity between GLR and LALR traces.
10876
10877 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10878 (YY_REDUCE_PRINT): New.
10879 (yyparse): Use them.
10880 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10881 YYDPRINT here.
10882 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10883 state reached after the reduction/recovery, since...
10884 (yyparse, yyprocessOneStack): Report the state we are entering in.
10885
108862002-11-16 Akim Demaille <akim@epita.fr>
10887
10888 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10889 Add support for --trace=skeleton.
10890 * src/scan-skel.l: %option debug.
10891 Scan strings of non-@ or \n instead of character by character.
10892 (scan_skel): Handle trace_skeleton.
10893 (QPUTS): New.
10894 (@output_parser_name@, @output_header_name@): ``Restore'' their
10895 support (used to be M4 macros).
10896 * data/yacc.c: Quote larger chunks, a la glr.c.
10897 * data/lalr1.cc: Likewise.
10898 The header guards are no longer available, so use some other
10899 string than `YYLSP_NEEDED'.
10900
109012002-11-16 Akim Demaille <akim@epita.fr>
10902
10903 Make the ``Printers and Destructors'' test more verbose, taking
10904 `yacc.c''s behavior as (possibly wrong) reference.
10905
10906 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10907 instead of fprint on stdout.
10908 Set and report the last_line of the symbols.
10909 Consistently display values and locations.
10910
109112002-11-16 Paul Eggert <eggert@twinsun.com>
10912
10913 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10914
109152002-11-15 Paul Eggert <eggert@twinsun.com>
10916
10917 * tests/actions.at (Actions after errors): New test case.
10918
10919 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10920 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10921 tests/action.at, tests/calc.at, tests/conflicts.at,
10922 tests/cxx-type.at, tests/regression.at:
10923 "parse error" -> "syntax error" for POSIX compatibility.
10924 "parsing stack overflow..." -> "parser stack overflow" so
10925 that code matches Bison documentation.
10926
109272002-11-15 Akim Demaille <akim@epita.fr>
10928
10929 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10930 take two BRACED_CODE, not two string_content.
10931 Free the scanner's obstack when we are done.
10932 (code_content): New.
10933 * tests/calc.at: Adjust.
10934 * doc/bison.texinfo: Adjust.
10935 Also, make sure to include the `,' for these declarations.
10936
109372002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10938
10939 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10940 definition; avoids potential autoreconf problems.
10941
109422002-11-15 Akim Demaille <akim@epita.fr>
10943
10944 Always check the value returned by yyparse.
10945
10946 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10947 returned by yyparse.
10948 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10949 Adjust calls.
10950 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10951 returned by yyparse.
10952
109532002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10954
10955 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10956 on input.at test.
10957
109582002-11-14 Paul Eggert <eggert@twinsun.com>
10959
10960 * src/output.c (output_skeleton): Call xfopen instead of
10961 duplicating xfopen's body.
10962
10963 Fix bugs reported by Nelson H. F. Beebe in
10964 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
10965
10966 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10967 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10968 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10969 file twice in the grammar, as an extra check.
10970
10971 * tests/input.at (Torturing the Scanner): Surround the
10972 backslash-newline tests with "#if 0", to make it less likely that
10973 we'll run into compiler bugs. Bring back solitary \ inside
10974 comment, but add a closing comment to work around HP C bug. Don't
10975 test backslash-newline in C character constant.
10976
109772002-11-14 Akim Demaille <akim@epita.fr>
10978
10979 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10980 status of the compiler.
10981 Calling `exit 1' is no longer needed.
10982 Reported by Nelson H. F. Beebe.
10983
109842002-11-14 Akim Demaille <akim@epita.fr>
10985
10986 * tests/atlocal.in (CPPFLAGS): We have config.h.
10987 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10988 New.
10989 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10990 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10991 * tests/regression.at, tests/torture.at: Use them for all the
10992 grammars that are to be compiled.
10993 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10994 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10995 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10996
109972002-11-14 Akim Demaille <akim@epita.fr>
10998
10999 * doc/bison.texinfo: Various formatting changes (alignments in
11000 samples, additional @group/@end group, GCS in samples.
11001 Use @deffn instead of simple @table to define the directives,
11002 macros, variables etc.
11003
110042002-11-13 Paul Eggert <eggert@twinsun.com>
11005
11006 Fix some bugs reported by Albert Chin-A-Young in
11007 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
11008
11009 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
11010 -o c"; the HP C compiler chatters during compilation.
11011 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
11012 * tests/headers.at (export YYLTYPE): Likewise.
11013
11014 * tests/input.at (Torturing the Scanner): Remove lines containing
11015 solitary backslashes, as they tickle a bug in the HP C compiler.
11016
11017 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
11018 comments, since they're not portable. Use GNU coding style.
11019
110202002-11-13 Akim Demaille <akim@epita.fr>
11021
11022 * data/yacc.c: Leave bigger chunks of quoted text.
11023 (YYDSYMPRINTF): New.
11024 Use it to report symbol activities.
11025 * data/glr.c (YYDSYMPRINTF): New.
11026 Use it.
11027
110282002-11-12 Paul Eggert <eggert@twinsun.com>
11029
11030 Version 1.75b.
11031
11032 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
11033 (yyglrReduce): Return yyok, not 0.
11034 This should avoid the enumerated-type warnings reported
11035 by Nelson H. F. Beebe in
11036 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
11037
11038 * lib/bbitset.h (BITSET_INLINE): Remove.
11039 * lib/bitset.h [! BITSET_INLINE]: Remove.
11040 (bitset_set, bitset_reset, bitset_test): Rename local vars
11041 to avoid shadowing warnings by GCC.
11042
11043 * data/glr.c (inline): Remove #define. It's the user's
11044 responsibility to #define it away, just like 'const'.
11045 This fixes one of the bugs reported by Nelson H. F. Beebe in
11046 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
11047
11048 * Makefile.maint (po-check): Scan .l and .y files instead of the
11049 .c and the .h files that they generate. This fixes the bug
11050 reported by Tim Van Holder in:
11051 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
11052 Look for N_ as well as for _. Try to avoid matching #define for
11053 N_ and _.
11054 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
11055 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
11056 * src/scan-gram.l: Revamp regular expressions so that " and '
11057 do not confuse xgettext.
11058
11059 * src/struniq.h (struniq_new): Do not declare the return type
11060 to be 'const'; this violates the C standard.
11061 * src/struniq.c (struniq_new): Likewise.
11062
110632002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
11064
11065 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
11066 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
11067 linker.
11068
110692002-11-12 Akim Demaille <akim@epita.fr>
11070
11071 * Makefile.maint: Sync with Autoconf:
11072 (local_updates): New.
11073
110742002-11-12 Akim Demaille <akim@epita.fr>
11075
11076 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
11077
110782002-11-12 Akim Demaille <akim@epita.fr>
11079
11080 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
11081 locations.
11082
110832002-11-12 Akim Demaille <akim@epita.fr>
11084
11085 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
11086 not yyvalue.
11087
110882002-11-12 Akim Demaille <akim@epita.fr>
11089
11090 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
11091 Use it to test the GLR parser.
11092
110932002-11-12 Akim Demaille <akim@epita.fr>
11094
11095 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
11096 defines it.
11097 * data/glr.c (yystos): New.
11098 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
11099 (YYDSYMPRINT): New.
11100 (yyval): Don't define it, it is handled via M4.
11101 (yyrecoverParseError): Free verbosely the discarded symbols.
11102 * data/yacc.c (yysymprint): Remove, rather...
11103 (b4_yysymprint_generate): invoke.
11104 * data/c.m4 (b4_yysymprint_generate): New.
11105 Accept pointers as arguments, as opposed to the version from
11106 yacc.c.
11107 (b4_yydestruct_generate): Likewise.
11108 * tests/cations.at (Printers and Destructors): Use Bison directives
11109 instead of CPP macros.
11110 Don't rely on internal details.
11111
111122002-11-12 Akim Demaille <akim@epita.fr>
11113
11114 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
11115 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
11116 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
11117 it against YYEMPTY and so forth), work on yytoken (i.e., set
11118 it to YYEMPTY etc.).
11119 (yydestruct): Replace with a b4_yydestruct_generate invocation.
11120 (b4_symbol_actions): Remove.
11121 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
11122 for 0, end-of-input.
11123
111242002-11-12 Akim Demaille <akim@epita.fr>
11125
11126 * doc/bison.texinfo (Destructor Decl): New.
11127
111282002-11-12 Akim Demaille <akim@epita.fr>
11129
11130 * src/tables.c (tables_generate): Use free for pointers that
11131 cannot be NULL, not XFREE.
11132 (pack_vector): Use assert, not fatal, for bound violations.
11133 * src/state.c (state_new): Likewise.
11134 * src/reader.c (reader): Likewise.
11135 * src/lalr.c (set_goto_map): Likewise.
11136 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
11137 the file name.
11138
111392002-11-12 Akim Demaille <akim@epita.fr>
11140
11141 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
11142 Restore.
11143 * src/scan-gram.l (last_string): Is global to the file, not to
11144 yylex.
11145 * src/parse-gram.y (input): Don't append the epilogue here,
11146 (epilogue.opt): do it here, and free the scanner's obstack.
11147 * src/reader.c (epilogue_set): Rename as...
11148 (epilogue_augment): this.
11149 * data/c.m4 (b4_epilogue): Defaults to empty.
11150
111512002-11-12 Akim Demaille <akim@epita.fr>
11152
11153 * src/getargs.c (long_options): Remove duplicates.
11154 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
11155 Remove.
11156 * doc/bison.rnh: Remove.
11157 * doc/bison.texinfo (VMS Invocation): Remove.
11158
111592002-11-12 Akim Demaille <akim@epita.fr>
11160
11161 * src/struniq.h, src/struniq.c (struniq_t): Is const.
11162 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
11163
11164 Use struniq for symbols.
11165
11166 * src/symtab.h (symbol_t): The tag member is a struniq.
11167 (symbol_type_set): Adjust.
11168 * src/symtab.c (symbol_new): Takes a struniq.
11169 (symbol_free): Don't free the tag member.
11170 (hash_compare_symbol_t, hash_symbol_t): Rename as...
11171 (hash_compare_symbol, hash_symbol): these.
11172 Use the fact that tags as struniqs.
11173 (symbol_get): Use struniq_new.
11174 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
11175 Returns a strniq.
11176 * src/reader.h (merger_list, grammar_currentmerge_set): The name
11177 and type members are struniqs.
11178 * src/reader.c (get_merge_function)
11179 (grammar_current_rule_merge_set): Adjust.
11180 (TYPE, current_type): Are struniq.
11181
11182 Use struniq for file names.
11183
11184 * src/files.h, src/files.c (infile): Split into...
11185 (grammar_file, current_file): these.
11186 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
11187 * src/reduce.c (reduce_print): Likewise.
11188 * src/getargs.c (getargs): Likewise.
11189 * src/complain.h, src/complain.c: Likewise.
11190 * src/main.c (main): Call struniqs_new early enough to use it for
11191 file names.
11192 Don't free the input file name.
11193
111942002-11-12 Akim Demaille <akim@epita.fr>
11195
11196 * src/symtab.c (symbol_free): Remove dead deactivated code:
11197 type_name are properly removed.
11198 Don't use XFREE to free items that cannot be NULL.
11199 * src/struniq.h, src/struniq.c: New.
11200 * src/main.c (main): Initialize/free struniqs.
11201 * src/parse-gram.y (%union): Add astruniq member.
11202 (yyprint): Adjust.
11203 * src/scan-gram.l (<{tag}>): Return a struniq.
11204 Free the obstack bit that used to store it.
11205 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
11206
112072002-11-11 Paul Eggert <eggert@twinsun.com>
11208
11209 Revamp to fix many (but not all) of the C- and M4-related quoting
11210 problems. Among other things, this fixes the Bison bug reported
11211 by Jan Hubicka when processing the Bash grammar; see:
11212 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
11213
11214 Use new @ escapes consistently. Represent brackets with @{ and @}
11215 rather than @<:@ and @:>@, since this works a bit better with dumb
11216 editors like vi. Represent @ with @@, since @ is now consistently
11217 an escape. Use @oline@ and @ofile@ rather than __oline__ and
11218 __ofile__, to avoid unexpected expansions. Similarly, use @output
11219 rather than #output.
11220
11221 * data/c.m4 (b4_copyright): Omit file name from comment, since
11222 the file name could contain "*/".
11223 (b4_synclines_flag): Don't quote the 2nd argument; it should already
11224 be quoted. All uses changed.
11225
11226 * data/glr.c: Use new @ escapes consistently.
11227 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
11228 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
11229 Remove, since they couldn't handle arbitrary characters in file
11230 names.
11231 * data/lalr1.cc: Likewise.
11232 * data/yacc.c: Likewise.
11233
11234 * src/files.c (output_infix): Remove; all uses removed.
11235 * src/files.h: Likewise.
11236
11237 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
11238 mishandled funny characters in file names, and anyway it isn't
11239 needed any more.
11240 * data/yacc.c: Likewise.
11241 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
11242
11243 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
11244 * data/yacc.c: Likewise.
11245
11246 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
11247 strings now.
11248 (muscle_init): Quote filename as a C string.
11249 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
11250 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
11251 * src/output.c (escaped_file_name_output): New function.
11252 (prepare_symbols): Quote tokens for M4.
11253 (prepare): Don't insert output_infix, output_prefix,
11254 output_parser_name, output_header_name; this is now down by scan-skel.
11255 Insert skeleton as a C string.
11256
11257 * src/output.c (user_actions_output, symbol_destructors_output,
11258 symbol_printers_output): Quote filenames for C and M4.
11259 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11260
11261 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
11262 escapes other than \\ and \'; this simplifies the code.
11263 (<SC_STRING>): Likewise, for \\ and \".
11264 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
11265 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
11266 Use new escapes @{ and @} for [ and ].
11267
11268 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
11269 them with auto vars.
11270 Switch to new escape scheme, where @ is the escape character uniformly.
11271 Abort if a stray escape character is found. Avoid unbounded input
11272 buffer when parsing non-escaped text.
11273
11274 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
11275 __oline__, #output, $@, and @{ do not have unintended meanings.
11276
112772002-11-09 Paul Eggert <eggert@twinsun.com>
11278
11279 Fix the test failure due to GCC warnings described in
11280 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
11281 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
11282 evaluate to 0 if it's impossible for NINF to be in the respective
11283 table.
11284 (yygetLRActions, yyrecoverParseError): Use them.
11285
11286 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
11287 counted in the token inserted at end of file. Now takes
11288 location_t *, not location_t, so that the location can be
11289 adjusted. All uses changed.
11290
11291 * tests/regression.at (Invalid inputs): Adjust wording in
11292 diagnostic to match the new behavior.
11293
11294 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
11295 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
11296 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
11297 abort ();'. This reduces the runtime of the "Many lookaheads"
11298 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
11299 GCC 3.2.
11300
113012002-11-07 Paul Eggert <eggert@twinsun.com>
11302
11303 * src/parse-gram.y (CHARACTER): Remove unused token.
11304 All uses removed.
11305
11306 * src/scan-gram.l: Remove stack option. We no longer use the
11307 stack, since the stack was never deeper than 1; instead, use the
11308 new auto var c_context to record the stacked value.
11309
11310 Remove nounput option. At an unexpected end of file, we now unput
11311 the minimal input necessary to end cleanly; this simplifies the
11312 code.
11313
11314 Avoid unbounded token sizes where this is easy.
11315
11316 (unexpected_end_of_file): New function.
11317 Use it to systematize the error message on unexpected EOF.
11318 (last-string): Now auto, not static.
11319 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
11320 (scanner_last_string_free): Remove; not used.
11321 (percent_percent_count): Move decl to just before use.
11322 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
11323 not the (never otherwised-used) CHARACTER.
11324
113252002-11-07 Akim Demaille <akim@epita.fr>
11326
11327 Let yyerror always receive the msg as last argument, so that
11328 yyerror can be variadic.
11329
11330 * data/yacc.c (b4_yyerror_args): New.
11331 Use it when calling yyerror.
11332 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
11333 Use it when calling yyerror.
11334 * doc/bison.texinfo (Error Reporting): Adjust.
11335 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
11336 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
11337
113382002-11-06 Akim Demaille <akim@epita.fr>
11339
11340 #line should have quoted strings.
11341 Ideally, this should be done by m4_quotearg.
11342
11343 * src/scan-skel.l: Include quotearg.h.
11344 Quote __ofile__.
11345 * src/output.c (symbol_printers_output)
11346 (symbol_destructors_output): Quote the file name.
11347
113482002-11-06 Akim Demaille <akim@epita.fr>
11349
11350 * tests/regression.at (Invalid inputs): Adjust to the recent
11351 messages.
11352
113532002-11-06 Akim Demaille <akim@epita.fr>
11354
11355 Restore --no-lines.
11356 Reported by Jim Kent.
11357
11358 * data/c.m4 (b4_syncline): New.
11359 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
11360 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
11361 * src/output.c (user_actions_output): Likewise.
11362 (prepare): Define 'b4_synclines_flag'.
11363 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
11364
113652002-11-06 Akim Demaille <akim@epita.fr>
11366
11367 * src/main.c (main): Free `infile'.
11368 * src/scan-gram.l (handle_syncline): New.
11369 Recognize `#line'.
11370 * src/output.c (user_actions_output, symbol_destructors_output)
11371 (symbol_printers_output): Use the location's file name, not
11372 infile.
11373 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11374
113752002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11376
11377 * src/tables.c (matching_state): Don't allow states to match if
11378 either has GLR conflict entries.
11379
113802002-11-05 Paul Eggert <eggert@twinsun.com>
11381
11382 * src/scan-gram.l: Use more accurate diagnostics, e.g.
11383 "integer out of range" rather than "invalid value".
11384 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
11385 accordingly.
11386
11387 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
11388 Also, remove one static variable in the scanner.
11389
11390 * src/scan-gram.l (braces_level): Now auto, not static.
11391 Initialize to zero if the compiler is being picky.
11392 (INITIAL): Clear braces_level instead of incrementing it.
11393 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
11394 as POSIX 1003.1-2001 requires.
11395 * src/system.h (IF_LINT): New macro, taken from coreutils.
11396 * configure.ac: Define "lint" if --enable-gcc-warnings.
11397
113982002-11-05 Akim Demaille <akim@epita.fr>
11399
11400 * src/scan-gram.l: When it starts with `%', complain about the
11401 whole directive, not just that `invalid character: %'.
11402
114032002-11-04 Akim Demaille <akim@epita.fr>
11404
11405 * Makefile.maint: Update from Autoconf.
11406 (update, cvs-update, po-update, do-po-update): New.
11407
114082002-11-04 Akim Demaille <akim@epita.fr>
11409
11410 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
11411 and yyerror.
11412 Have yyerror `use' its arguments.
11413 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
11414 returns true when location & yacc & pure & parse-param.
11415 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
11416
114172002-11-04 Akim Demaille <akim@epita.fr>
11418
11419 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
11420 clashes.
11421 * src/scan-gram.l: Use [\'] instead of ['] to pacify
11422 font-lock-mode.
11423 Use complain_at.
11424 Use quote, not quote_n since LOCATION_PRINT no longer uses the
11425 slot 0.
11426
114272002-11-03 Paul Eggert <eggert@twinsun.com>
11428
11429 * src/reader.c (get_merge_function, grammar_current_rule_check):
11430 Use consistent diagnostics for reporting type name clashes.
11431 Quote the types with <>, for consistency with Yacc.
11432 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
11433
114342002-11-03 Akim Demaille <akim@epita.fr>
11435
11436 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
11437 New.
11438 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
11439 (b4_parse_param): Remove.
11440 Use b4_identification.
11441 Propagate b4_pure_args where needed to pass them to yyerror.
11442 * data/glr.m4 (b4_parse_param): Remove.
11443 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
11444 (b4_lpure_formals): New.
11445 Use b4_identification.
11446 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
11447 b4_user_formals and b4_user_args.
11448 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
11449 (yyreportAmbiguity): When using a pure parser, also need
11450 the location, and the parse-params.
11451 Adjust callers.
11452 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
11453 When using a pure parser, also need the parse-params.
11454 Adjust callers.
11455 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
11456 (%pure-parser + %parse-param) LALR and GLR parsers.
11457 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
11458 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
11459 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
11460 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
11461 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
11462 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
11463 * doc/bison.texinfo: Untabify the whole file.
11464 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
11465 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
11466 (Error Reporting): Adjust to these new directives.
11467 Document %error-verbose, deprecate YYERROR_VERBOSE.
11468
114692002-11-03 Akim Demaille <akim@epita.fr>
11470
11471 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
11472 AT_CHECK_CALC_GLR invocations to use % directives, instead of
11473 command line options.
11474 * tests/cxx-type.at: Formatting changes.
11475
114762002-11-03 Paul Eggert <eggert@twinsun.com>
11477
11478 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
11479 to count columns correctly, and to check for invalid inputs.
11480
11481 Use mbsnwidth to count columns correctly. Account for tabs, too.
11482 Include mbswidth.h.
11483 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
11484 (extend_location): New function.
11485 (YY_LINES): Remove.
11486
11487 Handle CRLF in C code rather than in Lex code.
11488 (YY_INPUT): New macro.
11489 (no_cr_read): New function.
11490
11491 Scan UCNs, even though we don't fully handle them yet.
11492 (convert_ucn_to_byte): New function.
11493
11494 Handle backslash-newline correctly in C code.
11495 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
11496 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
11497 all uses changed.
11498 (tag, splice): New EREs. Do not allow NUL or newline in tags.
11499 Use {splice} wherever C allows backslash-newline.
11500 YY_STEP after space, newline, vertical-tab.
11501 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
11502
11503 (letter, id): Don't assume ASCII; e.g., spell out a-z.
11504
11505 ({int}, handle_action_dollar, handle_action_at): Check for integer
11506 overflow.
11507
11508 (YY_STEP): Omit trailing semicolon, so that it's more like C.
11509
11510 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
11511 as well as \000. Check for UCHAR_MAX, not 255.
11512 Allow \x with an arbitrary positive number of digits, as in C.
11513 Check for overflow here.
11514 Allow \? and UCNs, for compatibility with C.
11515
11516 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
11517 with quote slot used by complain_at.
11518
11519 * tests/input.at: Add tests for backslash-newline, m4 quotes
11520 in symbols, long literals, and funny escapes in strings.
11521
11522 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
11523 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
11524 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
11525 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
11526 * m4/mbswidth.m4: New file, from GNU coreutils.
11527
11528 * doc/bison.texinfo (Grammar Outline): Document // comments.
11529 (Symbols): Document that trigraphs have no special meaning in Bison,
11530 nor is backslash-newline allowed.
11531 (Actions): Document that trigraphs have no special meaning.
11532
11533 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
11534 no longer used.
11535
115362002-11-02 Paul Eggert <eggert@twinsun.com>
11537
11538 * src/reader.c: Don't include quote.h; not needed.
11539 (get_merge_function): Reword warning to be consistent with
11540 type clash diagnostic in grammar_current_rule_check.
11541
11542 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
11543 bug in trigraph handling.
11544
11545 * src/output.c (prepare_symbols): When printing token names,
11546 escape "[" as "@<:@" and likewise for "]".
11547
11548 * src/system.h (errno): Remove declaration, as we are now
11549 assuming C89 or better, and C89 guarantees errno.
11550
115512002-10-30 Paul Eggert <eggert@twinsun.com>
11552
11553 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
11554 Check for close failures.
11555 * src/files.h (xfclose): Return void, not int, since it always
11556 returned zero.
11557 * src/files.c (xfclose): Likewise. Report I/O error if ferror
11558 indicates one.
11559 * src/output.c (output_skeleton): Use xfclose rather than fclose
11560 and ferror. xfclose now checks ferror.
11561
11562 * data/glr.c (YYLEFTMOST_STATE): Remove.
11563 (yyreportTree): Use a stack-based leftmost state. This avoids
11564 our continuing battles with bogus warnings about initializers.
11565
115662002-10-30 Akim Demaille <akim@epita.fr>
11567
11568 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
11569 #if.
11570
115712002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11572
11573 * tests/glr-regr1.at: New test for reported regressions.
11574 * tests/testsuite.at: Add glr-regr1.at test.
11575 * tests/Makefile.am: Add glr-regr1.at test.
11576
115772002-10-24 Paul Eggert <eggert@twinsun.com>
11578
11579 Version 1.75a.
11580
11581 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
11582 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
11583 we use malloc. Don't assume 'A' through 'Z' are contiguous.
11584 Don't assume strdup exists; POSIX says its an XSI extension.
11585 Check for buffer overflow on input.
11586
115872002-10-24 Akim Demaille <akim@epita.fr>
11588
11589 * src/output.c (output_skeleton): Don't disable M4sugar comments
11590 too soon: it results in comments being expanded.
11591 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
11592 first output.
11593
115942002-10-24 Akim Demaille <akim@epita.fr>
11595
11596 * data/yacc.c (m4_int_type): New.
11597 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
11598 char' as only yacc.c wants K&R portability.
11599 * data/glr.c (yysigned_char): Remove.
11600 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
11601 Reported by Quoc Peyrot.
11602
116032002-10-23 Paul Eggert <eggert@twinsun.com>
11604
11605 * src/main.c (main): With --trace=time, report times even if a
11606 non-fatal error occurs. Formerly, the times were reported in some
11607 such cases but not in others.
11608 * src/reader.c (reader): Just return if a complaint has been issued,
11609 instead of exiting, so that 'main' can report times.
11610
116112002-10-22 Akim Demaille <akim@epita.fr>
11612
11613 * src/system.h: Include sys/types.
11614 Reported by Bert Deknuydt.
11615
116162002-10-23 Paul Eggert <eggert@twinsun.com>
11617
11618 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
11619 Suggested by Art Haas.
11620
116212002-10-22 Paul Eggert <eggert@twinsun.com>
11622
11623 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
11624 decl; not needed any more.
11625 * src/main.c (main): Use return to exit, undoing yesterday's change.
11626 The last OS that we could find where this wouldn't work is
11627 SunOS 3.5, and that's too old to worry about now.
11628
11629 * data/glr.c (struct yyltype): Define members even when not
11630 doing locations. This is more consistent with yacc.c, and it
11631 works around the following bug reports:
11632 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
11633 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
11634
11635 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
11636 @acronym consistently. Standardize on "Yacc" instead of "YACC",
11637 "Algol" instead of "ALGOL". Give a bit more history about BNF.
11638
116392002-10-22 Akim Demaille <akim@epita.fr>
11640
11641 * data/README: New.
11642
116432002-10-21 Paul Eggert <eggert@twinsun.com>
11644
11645 Be consistent about 'bool'; the old code used an enum in one
11646 module and an int in another, and this violates the C standard.
11647 * m4/stdbool.m4: New file, from coreutils 4.5.3.
11648 * configure.ac (AC_HEADER_STDBOOL): Add.
11649 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
11650 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
11651 * src/symtab.c (hash_compare_symbol_t): Likewise.
11652 * src/system.h (bool, false, true): Use a definition consistent
11653 with ../lib/hash.c. All uses changed.
11654
11655 * src/complain.c (warning_issued): Renamed from warn_message_count,
11656 so that we needn't worry about integer overflow (!).
11657 Now of type bool. All uses changed.
11658 (complaint_issued): Renamed from complain_message_count; likewise.
11659
11660 * src/main.c (main): Use exit to exit with failure.
11661
11662 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
11663 rather than 1 and 0.
11664 * src/main.c (main): Likewise.
11665 * src/getargs.c (getargs): Likewise.
11666 * src/reader.c (reader): Likewise.
11667
11668 * src/getarg.c (getargs): Remove duplicate code for
11669 "Try `bison --help'".
11670
11671 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
11672 What was that "2" for?
11673
11674 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
11675 * src/getargs.c (usage): Likewise.
11676
11677 * src/getargs.c (getargs): When there are too few operands, report
11678 the last one. When there are too many, report the first extra
11679 one. This is how diffutils does it.
11680
116812002-10-20 Paul Eggert <eggert@twinsun.com>
11682
11683 Remove K&R vestiges.
11684 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
11685 * src/complain.c (VA_START): Remove. Assume prototypes.
11686 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
11687 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
11688 fatal): Assume prototypes.
11689 * src/complain.h: Assume prototypes.
11690 * src/system.h (PARAMS): Remove.
11691 Include <limits.h> unconditionally, since it's guaranteeed even
11692 for a freestanding C89 compiler.
11693 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
11694 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
11695
116962002-10-20 Akim Demaille <akim@epita.fr>
11697
11698 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
11699 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
11700 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
11701 (yyresolveStates, yyresolveAction, yyresolveStack)
11702 (yyprocessOneStack): Use them.
11703 (yy_reduce_print): New.
11704 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
11705
117062002-10-20 Akim Demaille <akim@epita.fr>
11707
11708 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
11709 arguments and output `void'.
11710 (b4_c_function): Rename as...
11711 (b4_c_function_def): this.
11712 (b4_c_function_decl, b4_c_ansi_function_def)
11713 (b4_c_ansi_function_decl): New.
11714 Change the interpretation of the arguments: before `int, foo', now
11715 `int foo, foo'.
11716 * data/yacc.c (yyparse): Prototype and define thanks to these.
11717 Adjust b4_c_function_def uses.
11718 * data/glr.c (yyparse): Likewise, but ANSI only.
11719
117202002-10-20 Akim Demaille <akim@epita.fr>
11721
11722 * src/output.c (prepare): Move the definition of `tokens_number',
11723 `nterms_number', `undef_token_number', `user_token_number_max'
11724 to...
11725 (prepare_tokens): Here.
11726 (prepare_tokens): Rename as...
11727 (prepare_symbols): this.
11728 (prepare): Move the definition of `rules_number' to...
11729 (prepare_rules): here.
11730 (prepare): Move the definition of `last', `final_state_number',
11731 `states_number' to...
11732 (prepare_states): here.
11733 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
11734
117352002-10-20 Akim Demaille <akim@epita.fr>
11736
11737 * src/tables.h, src/tables.c, src/output.c: Comment changes.
11738
117392002-10-20 Akim Demaille <akim@epita.fr>
11740
11741 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
11742 * data/c.m4: here.
11743
117442002-10-20 Akim Demaille <akim@epita.fr>
11745
11746 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
11747 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
11748 `pair'.
11749 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
11750 `name' to...
11751 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
11752 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
11753 These.
11754
117552002-10-19 Paul Eggert <eggert@twinsun.com>
11756
11757 Do not create a temporary file, as that involves security and
11758 cleanup headaches. Instead, use a pair of pipes.
11759 Derived from a suggestion by Florian Krohm.
11760 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
11761 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
11762 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
11763 (BISON_PREREQ_SUBPIPE): Add.
11764 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
11765 Add subpipe.h, subpipe.c.
11766 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
11767 * po/POTFILES.in: Add lib/subpipe.c.
11768 * src/output.c: Include "subpipe.h".
11769 (m4_invoke): Remove decl.
11770 (scan_skel): New decl.
11771 (output_skeleton): Use pipe rather than temporary file for m4 input.
11772 Check that m4sugar.m4 is readable, to avoid deadlock.
11773 Check for pipe I/O error.
11774 * src/scan-skel.l (readpipe): Remove decl.
11775 (scan_skel): New function, to be used in place of m4_invoke.
11776 Read from stream rather than file.
11777
11778 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
11779 float, as this generates a warning on Solaris 8 + GCC 3.2 with
11780 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
11781 this generates a more-accurate value anyway.
11782
11783 * lib/timevar.c (timervar_accumulate): Rename locals to
11784 avoid confusion with similarly-named more-global.
11785 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
11786
11787 * src/output.c (prepare): Use xstrdup to convert char const *
11788 to char *, to avoid GCC warning.
11789
117902002-10-19 Akim Demaille <akim@epita.fr>
11791
11792 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
11793 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
11794 Use them to have `calc.y' ready for %pure-parser.
11795 * data/yacc.c (YYLEX): Pass a yylex return type to
11796 b4_c_function_call.
11797
117982002-10-19 Akim Demaille <akim@epita.fr>
11799
11800 Prototype support of %lex-param and %parse-param.
11801
11802 * src/parse-gram.y: Add the definition of the %lex-param and
11803 %parse-param tokens, plus their rules.
11804 Drop the `_' version of %glr-parser.
11805 Add the "," token.
11806 * src/scan-gram.l (INITIAL): Scan them.
11807 * src/muscle_tab.c: Comment changes.
11808 (muscle_insert, muscle_find): Rename `pair' as `probe'.
11809 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
11810 (muscle_entry_s): The `value' member is no longer const.
11811 Adjust all dependencies.
11812 * src/muscle_tab.c (muscle_init): Adjust: use
11813 MUSCLE_INSERT_STRING.
11814 Initialize the obstack earlier.
11815 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
11816 (muscle_pair_list_grow): New.
11817 * data/c.m4 (b4_c_function_call, b4_c_args): New.
11818 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
11819 * tests/calc.at: Use %locations, not --locations.
11820 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
11821
118222002-10-19 Akim Demaille <akim@epita.fr>
11823
11824 * src/getargs.c (usage): Take status as argument and exit
11825 accordingly.
11826 Report the traditional `Try ... --help' message when status != 0.
11827 (usage, version): Don't take a FILE * as arg, it is pointless.
11828 (getargs): When there is an incorrect number of arguments, make it
11829 an error, and report it GNUlically thanks to `usage ()'.
11830
118312002-10-18 Paul Eggert <eggert@twinsun.com>
11832
11833 * data/glr.c (yyreportParseError): Don't assume that sprintf
11834 yields the length of the printed string, as this is not true
11835 on SunOS 4.1.4. Reported by Peter Klein.
11836
11837 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
11838 * tests/conflicts.at (%nonassoc and eof): Likewise.
11839 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
11840
118412002-10-17 Akim Demaille <akim@epita.fr>
11842
11843 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
11844 * src/getargs.c (trace_types, trace_args): Adjust.
11845 * src/reader.c (grammar_current_rule_prec_set)
11846 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
11847 Standardize error messages.
11848 And s/@prec/%prec/!
11849 (reader): Use trace_flag to enable scanner/parser debugging,
11850 instead of an adhoc scheme.
11851 * src/scan-gram.l: Remove trailing debugging code.
11852
118532002-10-16 Paul Eggert <eggert@twinsun.com>
11854
11855 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11856 MUSCLE_TAB_H.
11857
11858 * NEWS: Officially drop support for building Bison with K&R C,
11859 since it didn't work anyway and it's not worth worrying about.
11860 * Makefile.maint (wget_files): Remove ansi2knr.c.
11861 (ansi2knr.c-url_prefix): Remove.
11862 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11863 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11864 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11865
118662002-10-15 Paul Eggert <eggert@twinsun.com>
11867
11868 Stop using the "enum_" trick for K&R-style function definitions;
11869 it confused me, and I was the author! Instead, assume that people
11870 who want to use K&R C compilers (when using these modules in GCC,
11871 perhaps?) will run ansi2knr.
11872
11873 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11874 All uses of "enum_" changed to "enum ".
11875 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11876 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11877
11878 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11879 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11880 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11881 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11882 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11883 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11884 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11885 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11886 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11887 Use function prototypes; this removes the need for declaring
11888 static functions simply to provide their prototypes.
11889 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11890 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11891 bitset_count_, bitset_create, bitset_dump, bitset_first,
11892 bitset_free, bitset_init, bitset_last, bitset_next,
11893 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11894 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11895 bitset_print, bitset_release_memory, bitset_toggle_,
11896 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11897 debug_bitset): Likewise.
11898 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11899 * lib/bitset_stats.c (bitset_log_histogram_print,
11900 bitset_percent_histogram_print, bitset_stats_and,
11901 bitset_stats_and_cmp, bitset_stats_and_or,
11902 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11903 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11904 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11905 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11906 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11907 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11908 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11909 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11910 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11911 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11912 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11913 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11914 bitset_stats_zero): Likewise.
11915 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11916 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11917 bitsetv_dump, debug_bitsetv): Likewise.
11918 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11919 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11920 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11921 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11922 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11923 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11924 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11925 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11926 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11927 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11928 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11929 Likewise.
11930 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11931 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11932 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11933 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11934 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11935 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11936 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11937 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11938 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11939 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11940 lbitset_xor_cmp, lbitset_zero): Likewise.
11941
119422002-10-14 Akim Demaille <akim@epita.fr>
11943
11944 Version 1.75.
11945
119462002-10-14 Akim Demaille <akim@epita.fr>
11947
11948 * tests/Makefile.am (maintainer-check-posix): New.
11949
119502002-10-14 Akim Demaille <akim@epita.fr>
11951
11952 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11953 member.
11954
119552002-10-14 Akim Demaille <akim@epita.fr>
11956
11957 * src/tables.c (table_ninf_remap): base -> tab.
11958 Reported by Matt Rosing.
11959
119602002-10-14 Paul Eggert <eggert@twinsun.com>
11961
11962 * tests/action.at, tests/calc.at, tests/conflicts.at,
11963 tests/cxx-type.at, tests/headers.at, tests/input.at,
11964 tests/regression.at, tests/synclines.at, tests/torture.at:
11965 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11966 so that the tests still work even if POSIXLY_CORRECT is set.
11967 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
11968
11969 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11970 for portability to K&R hosts. Fix typo: signed char is guaranteed
11971 only to 127, not to 128.
11972 * data/glr.c (yysigned_char): New type.
11973 * data/yacc.c (yysigned_char): Likewise.
11974 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11975
119762002-10-13 Paul Eggert <eggert@twinsun.com>
11977
11978 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11979 true due to limited range of data type" warning from GCC.
11980
11981 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11982 by wrapping enum yytokentype's definition inside #ifndef
11983 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11984
119852002-10-13 Akim Demaille <akim@epita.fr>
11986
11987 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11988 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11989
119902002-10-13 Akim Demaille <akim@epita.fr>
11991
11992 * Makefile.maint: Update from Autoconf 2.54.
11993 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11994
119952002-10-13 Akim Demaille <akim@epita.fr>
11996
11997 * src/print.c (print_state): Separate the list of solved conflicts
11998 from the other items.
11999 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
12000
120012002-10-13 Akim Demaille <akim@epita.fr>
12002
12003 Let nondeterministic skeletons be usable with deterministic
12004 tables.
12005
12006 With the patch, GAWK compiled by GCC without -O2 passes its test
12007 suite using a GLR parser driven by LALR tables. It fails with -O2
12008 because `struct stat' gives two different answers on my machine:
12009 88 (definition of an auto var) and later 96 (memset on this var).
12010 Hence the stack is badly corrumpted. The headers inclusion is to
12011 blame: if I move the awk.h inclusion before GLR's system header
12012 inclusion, the two struct stat have the same size.
12013
12014 * src/tables.c (pack_table): Always create conflict_table.
12015 (token_actions): Always create conflict_list.
12016 * data/glr.c (YYFLAG): Remove, unused.
12017
120182002-10-13 Akim Demaille <akim@epita.fr>
12019
12020 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
12021 (O0FLAGS): New.
12022 (VALGRIND, GXX): New.
12023 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
12024 * tests/bison.in: Run $PREBISON a pre-command.
12025 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
12026 (maintainer-check-g++): New.
12027 * Makefile.am (maintainer-check): New.
12028
120292002-10-13 Akim Demaille <akim@epita.fr>
12030
12031 * data/glr.c: Formatting changes.
12032 Tweak some trace messages to match yacc.c's.
12033
120342002-10-13 Akim Demaille <akim@epita.fr>
12035
12036 GLR parsers sometimes raise parse errors instead of performing the
12037 default reduction.
12038 Reported by Charles-Henry de Boysson.
12039
12040 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
12041 check the length of the traces when %glr.
12042 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
12043 GLR's traces.
12044 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
12045 Test GLR parsers.
12046 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
12047 (yyltype): Remove the yy prefix from the member names.
12048 (yytable): Complete its comment.
12049 (yygetLRActions): Map error action number from YYTABLE from
12050 YYTABLE_NINF to 0.
12051 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
12052 (which was a bug: it should have been YYTABEL_NINF, and yet it was
12053 not satisfying as we could compare an YYACTION computed from
12054 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
12055 only value for error actions.
12056 (yyreportParseError): In verbose parse error messages, don't issue
12057 `error' in the list of expected tokens.
12058 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
12059 next action to perform to match glr.c's decoding.
12060 (yytable): Complete its comment.
12061
120622002-10-13 Paul Eggert <eggert@twinsun.com>
12063
12064 Fix problem reported by Henrik Grubbstroem in
12065 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
12066 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
12067 because the Bison parser reads the second action before reducing
12068 the first one.
12069 * src/scan-gram.l (rule_length): New static var.
12070 Use it to keep track of the rule length in the scanner, since
12071 we can't expect the parser to be in lock-step sync with the scanner.
12072 (handle_action_dollar, handle_action_at): Use this var.
12073 * tests/actions.at (Exotic Dollars): Test for the problem.
12074
120752002-10-12 Paul Eggert <eggert@twinsun.com>
12076
12077 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
12078 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
12079 Include <sys/time.h> when checking for clock_t and struct tms.
12080 Use same include order as source.
12081 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
12082 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
12083
12084 * lib/timevar.c: Update copyright date and clarify comments.
12085 (get_time) [IN_GCC]: Keep the GCC version for reference.
12086
12087 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
12088 GCC version as of today, then merge Bison's changes.
12089 Change "GCC" to "Bison" in copyright notice. timevar.def's
12090 author is Akim, so change that too.
12091
12092 * src/reader.c (grammar_current_rule_check):
12093 Don't worry about the default action if $$ is untyped.
12094 Prevents bogus warnings reported by Jim Gifford in
12095 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
12096
12097 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
12098 * data/glr.c, data/lalr1.cc, data/yacc.c:
12099 Output token definitions before the first part of user declarations.
12100 Fixes compatibility problem reported by Jim Gifford for kbd in
12101 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
12102
121032002-10-11 Paul Eggert <eggert@twinsun.com>
12104
12105 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
12106 (yyparse): here. This undoes some of the 2002-07-25 change.
12107 Compatibility problem reported by Ralf S. Engelschall with
12108 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
12109
121102002-10-11 Akim Demaille <akim@epita.fr>
12111
12112 * tests/regression.at Characters Escapes): New.
12113 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
12114 characters.
12115 Reported by Jan Nieuwenhuizen.
12116
121172002-10-11 Akim Demaille <akim@epita.fr>
12118
12119 * po/id.po: New.
12120
121212002-10-10 Paul Eggert <eggert@twinsun.com>
12122
12123 Portability fixes for bitsets; this also avoids several GCC
12124 warnings.
12125
12126 * lib/abitset.c: Include <stddef.h>, for offsetof.
12127 * lib/lbitset.c: Likewise.
12128
12129 * lib/abitset.c (abitset_bytes): Return a size that is aligned
12130 properly for vectors of objects. Do not assume that adding a
12131 header size to a multiple of a word size yields a value that is
12132 properly aligned for the whole union.
12133 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12134
12135 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
12136 unique names for structures.
12137 * lib/ebitset.c (ebitset_bytes): Likewise.
12138 * lib/lbitset.c (lbitset_bytes): Likewise.
12139
12140 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
12141 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
12142 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
12143 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
12144 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
12145 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
12146 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
12147 to improve the type-checking that GCC can do.
12148 * lib/bitset.c (bitset_op4_cmp): Likewise.
12149 * lib/bitset_stats.c (bitset_stats_count,
12150 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
12151 bitset_stats_copy, bitset_stats_disjoint_p,
12152 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
12153 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
12154 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
12155 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
12156 bitset_stats_and_or_cmp, bitset_stats_andn_or,
12157 bitset_stats_andn_or_cmp, bitset_stats_or_and,
12158 bitset_stats_or_and_cmp): Likewise.
12159 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
12160 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
12161 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
12162 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
12163
12164 * lib/abitset.h: Include bitset.h, not bbitset.h.
12165 * lib/ebitset.h: Likewise.
12166 * lib/lbitset.h: Likewise.
12167
12168 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
12169 All instances of parameters of type enum bitset_opts are now of
12170 type enum_bitset_opts, to conform to the C Standard, and similarly
12171 for enum_bitset_type.
12172 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
12173 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
12174
12175 Do not use "struct bitset_struct" to mean different things in
12176 different modules. Not only is this confusing, it violates
12177 the C Standard, which requires that structure types in different
12178 modules must be compatible if one is to be passed to the other.
12179 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
12180 All instances of "struct bitset_struct *" replaced with "bitset".
12181 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
12182 (union bitset_union, struct abitset_struct, struct ebitset_struct,
12183 struct lbitset_struct, struct bitset_stats_struct): New types.
12184 All uses of struct bitset_struct changed to union bitset_union,
12185 etc.
12186 * lib/abitset.c (struct abitset_struct, abitset,
12187 struct bitset_struct): Remove.
12188 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
12189 struct bitset_struct): Remove.
12190 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
12191 bitset_struct): Remove.
12192 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
12193 Likewise.
12194
12195 Do not call a function of type T using a call that assumes the
12196 function is of a different type U. Standard C requires that a
12197 function must be called with a type that is compatible with its
12198 definition.
12199 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12200 New decls.
12201 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12202 New functions.
12203 * lib/ebitset.c (PFV): Remove.
12204 * lib/lbitset.c (PFV): Likewise.
12205 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
12206 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
12207 decls.
12208 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
12209 (ebitset_vtable): Use them.
12210 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
12211 lbitset_xor): New functions.
12212 (lbitset_vtable): Use them.
12213
12214 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
12215 Declare.
12216
12217 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
12218 GCC warning.
12219 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
12220 Use offsetof, for simplicity.
12221
122222002-10-06 Paul Eggert <eggert@twinsun.com>
12223
12224 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
12225 the same width as int. This reapplies a hunk of the 2002-08-12 patch
12226 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
12227 which was inadvertently undone by the 2002-09-30 patch.
12228 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
12229 the same width as int.
12230
122312002-10-04 Paul Eggert <eggert@twinsun.com>
12232
12233 Version 1.50.
12234
12235 * configure.ac (AC_INIT), NEWS: Increment version number.
12236
12237 * doc/bison.texinfo: Minor spelling, grammar, and white space
12238 fixes.
12239 (Symbols): Mention that any negative value returned from yylex
12240 signifies end-of-input. Warn about negative chars. Mention
12241 the portable Standard C character set.
12242
12243 The GNU coding standard says CFLAGS and YFLAGS are reserved
12244 for the installer to set.
12245 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
12246 * src/Makefile.am (AM_CFLAGS): Likewise.
12247 (AM_YFLAGS): Renamed from YFLAGS.
12248
12249 Fix some MAX and MIN problems.
12250 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
12251 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
12252 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
12253 * src/reader.c (reader): Use it.
12254
12255 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
12256 POSIX 1003.1-2001 has removed fgrep.
12257
122582002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
12259
12260 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
12261 interpreted as signed.
12262 * lib/ebitset.c (ebitset_list): Fix bug.
12263
122642002-10-01 Paul Eggert <eggert@twinsun.com>
12265
12266 More fixes for 64-bit hosts and large bitsets.
12267
12268 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
12269 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
12270 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
12271 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
12272 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
12273 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
12274 bitset_count_): Likewise.
12275 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
12276 bitset_first, bitset_last): Likewise.
12277 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
12278 bitset_stats_list_reverse, bitset_stats_size,
12279 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
12280 Likewise.
12281 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12282 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12283 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12284 bitsetv_reflexive_transitive_closure): Likewise.
12285 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
12286 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
12287 Likewise.
12288 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
12289 Likewise.
12290
12291 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
12292 Use size_t, not unsigned int, to count bytes.
12293 * lib/abitset.h (abitset_bytes): Likewise.
12294 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
12295 Likewise.
12296 * lib/bitset.h (bitset_bytes): Likewise.
12297 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
12298 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
12299 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12300 * lib/ebitset.c (ebitset_bytes): Likewise.
12301 * lib/ebitset.h (ebitset_bytes): Likewise.
12302 * lib/lbitset.c (lbitset_bytes): Likewise.
12303 * lib/lbitset.h (lbitset_bytes): Likewise.
12304
12305 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
12306 abitset_subset_p, abitset_disjoint_p, abitset_and,
12307 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
12308 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
12309 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
12310 abitset_or_and, abitset_or_and_cmp):
12311 Use bitset_windex instead of unsigned int.
12312 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12313 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
12314 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
12315 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
12316 Likewise.
12317 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
12318
12319 * lib/bitset.c (bitset_print):
12320 Use proper printf formats for widths of integer types.
12321 * lib/bitset_stats.c (bitset_percent_histogram_print,
12322 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
12323 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12324 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12325 * lib/lbitset.c (lbitset_bytes): Likewise.
12326
12327 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
12328 BITSET_SIZE_MAX): New macros.
12329 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
12330 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
12331 to BITSET_WINDEX_MAX.
12332
12333 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
12334 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
12335 since we now return the bitset_bindex type (not int).
12336
12337 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
12338 when computing sizes.
12339 * lib/ebitset.c (ebitset_elts_grow): Likewise.
12340
12341 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
12342 and avoid cast to unsigned.
12343
123442002-09-30 Akim Demaille <akim@epita.fr>
12345
12346 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12347 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
12348 Updates from Michael Hayes.
12349
123502002-09-30 Art Haas <ahaas@neosoft.com>
12351
12352 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
12353 invocations.
12354 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
12355 defined.
12356
123572002-09-27 Akim Demaille <akim@epita.fr>
12358
12359 Version 1.49c.
12360
123612002-09-27 Akim Demaille <akim@epita.fr>
12362
12363 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
12364 (Because of AC_LIBSOURCE).
12365
123662002-09-27 Akim Demaille <akim@epita.fr>
12367
12368 Playing with Autoscan.
12369
12370 * configure.ac: Remove the old LIBOBJ tweaks.
12371 (AC_REPLACE_FUNCS): Add strrchr and strtol.
12372 * lib/strrchr.c: New.
12373 * lib/strtol.c: New, from the Coreutils 4.5.1.
12374
123752002-09-27 Akim Demaille <akim@epita.fr>
12376
12377 Playing with Autoscan.
12378
12379 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
12380 * lib/Makefile.am (libbison_a_SOURCES): No longer include
12381 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
12382 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
12383 Coreutils 4.5.1.
12384
123852002-09-24 Akim Demaille <akim@epita.fr>
12386
12387 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
12388 (Frequently Asked Questions, Parser Stack Overflow): New.
12389
123902002-09-13 Akim Demaille <akim@epita.fr>
12391
12392 Playing with autoscan.
12393
12394 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
12395 * src/files.c (skeleton_find): Remove, unused.
12396 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
12397 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
12398
123992002-09-13 Akim Demaille <akim@epita.fr>
12400
12401 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
12402 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
12403
124042002-09-13 Akim Demaille <akim@epita.fr>
12405
12406 * configure.ac: Require 2.54.
12407 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
12408 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
12409 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
12410 Remove, provided by Autoconf macros.
12411
124122002-09-12 Akim Demaille <akim@epita.fr>
12413
12414 * m4/prereq.m4: Update, from Coreutils 4.5.1.
12415
124162002-09-12 Akim Demaille <akim@epita.fr>
12417
12418 * m4/prereq.m4: Update, from Fileutils 4.1.5.
12419 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
12420 Reported by Martin Mokrejs.
12421
124222002-09-10 Akim Demaille <akim@epita.fr>
12423
12424 * src/parse-gram.y: Associate a human readable string to each
12425 token type.
12426 * tests/regression.at (Invalid inputs): Adjust.
12427
124282002-09-10 Gary V. Vaughan <gary@gnu.org>
12429
12430 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
12431 with an Autoconf-2.5x style configure.ac.
12432
124332002-09-06 Paul Eggert <eggert@twinsun.com>
12434
12435 * doc/bison.texinfo (Conditions): Make explicit that the GPL
12436 exception applies only to yacc.c. This is a modification of a
12437 patch originally suggested by Akim Demaille.
12438
124392002-09-06 Akim Demaille <akim@epita.fr>
12440
12441 * data/c.m4 (b4_copyright): Move the GPL exception comment from
12442 here to...
12443 * data/yacc.c: here.
12444
12445 * data/lalr1.cc (struct yyltype): Don't define it, since we use
12446 LocationType.
12447 (b4_ltype): Default to yy::Location from location.hh.
12448
124492002-09-04 Jim Meyering <jim@meyering.net>
12450
12451 * data/yacc.c: Guard the declaration of yytoknum also with
12452 `#ifdef YYPRINT', so it is declared only when used.
12453
124542002-09-04 Akim Demaille <akim@epita.fr>
12455
12456 * configure.in: Rename as...
12457 * configure.ac: this.
12458 Bump to 1.49c.
12459
124602002-09-04 Akim Demaille <akim@epita.fr>
12461
12462 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
12463 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
12464 translate maintainer only messages.
12465
124662002-08-12 Paul Eggert <eggert@twinsun.com>
12467
12468 Version 1.49b.
12469
12470 * Makefile.am (SUBDIRS): Remove intl.
12471 (DISTCLEANFILES): Remove.
12472 * NEWS: Mention that GNU M4 is now required. Clarify what is
12473 meant by "larger grammars". Mention the pt_BR translation.
12474 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
12475 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
12476 Bump version from 0.11.2 to 0.11.5.
12477 (BISON_PREREQ_STAGE): Remove.
12478 (AM_GNU_GETTEXT): Use external gettext.
12479 (AC_OUTPUT): Remove intl/Makefile.
12480
12481 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
12482
12483 * data/glr.c: Include string.h, for strlen.
12484 (yyreportParseError): Use size_t for yysize.
12485 (yy_yypstack): No longer nested inside yypstates, as nested
12486 functions are not portable. Do not assume size_t is the
12487 same width as int.
12488 (yypstates): Do not assume that ptrdiff_t is the same width
12489 as int, and similarly for yyposn and YYINDEX.
12490
12491 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
12492
12493 * lib/Makefile.am (INCLUDES): Do not include from the intl
12494 directory, which has been removed.
12495 * src/Makefile.am (INCLUDES): Likewise.
12496
12497 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
12498 (bitsets_sources, additional_bitsets_sources, timevars_sources):
12499 New vars.
12500
12501 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
12502 * tests/Makefile.am (EXTRA_DIST): Likewise.
12503
12504 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
12505 Do not assume that bitset_windex is the same width as unsigned.
12506
12507 * lib/abitset.c (abitset_unused_clear): Do not assume that
12508 bitset_word is the same width as int.
12509 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
12510 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
12511 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
12512 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
12513 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
12514
12515 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
12516 portability to one's complement hosts!).
12517 * lib/ebitset.c (ebitset_op1): Likewise.
12518 * lib/lbitset.c (lbitset_op1): Likewise.
12519
12520 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
12521 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12522 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
12523 Sync with fileutils.
12524 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
12525 lib/gettext.h: Sync with diffutils.
12526
12527 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
12528 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
12529
12530 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
12531 PROTOTYPES to check for prototypes, and "defined __STDC__" to
12532 check for void *.
12533
12534 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
12535 size_t; the old version tried to do this but casted improperly.
12536 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
12537 (bitset_test): Now returns int, not unsigned long.
12538
12539 * lib/bitset_stats.c: Include "gettext.h".
12540 (_): New macro.
12541 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
12542 name locals "index", as it generates unnecessary warnings on some
12543 hosts that have an "index" function.
12544
12545 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
12546 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
12547 they need translation.
12548 * src/LR0.c (state_list_append, new_itemsets, get_state,
12549 append_states, generate_states): Likewise.
12550 * src/assoc.c (assoc_to_string): Likewise.
12551 * src/closure.c (print_closure, set_firsts, closure): Likewise.
12552 * src/gram.c (grammar_dump): Likewise.
12553 * src/injections.c (injections_compute): Likewise.
12554 * src/lalr.c (lookaheads_print): Likewise.
12555 * src/relation.c (relation_transpose): Likewise.
12556 * src/scan-gram.l: Likewise.
12557 * src/tables.c (table_grow, pack_vector): Likewise.
12558
12559 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
12560 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
12561 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
12562 * m4/mbstate_t.m4: Sync with fileutils.
12563 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
12564
12565 * po/LINGUAS: Add pt_BR.
12566 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
12567 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
12568 lib/timevar.c.
12569 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
12570 manual recommends.
12571 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
12572
12573 * src/complain.c (strerror_r): Remove decl; not needed.
12574 (strerror): Use same pattern as ../lib/error.c.
12575
12576 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
12577
12578 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
12579
12580 * src/main.c (main): Cast result of bindtextdomain and textdomain
12581 to void, to avoid a GCC warning when --disable-nls is in effect.
12582
12583 * src/scan-gram.l: Use strings rather than escapes when possible,
12584 to minimize the number of warnings from xgettext.
12585 (handle_action_dollar, handle_action_at): Don't use isdigit,
12586 as it mishandles negative chars and it may not work as expected
12587 outside the C locale.
12588
12589 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
12590 this is a GCC extension and is not portable to other compilers.
12591
12592 * src/system.h (alloca): Use same pattern as ../lib/error.c.
12593 Do not include <ctype.h>; no longer needed.
12594 Do not include <malloc.h>; no longer needed (and generates
12595 warnings on OpenBSD 3.0).
12596
12597 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
12598 it's not portable.
12599
12600 * tests/regression.at: Do not use 'cc -c input.c -o input';
12601 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
12602
12603 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
12604 exit status as failure, not just exit status 1. Sun C exits
12605 with status 2 sometimes.
12606
12607 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
12608 Use it for the two large tests.
12609
126102002-08-02 Akim Demaille <akim@epita.fr>
12611
12612 * src/conflicts.c (conflicts_output): Don't output rules never
12613 reduced here, since anyway that computation doesn't work.
12614 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
12615 (rule_useless_p, rule_never_reduced_p): New.
12616 (grammar_rules_partial_print): Use a filter instead of a range.
12617 Display the title only if needed.
12618 (grammar_rules_print): Adjust.
12619 (grammar_rules_never_reduced_report): New.
12620 * src/tables.c (action_row): Move the computation of rules never
12621 reduced to...
12622 (token_actions): here.
12623 * src/main.c (main): Make the parser before making the report, so
12624 that rules never reduced are computed.
12625 Call grammar_rules_never_reduced_report.
12626 * src/print.c (print_results): Report rules never reduced.
12627 * tests/conflicts.at, tests/reduce.at: Adjust.
12628
126292002-08-01 Akim Demaille <akim@epita.fr>
12630
12631 Instead of attaching lookaheads and duplicating the rules being
12632 reduced by a state, attach the lookaheads to the reductions.
12633
12634 * src/state.h (state_t): Remove the `lookaheads',
12635 `lookaheads_rule' member.
12636 (reductions_t): Add a `lookaheads' member.
12637 Use a regular array for the `rules'.
12638 * src/state.c (reductions_new): Initialize the lookaheads member
12639 to 0.
12640 (state_rule_lookaheads_print): Adjust.
12641 * src/state.h, src/state.c (state_reductions_find): New.
12642 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
12643 (count_rr_conflicts): Adjust.
12644 * src/lalr.c (LArule): Remove.
12645 (add_lookback_edge): Adjust.
12646 (state_lookaheads_count): New.
12647 (states_lookaheads_initialize): Merge into...
12648 (initialize_LA): this.
12649 (lalr_free): Adjust.
12650 * src/main.c (main): Don't free nullable and derives too early: it
12651 is used by --verbose.
12652 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
12653
126542002-08-01 Akim Demaille <akim@epita.fr>
12655
12656 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
12657 `rule_number_t**'.
12658 (set_derives, free_derives): Rename as...
12659 (derives_compute, derives_free): this.
12660 Adjust all dependencies.
12661 * src/nullable.c (set_nullable, free_nullable): Rename as...
12662 (nullable_compute, nullable_free): these.
12663 (rule_list_t): Store rule_t *, not rule_number_t.
12664 * src/state.c (state_rule_lookaheads_print): Directly compare rule
12665 pointers, instead of their numbers.
12666 * src/main.c (main): Call nullable_free, and derives_free earlier,
12667 as they were lo longer used.
12668
126692002-08-01 Akim Demaille <akim@epita.fr>
12670
12671 * lib/timevar.c (get_time): Include children time.
12672 * src/lalr.h (LA, LArule): Don't export them: used with the
12673 state_t.
12674 * src/lalr.c (LA, LArule): Static.
12675 * src/lalr.h, src/lalr.c (lalr_free): New.
12676 * src/main.c (main): Call it.
12677 * src/tables.c (pack_vector): Check whether loc is >= to the
12678 table_size, not >.
12679 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
12680 (tables_generate): do it, since that's also it which allocates
12681 them.
12682 Don't free LA and LArule, main does.
12683
126842002-07-31 Akim Demaille <akim@epita.fr>
12685
12686 Separate parser tables computation and output.
12687
12688 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
12689 (conflict_list, conflict_list_cnt, table, check, table_ninf)
12690 (yydefgoto, yydefact, high): Move to...
12691 * src/tables.h, src/tables.c: here.
12692 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12693 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12694 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
12695 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
12696 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
12697 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
12698 (action_row, save_row, token_actions, save_column, default_goto)
12699 (goto_actions, sort_actions, matching_state, pack_vector)
12700 (table_ninf_remap, pack_table, prepare_actions): Move to...
12701 * src/tables.c: here.
12702 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
12703 * src/output.c (token_actions, output_base, output_conflicts)
12704 (output_check): Merge into...
12705 (prepare_actions): this.
12706 (actions_output): Rename as...
12707 (user_actions_output): this.
12708 * src/main.c (main): Call tables_generate and tables_free.
12709
127102002-07-31 Akim Demaille <akim@epita.fr>
12711
12712 Steal GCC's --time-report support.
12713
12714 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
12715 stolen/adjusted from GCC.
12716 * m4/stage.m4: Remove time related checks.
12717 * m4/timevar.m4: New.
12718 * configure.in: Adjust.
12719 * src/system.h: Adjust to using timevar.h.
12720 * src/getargs.h, src/getargs.c: Support trace_time for
12721 --trace=time.
12722 * src/main.c (stage): Remove.
12723 (main): Replace `stage' invocations with timevar calls.
12724 * src/output.c: Insert pertinent timevar calls.
12725
127262002-07-31 Akim Demaille <akim@epita.fr>
12727
12728 Let --trace have arguments.
12729
12730 * src/getargs.h (enum trace_e): New.
12731 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
12732 (long_options, short_options): --trace/-T takes an optional
12733 argument.
12734 Change all the uses of trace_flag to reflect the new flags.
12735 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
12736
12737 Strengthen `stage' portability.
12738
12739 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
12740 * configure.in: Use it.
12741 Don't check for malloc.h and sys/times.h.
12742 * src/system.h: Include them when appropriate.
12743 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
12744 times and struct tms are available.
12745
127462002-07-30 Akim Demaille <akim@epita.fr>
12747
12748 In verbose parse error message, don't report `error' as an
12749 expected token.
12750 * tests/actions.at (Printers and Destructors): Adjust.
12751 * tests/calc.at (Calculator $1): Adjust.
12752 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
12753 error message, do not report the parser accepts the error token in
12754 that state.
12755
127562002-07-30 Akim Demaille <akim@epita.fr>
12757
12758 Normalize conflict related messages.
12759
12760 * src/complain.h, src/complain.c (warn, complain): New.
12761 * src/conflicts.c (conflicts_print): Use them.
12762 (conflict_report_yacc): New, extracted from...
12763 (conflicts_print): here.
12764 * tests/conflicts.at, tests/existing.at: Adjust.
12765
127662002-07-30 Akim Demaille <akim@epita.fr>
12767
12768 Report rules which are never reduced by the parser: those hidden
12769 by conflicts.
12770
12771 * src/LR0.c (save_reductions): Don't make the final state too
12772 different: save its reduction (accept) instead of having a state
12773 without any action (no shift or goto, no reduce).
12774 Note: the final state is now a ``regular'' state, i.e., the
12775 parsers now contain `reduce 0' as default reduction.
12776 Nevertheless, since they decide to `accept' when yystate =
12777 final_state, they still will not reduce rule 0.
12778 * src/print.c (print_actions, print_reduction): Adjust.
12779 * src/output.c (action_row): Track reduced rules.
12780 (token_actions): Report rules never reduced.
12781 * tests/conflicts.at, tests/regression.at: Adjust.
12782
127832002-07-30 Akim Demaille <akim@epita.fr>
12784
12785 `stage' was accidently included in a previous patch.
12786 Initiate its autoconfiscation.
12787
12788 * configure.in: Look for malloc.h and sys/times.h.
12789 * src/main.c (stage): Adjust.
12790 Report only when trace_flag.
12791
127922002-07-29 Akim Demaille <akim@epita.fr>
12793
12794 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
12795 state_number_t.
12796 (errs_t): symbol_t*, not symbol_number_t.
12797 (reductions_t): rule_t*, not rule_number_t.
12798 (FOR_EACH_SHIFT): New.
12799 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
12800 * src/print.c, src/print_graph.c: Adjust.
12801
128022002-07-29 Akim Demaille <akim@epita.fr>
12803
12804 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
12805
12806 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
12807 (endtoken, accept): these.
12808 * src/reader.c (reader): Set endtoken's default tag to "$end".
12809 Set undeftoken's tag to "$undefined" instead of "$undefined.".
12810 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
12811 Adjust.
12812
128132002-07-29 Akim Demaille <akim@epita.fr>
12814
12815 * src/reduce.c (reduce_grammar): When the language is empty,
12816 complain about the start symbol, not the axiom.
12817 Use its location.
12818 * tests/reduce.at (Empty Language): New.
12819
128202002-07-26 Akim Demaille <akim@epita.fr>
12821
12822 * src/reader.h, src/reader.c (gram_error): ... can't get
12823 yycontrol without making too strong assumptions on the parser
12824 itself.
12825 * src/output.c (prepare_tokens): Use the real 0th value of
12826 token_translations instead of `0'.
12827 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
12828 visible here.
12829 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
12830 for the time being: %locations ought to provide it to yyerror.
12831
128322002-07-25 Akim Demaille <akim@epita.fr>
12833
12834 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
12835 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
12836 * tests/regression.at (Web2c Actions): Adjust.
12837
128382002-07-25 Akim Demaille <akim@epita.fr>
12839
12840 Stop storing rules from 1 to nrules + 1.
12841
12842 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12843 * src/nullable.c, src/output.c, src/print.c, src/reader.c
12844 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
12845 Iterate from 0 to nrules.
12846 Use rule_number_as_item_number and item_number_as_rule_number.
12847 Adjust to `derive' now containing possibly 0.
12848 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12849 Handle the `- 1' part in rule numbers from/to item numbers.
12850 * src/conflicts.c (log_resolution): Fix the message which reversed
12851 shift and reduce.
12852 * src/output.c (action_row): Initialize default_rule to -1.
12853 (token_actions): Adjust.
12854 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
12855 expected output.
12856 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12857
128582002-07-25 Akim Demaille <akim@epita.fr>
12859
12860 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12861 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12862 (b4_c_knr_arg_decl): New.
12863 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12864 yyreport_parse_error.
12865
128662002-07-25 Akim Demaille <akim@epita.fr>
12867
12868 * data/yacc.c (yyreport_parse_error): New, extracted from...
12869 (yyparse): here.
12870 (yydestruct, yysymprint): Move above yyparse.
12871 Be K&R compliant.
12872
128732002-07-25 Akim Demaille <akim@epita.fr>
12874
12875 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12876 replace...
12877 (b4_sint_type, b4_uint_type): these.
12878 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12879 * tests/regression.at (Web2c Actions): Adjust.
12880
128812002-07-25 Akim Demaille <akim@epita.fr>
12882
12883 * src/gram.h (TIEM_NUMBER_MAX): New.
12884 (item_number_of_rule_number, rule_number_of_item_number): Rename
12885 as...
12886 (rule_number_as_item_number, item_number_as_rule_number): these.
12887 Adjust dependencies.
12888 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12889 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12890 (symbol_number_to_vector_number): New.
12891 (order): Of vector_number_t* type.
12892 (base_t, BASE_MAX, BASE_MIN): New.
12893 (froms, tos, width, pos, check): Of base_t type.
12894 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12895 (actrow): Of action_number_t type.
12896 (conflrow): Of unsigned int type.
12897 (table_ninf, base_ninf): New.
12898 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12899 (muscle_insert_int_table, muscle_insert_base_table)
12900 (muscle_insert_rule_number_table): New.
12901 (prepare_tokens): Output `toknum' as int_table.
12902 (action_row): Returns a rule_number_t.
12903 Use ACTION_MIN, not SHRT_MIN.
12904 (token_actions): yydefact is rule_number_t*.
12905 (table_ninf_remap): New.
12906 (pack_table): Use it for `base' and `table'.
12907 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12908 replaced with...
12909 (YYPACT_NINF, YYTABLE_NINF): these.
12910 (yypact, yytable): Compute their types instead of hard-coded
12911 `short'.
12912 * tests/regression.at (Web2c Actions): Adjust.
12913
129142002-07-19 Akim Demaille <akim@epita.fr>
12915
12916 * src/scan-gram.l (id): Can start with an underscore.
12917
129182002-07-16 Akim Demaille <akim@epita.fr>
12919
12920 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12921 Adjust all former `associativity' dependencies.
12922 * src/symtab.c (symbol_new): Default associativity is `undef', not
12923 `right'.
12924 (symbol_check_alias_consistence): Adjust.
12925
129262002-07-09 Akim Demaille <akim@epita.fr>
12927
12928 * doc/bison.texinfo: Properly set the ``header'' part.
12929 Use @dircategory ``GNU programming tools'' as per Texinfo's
12930 documentation.
12931 Use @copying.
12932
129332002-07-09 Akim Demaille <akim@epita.fr>
12934
12935 * lib/quotearg.h: Protect against multiple inclusions.
12936 * src/location.h (location_t): Add a `file' member.
12937 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12938 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12939 `error_one_per_line' support.
12940
129412002-07-09 Akim Demaille <akim@epita.fr>
12942
12943 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12944 * src/reader.c (lineno): Remove.
12945 Adjust all dependencies.
12946 (get_merge_function): Take a location and use complain_at.
12947 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12948 * tests/regression.at (Invalid inputs, Mixing %token styles):
12949 Adjust.
12950
129512002-07-09 Akim Demaille <akim@epita.fr>
12952
12953 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12954 recovery rule, and forbid extensions when --yacc.
12955 (gram_error): Use complain_at.
12956 * src/reader.c (reader): Exit if there were parse errors.
12957
129582002-07-09 Akim Demaille <akim@epita.fr>
12959
12960 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12961 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12962 Reported by R Blake <blakers@mac.com>.
12963
129642002-07-09 Akim Demaille <akim@epita.fr>
12965
12966 * data/yacc.c: Output the copyright notive in the header.
12967
129682002-07-03 Akim Demaille <akim@epita.fr>
12969
12970 * src/output.c (froms, tos): Are state_number_t.
12971 (save_column): sp, sp1, and sp2 are state_number_t.
12972 (prepare): Rename `final' as `final_state_number', `nnts' as
12973 `nterms_number', `nrules' as `rules_number', `nstates' as
12974 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12975 unused.
12976 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12977 * data/lalr1.cc (nsym_): Remove, unused.
12978
129792002-07-03 Akim Demaille <akim@epita.fr>
12980
12981 * src/lalr.h, src/lalr.c (goto_number_t): New.
12982 * src/lalr.c (goto_list_t): New.
12983 Propagate them.
12984 * src/nullable.c (rule_list_t): New.
12985 Propagate.
12986 * src/types.h: Remove.
12987
129882002-07-03 Akim Demaille <akim@epita.fr>
12989
12990 * src/closure.c (print_fderives): Use rule_rhs_print.
12991 * src/derives.c (print_derives): Use rule_rhs_print.
12992 (rule_list_t): New, replaces `shorts'.
12993 (set_derives): Add comments.
12994 * tests/sets.at (Nullable, Firsts): Adjust.
12995
129962002-07-03 Akim Demaille <akim@epita.fr>
12997
12998 * src/output.c (prepare_actions): Free `tally' and `width'.
12999 (prepare_actions): Allocate and free `order'.
13000 * src/symtab.c (symbols_free): Free `symbols'.
13001 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
13002 * src/output.c (m4_invoke): Move to...
13003 * src/scan-skel.l: here.
13004 (<<EOF>>): Close yyout, and free its name.
13005
130062002-07-03 Akim Demaille <akim@epita.fr>
13007
13008 Fix some memory leaks, and fix a bug: state 0 was examined twice.
13009
13010 * src/LR0.c (new_state): Merge into...
13011 (state_list_append): this.
13012 (new_states): Merge into...
13013 (generate_states): here.
13014 (set_states): Don't ensure a proper `errs' state member here, do it...
13015 * src/conflicts.c (conflicts_solve): here.
13016 * src/state.h, src/state.c: Comment changes.
13017 (state_t): Rename member `shifts' as `transitions'.
13018 Adjust all dependencies.
13019 (errs_new): For consistency, also take the values as argument.
13020 (errs_dup): Remove.
13021 (state_errs_set): New.
13022 (state_reductions_set, state_transitions_set): Assert that no
13023 previous value was assigned.
13024 (state_free): New.
13025 (states_free): Use it.
13026 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
13027 temporary storage: use `errs' and `nerrs' as elsewhere.
13028 (set_conflicts): Allocate and free this `errs'.
13029
130302002-07-02 Akim Demaille <akim@epita.fr>
13031
13032 * lib/libiberty.h: New.
13033 * lib: Update the bitset implementation from upstream.
13034 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
13035 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
13036 * src/main.c: Adjust bitset stats calls.
13037
130382002-07-01 Paul Eggert <eggert@twinsun.com>
13039
13040 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
13041 char, so that negative chars don't collide with $.
13042
130432002-06-30 Akim Demaille <akim@epita.fr>
13044
13045 Have the GLR tests be `warning' checked, and fix the warnings.
13046
13047 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
13048 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
13049 (yyremoveDeletes): `yyi' and `yyj' are size_t.
13050 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
13051 (yyaddDeferredAction): static.
13052 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
13053 (yyreportParseError): yyprefix is const.
13054 yytokenp is used only when verbose.
13055 (yy__GNUC__): Replace with __GNUC__.
13056 (yypdumpstack): yyi is size_t.
13057 (yypreference): Un-yy local variables and arguments, to avoid
13058 clashes with `yyr1'. Anyway, we are not in the user name space.
13059 (yytname_size): be an int, as is compared with ints.
13060 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
13061 Use them.
13062 * tests/cxx-gram.at: Use quotation to protect $1.
13063 Use AT_COMPILE to enable warnings hunts.
13064 Prototype yylex and yyerror.
13065 `Use' argc.
13066 Include `string.h', not `strings.h'.
13067 Produce and prototype stmtMerge only when used.
13068 yylex takes a location.
13069
130702002-06-30 Akim Demaille <akim@epita.fr>
13071
13072 We spend a lot of time in quotearg, in particular when --verbose.
13073
13074 * src/symtab.c (symbol_get): Store a quoted version of the key.
13075 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
13076 Adjust all callers.
13077
130782002-06-30 Akim Demaille <akim@epita.fr>
13079
13080 * src/state.h (reductions_t): Rename member `nreds' as num.
13081 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
13082 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
13083
130842002-06-30 Akim Demaille <akim@epita.fr>
13085
13086 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
13087 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
13088 (shifts_to): Rename as...
13089 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
13090 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
13091 (TRANSITION_IS_DISABLED, transitions_to): these.
13092
130932002-06-30 Akim Demaille <akim@epita.fr>
13094
13095 * src/print.c (print_shifts, print_gotos): Merge into...
13096 (print_transitions): this.
13097 (print_transitions, print_errs, print_reductions): Align the
13098 lookaheads columns.
13099 (print_core, print_transitions, print_errs, print_state,
13100 print_grammar): Output empty lines separator before, not after.
13101 (state_default_rule_compute): Rename as...
13102 (state_default_rule): this.
13103 * tests/conflicts.at (Defaulted Conflicted Reduction),
13104 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
13105 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
13106
131072002-06-30 Akim Demaille <akim@epita.fr>
13108
13109 Display items as we display rules.
13110
13111 * src/gram.h, src/gram.c (rule_lhs_print): New.
13112 * src/gram.c (grammar_rules_partial_print): Use it.
13113 * src/print.c (print_core): Likewise.
13114 * tests/conflicts.at (Defaulted Conflicted Reduction),
13115 (Unresolved SR Conflicts): Adjust.
13116 (Unresolved SR Conflicts): Adjust and rename as...
13117 (Resolved SR Conflicts): this, as was meant.
13118 * tests/regression.at (Web2c Report): Adjust.
13119
131202002-06-30 Akim Demaille <akim@epita.fr>
13121
13122 * src/print.c (state_default_rule_compute): New, extracted from...
13123 (print_reductions): here.
13124 Pessimize, but clarify the code.
13125 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
13126
131272002-06-30 Akim Demaille <akim@epita.fr>
13128
13129 * src/output.c (action_row): Let default_rule be always a rule
13130 number.
13131
131322002-06-30 Akim Demaille <akim@epita.fr>
13133
13134 * src/closure.c (print_firsts, print_fderives, closure):
13135 Use BITSET_EXECUTE.
13136 * src/lalr.c (lookaheads_print): Likewise.
13137 * src/state.c (state_rule_lookaheads_print): Likewise.
13138 * src/print_graph.c (print_core): Likewise.
13139 * src/print.c (print_reductions): Likewise.
13140 * src/output.c (action_row): Likewise.
13141 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
13142
131432002-06-30 Akim Demaille <akim@epita.fr>
13144
13145 * src/print_graph.c: Use report_flag.
13146
131472002-06-30 Akim Demaille <akim@epita.fr>
13148
13149 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
13150 to...
13151 * src/relation.h, src/relation.c (traverse, relation_digraph)
13152 (relation_print, relation_transpose): New.
13153
131542002-06-30 Akim Demaille <akim@epita.fr>
13155
13156 * src/state.h, src/state.c (shifts_to): New.
13157 * src/lalr.c (build_relations): Use it.
13158
131592002-06-30 Akim Demaille <akim@epita.fr>
13160
13161 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
13162 (item_number_of_rule_number, rule_number_of_item_number): New.
13163 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
13164 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
13165 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
13166 Propagate their use.
13167 Much remains to be done, in particular wrt `shorts' from types.h.
13168
131692002-06-30 Akim Demaille <akim@epita.fr>
13170
13171 * src/symtab.c (symbol_new): Initialize the `printer' member.
13172
131732002-06-30 Akim Demaille <akim@epita.fr>
13174
13175 * src/LR0.c (save_reductions): Remove, replaced by...
13176 * src/state.h, src/state.c (state_reductions_set): New.
13177 (reductions, errs): Rename as...
13178 (reductions_t, errs_t): these.
13179 Adjust all dependencies.
13180
131812002-06-30 Akim Demaille <akim@epita.fr>
13182
13183 * src/LR0.c (state_list_t, state_list_append): New.
13184 (first_state, last_state): Now symbol_list_t.
13185 (this_state): Remove.
13186 (new_itemsets, append_states, save_reductions): Take a state_t as
13187 argument.
13188 (set_states, generate_states): Adjust.
13189 (save_shifts): Remove, replaced by...
13190 * src/state.h, src/state.c (state_shifts_set): New.
13191 (shifts): Rename as...
13192 (shifts_t): this.
13193 Adjust all dependencies.
13194 * src/state.h (state_t): Remove the `next' member.
13195
131962002-06-30 Akim Demaille <akim@epita.fr>
13197
13198 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
13199 escaped in slot 0.
13200
132012002-06-30 Akim Demaille <akim@epita.fr>
13202
13203 Use hash.h for the state hash table.
13204
13205 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
13206 (allocate_storage): Use state_hash_new.
13207 (free_storage): Use state_hash_free.
13208 (new_state, get_state): Adjust.
13209 * src/lalr.h, src/lalr.c (states): Move to...
13210 * src/states.h (state_t): Remove the `link' member, no longer
13211 used.
13212 * src/states.h, src/states.c: here.
13213 (state_hash_new, state_hash_free, state_hash_lookup)
13214 (state_hash_insert, states_free): New.
13215 * src/states.c (state_table, state_compare, state_hash): New.
13216 * src/output.c (output_actions): Do not free states now, since we
13217 still need to know the final_state number in `prepare', called
13218 afterwards. Do it...
13219 * src/main.c (main): here: call states_free after `output'.
13220
132212002-06-30 Akim Demaille <akim@epita.fr>
13222
13223 * src/state.h, src/state.c (state_new): New, extracted from...
13224 * src/LR0.c (new_state): here.
13225 * src/state.h (STATE_ALLOC): Move to...
13226 * src/state.c: here.
13227 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
13228 * src/state.h, src/state.c: here.
13229
132302002-06-30 Akim Demaille <akim@epita.fr>
13231
13232 * src/reader.c (gensym): Rename as...
13233 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
13234 (getsym): Rename as...
13235 (symbol_get): this.
13236
132372002-06-30 Akim Demaille <akim@epita.fr>
13238
13239 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
13240 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
13241 * src/output.c, src/print.c, src/print_graph.c: Propagate.
13242 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
13243
132442002-06-30 Akim Demaille <akim@epita.fr>
13245
13246 Make the test suite pass with warnings checked.
13247
13248 * tests/actions.at (Printers and Destructors): Improve.
13249 Avoid unsigned vs. signed issues.
13250 * tests/calc.at: Don't exercise the scanner here, do it...
13251 * tests/input.at (Torturing the Scanner): here.
13252
132532002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13254
13255 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
13256 reorganize first lines parallel to yacc.c.
13257
132582002-06-28 Akim Demaille <akim@epita.fr>
13259
13260 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
13261 (b4_token_enum, b4_token_defines): New, factored from...
13262 * data/lalr1.cc, data/yacc.c, glr.c: here.
13263
132642002-06-28 Akim Demaille <akim@epita.fr>
13265
13266 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
13267 unused variables.
13268 * src/output.c (merger_output): static.
13269
132702002-06-28 Akim Demaille <akim@epita.fr>
13271
13272 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
13273 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
13274 pacify GCC.
13275 * src/output.c (save_row): Initialize all the variables to pacify GCC.
13276
132772002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13278
13279 Accumulated changelog for new GLR parsing features.
13280
13281 * src/conflicts.c (count_total_conflicts): Change name to
13282 conflicts_total_count.
13283 * src/conflicts.h: Ditto.
13284 * src/output.c (token_actions): Use the new name.
13285 (output_conflicts): Change conflp => conflict_list_heads, and
13286 confl => conflict_list for better readability.
13287 * data/glr.c: Use the new names.
13288 * NEWS: Add self to GLR announcement.
13289
13290 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
13291
13292 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
13293 Akim Demaille.
13294
13295 * data/bison.glr: Change name to glr.c
13296 * data/glr.c: Renamed from bison.glr.
13297 * data/Makefile.am: Add glr.c
13298
13299 * src/getargs.c:
13300
13301 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
13302 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
13303
13304 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13305
13306 * data/bison.glr: Be sure to restore the
13307 current #line when returning to the skeleton contents after having
13308 exposed the input file's #line.
13309
13310 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13311
13312 * data/bison.glr: Bring up to date with changes to bison.simple.
13313
13314 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13315
13316 * data/bison.glr: Correct definitions that use b4_prefix.
13317 Various reformatting.
13318 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
13319 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
13320 yytokenp argument; now part of stack.
13321 (yychar): Define to behave as documented.
13322 (yyclearin): Ditto.
13323
13324 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13325
13326 * src/reader.h: Add declaration for free_merger_functions.
13327
13328 * src/reader.c (merge_functions): New variable.
13329 (get_merge_function): New function.
13330 (free_merger_functions): New function.
13331 (readgram): Check for %prec that is not followed by a symbol.
13332 Handle %dprec and %merge declarations.
13333 (packgram): Initialize dprec and merger fields in rules array.
13334
13335 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
13336 conflict_list_cnt, conflict_list_free): New variables.
13337 (table_grow): Also grow conflict_table.
13338 (prepare_rules): Output dprec and merger tables.
13339 (conflict_row): New function.
13340 (action_row): Output conflict lists for GLR parser. Don't use
13341 default reduction in conflicted states for GLR parser so that there
13342 are spaces for the conflict lists.
13343 (save_row): Also save conflict information.
13344 (token_actions): Allocate conflict list.
13345 (merger_output): New function.
13346 (pack_vector): Pack conflict table, too.
13347 (output_conflicts): New function to output yyconflp and yyconfl.
13348 (output_check): Allocate conflict_tos.
13349 (output_actions): Output conflict tables, also.
13350 (output_skeleton): Output b4_mergers definition.
13351 (prepare): Output b4_max_rhs_length definition.
13352 Use 'bison.glr' as default skeleton for GLR parsers.
13353
13354 * src/gram.c (glr_parser): New flag.
13355 (grammar_free): Call free_merger_functions.
13356
13357 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
13358 all pairs of conflicting reductions, rather than just all tokens
13359 causing conflicts. Needed to size conflict tables.
13360 (conflicts_output): Modify call to count_rr_conflicts for new
13361 interface.
13362 (conflicts_print): Ditto.
13363 (count_total_conflicts): New function.
13364
13365 * src/reader.h (merger_list): New type.
13366 (merge_functions): New variable.
13367
13368 * src/lex.h (tok_dprec, tok_merge): New token types.
13369
13370 * src/gram.h (rule_s): Add dprec and merger fields.
13371 (glr_parser): New flag.
13372
13373 * src/conflicts.h (count_total_conflicts): New function.
13374
13375 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
13376
13377 * doc/bison.texinfo (Generalized LR Parsing): New section.
13378 (GLR Parsers): New section.
13379 (Language and Grammar): Mention GLR parsing.
13380 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
13381 Correct typo ("tge" -> "the").
13382
13383 * data/bison.glr: New skeleton for GLR parsing.
13384
13385 * tests/cxx-gram.at: New tests for GLR parsing.
13386
13387 * tests/testsuite.at: Include cxx-gram.at.
13388
13389 * tests/Makefile.am: Add cxx-gram.at.
13390
13391 * src/parse-gram.y:
13392
13393 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
13394
13395 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
13396
133972002-06-27 Akim Demaille <akim@epita.fr>
13398
13399 * src/options.h, src/options.c: Remove.
13400 * src/getargs.c (short_options, long_options): New.
13401
134022002-06-27 Akim Demaille <akim@epita.fr>
13403
13404 * data/bison.simple, data/bison.c++: Rename as...
13405 * data/yacc.c, data/lalr1.cc: these.
13406 * doc/bison.texinfo (Environment Variables): Remove.
13407
134082002-06-25 Raja R Harinath <harinath@cs.umn.edu>
13409
13410 * src/getargs.c (report_argmatch): Initialize strtok().
13411
134122002-06-20 Akim Demaille <akim@epita.fr>
13413
13414 * data/bison.simple (b4_symbol_actions): New, replaces...
13415 (b4_symbol_destructor, b4_symbol_printer): these.
13416 (yysymprint): Be sure to call YYPRINT only for tokens, and using
13417 user token numbers.
13418
134192002-06-20 Akim Demaille <akim@epita.fr>
13420
13421 * data/bison.simple (yydestructor): Rename as...
13422 (yydestruct): this.
13423
134242002-06-20 Akim Demaille <akim@epita.fr>
13425
13426 * src/symtab.h, src/symtab.c (symbol_type_set)
13427 (symbol_destructor_set, symbol_precedence_set): The location is
13428 the last argument.
13429 Adjust all callers.
13430
134312002-06-20 Akim Demaille <akim@epita.fr>
13432
13433 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
13434 internals.
13435 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
13436 Takes a location.
13437 * src/symtab.h, src/symtab.c (symbol_class_set)
13438 (symbol_user_token_number_set): Likewise.
13439 Adjust all callers.
13440 Promote complain_at.
13441 * tests/input.at (Type Clashes): Adjust.
13442
134432002-06-20 Akim Demaille <akim@epita.fr>
13444
13445 * data/bison.simple (YYLEX): Fix the declaration when
13446 %pure-parser.
13447
134482002-06-20 Akim Demaille <akim@epita.fr>
13449
13450 * data/bison.simple (yysymprint): Don't print the token number,
13451 just its name.
13452 * tests/actions.at (Destructors): Rename as...
13453 (Printers and Destructors): this.
13454 Also exercise %printer.
13455
134562002-06-20 Akim Demaille <akim@epita.fr>
13457
13458 * data/bison.simple (YYDSYMPRINT): New.
13459 Use it to remove many of the #if YYDEBUG/if (yydebug).
13460
134612002-06-20 Akim Demaille <akim@epita.fr>
13462
13463 * src/symtab.h, src/symtab.c (symbol_t): printer and
13464 printer_location are new members.
13465 (symbol_printer_set): New.
13466 * src/parse-gram.y (PERCENT_PRINTER): New token.
13467 Handle its associated rule.
13468 * src/scan-gram.l: Adjust.
13469 (handle_destructor_at, handle_destructor_dollar): Rename as...
13470 (handle_symbol_code_at, handle_symbol_code_dollar): these.
13471 * src/output.c (symbol_printers_output): New.
13472 (output_skeleton): Call it.
13473 * data/bison.simple (yysymprint): New. Cannot be named yyprint
13474 since there are already many grammar files with a user `yyprint'.
13475 Replace the calls to YYPRINT to calls to yysymprint.
13476 * tests/calc.at: Adjust.
13477 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
13478 taking advantage of parser very internal details (stack size!).
13479
134802002-06-20 Akim Demaille <akim@epita.fr>
13481
13482 * src/scan-gram.l: Complete the scanner with the missing patterns
13483 to pacify Flex.
13484 Use `quote' and `symbol_tag_get' where appropriate.
13485
134862002-06-19 Akim Demaille <akim@epita.fr>
13487
13488 * tests/actions.at (Destructors): Augment to test locations.
13489 * data/bison.simple (yydestructor): Pass it the current location
13490 if locations are enabled.
13491 Prototype only when __STDC__ or C++.
13492 Change the argument names to move into the yy name space: there is
13493 user code here.
13494
134952002-06-19 Akim Demaille <akim@epita.fr>
13496
13497 * data/bison.simple (b4_pure_if): New.
13498 Use it instead of #ifdef YYPURE.
13499
135002002-06-19 Akim Demaille <akim@epita.fr>
13501
13502 * data/bison.simple (b4_location_if): New.
13503 Use it instead of #ifdef YYLSP_NEEDED.
13504
135052002-06-19 Akim Demaille <akim@epita.fr>
13506
13507 Prepare @$ in %destructor, but currently don't bind it in the
13508 skeleton, as %location use is not cleaned up yet.
13509
13510 * src/scan-gram.l (handle_dollar, handle_destructor_at)
13511 (handle_action_at): New.
13512 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
13513 a braced_code_t and a location as additional arguments.
13514 (handle_destructor_dollar): Instead of requiring `b4_eval', just
13515 unquote one when outputting `b4_dollar_dollar'.
13516 Adjust callers.
13517 * data/bison.simple (b4_eval): Remove.
13518 (b4_symbol_destructor): Adjust.
13519 * tests/input.at (Invalid @n): Adjust.
13520
135212002-06-19 Zack Weinberg <zack@codesourcery.com>
13522
13523 * doc/bison.texinfo: Document ability to have multiple
13524 prologue sections.
13525
135262002-06-18 Akim Demaille <akim@epita.fr>
13527
13528 * src/files.c (compute_base_names): When computing the output file
13529 names from the input file name, strip the directory part.
13530
135312002-06-18 Akim Demaille <akim@epita.fr>
13532
13533 * data/bison.simple.new: Comment changes.
13534 Reported by Andreas Schwab.
13535
135362002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
13537
13538 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
13539 there are no `label `yyoverflowlab' defined but not used' warnings
13540 when yyoverflow is defined.
13541
135422002-06-18 Akim Demaille <akim@epita.fr>
13543
13544 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
13545 new member.
13546 (symbol_destructor_set): Adjust.
13547 * src/output.c (symbol_destructors_output): Output the destructor
13548 locations.
13549 Output the symbol name.
13550 * data/bison.simple (b4_symbol_destructor): Adjust.
13551
135522002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
13553 and Akim Demaille <akim@epita.fr>
13554
13555 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
13556 what's left on the stack when the error recovery hits EOF.
13557 * tests/actions.at (Destructors): Complete to exercise this case.
13558
135592002-06-17 Akim Demaille <akim@epita.fr>
13560
13561 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
13562 arguments is really empty, not only equal to `[]'.
13563 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
13564 member.
13565 (symbol_destructor_set): New.
13566 * src/output.c (symbol_destructors_output): New.
13567 * src/reader.h (brace_code_t, current_braced_code): New.
13568 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
13569 (handle_dollar): Rename as...
13570 (handle_action_dollar): this.
13571 (handle_destructor_dollar): New.
13572 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
13573 (grammar_declaration): Use it.
13574 * data/bison.simple (yystos): Is always defined.
13575 (yydestructor): New.
13576 * tests/actions.at (Destructors): New.
13577 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
13578
135792002-06-17 Akim Demaille <akim@epita.fr>
13580
13581 * src/symlist.h, src/symlist.c (symbol_list_length): New.
13582 * src/scan-gram.l (handle_dollar, handle_at): Compute the
13583 rule_length only when needed.
13584 * src/output.c (actions_output, token_definitions_output): Output
13585 the full M4 block.
13586 * src/symtab.c: Don't access directly to the symbol tag, use
13587 symbol_tag_get.
13588 * src/parse-gram.y: Use symbol_list_free.
13589
135902002-06-17 Akim Demaille <akim@epita.fr>
13591
13592 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
13593 (symbol_list_prepend, get_type_name): Move to...
13594 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
13595 (symbol_list_prepend, symbol_list_n_type_name_get): here.
13596 Adjust all callers.
13597 (symbol_list_free): New.
13598 * src/scan-gram.l (handle_dollar): Takes a location.
13599 * tests/input.at (Invalid $n): Adjust.
13600
136012002-06-17 Akim Demaille <akim@epita.fr>
13602
13603 * src/reader.h, src/reader.c (symbol_list_new): Export it.
13604 (symbol_list_prepend): New.
13605 * src/parse-gram.y (%union): `list' is a new member.
13606 (symbols.1): New, replaces...
13607 (terms_to_prec.1, nterms_to_type.1): these.
13608 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
13609 Take a location as additional argument.
13610 Adjust all callers.
13611
136122002-06-15 Akim Demaille <akim@epita.fr>
13613
13614 * src/parse-gram.y: Move %token in the declaration section so that
13615 we don't depend upon CVS Bison.
13616
136172002-06-15 Akim Demaille <akim@epita.fr>
13618
13619 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
13620 * src/print.c (print_core): Use it.
13621
136222002-06-15 Akim Demaille <akim@epita.fr>
13623
13624 * src/conflicts.c (log_resolution): Accept the rule involved in
13625 the sr conflicts instead of the lookahead number that points to
13626 that rule.
13627 (flush_reduce): Accept the current lookahead vector as argument,
13628 instead of the index in LA.
13629 (resolve_sr_conflict): Accept the current number of lookahead
13630 bitset to consider for the STATE, instead of the index in LA.
13631 (set_conflicts): Adjust.
13632 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
13633
136342002-06-15 Akim Demaille <akim@epita.fr>
13635
13636 * src/state.h (state_t): Replace the `lookaheadsp' member, a
13637 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
13638 Adjust all dependencies.
13639 * src/lalr.c (initialize_lookaheads): Split into...
13640 (states_lookaheads_count, states_lookaheads_initialize): these.
13641 (lalr): Adjust.
13642
136432002-06-15 Akim Demaille <akim@epita.fr>
13644
13645 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
13646 out of...
13647 (grammar_rules_print): here.
13648 * src/reduce.c (reduce_output): Use it.
13649 * tests/reduce.at (Useless Rules, Reduced Automaton)
13650 (Underivable Rules): Adjust.
13651
136522002-06-15 Akim Demaille <akim@epita.fr>
13653
13654 Copy BYacc's nice way to report the grammar.
13655
13656 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
13657 New.
13658 Don't print the rules' location, it is confusing and useless.
13659 (rule_print): Use grammar_rhs_print.
13660 * src/print.c (print_grammar): Use grammar_rules_print.
13661
136622002-06-15 Akim Demaille <akim@epita.fr>
13663
13664 Complete and rationalize `useless thing' warnings.
13665
13666 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
13667 (symbol_tag_print): New.
13668 Use them everywhere in place of accessing directly the tag member.
13669 * src/gram.h, src/gram.c (rule_print): New.
13670 Use it where a rule used to be printed `by hand'.
13671 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
13672 (reduce_grammar_tables): Report the useless rules.
13673 (reduce_print): Useless things are a warning, not an error.
13674 Report it as such.
13675 * tests/reduce.at (Useless Nonterminals, Useless Rules):
13676 (Reduced Automaton, Underivable Rules): Adjust.
13677 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
13678 * tests/conflicts.at (Unresolved SR Conflicts)
13679 (Solved SR Conflicts): Adjust.
13680
136812002-06-15 Akim Demaille <akim@epita.fr>
13682
13683 Let symbols have a location.
13684
13685 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
13686 (getsym): Adjust.
13687 Adjust all callers.
13688 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
13689 Use location_t, not int.
13690 * src/symtab.c (symbol_check_defined): Take advantage of the
13691 location.
13692 * tests/regression.at (Invalid inputs): Adjust.
13693
136942002-06-15 Akim Demaille <akim@epita.fr>
13695
13696 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
13697 (input): Don't try to initialize yylloc here, do it in the
13698 scanner.
13699 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
13700 * src/gram.h (rule_t): Change line and action_line into location
13701 and action_location, of location_t type.
13702 Adjust all dependencies.
13703 * src/location.h, src/location.c (empty_location): New.
13704 * src/reader.h, src/reader.c (grammar_start_symbol_set)
13705 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
13706 (grammar_current_rule_symbol_append)
13707 (grammar_current_rule_action_append): Expect a location as argument.
13708 * src/reader.c (grammar_midrule_action): Adjust to attach an
13709 action's location as dummy symbol location.
13710 * src/symtab.h, src/symtab.c (startsymbol_location): New.
13711 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
13712 the line numbers.
13713
137142002-06-14 Akim Demaille <akim@epita.fr>
13715
13716 Grammar declarations may be found in the grammar section.
13717
13718 * src/parse-gram.y (rules_or_grammar_declaration): New.
13719 (declarations): Each declaration may end with a semicolon, not
13720 just...
13721 (grammar_declaration): `"%union"'.
13722 (grammar): Branch to rules_or_grammar_declaration.
13723
137242002-06-14 Akim Demaille <akim@epita.fr>
13725
13726 * src/main.c (main): Invoke scanner_free.
13727
137282002-06-14 Akim Demaille <akim@epita.fr>
13729
13730 * src/output.c (m4_invoke): Extracted from...
13731 (output_skeleton): here.
13732 Free tempfile.
13733
137342002-06-14 Akim Demaille <akim@epita.fr>
13735
13736 * src/parse-gram.y (directives, directive, gram)
13737 (grammar_directives, precedence_directives, precedence_directive):
13738 Rename as...
13739 (declarations, declaration, grammar, grammar_declaration)
13740 (precedence_declaration, precedence_declarator): these.
13741 (symbol_declaration): New.
13742
137432002-06-14 Akim Demaille <akim@epita.fr>
13744
13745 * src/files.c (action_obstack): Remove, unused.
13746 (output_obstack): Remove it, and all its dependencies, as it is no
13747 longer needed.
13748 * src/reader.c (epilogue_set): Build the epilogue in the
13749 muscle_obstack.
13750 * src/output.h, src/output.c (muscle_obstack): Move to...
13751 * src/muscle_tab.h, src/muscle_tab.h: here.
13752 (muscle_init): Initialize muscle_obstack.
13753 (muscle_free): New.
13754 * src/main.c (main): Call it.
13755
137562002-06-14 Akim Demaille <akim@epita.fr>
13757
13758 * src/location.h: New, extracted from...
13759 * src/reader.h: here.
13760 * src/Makefile.am (noinst_HEADERS): Merge into
13761 (bison_SOURCES): this.
13762 Add location.h.
13763 * src/parse-gram.y: Use location_t instead of Bison's.
13764 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
13765 Use location_t instead of ints.
13766
137672002-06-14 Akim Demaille <akim@epita.fr>
13768
13769 * data/bison.simple, data/bison.c++: Be sure to restore the
13770 current #line when returning to the skeleton contents after having
13771 exposed the input file's #line.
13772
137732002-06-12 Akim Demaille <akim@epita.fr>
13774
13775 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
13776 eager.
13777 * tests/actions.at (Exotic Dollars): New.
13778
137792002-06-12 Akim Demaille <akim@epita.fr>
13780
13781 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
13782 ['"/] too eagerly.
13783 * tests/input.at (Torturing the Scanner): New.
13784
137852002-06-11 Akim Demaille <akim@epita.fr>
13786
13787 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
13788 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
13789 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
13790 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
13791 * src/reader.c (reader): Use it.
13792
137932002-06-11 Akim Demaille <akim@epita.fr>
13794
13795 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
13796 Adjust all callers.
13797 (scanner_last_string_free): New.
13798
137992002-06-11 Akim Demaille <akim@epita.fr>
13800
13801 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
13802 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
13803 (last_string, YY_OBS_FREE): New.
13804 Use them when returning an ID.
13805
138062002-06-11 Akim Demaille <akim@epita.fr>
13807
13808 Have Bison grammars parsed by a Bison grammar.
13809
13810 * src/reader.c, src/reader.h (prologue_augment): New.
13811 * src/reader.c (copy_definition): Remove.
13812
13813 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
13814 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
13815 (grammar_current_rule_prec_set, grammar_current_rule_check)
13816 (grammar_current_rule_symbol_append)
13817 (grammar_current_rule_action_append): Export.
13818 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
13819 (symbol_list_action_append): Remove.
13820 Hook the routines from reader.
13821 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
13822 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
13823
13824 * src/reader.c (read_declarations): Remove, unused.
13825
13826 * src/parse-gram.y: Handle the epilogue.
13827 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
13828 (grammar_start_symbol_set): this.
13829 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
13830 * src/reader.c (readgram): Remove, unused.
13831 (reader): Adjust to insert eoftoken and axiom where appropriate.
13832
13833 * src/reader.c (copy_dollar): Replace with...
13834 * src/scan-gram.h (handle_dollar): this.
13835 * src/parse-gram.y: Remove `%thong'.
13836
13837 * src/reader.c (copy_at): Replace with...
13838 * src/scan-gram.h (handle_at): this.
13839
13840 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
13841 New.
13842
13843 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
13844 time being.
13845
13846 * src/reader.h, src/reader.c (grammar_rule_end): New.
13847
13848 * src/parse.y (current_type, current_class): New.
13849 Implement `%nterm', `%token' support.
13850 Merge `%term' into `%token'.
13851 (string_as_id): New.
13852 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
13853 type name.
13854
13855 * src/parse-gram.y: Be sure to handle properly the beginning of
13856 rules.
13857
13858 * src/parse-gram.y: Handle %type.
13859 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13860
13861 * src/parse-gram.y: More directives support.
13862 * src/options.c: No longer handle source directives.
13863
13864 * src/parse-gram.y: Fix %output.
13865
13866 * src/parse-gram.y: Handle %union.
13867 Use the prologue locations.
13868 * src/reader.c (parse_union_decl): Remove.
13869
13870 * src/reader.h, src/reader.c (epilogue_set): New.
13871 * src/parse-gram.y: Use it.
13872
13873 * data/bison.simple, data/bison.c++: b4_stype is now either not
13874 defined, then default to int, or to the contents of %union,
13875 without `union' itself.
13876 Adjust.
13877 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13878
13879 * src/output.c (actions_output): Don't output braces, as they are
13880 already handled by the scanner.
13881
13882 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13883 characters to themselves.
13884
13885 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13886 that the epilogue has a proper #line.
13887
13888 * src/parse-gram.y: Handle precedence/associativity.
13889
13890 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13891 a terminal.
13892 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13893 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13894 at all to define terminals that cannot be emitted.
13895
13896 * src/scan-gram.l: Escape M4 characters.
13897
13898 * src/scan-gram.l: Working properly with escapes in user
13899 strings/characters.
13900
13901 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13902 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13903 grammar.
13904 Use more modest sizes, as for the time being the parser does not
13905 release memory, and therefore the process swallows a huge amount
13906 of memory.
13907
13908 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13909 stricter %token grammar.
13910
13911 * src/symtab.h (associativity): Add `undef_assoc'.
13912 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13913 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13914
13915 * tests/regression.at (Invalid %directive): Remove, as it is now
13916 meaningless.
13917 (Invalid inputs): Adjust to the new error messages.
13918 (Token definitions): The new grammar doesn't allow too many
13919 eccentricities.
13920
13921 * src/lex.h, src/lex.c: Remove.
13922 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13923 (copy_character, copy_string2, copy_string, copy_identifier)
13924 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13925 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13926 (parse_action): Remove.
13927 * po/POTFILES.in: Adjust.
13928
139292002-06-11 Akim Demaille <akim@epita.fr>
13930
13931 * src/reader.c (parse_action): Don't store directly into the
13932 rule's action member: return the action as a string.
13933 Don't require `rule_length' as an argument: compute it.
13934 (grammar_current_rule_symbol_append)
13935 (grammar_current_rule_action_append): New, eved out from
13936 (readgram): here.
13937 Remove `action_flag', `rulelength', unused now.
13938
139392002-06-11 Akim Demaille <akim@epita.fr>
13940
13941 * src/reader.c (grammar_current_rule_prec_set).
13942 (grammar_current_rule_check): New, eved out from...
13943 (readgram): here.
13944 Remove `xaction', `first_rhs': useless.
13945 * tests/input.at (Type clashes): New.
13946 * tests/existing.at (GNU Cim Grammar): Adjust.
13947
139482002-06-11 Akim Demaille <akim@epita.fr>
13949
13950 * src/reader.c (grammar_midrule_action): New, Eved out from
13951 (readgram): here.
13952
139532002-06-11 Akim Demaille <akim@epita.fr>
13954
13955 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13956 New.
13957 (readgram): Use them as replacement of inlined code, crule and
13958 crule1.
13959
139602002-06-11 Akim Demaille <akim@epita.fr>
13961
13962 * src/reader.c (grammar_end, grammar_symbol_append): New.
13963 (readgram): Use them.
13964 Make the use of `p' as local as possible.
13965
139662002-06-10 Akim Demaille <akim@epita.fr>
13967
13968 GCJ's parser requires the tokens to be defined before the prologue.
13969
13970 * data/bison.simple: Output the token definition before the user's
13971 prologue.
13972 * tests/regression.at (Braces parsing, Duplicate string)
13973 (Mixing %token styles): Check the output from bison.
13974 (Early token definitions): New.
13975
139762002-06-10 Akim Demaille <akim@epita.fr>
13977
13978 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13979 assigning twice the same user number to a token, so that we can
13980 use it in...
13981 * src/lex.c (lex): here.
13982 Also use `symbol_class_set' instead of hand written code.
13983 * src/reader.c (parse_assoc_decl): Likewise.
13984
139852002-06-10 Akim Demaille <akim@epita.fr>
13986
13987 * src/symtab.c, src/symtab.c (symbol_class_set)
13988 (symbol_user_token_number_set): New.
13989 * src/reader.c (parse_token_decl): Use them.
13990 Use a switch instead of ifs.
13991 Use a single argument.
13992
139932002-06-10 Akim Demaille <akim@epita.fr>
13994
13995 Remove `%thong' support as it is undocumented, unused, duplicates
13996 `%token's job, and creates useless e-mail traffic with people who
13997 want to know what it is, why it is undocumented, unused, and
13998 duplicates `%token's job.
13999
14000 * src/reader.c (parse_thong_decl): Remove.
14001 * src/options.c (option_table): Remove "thong".
14002 * src/lex.h (tok_thong): Remove.
14003
140042002-06-10 Akim Demaille <akim@epita.fr>
14005
14006 * src/symtab.c, src/symtab.c (symbol_type_set)
14007 (symbol_precedence_set): New.
14008 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
14009 (value_components_used): Remove, unused.
14010
140112002-06-09 Akim Demaille <akim@epita.fr>
14012
14013 Move symbols handling code out of the reader.
14014
14015 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
14016 (axiom): Move to...
14017 * src/symtab.h, src/symtab.c: here.
14018
14019 * src/gram.c (start_symbol): Remove: use startsymbol->number.
14020 * src/reader.c (startval): Rename as...
14021 * src/symtab.h, src/symtab.c (startsymbol): this.
14022 * src/reader.c: Adjust.
14023
14024 * src/reader.c (symbol_check_defined, symbol_make_alias)
14025 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14026 (token_translations_init)
14027 Move to...
14028 * src/symtab.c: here.
14029 * src/reader.c (packsymbols): Move to...
14030 * src/symtab.h, src/symtab.c (symbols_pack): here.
14031 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
14032 argument.
14033
140342002-06-03 Akim Demaille <akim@epita.fr>
14035
14036 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
14037 then statements.
14038
140392002-06-03 Akim Demaille <akim@epita.fr>
14040
14041 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
14042 structs with non literals.
14043 * src/scan-skel.l: never-interactive.
14044 * src/conflicts.c (enum conflict_resolution_e): No trailing
14045 comma.
14046 * src/getargs.c (usage): Split long literal strings.
14047 Reported by Hans Aberg.
14048
140492002-05-28 Akim Demaille <akim@epita.fr>
14050
14051 * data/bison.c++: Use C++ ostreams.
14052 (cdebug_): New member.
14053
140542002-05-28 Akim Demaille <akim@epita.fr>
14055
14056 * src/output.c (output_skeleton): Be sure to allocate enough room
14057 for `/' _and_ for `\0' in full_skeleton.
14058
140592002-05-28 Akim Demaille <akim@epita.fr>
14060
14061 * data/bison.c++: Catch up with bison.simple:
14062 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14063 and Paul Eggert <eggert@twinsun.com>: `error' handing.
14064 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
14065 and popping traces.
14066
140672002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14068
14069 * src/output.c (output_skeleton): Put an explicit path in front of
14070 the skeleton file name, rather than relying on the -I directory,
14071 to partially alleviate effects of having a skeleton file lying around
14072 in the current directory.
14073
140742002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14075
14076 * src/conflicts.c (log_resolution): Correct typo:
14077 obstack_printf should be obstack_fgrow1.
14078
140792002-05-26 Akim Demaille <akim@epita.fr>
14080
14081 * src/state.h (state_t): `solved_conflicts' is a new member.
14082 * src/LR0.c (new_state): Set it to 0.
14083 * src/conflicts.h, src/conflicts.c (print_conflicts)
14084 (free_conflicts, solve_conflicts): Rename as...
14085 (conflicts_print, conflicts_free, conflicts_solve): these.
14086 Adjust callers.
14087 * src/conflicts.c (enum conflict_resolution_e)
14088 (solved_conflicts_obstack): New, used by...
14089 (log_resolution): this.
14090 Adjust to attach the conflict resolution to each state.
14091 Complete the description with the precedence/associativity
14092 information.
14093 (resolve_sr_conflict): Adjust.
14094 * src/print.c (print_state): Output its solved_conflicts.
14095 * tests/conflicts.at (Unresolved SR Conflicts)
14096 (Solved SR Conflicts): Exercise --report=all.
14097
140982002-05-26 Akim Demaille <akim@epita.fr>
14099
14100 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14101 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14102 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
14103 (token_number_t, item_number_as_token_number)
14104 (token_number_as_item_number, muscle_insert_token_number_table):
14105 Rename as...
14106 (symbol_number_t, item_number_as_symbol_number)
14107 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
14108 these, since it is more appropriate.
14109
141102002-05-26 Akim Demaille <akim@epita.fr>
14111
14112 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
14113 `Error:' lines.
14114 * data/bison.simple (yystos) [YYDEBUG]: New.
14115 (yyparse) [YYDEBUG]: Display the symbols which are popped during
14116 error recovery.
14117 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
14118
141192002-05-25 Akim Demaille <akim@epita.fr>
14120
14121 * doc/bison.texinfo (Debugging): Split into...
14122 (Tracing): this new section, its former contents, and...
14123 (Understanding): this new section.
14124 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
14125 by...
14126 (report_flag): this.
14127 Adjust all dependencies.
14128 (report_args, report_types, report_argmatch): New.
14129 (usage, getargs): Report/support -r, --report.
14130 * src/options.h
14131 (struct option_table_struct): Rename as..,
14132 (struct option_table_s): this.
14133 Rename the `set_flag' member to `flag' to match with getopt_long's
14134 struct.
14135 * src/options.c (option_table): Split verbose into an entry for
14136 %verbose, and another for --verbose.
14137 Support --report/-r, so remove -r from the obsolete --raw.
14138 * src/print.c: Attach full item sets and lookaheads reports to
14139 report_flag instead of trace_flag.
14140 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
14141
141422002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14143 and Paul Eggert <eggert@twinsun.com>
14144
14145 * data/bison.simple (yyparse): Correct error handling to conform to
14146 POSIX and yacc. Specifically, after syntax error is discovered,
14147 do not reduce further before shifting the error token.
14148 Clean up the code a bit by removing the labels yyerrdefault,
14149 yyerrhandle, yyerrpop.
14150 * NEWS: Document the above.
14151
141522002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14153
14154 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
14155 type; it isn't always big enough, since it doesn't necessarily
14156 include non-terminals.
14157 (yytranslate): Expand definition of yy_token_number_type, so that
14158 the latter can be removed.
14159 (yy_token_number_type): Remove, only one use.
14160 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
14161 don't use TokenNumberType as element type.
14162
14163 * tests/regression.at: Modify expected output to agree with change
14164 to yyr1 and yytranslate.
14165
141662002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
14167
14168 * src/reader.c (parse_action): Use copy_character instead of
14169 obstack_1grow.
14170
141712002-05-13 Akim Demaille <akim@epita.fr>
14172
14173 * tests/regression.at (Token definitions): Prototype yylex and
14174 yyerror.
14175
141762002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14177
14178 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
14179 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
14180 32-bit arithmetic.
14181 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
14182
141832002-05-07 Akim Demaille <akim@epita.fr>
14184
14185 * tests/synclines.at: Be sure to prototype yylex and yyerror to
14186 avoid GCC warnings.
14187
141882002-05-07 Akim Demaille <akim@epita.fr>
14189
14190 Kill GCC warnings.
14191
14192 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
14193 over the RHS of each rule.
14194 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
14195 * src/state.h (state_t): Member `nitems' is unsigned short.
14196 * src/LR0.c (get_state): Adjust.
14197 * src/reader.c (packgram): Likewise.
14198 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
14199 `Type'.
14200 (muscle_insert_int_table): Remove, unused.
14201 (prepare_rules): Remove `max'.
14202
142032002-05-06 Akim Demaille <akim@epita.fr>
14204
14205 * src/closure.c (print_firsts): Display of the symbol tags.
14206 (bitmatrix_print): Move to...
14207 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
14208 here.
14209 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
14210
142112002-05-06 Akim Demaille <akim@epita.fr>
14212
14213 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
14214 hash_do_for_each.
14215
142162002-05-06 Akim Demaille <akim@epita.fr>
14217
14218 * src/LR0.c (new_state, get_state): Instead of using the global
14219 `kernel_size' and `kernel_base', have two new arguments:
14220 `core_size' and `core'.
14221 Adjust callers.
14222
142232002-05-06 Akim Demaille <akim@epita.fr>
14224
14225 * src/reader.c (packgram): No longer end `ritem' with a 0
14226 sentinel: it is not used.
14227
142282002-05-05 Akim Demaille <akim@epita.fr>
14229
14230 New experimental feature: display the lookaheads in the report and
14231 graph.
14232
14233 * src/print (print_core): When --trace-flag, display the rules
14234 lookaheads.
14235 * src/print_graph.c (print_core): Likewise.
14236 Swap the arguments.
14237 Adjust caller.
14238
142392002-05-05 Akim Demaille <akim@epita.fr>
14240
14241 * tests/torture.at (Many lookaheads): New test.
14242
142432002-05-05 Akim Demaille <akim@epita.fr>
14244
14245 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
14246 (GENERATE_MUSCLE_INSERT_TABLE): this.
14247 (output_int_table, output_unsigned_int_table, output_short_table)
14248 (output_token_number_table, output_item_number_table): Replace with...
14249 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
14250 (muscle_insert_short_table, muscle_insert_token_number_table)
14251 (muscle_insert_item_number_table): these.
14252 Adjust all callers.
14253 (prepare_tokens): Don't free `translations', since...
14254 * src/reader.h, src/reader.c (grammar_free): do it.
14255 Move to...
14256 * src/gram.h, src/gram.c (grammar_free): here.
14257 * data/bison.simple, data/bison.c++: b4_token_number_max is now
14258 b4_translate_max.
14259
142602002-05-05 Akim Demaille <akim@epita.fr>
14261
14262 * src/output.c (output_unsigned_int_table): New.
14263 (prepare_rules): `i' is unsigned.
14264 `prhs', `rline', `r2' are unsigned int.
14265 Rename muscle `rhs_number_max' as `rhs_max'.
14266 Output muscles `prhs_max', `rline_max', and `r2_max'.
14267 Free rline and r1.
14268 * data/bison.simple, data/bison.c++: Adjust to use these muscles
14269 to compute types instead of constant types.
14270 * tests/regression.at (Web2c Actions): Adjust.
14271
142722002-05-04 Akim Demaille <akim@epita.fr>
14273
14274 * src/symtab.h (SALIAS, SUNDEF): Rename as...
14275 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
14276 Adjust dependencies.
14277 * src/output.c (token_definitions_output): Be sure not to output a
14278 `#define 'a'' when fed with `%token 'a' "a"'.
14279 * tests/regression.at (Token definitions): New.
14280
142812002-05-03 Paul Eggert <eggert@twinsun.com>
14282
14283 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
14284 for K&R C.
14285
142862002-05-03 gettextize <bug-gnu-gettext@gnu.org>
14287
14288 * Makefile.am (SUBDIRS): Remove intl.
14289 (EXTRA_DIST): Add config/config.rpath.
14290
142912002-05-03 Akim Demaille <akim@epita.fr>
14292
14293 * data/bison.simple (m4_if): Don't output empty enums.
14294 And actually, output valid enum definitions :(.
14295
142962002-05-03 Akim Demaille <akim@epita.fr>
14297
14298 * configure.bat: Remove, completely obsolete.
14299 * Makefile.am (EXTRA_DIST): Adjust.
14300 Don't distribute config.rpath...
14301 * config/Makefile.am (EXTRA_DIST): Do it.
14302
143032002-05-03 Akim Demaille <akim@epita.fr>
14304
14305 * configure.in (GETTEXT_VERSION): New.
14306 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
14307
143082002-05-03 Akim Demaille <akim@epita.fr>
14309
14310 * data/bison.simple (b4_token_enum): New.
14311 (b4_token_defines): Use it to output tokens both as #define and
14312 enums.
14313 Suggested by Paul Eggert.
14314 * src/output.c (token_definitions_output): Don't output spurious
14315 white spaces.
14316
143172002-05-03 Akim Demaille <akim@epita.fr>
14318
14319 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14320
143212002-05-02 Robert Anisko <robert@lrde.epita.fr>
14322
14323 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
14324 Update the stack class, give a try to deque as the default container.
14325
143262002-05-02 Akim Demaille <akim@epita.fr>
14327
14328 * data/bison.simple (yyparse): Do not implement @$ = @1.
14329 (YYLLOC_DEFAULT): Adjust to do it.
14330 * doc/bison.texinfo (Location Default Action): Fix.
14331
143322002-05-02 Akim Demaille <akim@epita.fr>
14333
14334 * src/reader.c (parse_braces): Merge into...
14335 (parse_action): this.
14336
143372002-05-02 Akim Demaille <akim@epita.fr>
14338
14339 * configure.in (ALL_LINGUAS): Remove.
14340 * po/LINGUAS, hr.po: New.
14341
143422002-05-02 Akim Demaille <akim@epita.fr>
14343
14344 Remove the so called hairy (semantic) parsers.
14345
14346 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
14347 * src/gram.h, src/gram.c (semantic_parser): Remove.
14348 (rule_t): Remove the guard and guard_line members.
14349 * src/lex.h (token_t): remove tok_guard.
14350 * src/options.c (option_table): Remove %guard and %semantic_parser
14351 support.
14352 * src/output.c, src/output.h (guards_output): Remove.
14353 (prepare): Adjust.
14354 (token_definitions_output): Don't output the `T'
14355 tokens (???).
14356 (output_skeleton): Don't output the guards.
14357 * src/files.c, src/files.c (attrsfile): Remove.
14358 * src/reader.c (symbol_list): Remove the guard and guard_line
14359 members.
14360 Adjust dependencies.
14361 (parse_guard): Remove.
14362 * data/bison.hairy: Remove.
14363 * doc/bison.texinfo (Environment Variables): Remove occurrences of
14364 BISON_HAIRY.
14365
143662002-05-02 Akim Demaille <akim@epita.fr>
14367
14368 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
14369 (parse_guard): Rename the formal argument `stack_offset' as
14370 `rule_length', which is more readable.
14371 Adjust callers.
14372 (copy_at, copy_dollar): Instead of outputting the hard coded
14373 values of $$, $n and so forth, output invocation to b4_lhs_value,
14374 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
14375 Note: this patch partially drops `semantic-parser' support: it
14376 always does `rule_length - n', where semantic parsers ought to
14377 always use `-n'.
14378 * data/bison.simple, data/bison.c++ (b4_lhs_value)
14379 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
14380
143812002-05-02 Akim Demaille <akim@epita.fr>
14382
14383 * configure.in (AC_INIT): Bump to 1.49b.
14384 (AM_INIT_AUTOMAKE): Short invocation.
14385
143862002-05-02 Akim Demaille <akim@epita.fr>
14387
14388 Version 1.49a.
14389
143902002-05-01 Akim Demaille <akim@epita.fr>
14391
14392 * src/skeleton.h: Remove.
14393
143942002-05-01 Akim Demaille <akim@epita.fr>
14395
14396 * src/skeleton.h: Fix the #endif.
14397 Reported by Magnus Fromreide.
14398
143992002-04-26 Paul Eggert <eggert@twinsun.com>
14400
14401 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
14402 Define if we define YYSTYPE and YYLTYPE, respectively.
14403 (YYCOPY): Fix [] quoting problem in the non-GCC case.
14404
144052002-04-25 Robert Anisko <robert@lrde.epita.fr>
14406
14407 * src/scan-skel.l: Postprocess quadrigraphs.
14408
14409 * src/reader.c (copy_character): New function, used to output
14410 single characters while replacing `[' and `]' with quadrigraphs, to
14411 avoid troubles with M4 quotes.
14412 (copy_comment): Output characters with copy_character.
14413 (read_additionnal_code): Likewise.
14414 (copy_string2): Likewise.
14415 (copy_definition): Likewise.
14416
14417 * tests/calc.at: Exercise M4 quoting.
14418
144192002-04-25 Akim Demaille <akim@epita.fr>
14420
14421 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
14422 between `!' and the command.
14423 Reported by Paul Eggert.
14424
144252002-04-24 Robert Anisko <robert@lrde.epita.fr>
14426
14427 * tests/calc.at: Exercise prologue splitting.
14428
14429 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
14430 `b4_post_prologue' instead of `b4_prologue'.
14431
14432 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
14433 muscles.
14434 (output): Free pre_prologue_obstack and post_prologue_obstack.
14435 * src/files.h, src/files.c (attrs_obstack): Remove.
14436 (pre_prologue_obstack, post_prologue_obstack): New.
14437 * src/reader.c (copy_definition): Add a parameter to specify the
14438 obstack to fill, instead of using attrs_obstack unconditionally.
14439 (read_declarations): Pass pre_prologue_obstack to copy_definition if
14440 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
14441
144422002-04-23 Paul Eggert <eggert@twinsun.com>
14443
14444 * data/bison.simple: Remove unnecessary commentary and white
14445 space differences from 1_29-branch.
14446 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
14447
14448 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
14449 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
14450 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
14451 constructors or destructors.
14452
14453 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
14454
144552002-04-23 Akim Demaille <akim@epita.fr>
14456
14457 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
14458 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
14459 location with columns.
14460 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
14461 All reported by Paul Eggert.
14462
144632002-04-22 Akim Demaille <akim@epita.fr>
14464
14465 * src/reduce.c (dump_grammar): Move to...
14466 * src/gram.h, src/gram.c (grammar_dump): here.
14467 Be sure to separate long item numbers.
14468 Don't read the members of a rule's prec if its nil.
14469
144702002-04-22 Akim Demaille <akim@epita.fr>
14471
14472 * src/output.c (table_size, table_grow): New.
14473 (MAXTABLE): Remove, replace uses with table_size.
14474 (pack_vector): Instead of dying when the table is too big, grow it.
14475
144762002-04-22 Akim Demaille <akim@epita.fr>
14477
14478 * data/bison.simple (yyr1): Its type is that of a token number.
14479 * data/bison.c++ (r1_): Likewise.
14480 * tests/regression.at (Web2c Actions): Adjust.
14481
144822002-04-22 Akim Demaille <akim@epita.fr>
14483
14484 * src/reader.c (token_translations_init): 256 is now the default
14485 value for the error token, i.e., it will be assigned another
14486 number if the user assigned 256 to one of her tokens.
14487 (reader): Don't force 256 to error.
14488 * doc/bison.texinfo (Symbols): Adjust.
14489 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
14490 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
14491 etc. instead of 10, 20, 30 (which was used to `jump' over error
14492 (256) and undefined (2)).
14493
144942002-04-22 Akim Demaille <akim@epita.fr>
14495
14496 Propagate more token_number_t.
14497
14498 * src/gram.h (token_number_as_item_number)
14499 (item_number_as_token_number): New.
14500 * src/output.c (GENERATE_OUTPUT_TABLE): New.
14501 Use it to create output_item_number_table and
14502 output_token_number_table.
14503 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14504 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
14505 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
14506 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
14507
145082002-04-22 Akim Demaille <akim@epita.fr>
14509
14510 * src/output.h, src/output.c (get_lines_number): Remove.
14511
145122002-04-19 Akim Demaille <akim@epita.fr>
14513
14514 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
14515 as Lex/Flex'.
14516 (Debugging): More details about enabling the debugging features.
14517 (Table of Symbols): Describe $$, $n, @$, and @n.
14518 Suggested by Tim Josling.
14519
145202002-04-19 Akim Demaille <akim@epita.fr>
14521
14522 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
14523
145242002-04-10 Akim Demaille <akim@epita.fr>
14525
14526 * src/system.h: Rely on HAVE_LIMITS_H.
14527 Suggested by Paul Eggert.
14528
145292002-04-09 Akim Demaille <akim@epita.fr>
14530
14531 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
14532 full stderr, and strip it according to the bison options, instead
14533 of composing the error message from different bits.
14534 This makes it easier to check for several error messages.
14535 Adjust all the invocations.
14536 Add an invocation exercising the error token.
14537 Add an invocation demonstrating a stupid error message.
14538 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
14539 Adjust the tests.
14540 Error message are for stderr, not stdout.
14541
145422002-04-09 Akim Demaille <akim@epita.fr>
14543
14544 * src/gram.h, src/gram.c (error_token_number): Remove, use
14545 errtoken->number.
14546 * src/reader.c (reader): Don't specify the user token number (2)
14547 for $undefined, as it uselessly prevents using it.
14548 * src/gram.h (token_number_t): Move to...
14549 * src/symtab.h: here.
14550 (state_t.number): Is a token_number_t.
14551 * src/print.c, src/reader.c: Use undeftoken->number instead of
14552 hard coded 2.
14553 (Even though this 2 is not the same as above: the number of the
14554 undeftoken remains being 2, it is its user token number which
14555 might not be 2).
14556 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
14557 `user_token_number_max'.
14558 Output `undef_token_number'.
14559 * data/bison.simple, data/bison.c++: Use them.
14560 Be sure to map invalid yylex return values to
14561 `undef_token_number'. This saves us from gratuitous SEGV.
14562
14563 * tests/conflicts.at (Solved SR Conflicts)
14564 (Unresolved SR Conflicts): Adjust.
14565 * tests/regression.at (Web2c Actions): Adjust.
14566
145672002-04-08 Akim Demaille <akim@epita.fr>
14568
14569 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
14570 Adding #line.
14571 Remove the duplicate `typedefs'.
14572 (RhsNumberType): Fix the declaration and various other typos.
14573 Use __ofile__.
14574 * data/bison.simple: Use __ofile__.
14575 * src/scan-skel.l: Handle __ofile__.
14576
145772002-04-08 Akim Demaille <akim@epita.fr>
14578
14579 * src/gram.h (item_number_t): New, the type of item numbers in
14580 RITEM. Note that it must be able to code symbol numbers as
14581 positive number, and the negation of rule numbers as negative
14582 numbers.
14583 Adjust all dependencies (pretty many).
14584 * src/reduce.c (rule): Remove this `short *' pointer: use
14585 item_number_t.
14586 * src/system.h (MINSHORT, MAXSHORT): Remove.
14587 Include `limits.h'.
14588 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
14589 (shortcpy): Remove.
14590 (MAXTABLE): Move to...
14591 * src/output.c (MAXTABLE): here.
14592 (prepare_rules): Use output_int_table to output rhs.
14593 * data/bison.simple, data/bison.c++: Adjust.
14594 * tests/torture.at (Big triangle): Move the limit from 254 to
14595 500.
14596 * tests/regression.at (Web2c Actions): Ajust.
14597
14598 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
14599 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
14600 passes, but produces negative #line number, once fixed, GCC is
14601 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
14602 C), it passes.
14603 * src/state.h (state_h): Code input lines on ints, not shorts.
14604
146052002-04-08 Akim Demaille <akim@epita.fr>
14606
14607 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
14608 and then the grammar.
14609
146102002-04-08 Akim Demaille <akim@epita.fr>
14611
14612 * src/system.h: No longer using strndup.
14613
146142002-04-07 Akim Demaille <akim@epita.fr>
14615
14616 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
14617 * src/output.c (output_table_data): Return the longest number.
14618 (prepare_tokens): Output `token_number_max').
14619 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
14620 New.
14621 Use them to define yy_token_number_type/TokenNumberType.
14622 Use this type for yytranslate.
14623 * tests/torture.at (Big triangle): Push the limit from 124 to
14624 253.
14625 * tests/regression.at (Web2c Actions): Adjust.
14626
146272002-04-07 Akim Demaille <akim@epita.fr>
14628
14629 * tests/torture.at (Big triangle): New.
14630 (GNU AWK Grammar, GNU Cim Grammar): Move to...
14631 * tests/existing.at: here.
14632
146332002-04-07 Akim Demaille <akim@epita.fr>
14634
14635 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
14636 nritems.
14637 Adjust dependencies.
14638
146392002-04-07 Akim Demaille <akim@epita.fr>
14640
14641 * src/reader.c: Normalize increments to prefix form.
14642
146432002-04-07 Akim Demaille <akim@epita.fr>
14644
14645 * src/reader.c, symtab.c: Remove debugging code.
14646
146472002-04-07 Akim Demaille <akim@epita.fr>
14648
14649 Rename all the `bucket's as `symbol_t'.
14650
14651 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
14652 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
14653 * src/symtab.c, src/symtab.h (bucket): Rename as...
14654 (symbol_t): this.
14655 (symbol_list_new, bucket_check_defined, bucket_make_alias)
14656 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
14657 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14658 (buckets_new, buckets_free, buckets_do): Rename as...
14659 (symbol_list_new, symbol_check_defined, symbol_make_alias)
14660 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14661 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
14662 (symbols_new, symbols_free, symbols_do): these.
14663
146642002-04-07 Akim Demaille <akim@epita.fr>
14665
14666 Use lib/hash for the symbol table.
14667
14668 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
14669 EOF.
14670 * src/lex.c (lex): Set the `number' member of new terminals.
14671 * src/reader.c (bucket_check_defined, bucket_make_alias)
14672 (bucket_check_alias_consistence, bucket_translation): New.
14673 (reader, grammar_free, readgram, token_translations_init)
14674 (packsymbols): Adjust.
14675 (reader): Number the predefined tokens.
14676 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
14677 for predefined tokens.
14678 * src/symtab.h (bucket): Remove all the hash table related
14679 members.
14680 * src/symtab.c (symtab): Replace by...
14681 (bucket_table): this.
14682 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14683 (buckets_new, buckets_do): New.
14684
146852002-04-07 Akim Demaille <akim@epita.fr>
14686
14687 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
14688 (start_symbol, max_user_token_number, semantic_parser)
14689 (error_token_number): Initialize.
14690 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
14691 Initialize.
14692 (reader): Don't.
14693 (errtoken, eoftoken, undeftoken, axiom): Extern.
14694
146952002-04-07 Akim Demaille <akim@epita.fr>
14696
14697 * src/gram.h (rule_s): prec and precsym are now pointers
14698 to the bucket giving the priority/associativity.
14699 Member `associativity' removed: useless.
14700 * src/reduce.c, src/conflicts.c: Adjust.
14701
147022002-04-07 Akim Demaille <akim@epita.fr>
14703
14704 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
14705 Properly escape the symbols' TAG when outputting them.
14706
147072002-04-07 Akim Demaille <akim@epita.fr>
14708
14709 * src/lalr.h (LA): Is a bitsetv, not bitset*.
14710
147112002-04-07 Akim Demaille <akim@epita.fr>
14712
14713 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
14714 (LArule): this, which is an array to rule_t*.
14715 * src/print.c, src/conflicts.c: Adjust.
14716
147172002-04-07 Akim Demaille <akim@epita.fr>
14718
14719 * src/gram.h (rule_t): Rename `number' as `user_number'.
14720 `number' is a new member.
14721 Adjust dependencies.
14722 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
14723
147242002-04-07 Akim Demaille <akim@epita.fr>
14725
14726 As a result of the previous patch, it is no longer needed
14727 to reorder ritem itself.
14728
14729 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
14730
147312002-04-07 Akim Demaille <akim@epita.fr>
14732
14733 Be sure never to walk through RITEMS, but use only data related to
14734 the rules themselves. RITEMS should be banished.
14735
14736 * src/output.c (output_token_translations): Rename as...
14737 (prepare_tokens): this.
14738 In addition to `translate', prepare the muscles `tname' and
14739 `toknum', which were handled by...
14740 (output_rule_data): this.
14741 Remove, and move the remainder of its outputs into...
14742 (prepare_rules): this new routines, which also merges content from
14743 (output_gram): this.
14744 (prepare_rules): Be sure never to walk through RITEMS.
14745 (output_stos): Rename as...
14746 (prepare_stos): this.
14747 (output): Always invoke prepare_states, after all, just don't use it
14748 in the output if you don't need it.
14749
147502002-04-07 Akim Demaille <akim@epita.fr>
14751
14752 * src/LR0.c (new_state): Display `nstates' as the name of the
14753 newly created state.
14754 Adjust to initialize first_state and last_state if needed.
14755 Be sure to distinguish the initial from the final state.
14756 (new_states): Create the itemset of the initial state, and use
14757 new_state.
14758 * src/closure.c (closure): Now that the initial state has its
14759 items properly set, there is no need for a special case when
14760 creating `ruleset'.
14761
14762 As a result, now the rule 0, reducing to $axiom, is visible in the
14763 outputs. Adjust the test suite.
14764
14765 * tests/conflicts.at (Solved SR Conflicts)
14766 (Unresolved SR Conflicts): Adjust.
14767 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
14768 * tests/conflicts.at (S/R in initial): New.
14769
147702002-04-07 Akim Demaille <akim@epita.fr>
14771
14772 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
14773 the RHS of the rules.
14774 * src/output.c (output_gram): Likewise.
14775
147762002-04-07 Akim Demaille <akim@epita.fr>
14777
14778 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
14779 bucket.
14780 Adjust all dependencies.
14781 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
14782 `number' of the buckets too.
14783 * src/gram.h: Include `symtab.h'.
14784 (associativity): Move to...
14785 * src/symtab.h: here.
14786 No longer include `gram.h'.
14787
147882002-04-07 Akim Demaille <akim@epita.fr>
14789
14790 * src/gram.h, src/gram.c (rules_rhs_length): New.
14791 (ritem_longest_rhs): Use it.
14792 * src/gram.h (rule_t): `number' is a new member.
14793 * src/reader.c (packgram): Set it.
14794 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
14795 the end of `rules', and count them out of `nrules'.
14796 (reduce_output, dump_grammar): Adjust.
14797 * src/print.c (print_grammar): It is no longer needed to check for
14798 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
14799 * tests/reduce.at (Reduced Automaton): New test.
14800
148012002-04-07 Akim Demaille <akim@epita.fr>
14802
14803 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
14804 lacking `+ 1' to nrules, Bison reported as useless a token if it
14805 was used solely to set the precedence of the last rule...
14806
148072002-04-07 Akim Demaille <akim@epita.fr>
14808
14809 * data/bison.c++, data/bison.simple: Don't output the current file
14810 name in #line, to avoid useless diffs between two identical
14811 outputs under different names.
14812
148132002-04-07 Akim Demaille <akim@epita.fr>
14814
14815 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
14816 Normalize loops to using `< nrules + 1', not `<= nrules'.
14817
148182002-04-07 Akim Demaille <akim@epita.fr>
14819
14820 * TODO: Update.
14821
148222002-04-07 Akim Demaille <akim@epita.fr>
14823
14824 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
14825 bucket.value as bucket.number.
14826
148272002-04-07 Akim Demaille <akim@epita.fr>
14828
14829 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
14830 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14831 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
14832 RHS, instead of being an index in RITEMS.
14833
148342002-04-04 Paul Eggert <eggert@twinsun.com>
14835
14836 * doc/bison.texinfo: Update copyright date.
14837 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
14838 (Symbols): Warn about running Bison in one character set,
14839 but compiling and/or running in an incompatible one.
14840 Warn about character code 256, too.
14841
148422002-04-03 Paul Eggert <eggert@twinsun.com>
14843
14844 * src/bison.data (YYSTACK_ALLOC): Depend on whether
14845 YYERROR_VERBOSE is nonzero, not whether it is defined.
14846
14847 Merge changes from bison-1_29-branch.
14848
148492002-03-20 Paul Eggert <eggert@twinsun.com>
14850
14851 Merge fixes from Debian bison_1.34-1.diff.
14852
14853 * configure.in (AC_PREREQ): 2.53.
14854
148552002-03-20 Akim Demaille <akim@epita.fr>
14856
14857 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14858
148592002-03-19 Paul Eggert <eggert@twinsun.com>
14860
14861 * src/bison.simple (YYCOPY): New macro.
14862 (YYSTACK_RELOCATE): Use it.
14863 Remove Type arg; no longer needed. All callers changed.
14864 (yymemcpy): Remove; no longer needed.
14865
14866 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14867 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14868
148692002-03-19 Akim Demaille <akim@epita.fr>
14870
14871 Test and fix the #line outputs.
14872
14873 * tests/atlocal.at (GCC): New.
14874 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
14875 (Prologue synch line, %union synch line, Postprologue synch line)
14876 (Action synch line, Epilogue synch line): New tests.
14877 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14878 * data/bison.simple, data/bison.c++: Use it.
14879
148802002-03-19 Akim Demaille <akim@epita.fr>
14881
14882 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14883 (Solved SR Conflicts, %expect not enough, %expect right)
14884 (%expect too much): Move to...
14885 * tests/conflicts.at: this new file.
14886
148872002-03-19 Akim Demaille <akim@epita.fr>
14888
14889 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14890 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14891 that we can move to enums for instance.
14892 * src/output.c (token_definitions_output): Output a list of
14893 `token-name, token-number' instead of the #define.
14894 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14895
148962002-03-14 Akim Demaille <akim@epita.fr>
14897
14898 Use Gettext 0.11.1.
14899
149002002-03-09 Robert Anisko <robert@lrde.epita.fr>
14901
14902 * data/bison.c++: Make the user able to add members to the generated
14903 parser by subclassing.
14904
149052002-03-05 Robert Anisko <robert@lrde.epita.fr>
14906
14907 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14908 a character.
14909 Reported by Nicolas Tisserand and Nicolas Burrus.
14910
149112002-03-04 Robert Anisko <robert@lrde.epita.fr>
14912
14913 * src/reader.c: Warn about lacking semi-colons, do not complain.
14914
149152002-03-04 Robert Anisko <robert@lrde.epita.fr>
14916
14917 * data/bison.c++: Remove a debug line.
14918
149192002-03-04 Robert Anisko <robert@lrde.epita.fr>
14920
14921 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14922 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14923 provide a default implementation.
14924
149252002-03-04 Akim Demaille <akim@epita.fr>
14926
14927 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14928 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14929 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14930 * tests/semantic.at (Parsing Guards): Similarly.
14931 * src/reader.at (readgram): Complain if the last rule is not ended
14932 with a semi-colon.
14933
149342002-03-04 Akim Demaille <akim@epita.fr>
14935
14936 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14937 * src/closure.c: here.
14938 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14939 RTC.
14940 * src/warshall.h, src/warshall.c: Remove.
14941 * tests/sets.at (Broken Closure): Adjust.
14942
149432002-03-04 Akim Demaille <akim@epita.fr>
14944
14945 * src/output.c (output_skeleton): tempdir is const.
14946 bytes_read is unused.
14947
149482002-03-04 Akim Demaille <akim@epita.fr>
14949
14950 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14951 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14952 Update.
14953 From Michael Hayes.
14954
149552002-03-04 Akim Demaille <akim@epita.fr>
14956
14957 * src/closure.c (closure): `r' is unused.
14958
149592002-03-04 Akim Demaille <akim@epita.fr>
14960
14961 * tests/sets.at (Broken Closure): Add the ending `;'.
14962 * src/reader.at (readgram): Complain if a rule is not ended with a
14963 semi-colon.
14964
149652002-03-04 Akim Demaille <akim@epita.fr>
14966
14967 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14968 (count_sr_conflicts): Use bitset_count.
14969 * src/reduce.c (inaccessable_symbols): Ditto.
14970 (bits_size): Remove.
14971 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14972
149732002-03-04 Akim Demaille <akim@epita.fr>
14974
14975 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14976 * src/reduce.c: Remove the `bitset_zero's following the
14977 `bitset_create's, as now it is performed by the latter.
14978
149792002-03-04 Akim Demaille <akim@epita.fr>
14980
14981 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14982 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14983 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14984 latest sources from Michael.
14985
149862002-03-04 Akim Demaille <akim@epita.fr>
14987
14988 * src/output.c (output): Don't free the grammar.
14989 * src/reader.c (grammar_free): New.
14990 * src/main.c (main): Call it and don't free symtab here.
14991
149922002-03-04 Akim Demaille <akim@epita.fr>
14993
14994 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14995 before returning.
14996 Reported by Benoit Perrot.
14997
149982002-03-04 Akim Demaille <akim@epita.fr>
14999
15000 Use bitset operations when possible, not loops over bits.
15001
15002 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
15003 bitset_or.
15004 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
15005 * src/reduce.c (useless_nonterminals): Formatting changes.
15006 * src/warshall.c (TC): Use bitset_or.
15007
150082002-03-04 Akim Demaille <akim@epita.fr>
15009
15010 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
15011 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
15012 Ditto.
15013
150142002-03-04 Akim Demaille <akim@epita.fr>
15015
15016 * src/lalr.c (F): Now a bitset*.
15017 Adjust all dependencies.
15018
150192002-03-04 Akim Demaille <akim@epita.fr>
15020
15021 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
15022 Adjust all dependencies.
15023
150242002-03-04 Akim Demaille <akim@epita.fr>
15025
15026 * src/L0.c, src/LR0.h (nstates): Be size_t.
15027 Adjust comparisons (signed vs unsigned).
15028 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
15029 bitset*.
15030 Adjust all dependencies.
15031
150322002-03-04 Akim Demaille <akim@epita.fr>
15033
15034 * src/closure.c (firsts): Now, also a bitset.
15035 Adjust all dependencies.
15036 (varsetsize): Remove, now unused.
15037 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
15038
150392002-03-04 Akim Demaille <akim@epita.fr>
15040
15041 * src/print.c: Convert to use bitset.h, not hand coded iterations
15042 over ints.
15043
150442002-03-04 Akim Demaille <akim@epita.fr>
15045
15046 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
15047
150482002-03-04 Akim Demaille <akim@epita.fr>
15049
15050 * src/closure.c (ruleset): Be a bitset.
15051 (rulesetsize): Remove.
15052
150532002-03-04 Akim Demaille <akim@epita.fr>
15054
15055 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
15056 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
15057 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
15058 * src/closure.c (fderives): Be an array of bitsets.
15059
150602002-02-28 Robert Anisko <robert@lrde.epita.fr>
15061
15062 * data/bison.c++: Merge the two generated headers. Insert a copyright
15063 notice in each output file.
15064
150652002-02-28 Akim Demaille <akim@epita.fr>
15066
15067 * data/bison.c++: Copy the prologue of bison.simple to fetch
15068 useful M4 definitions, such as b4_header_guard.
15069
150702002-02-25 Akim Demaille <akim@epita.fr>
15071
15072 * src/getargs.c (version): Give the name of the authors, and use a
15073 translator friendly scheme for the bgr
15074 copyright notice.
15075
150762002-02-25 Akim Demaille <akim@epita.fr>
15077
15078 * src/output.c (header_output): Remove, now handled completely via
15079 M4.
15080
150812002-02-25 Akim Demaille <akim@epita.fr>
15082
15083 * m4/m4.m4: New, from CVS Autoconf.
15084 * configure.in: Invoke it.
15085 * src/output.c (output_skeleton): Use its result instead of the
15086 hard coded name.
15087
150882002-02-25 Akim Demaille <akim@epita.fr>
15089
15090 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
15091 Fileutils 4.1.5.
15092 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
15093 * src/output.c (output_skeleton): Use mkstemp to create a real
15094 temporary file.
15095 Move the filling of `skeleton' and its muscle to...
15096 (prepare): here.
15097 (output): Move the definition of the prologue muscle to...
15098 (prepare): here.
15099 * src/system.h (DEFAULT_TMPDIR): New.
15100
151012002-02-14 Paul Eggert <eggert@twinsun.com>
15102
15103 Remove the support for C++ namespace cleanliness; it was
15104 causing more problems than it was curing, since it didn't work
15105 properly on some nonstandard C++ compilers. This can wait
15106 for a proper C++ parser.
15107
15108 * NEWS: Document this.
15109 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
15110 of C++, as it's treated like C now.
15111 * src/bison.simple (YYSTD): Remove.
15112 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
15113 Treat C++ just like Standard C instead of trying to support
15114 namespace cleanliness.
15115
151162002-02-14 Akim Demaille <akim@epita.fr>
15117
15118 * tests/regression.at (else): Adjust to Andreas' change.
15119
151202002-02-14 Akim Demaille <akim@epita.fr>
15121
15122 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
15123
151242002-02-13 Andreas Schwab <schwab@suse.de>
15125
15126 * src/output.c (output_rule_data): Don't output NULL, it might
15127 not be defined yet.
15128
151292002-02-11 Robert Anisko <robert@lrde.epita.fr>
15130
15131 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
15132 (Copyright notice): Update.
15133
151342002-02-11 Akim Demaille <akim@epita.fr>
15135
15136 * tests/regression.at (%nonassoc and eof): Don't include
15137 nonportable headers.
15138
151392002-02-08 Robert Anisko <robert@lrde.epita.fr>
15140
15141 * data/bison.c++: Correct error recovery. Make the user able to
15142 initialize the starting location.
15143
151442002-02-07 Akim Demaille <akim@epita.fr>
15145
15146 * tests/input.at: New.
15147
151482002-02-07 Robert Anisko <robert@lrde.epita.fr>
15149
15150 * data/bison.c++: Replace some direct m4 expansions by constants. Be
15151 more consistent when naming methods and variables. Put preprocessor
15152 directives around tables only needed for debugging.
15153
151542002-02-07 Robert Anisko <robert@lrde.epita.fr>
15155
15156 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
15157 C++ parsers.
15158 (yy::b4_name::parse): Use print_.
15159
151602002-02-07 Robert Anisko <robert@lrde.epita.fr>
15161
15162 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
15163
151642002-02-07 Robert Anisko <robert@lrde.epita.fr>
15165
15166 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
15167 C++ parsers.
15168 (yy::b4_name::parse): Build verbose error messages, and use error_.
15169
151702002-02-06 Robert Anisko <robert@lrde.epita.fr>
15171
15172 * data/bison.c++: Fix m4 quoting in comments.
15173
151742002-02-06 Robert Anisko <robert@lrde.epita.fr>
15175
15176 * data/bison.c++: Adjust the parser code. Fix some muscles that were
15177 not expanded by m4.
15178
151792002-02-05 Akim Demaille <akim@epita.fr>
15180
15181 * data/bison.c++: Adjust to the M4 back end.
15182 More is certainly needed.
15183
151842002-02-05 Akim Demaille <akim@epita.fr>
15185
15186 Give a try to M4 as a back end.
15187
15188 * lib/readpipe.c: New, from wdiff.
15189 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
15190 BISON_HAIRY.
15191 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
15192 specific values. Now it is m4 that performs the lookup.
15193 * src/parse-skel.y: Remove.
15194 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
15195 * src/output.c (actions_output, guards_output)
15196 (token_definitions_output): No longer keeps track of the output
15197 line number, hence remove the second argument.
15198 (guards_output): Check against the guard member of a rule, not the
15199 action member.
15200 Adjust callers.
15201 (output_skeleton): Don't look for the skeleton location, let m4 do
15202 that.
15203 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
15204 file will be used.
15205 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
15206 (prepare): Given that for the time being changesyntax is not
15207 usable in M4, rename the muscles using `-' to `_'.
15208 Define `defines_flag', `output_parser_name' and `output_header_name'.
15209 * src/output.h (actions_output, guards_output)
15210 (token_definitions_output): Adjust prototypes.
15211 * src/scan-skel.l: Instead of scanning the skeletons, it now
15212 processes the output of m4: `__oline__' and `#output'.
15213 * data/bison.simple: Adjust to be used by M4(sugar).
15214 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
15215 to date.
15216 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
15217 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
15218 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
15219 shamelessly stolen from CVS Autoconf.
15220
152212002-02-05 Akim Demaille <akim@epita.fr>
15222
15223 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
15224 * configure.in: Check for the declarations of free and malloc.
15225 * src/muscle_tab.c: Adjust.
15226
152272002-02-05 Akim Demaille <akim@epita.fr>
15228
15229 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
15230 which have no values.
15231
152322002-02-05 Akim Demaille <akim@epita.fr>
15233
15234 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
15235 * data/: here.
15236
152372002-01-29 Paul Eggert <eggert@twinsun.com>
15238
15239 * src/bison.simple (YYSIZE_T): Do not define merely because
15240 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
15241 On some platforms, <alloca.h> does not declare YYSTD (size_t).
15242
152432002-01-27 Akim Demaille <akim@epita.fr>
15244
15245 Fix `%nonassoc and eof'.
15246
15247 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
15248 which were not properly copied! Replace
15249 memcpy (res->errs, src->errs, src->nerrs);
15250 with
15251 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
15252 !!!
15253 * tests/regression.at (%nonassoc and eof): Adjust to newest
15254 Autotest: `.' is not in the PATH.
15255
152562002-01-27 Akim Demaille <akim@epita.fr>
15257
15258 * tests/sets.at (AT_EXTRACT_SETS): New.
15259 (Nullable): Use it.
15260 (Firsts): New.
15261
152622002-01-26 Akim Demaille <akim@epita.fr>
15263
15264 * tests/actions.at, tests/calc.at, tests/headers.at,
15265 * tests/torture.at: Adjust to the newest Autotest which no longer
15266 forces `.' in the PATH.
15267
152682002-01-25 Akim Demaille <akim@epita.fr>
15269
15270 * tests/regression.at (%nonassoc and eof): New.
15271 Suggested by Robert Anisko.
15272
152732002-01-24 Akim Demaille <akim@epita.fr>
15274
15275 Bison dumps core when trying to complain about broken input files.
15276 Reported by Cris van Pelt.
15277
15278 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
15279 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
15280 into...
15281 (Invalid inputs): Strengthen: exercise parse_percent_token.
15282
152832002-01-24 Robert Anisko <robert.anisko@epita.fr>
15284
15285 * src/Makefile.am: Add bison.c++.
15286 * src/bison.c++: New skeleton.
15287
152882002-01-21 Paolo Bonzini <bonzini@gnu.org>
15289
15290 * po/it.po: New.
15291
152922002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
15293
15294 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
15295
152962002-01-20 Marc Autret <marc@gnu.org>
15297
15298 * src/files.c (compute_output_file_names): Fix
15299
153002002-01-20 Marc Autret <marc@gnu.org>
15301
15302 * tests/output.at: New test.
15303 * src/files.c (compute_base_names): Don't map extensions when
15304 the YACC flag is set, use defaults.
15305 Reported by Evgeny Stambulchik.
15306
153072002-01-20 Marc Autret <marc@gnu.org>
15308
15309 * src/system.h: Need to define __attribute__ away for non-GCC
15310 compilers as well (i.e., the vendor C compiler).
15311 Suggested by Albert Chin-A-Young.
15312
153132002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
15314
15315 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
15316 canonical definition.
15317 * src/system.h: Use the canonical definition for PARAMS (avoids
15318 a conflict with the macro from lib/hash.h).
15319
153202002-01-11 Akim Demaille <akim@epita.fr>
15321
15322 * configure.in: Use AC_FUNC_STRNLEN.
15323 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
15324
153252002-01-09 Akim Demaille <akim@epita.fr>
15326
15327 * src/files.c, src/files.h (output_infix): New.
15328 (tab_extension): Remove.
15329 (compute_base_names): Compute the former, drop the latter.
15330 * src/output.c (prepare): Insert the muscles `output-infix', and
15331 `output-suffix'.
15332 * src/parse-skel.y (string, string.1): New.
15333 (section.header): Use it.
15334 (section.yacc): Remove.
15335 (prefix): Remove too.
15336 * src/scan-skel.l: Adjust.
15337 * src/bison.simple, src/bison.hairy: Adjust.
15338
153392002-01-09 Akim Demaille <akim@epita.fr>
15340
15341 * configure.in (WERROR_CFLAGS): Compute it.
15342 * src/Makefile.am (CFLAGS): Pass it.
15343 * tests/atlocal.in (CFLAGS): Idem.
15344 * src/files.c: Fix a few warnings.
15345 (get_extension_index): Remove, unused.
15346
153472002-01-08 Akim Demaille <akim@epita.fr>
15348
15349 * src/getargs.c (AS_FILE_NAME): New.
15350 (getargs): Use it to convert DOSish file names.
15351 * src/files.c (base_name): Rename as full_base_name to avoid
15352 clashes with `base_name ()'.
15353 (filename_split): New.
15354 (compute_base_names): N-th rewrite, using filename_split.
15355
153562002-01-08 Akim Demaille <akim@epita.fr>
15357
15358 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
15359 New, stolen from the Fileutils 4.1.
15360 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15361 * configure.in: Check for the presence of memrchr, and of its
15362 prototype.
15363
153642002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
15365
15366 * lib/hash.h (__P): Added definition for this macro.
15367 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
15368 BUILT_SOURCES, to ensure they are generated first.
15369 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
15370 %error-verbose to allow bootstrapping with bison 1.30x.
15371
153722002-01-06 Akim Demaille <akim@epita.fr>
15373
15374 * src/reader.c (parse_braces): Don't fetch the next char, the
15375 convention is to fetch on entry.
15376 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
15377 'switch' without a following semicolon.
15378 * tests/regression.at (braces parsing): New.
15379
153802002-01-06 Akim Demaille <akim@epita.fr>
15381
15382 Bison is dead wrong in its RR conflict reports.
15383
15384 * tests/torture.at (GNU Cim Grammar): New.
15385 * src/conflicts.c (count_rr_conflicts): Fix.
15386
153872002-01-06 Akim Demaille <akim@epita.fr>
15388
15389 Creating package.m4 from configure.ac causes too many problems.
15390
15391 * tests/Makefile.am (package.m4): Create it by hand,
15392 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
15393
153942002-01-06 Akim Demaille <akim@epita.fr>
15395
15396 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
15397 skeleton.h.
15398
153992002-01-04 Paul Eggert <eggert@twinsun.com>
15400
15401 * doc/bison.texinfo (Debugging):
15402 Remove YYSTDERR; it's no longer defined or used.
15403 Also, s/cstdio.h/cstdio/.
15404
154052002-01-03 Akim Demaille <akim@epita.fr>
15406
15407 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
15408
154092002-01-03 Akim Demaille <akim@epita.fr>
15410
15411 * src/parse-skel.y (process_skeleton): Don't bind the parser's
15412 tracing code to --trace, wait for a better --trace option, with
15413 args.
15414
154152002-01-03 Akim Demaille <akim@epita.fr>
15416
15417 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
15418 The ISO C++ standard is extremely clear about it: stderr is
15419 considered a macro, not a regular symbol (see table 94 `Header
15420 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
15421 Therefore std:: does not apply to it. It still does with fprintf.
15422 Also, s/cstdio.h/cstdio/.
15423
154242002-01-03 Akim Demaille <akim@epita.fr>
15425
15426 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
15427 for non system headers.
15428
154292002-01-02 Akim Demaille <akim@epita.fr>
15430
15431 Equip the skeleton chain with location tracking, runtime trace,
15432 pure parser and scanner.
15433
15434 * src/parse-skel.y: Request a pure parser, locations, and prefix
15435 renaming.
15436 (%union): Having several members with the same type does not help
15437 type mismatches, simplify.
15438 (YYPRINT, yyprint): New.
15439 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
15440 (skel_error): this.
15441 Handle locations.
15442 * src/scan-skel.l: Adjust to these changes.
15443 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
15444 (LOCATION_PRINT, skel_control_t): New.
15445
154462001-12-30 Akim Demaille <akim@epita.fr>
15447
15448 * src/parse-skel.y: Get rid of the shift/reduce conflict:
15449 replace `gb' with BLANKS.
15450 * src/scan-skel.l: Adjust.
15451
154522001-12-30 Akim Demaille <akim@epita.fr>
15453
15454 * src/system.h: We don't need nor want bcopy.
15455 Throw away MS-DOS crap: we don't need getpid.
15456 * configure.in: We don't need strndup. It was even causing
15457 problems: because Flex includes the headers *before* us,
15458 _GNU_SOURCE is not defined by config.h, and therefore strndup was
15459 not visible.
15460 * lib/xstrndup.c: New.
15461 * src/scan-skel.l: Use it.
15462 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
15463 * src/parse-skel.y: Use %directives instead of #defines.
15464
154652001-12-30 Akim Demaille <akim@epita.fr>
15466
15467 * src/skeleton.h: New.
15468 * src/output.c (output_parser, output_master_parser): Remove, dead
15469 code.
15470 * src/output.h (get_lines_number, actions_output, guards_output)
15471 (token_definitions_output): Prototype them.
15472 * src/parse-skel.y: Add the license notice.
15473 Include output.h and skeleton.h.
15474 (process_skeleton): Returns void, and takes a single parameter.
15475 * src/scan-skel.l: Add the license notice.
15476 Include skeleton.h.
15477 Don't use %option yylineno: it seems that then Flex imagines
15478 REJECT has been used, and therefore it won't reallocate its
15479 buffers (which makes no other sense to me than a bug). It results
15480 in warnings for `unused: yy_flex_realloc'.
15481
154822001-12-30 Robert Anisko <robert.anisko@epita.fr>
15483
15484 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15485 (MUSCLE_INSERT_PREFIX): ...to there.
15486 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15487 (MUSCLE_INSERT_PREFIX): Move from here...
15488
15489 * src/bison.hairy: Add a section directive. Put braces around muscle
15490 names. This parser skeleton is still broken, but Bison should not
15491 choke on a bad muscle 'syntax'.
15492 * src/bison.simple: Add a section directive. Put braces around muscle
15493 names.
15494
15495 * src/files.h (strsuffix, stringappend): Add declarations.
15496 (tab_extension): Add declaration.
15497 (short_base_name): Add declaration.
15498
15499 * src/files.c (strsuffix, stringappend): No longer static. These
15500 functions are used in the skeleton parser.
15501 (tab_extension): New.
15502 (compute_base_names): Use the computations done in this function
15503 to guess if the generated parsers should have '.tab' in their
15504 names.
15505 (short_base_name): No longer static.
15506
15507 * src/output.c (output_skeleton): New.
15508 (output): Disable call to output_master_parser, and give a try to
15509 a new skeleton handling system.
15510 (guards_output, actions_output): No longer static.
15511 (token_definitions_output, get_lines_number): No longer static.
15512
15513 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
15514
15515 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
15516 parse-skel.y.
15517
15518 * src/parse-skel.y: New file.
15519 * src/scan-skel.l: New file.
15520
155212001-12-29 Akim Demaille <akim@epita.fr>
15522
15523 %name-prefix is broken.
15524
15525 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
15526 Adjust all dependencies.
15527 * tests/headers.at (export YYLTYPE): Strengthen this test: use
15528 %name-prefix.
15529
15530 Renaming yylval but not yylloc is not consistent. Now we do.
15531
15532 * src/bison.simple: Prefix yylloc if used.
15533 * doc/bison.texinfo (Decl Summary): Document that.
15534
155352001-12-29 Akim Demaille <akim@epita.fr>
15536
15537 * doc/bison.texinfo: Promote `%long-directive' over
15538 `%long_directive'.
15539 Remove all references to fixed-output-files, yacc is enough.
15540
155412001-12-29 Akim Demaille <akim@epita.fr>
15542
15543 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
15544 user prologue. These are defaults.
15545 * tests/actions.at (Mid-rule actions): Make sure the user can
15546 define YYDEBUG and YYERROR_VERBOSE.
15547
155482001-12-29 Akim Demaille <akim@epita.fr>
15549
15550 * src/output.c (header_output): Don't forget to export YYLTYPE and
15551 yylloc.
15552 * tests/headers.at (export YYLTYPE): New, make sure it does.
15553 * tests/regression.at (%union and --defines, Invalid CPP headers):
15554 Move to...
15555 * tests/headers.at: here.
15556
155572001-12-29 Akim Demaille <akim@epita.fr>
15558
15559 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
15560
155612001-12-29 Akim Demaille <akim@epita.fr>
15562
15563 * tests/actions.at (Mid-rule actions): Output on a single line
15564 instead of several.
15565
155662001-12-29 Akim Demaille <akim@epita.fr>
15567
15568 * doc/bison.texinfo: Formatting changes.
15569
155702001-12-29 Akim Demaille <akim@epita.fr>
15571
15572 Don't store the token defs in a muscle, just be ready to output it
15573 on command. Now possible via `symbols'. Fixes a memory leak.
15574
15575 * src/output.c (token_definitions_output): New.
15576 (output_parser, header_output): Use it.
15577 * src/reader.c (symbols_save): Remove.
15578
155792001-12-29 Akim Demaille <akim@epita.fr>
15580
15581 * src/bison.simple: Do not provide a default for YYSTYPE and
15582 YYLTYPE before the user's prologue. Otherwise it's hardly... a
15583 default.
15584
155852001-12-29 Akim Demaille <akim@epita.fr>
15586
15587 Mid-rule actions are simply... ignored!
15588
15589 * src/reader.c (readgram): Be sure to attach mid-rule actions to
15590 the empty-rule associated to the dummy symbol, not to the host
15591 rule.
15592 * tests/actions.at (Mid-rule actions): New.
15593
155942001-12-29 Akim Demaille <akim@epita.fr>
15595
15596 Memory leak.
15597
15598 * src/reader.c (reader): Free grammar.
15599
156002001-12-29 Akim Demaille <akim@epita.fr>
15601
15602 Memory leak.
15603
15604 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
15605 since it allocates it for each state, although only one is needed.
15606 (allocate_storage): Do it here.
15607
156082001-12-29 Akim Demaille <akim@epita.fr>
15609
15610 * src/options.h, src/options.c (create_long_option_table): Rename
15611 as...
15612 (long_option_table_new): this, with a clearer prototype.
15613 (percent_table): Remove, unused,
15614 * src/getargs.c (getargs): Adjust.
15615
156162001-12-29 Akim Demaille <akim@epita.fr>
15617
15618 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
15619 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
15620 as states.
15621
156222001-12-29 Akim Demaille <akim@epita.fr>
15623
15624 * src/lalr.c (build_relations): Rename `states' as `states1'.
15625 Sorry, I don't understand exactly what it is, no better name...
15626
156272001-12-29 Akim Demaille <akim@epita.fr>
15628
15629 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
15630 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
15631 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
15632 as rules.
15633
156342001-12-29 Akim Demaille <akim@epita.fr>
15635
15636 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
15637 ago.
15638
156392001-12-29 Akim Demaille <akim@epita.fr>
15640
15641 * src/reader.c, src/reader.h (user_toknums): Remove.
15642 Adjust all users to use symbols[i]->user_token_number.
15643
156442001-12-29 Akim Demaille <akim@epita.fr>
15645
15646 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
15647 Adjust all users to use symbols[i]->prec or ->assoc.
15648
156492001-12-29 Akim Demaille <akim@epita.fr>
15650
15651 * src/reader.c, src/reader.h (tags): Remove.
15652 Adjust all users to use symbols[i]->tag.
15653
156542001-12-29 Akim Demaille <akim@epita.fr>
15655
15656 * src/gram.h, src/gram.c (symbols): New, similar to state_table
15657 and rule_table.
15658 * src/reader.c (packsymbols): Fill this table.
15659 Drop sprec.
15660 * src/conflicts.c (resolve_sr_conflict): Adjust.
15661 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
15662 single table.
15663 Use symbols[i]->tag instead of tags[i].
15664
156652001-12-29 Akim Demaille <akim@epita.fr>
15666
15667 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
15668 In addition, put a comment in there, to replace...
15669 * tests/regression.at (%union and C comments): Remove.
15670
156712001-12-29 Akim Demaille <akim@epita.fr>
15672
15673 * tests/regression.at (Web2c Actions): Blindly move the actual
15674 output as expected output. The contents *seem* right to me, but I
15675 can't pretend reading perfectly parser tables... Nonetheless, all
15676 the other tests pass correctly, the table look OK, even though the
15677 presence of `$axiom' is to be noted: AFAICS it is useless (but
15678 harmless).
15679
156802001-12-29 Akim Demaille <akim@epita.fr>
15681
15682 * src/reader.c (readgram): Don't add the rule 0 if there were no
15683 rules read. In other words, add it _after_ having performed
15684 grammar sanity checks.
15685 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
15686
156872001-12-29 Akim Demaille <akim@epita.fr>
15688
15689 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
15690 visible, and some states have now a different number.
15691
156922001-12-29 Akim Demaille <akim@epita.fr>
15693
15694 * src/reader.c (readgram): Bind the initial rule's lineno to that
15695 of the first rule.
15696 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
15697 (Solved SR Conflicts): Adjust rule 0's line number.
15698
156992001-12-29 Akim Demaille <akim@epita.fr>
15700
15701 Fix the `GAWK Grammar' failure.
15702
15703 * src/LR0.c (final_state): Initialize to -1 so that we do compute
15704 the reductions of the first state which was mistakenly confused
15705 with the final state because precisely final_state was initialized
15706 to 0.
15707 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
15708 now noticed by Bison.
15709 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
15710 have a reduction on $default.
15711
157122001-12-29 Akim Demaille <akim@epita.fr>
15713
15714 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
15715 rule line numbers.
15716 * src/closure.c (print_closure): Likewise.
15717 * src/derives.c (print_derives): Likewise.
15718 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
15719 now.
15720
157212001-12-29 Akim Demaille <akim@epita.fr>
15722
15723 * src/lalr.c (lookaheads_print): New.
15724 (lalr): Call it when --trace-flag.
15725 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
15726 are dumped.
15727
157282001-12-29 Akim Demaille <akim@epita.fr>
15729
15730 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
15731 when walking through ritem, even via rule->rhs.
15732 * src/reduce.c (dump_grammar, useful_production, reduce_output)
15733 (useful_production, useless_nonterminals): Likewise.
15734 (reduce_grammar_tables): Likewise, plus update nritems.
15735 * src/nullable.c (set_nullable): Likewise.
15736 * src/lalr.c (build_relations): Likewise.
15737 * tests/sets.at (Nullable): Adjust.
15738 Fortunately, now, the $axiom is no longer nullable.
15739
157402001-12-29 Akim Demaille <akim@epita.fr>
15741
15742 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
15743 the 0-sentinel.
15744 * src/gram.c (ritem_longest_rhs): Likewise.
15745 * src/reduce.c (nonterminals_reduce): Likewise.
15746 * src/print_graph.c (print_graph): Likewise.
15747 * src/output.c (output_rule_data): Likewise.
15748 * src/nullable.c (set_nullable): Likewise.
15749
157502001-12-29 Akim Demaille <akim@epita.fr>
15751
15752 * src/output.c: Comment changes.
15753
157542001-12-27 Paul Eggert <eggert@twinsun.com>
15755
15756 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
15757 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
15758 Sparc, as they were causing more porting problems than the
15759 (minor) performance improvement was worth.
15760
15761 Also, catch up with 1.31's YYSTD.
15762
157632001-12-27 Akim Demaille <akim@epita.fr>
15764
15765 * src/output.c (output_gram): Rely on nritems, not the
15766 0-sentinel. See below.
15767 Use -1 as separator, not 0.
15768 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
15769 Rely on -1 as separator in yyrhs, instead of 0.
15770 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
15771 twice `Now at end of input', therefore there are two lines less to
15772 expect.
15773
157742001-12-27 Akim Demaille <akim@epita.fr>
15775
15776 * tests/regression.at (Unresolved SR Conflicts):
15777 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
15778 below.
15779
157802001-12-27 Akim Demaille <akim@epita.fr>
15781
15782 * src/LR0.c (new_state): Recognize the final state by the fact it
15783 is reached by eoftoken.
15784 (insert_start_shifting_state, insert_eof_shifting_state)
15785 (insert_accepting_state, augment_automaton): Remove, since now
15786 these states are automatically computed from the initial state.
15787 (generate_states): Adjust.
15788 * src/print.c: When reporting a rule number to the user, substract
15789 1, so that the axiom rule is rule 0, and the first user rule is 1.
15790 * src/reduce.c: Likewise.
15791 * src/print_graph.c (print_core): For the time being, just as for
15792 the report, depend upon --trace-flags to dump the full set of
15793 items.
15794 * src/reader.c (readgram): Once the grammar read, insert the rule
15795 0: `$axiom: START-SYMBOL $'.
15796 * tests/set.at: Adjust: rule 0 is now displayed, and since the
15797 number of the states has changed (the final state is no longer
15798 necessarily the last), catch up.
15799
158002001-12-27 Akim Demaille <akim@epita.fr>
15801
15802 Try to make the use of the eoftoken valid. Given that its value
15803 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
15804 is used instead of > 0 where appropriate, (ii), depend upon nritems
15805 instead of the 0-sentinel.
15806
15807 * src/gram.h, src/gram.c (nritems): New.
15808 Expected to be duplication of nitems, but for the time being...
15809 * src/reader.c (packgram): Assert nritems and nitems are equal.
15810 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
15811 * src/closure.c (print_closure, print_fderives): Likewise.
15812 * src/gram.c (ritem_print): Likewise.
15813 * src/print.c (print_core, print_grammar): Likewise.
15814 * src/print_graph.c: Likewise.
15815
158162001-12-27 Akim Demaille <akim@epita.fr>
15817
15818 * src/main.c (main): If there are complains after grammar
15819 reductions, then output the report anyway if requested, then die.
15820 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
15821 * src/reader.c (eoftoken): New.
15822 (parse_token_decl): If the token being defined has value `0', it
15823 is the eoftoken.
15824 (packsymbols): No longer hack `tags' to insert `$' by hand.
15825 Be sure to preserve the value of the eoftoken.
15826 (reader): Make sure eoftoken is defined.
15827 Initialize nsyms to 0: now eoftoken is created just like the others.
15828 * src/print.c (print_grammar): Don't special case the eof token.
15829 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
15830 lie anyway, albeit pleasant.
15831 * tests/calc.at: Exercise error messages with eoftoken.
15832 Change the grammar so that empty input is invalid.
15833 Adjust expectations.
15834 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
15835
158362001-12-27 Akim Demaille <akim@epita.fr>
15837
15838 * configure.in: Check the protos of strchr ans strspn.
15839 Replace strchr if needed.
15840 * src/system.h: Provide the protos of strchr, strspn and memchr if
15841 missing.
15842 * lib/strchr.c: New.
15843 * src/reader.c (symbols_save): Use strchr.
15844
158452001-12-27 Akim Demaille <akim@epita.fr>
15846
15847 * src/print.c, src/print_graph.c (escape): New.
15848 Use it to quote the TAGS outputs.
15849 * src/print_graph.c (print_state): Now errors are in red, and
15850 reductions in green.
15851 Prefer high to wide: output the state number on a line of its own.
15852
158532001-12-27 Akim Demaille <akim@epita.fr>
15854
15855 * src/state.h, src/state.c (reductions_new): New.
15856 * src/LR0.c (set_state_table): Let all the states have a
15857 `reductions', even if reduced to 0.
15858 (save_reductions): Adjust.
15859 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15860 * src/print.c (print_reductions, print_actions): Adjust.
15861 * src/output.c (action_row): Adjust.
15862
158632001-12-27 Akim Demaille <akim@epita.fr>
15864
15865 * src/state.h, src/state.c (errs_new, errs_dup): New.
15866 * src/LR0.c (set_state_table): Let all the states have an errs,
15867 even if reduced to 0.
15868 * src/print.c (print_errs, print_reductions): Adjust.
15869 * src/output.c (output_actions, action_row): Adjust.
15870 * src/conflicts.c (resolve_sr_conflict): Adjust.
15871
158722001-12-27 Akim Demaille <akim@epita.fr>
15873
15874 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15875
158762001-12-27 Akim Demaille <akim@epita.fr>
15877
15878 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15879 * src/print.c: here.
15880 (lookaheadset, shiftset): New, used as additional storage by
15881 print_reductions.
15882 (print_results): Adjust.
15883 (print_shifts, print_gotos, print_errs): New, extracted from...
15884 (print_actions): here.
15885 * src/print_graph.c (print_actions): Remove dead code.
15886
158872001-12-27 Akim Demaille <akim@epita.fr>
15888
15889 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15890 `$n' and `@n'.
15891
158922001-12-27 Akim Demaille <akim@epita.fr>
15893
15894 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15895 (build_relations): Adjust.
15896
158972001-12-27 Akim Demaille <akim@epita.fr>
15898
15899 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15900 duplication.
15901
159022001-12-27 Akim Demaille <akim@epita.fr>
15903
15904 * src/reader.c (packgram): Catch nitems overflows.
15905
159062001-12-27 Akim Demaille <akim@epita.fr>
15907
15908 * src/files.c, src/files.h (guard_obstack): Remove.
15909 * src/output.c (output): Adjust.
15910 * src/reader.c (parse_braces): New, factoring...
15911 (copy_action, copy_guard): these two which are renamed as...
15912 (parse_action, parse_guard): these.
15913 As a voluntary consequence, using braces around guards is now
15914 mandatory.
15915
159162001-12-27 Akim Demaille <akim@epita.fr>
15917
15918 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15919 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15920 members.
15921 (symbol_list_new): Adjust.
15922 (copy_action): action_line is the first line, not the last.
15923 (copy_guard): Just as for actions, store the `action' only, not
15924 the switch/case/break flesh.
15925 Don't parse the user action that might follow the guard, let...
15926 (readgram): do it, i.e., now, there can be an action after a
15927 guard.
15928 In other words the guard is just explicitly optional.
15929 (packgram): Adjust.
15930 * src/output.c (guards_output): New.
15931 (output_parser): Call it when needed.
15932 (output): Also free the guard and attrs obstacks.
15933 * src/files.c, src/files.h (obstack_save): Remove.
15934 (output_files): Remove.
15935 As a result, if one needs the former `.act' file, using an
15936 appropriate skeleton which requires actions and guards is now
15937 required.
15938 * src/main.c (main): Adjust.
15939 * tests/semantic.at: New.
15940 * tests/regression.at: Use `input.y' as input file name.
15941 Avoid 8+3 problems by requiring input.c when the test needs the
15942 parser.
15943
159442001-12-27 Akim Demaille <akim@epita.fr>
15945
15946 * src/reader.c (symbol_list_new): Be sure to initialize all the
15947 fields.
15948
159492001-12-27 Akim Demaille <akim@epita.fr>
15950
15951 All the hacks using a final pseudo state are now useless.
15952
15953 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15954 * src/lalr.c (nLA): New.
15955 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15956 instead of lookaheadsp from the pseudo state (nstate + 1).
15957
159582001-12-27 Akim Demaille <akim@epita.fr>
15959
15960 * src/output.c (action_row, token_actions): Use a state_t instead
15961 of a integer, and nlookaheads instead of the following state's
15962 lookaheadsp.
15963
159642001-12-27 Akim Demaille <akim@epita.fr>
15965
15966 * src/conflicts.c (log_resolution, flush_shift)
15967 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15968 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15969 (conflicts_print, print_reductions): Use a state_t instead of an
15970 integer when referring to a state.
15971 As much as possible, depend upon nlookaheads, instead of the
15972 `lookaheadsp' member of the following state (since lookaheads of
15973 successive states are successive, the difference between state n + 1
15974 and n served as the number of lookaheads for state n).
15975 * src/lalr.c (add_lookback_edge): Likewise.
15976 * src/print.c (print_core, print_actions, print_state)
15977 (print_results): Likewise.
15978 * src/print_graph.c (print_core, print_actions, print_state)
15979 (print_graph): Likewise.
15980 * src/conflicts.h: Adjust.
15981
159822001-12-27 Akim Demaille <akim@epita.fr>
15983
15984 * src/bison.hairy: Formatting/comment changes.
15985 ANSIfy.
15986 Remove `register' indications.
15987 Add plenty of `static'.
15988
159892001-12-27 Akim Demaille <akim@epita.fr>
15990
15991 * src/output.c (prepare): Drop the muscle `ntbase' which
15992 duplicates ntokens.
15993 * src/bison.simple: Formatting/comment changes.
15994 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15995 is an undocumented synonym.
15996
159972001-12-22 Akim Demaille <akim@epita.fr>
15998
15999 * src/output.c (output_table_data): Change the prototype to use
16000 `int' for array ranges: some invocations do pass an int, not a
16001 short.
16002 Reported by Wayne Green.
16003
160042001-12-22 Akim Demaille <akim@epita.fr>
16005
16006 Some actions of web2c.y are improperly triggered.
16007 Reported by Mike Castle.
16008
16009 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
16010 * tests/regression.at (Web2c): Rename as...
16011 (Web2c Report): this.
16012 (Web2c Actions): New.
16013
160142001-12-22 Akim Demaille <akim@epita.fr>
16015
16016 Reductions in web2c.y are improperly reported.
16017 Reported by Mike Castle.
16018
16019 * src/conflicts.c (print_reductions): Fix.
16020 * tests/regression.at (Web2c): New.
16021
160222001-12-18 Akim Demaille <akim@epita.fr>
16023
16024 Some host fail on `assert (!"foo")', which expands to
16025 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
16026 Reported by Nelson Beebee.
16027
16028 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
16029 `#define it_succeeded 0' and `assert (it_succeeded)'.
16030
160312001-12-17 Marc Autret <autret_m@epita.fr>
16032
16033 * src/bison.simple: Don't hard code the skeleton line and filename.
16034 * src/output.c (output_parser): Rename 'line' as 'output_line'.
16035 New line counter 'skeleton_line' (skeleton-line muscle).
16036
160372001-12-17 Paul Eggert <eggert@twinsun.com>
16038
16039 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
16040 YYDEBUG must be defined to a nonzero value.
16041
16042 * src/bison.simple (yytname): Do not assume that the user defines
16043 YYDEBUG to a properly parenthesized expression.
16044
160452001-12-17 Akim Demaille <akim@epita.fr>
16046
16047 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
16048 nlookaheads is a new member.
16049 Adjust all users.
16050 * src/lalr.h (nlookaheads): Remove this orphan declaration.
16051 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
16052 state.
16053
160542001-12-17 Akim Demaille <akim@epita.fr>
16055
16056 * src/files.h, src/files.c (open_files, close_files): Remove.
16057 * src/main.c (main): Don't open/close files, nor invoke lex_free,
16058 let...
16059 * src/reader.c (reader): Do it.
16060
160612001-12-17 Akim Demaille <akim@epita.fr>
16062
16063 * src/conflicts.c (print_reductions): Formatting changes.
16064
160652001-12-17 Akim Demaille <akim@epita.fr>
16066
16067 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
16068 (flush_reduce): New.
16069 (resolve_sr_conflict): Adjust.
16070
160712001-12-17 Akim Demaille <akim@epita.fr>
16072
16073 * src/output.c (output_obstack): Be static and rename as...
16074 (format_obstack): this, to avoid any confusion with files.c's
16075 output_obstack.
16076 * src/reader.h (muscle_obstack): Move to...
16077 * src/output.h: here, since it's defined in output.c.
16078
160792001-12-17 Akim Demaille <akim@epita.fr>
16080
16081 * src/output.c (action_row, save_column, default_goto)
16082 (sort_actions, matching_state, pack_vector): Better variable
16083 locality.
16084
160852001-12-17 Akim Demaille <akim@epita.fr>
16086
16087 * src/output.c: Various formatting changes.
16088
160892001-12-17 Akim Demaille <akim@epita.fr>
16090
16091 * src/files.c (output_files): Free the output_obstack.
16092 * src/main.c (main): Call print and print_graph conditionally.
16093 * src/print.c (print): Work unconditionally.
16094 * src/print_graph.c (print_graph): Work unconditionally.
16095 * src/conflicts.c (log_resolution): Output only if verbose_flag.
16096
160972001-12-16 Marc Autret <autret_m@epita.fr>
16098
16099 * src/output.c (actions_output): Fix. When we use %no-lines,
16100 there is one less line per action.
16101
161022001-12-16 Marc Autret <autret_m@epita.fr>
16103
16104 * src/bison.simple: Remove a useless #line directive.
16105 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
16106 * src/output.c (get_lines_number): New.
16107 (output_parser): Adjust, now takes care about the lines of a
16108 output muscles.
16109 Fix line numbering.
16110 (actions_output): Computes the number of lines taken by actions.
16111 (output_master_parser): Insert new skeleton which is the name of
16112 the output parser file name.
16113
161142001-12-15 Marc Autret <autret_m@epita.fr>
16115
16116 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
16117
161182001-12-15 Marc Autret <autret_m@epita.fr>
16119
16120 * src/output.c (output_gram): Keep track of the hairy one.
16121
161222001-12-15 Akim Demaille <akim@epita.fr>
16123
16124 Make `make distcheck' work.
16125
16126 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
16127 system.h which uses libgettext.h.
16128
161292001-12-15 Akim Demaille <akim@epita.fr>
16130
16131 * src/nullable.c (set_nullable): Useless rules must be skipped,
16132 otherwise, since we range over their symbols, we might look at a
16133 nonterminal which no longer ``exists'', i.e., it is not counted in
16134 `nvars', hence we overflow our arrays.
16135
161362001-12-15 Akim Demaille <akim@epita.fr>
16137
16138 The header can also be produced directly, without any obstack!
16139 Yahoo!
16140
16141 * src/files.c, src/files.h (defines_obstack): Remove.
16142 (compute_header_macro): Global.
16143 (defines_obstack_save): Remove.
16144 * src/reader.c (parse_union_decl): No longer output to
16145 defines_obstack: its content can be found in the `stype' muscle
16146 anyway.
16147 (output_token_translations): Merge into...
16148 (symbols_output): this.
16149 Rename as...
16150 (symbols_save): this.
16151 (reader): Adjust.
16152 * src/output.c (header_output): New.
16153 (output): Call it.
16154
161552001-12-15 Akim Demaille <akim@epita.fr>
16156
16157 * src/reader.c (parse_union_decl): Instead of handling two obstack
16158 simultaneously, use one to define the `stype' muscle, and use the
16159 value of the latter to fill defines_obstack.
16160 (copy_comment): Remove.
16161 (copy_comment2): Work for a single obstack.
16162 Rename as...
16163 (copy_comment): this.
16164
161652001-12-15 Akim Demaille <akim@epita.fr>
16166
16167 * src/lex.c, src/lex.h (xgetc): No longer static.
16168 * src/reader.c (parse_union_decl): Revamp.
16169
161702001-12-15 Akim Demaille <akim@epita.fr>
16171
16172 Still making progress in separating Bison into (i) input, (ii)
16173 process, (iii) output: now we can directly output the parser file
16174 without using table_obstack at all.
16175
16176 * src/files.c, src/files.h (table_obstack): Bye bye.
16177 (parser_file_name): New.
16178 * src/files.c (compute_output_file_names): Compute it.
16179 * src/output.c (actions_output, output_parser)
16180 (output_master_parser): To a file instead of an obstack.
16181
161822001-12-15 Akim Demaille <akim@epita.fr>
16183
16184 Attach actions to rules, instead of pre-outputting them to
16185 actions_obstack.
16186
16187 * src/gram.h (rule_t): action and action_line are new members.
16188 * src/reader.c (symbol_list): Likewise.
16189 (copy_action): Save the actions within the rule.
16190 (packgram): Save them in rule_table.
16191 * src/output.c (actions_output): New.
16192 (output_parser): Use it on `%%actions'.
16193 (output_rule_data): Don't free rule_table.
16194 (output): Do it.
16195 (prepare): Don't save the `action' muscle.
16196 * src/bison.simple: s/%%action/%%actions/.
16197
161982001-12-15 Akim Demaille <akim@epita.fr>
16199
16200 * src/reader.c (copy_action): When --yacc, don't append a `;'
16201 to the user action: let it fail if lacking.
16202 Suggested by Arnold Robbins and Tom Tromey.
16203
162042001-12-14 Akim Demaille <akim@epita.fr>
16205
16206 * src/lex.c (literalchar): Simply return the char you decoded, non
16207 longer mess around with obstacks and int pointers.
16208 Adjust all callers.
16209
162102001-12-14 Akim Demaille <akim@epita.fr>
16211
16212 * src/lex.c (literalchar): Don't escape the special characters,
16213 just decode them, and keep them as char (before, eol was output as
16214 the 2 char string `\n' etc.).
16215 * src/output.c (output_rule_data): Use quotearg to output the
16216 token strings.
16217
162182001-12-13 Paul Eggert <eggert@twinsun.com>
16219
16220 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
16221 Do not infringe on the global user namespace when using C++.
16222 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
16223 All uses of `fprintf' and `stderr' changed.
16224
16225 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
16226
162272001-12-13 Akim Demaille <akim@epita.fr>
16228
16229 The computation of nullable is broken: it doesn't handle empty
16230 RHS's properly.
16231
16232 * tests/torture.at (GNU AWK Grammar): New.
16233 * tests/sets.at (Nullable): New.
16234 * src/nullable.c (set_nullable): Instead of blindly looping over
16235 `ritems', loop over the rules, and then over their rhs's.
16236
16237 Work around Autotest bugs.
16238
16239 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
16240 frame, because Autotest understand lines starting with a `+' as
16241 traces from the shell. Then, they are not processed properly.
16242 Admittedly an Autotest bug, but we don't have time to wait for
16243 Autotest to catch up.
16244 * tests/regression.at (Broken Closure): Adjust to the new table
16245 frames.
16246 Move to...
16247 * tests/sets.at: here.
16248
162492001-12-13 Akim Demaille <akim@epita.fr>
16250
16251 * src/closure.c (closure): Use nrules instead of playing tricks
16252 with BITS_PER_WORD.
16253
162542001-12-13 Akim Demaille <akim@epita.fr>
16255
16256 * src/print.c (print_actions): Output the handling of `$' as the
16257 traces do: shifting the token EOF. Before EOF was treated as a
16258 nonterminal.
16259 * tests/regression.at: Adjust some tests.
16260 * src/print_graph.c (print_core): Complete the set of items via
16261 closure. The next-to-final and final states are still unsatisfying,
16262 but that's to be addressed elsewhere.
16263 No longer output the rule numbers, but do output the state number.
16264 A single loop for the shifts + gotos is enough, but picked a
16265 distinct color for each.
16266 (print_graph): Initialize and finalize closure.
16267
162682001-12-13 Akim Demaille <akim@epita.fr>
16269
16270 * src/reader.c (readgram): Remove dead code, an strip useless
16271 braces.
16272 (get_type): Remove, unused.
16273
162742001-12-12 Akim Demaille <akim@epita.fr>
16275
16276 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
16277 on that of lib/error.c.
16278
162792001-12-12 Akim Demaille <akim@epita.fr>
16280
16281 Some hosts don't like `/' in includes.
16282
16283 * src/system.h: Include libgettext.h without qualifying the path.
16284 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
16285 $(top_srcdir).
16286
162872001-12-11 Marc Autret <autret_m@epita.fr>
16288
16289 * src/output.c (output_parser): Remove useless muscle.
16290
162912001-12-11 Marc Autret <autret_m@epita.fr>
16292
16293 * src/bison.simple: Remove #line just before %%epilogue. It
16294 is now handled in ...
16295 * src/reader.c (read_additionnal_code): Add the output of a
16296 #line for the epilogue.
16297
162982001-12-10 Marc Autret <autret_m@epita.fr>
16299
16300 * src/reader.c (copy_definition): Re-use CPP-outed code which
16301 replace precedent remove.
16302 * src/bison.simple: Remove #line before %%prologue because
16303 %%input-line is wrong at this time.
16304
163052001-12-10 Marc Autret <autret_m@epita.fr>
16306
16307 * src/reader.c (symbols_output): Clean up.
16308 * src/output.c (output_gram, output): Clean up.
16309
163102001-12-10 Akim Demaille <akim@epita.fr>
16311
16312 * src/lalr.c (initialize_lookaheads): New. Extracted from...
16313 * src/LR0.c (set_state_table): here.
16314 * src/lalr.c (lalr): Call it.
16315
163162001-12-10 Akim Demaille <akim@epita.fr>
16317
16318 * src/state.h (shifts): Remove the `number' member: shifts are
16319 attached to state, hence no longer need to be labelled with a
16320 state number.
16321
163222001-12-10 Akim Demaille <akim@epita.fr>
16323
16324 Now that states have a complete set of members, the linked list of
16325 shifts is useless: just fill directly the state's shifts member.
16326
16327 * src/state.h (shifts): Remove the `next' member.
16328 * src/LR0.c (first_state, last_state): Remove.
16329 Adjust the callers.
16330 (augment_automaton): Don't look for the shifts that must be added
16331 a shift on EOF: it is those of the state we looked for! But now,
16332 since shifts are attached, it is no longer needed to looking
16333 merely by its id: its number.
16334
163352001-12-10 Akim Demaille <akim@epita.fr>
16336
16337 * src/LR0.c (augment_automaton): Better variable locality.
16338 Remove an impossible branch: if there is a state corresponding to
16339 the start symbol being shifted, then there is shift for the start
16340 symbol from the initial state.
16341
163422001-12-10 Akim Demaille <akim@epita.fr>
16343
16344 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
16345 only when appropriate: when insert_start_shifting_state' is not
16346 invoked.
16347 * tests/regression.at (Rule Line Numbers): Adjust.
16348
163492001-12-10 Akim Demaille <akim@epita.fr>
16350
16351 * src/LR0.c (augment_automaton): Now that all states have shifts,
16352 merge the two cases addition shifts to the initial state.
16353
163542001-12-10 Akim Demaille <akim@epita.fr>
16355
16356 * src/lalr.c (set_state_table): Move to...
16357 * src/LR0.c: here.
16358 * src/lalr.c (lalr): Don't call it...
16359 * src/LR0.c (generate_states): do it.
16360 * src/LR0.h (first_state): Remove, only the table is used.
16361
163622001-12-10 Akim Demaille <akim@epita.fr>
16363
16364 * src/LR0.h (first_shift, first_reduction): Remove.
16365 * src/lalr.c: Don't use first_shift: find shifts through the
16366 states.
16367
163682001-12-10 Akim Demaille <akim@epita.fr>
16369
16370 * src/LR0.c: Attach shifts to states as soon as they are
16371 computed.
16372 * src/lalr.c (set_state_table): Instead of assigning shifts to
16373 state, just assert that the mapping was properly done.
16374
163752001-12-10 Akim Demaille <akim@epita.fr>
16376
16377 * src/LR0.c (insert_start_shift): Rename as...
16378 (insert_start_shifting_state): this.
16379 (insert_eof_shifting_state, insert_accepting_state): New.
16380 (augment_automaton): Adjust.
16381 Better locality of the variables.
16382 When looking if the start_symbol is shifted from the initial
16383 state, using `while (... symbol != start_symbol ...)' sounds
16384 better than `while (... symbol < start_symbol ...)': If fail
16385 to see how the order between symbols could be relevant!
16386
163872001-12-10 Akim Demaille <akim@epita.fr>
16388
16389 * src/getargs.h: Don't declare `spec_name_prefix' and
16390 `spec_file_prefix', declared by src/files.h.
16391 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
16392 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
16393 * src/output.c (prepare): Adjust.
16394 * src/reader.c (symbols_output): Likewise.
16395 * src/vmsgetargs.c: Vaguely adjust, but who cares?
16396
163972001-12-10 Akim Demaille <akim@epita.fr>
16398
16399 * src/muscle_tab.c (muscle_init): NULL is a better default than
16400 `"0"'.
16401
164022001-12-10 Akim Demaille <akim@epita.fr>
16403
16404 * src/reader.c (reader): Calling symbols_output once is enough.
16405
164062001-12-10 Akim Demaille <akim@epita.fr>
16407
16408 Now that states have a complete set of members, the linked list of
16409 reductions is useless: just fill directly the state's reductions
16410 member.
16411
16412 * src/state.h (struct reductions): Remove member `number' and
16413 `next'.
16414 * src/LR0.c (first_reduction, last_reduction): Remove.
16415 (save_reductions): Don't link the new reductions, store them in
16416 this_state.
16417 * src/lalr.c (set_state_table): No need to attach reductions to
16418 states, it's already done.
16419 * src/output.c (output_actions): No longer free the shifts, then
16420 the reductions, then the states: free all the states and their
16421 members.
16422
164232001-12-10 Akim Demaille <akim@epita.fr>
16424
16425 * src/options.c (OPTN, DRTV, BOTH): New.
16426 (option_table): Use them.
16427
16428 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
16429 the job of system.h.
16430 * src/options.c: Don't include stdio.h and xalloc.h for the same
16431 reasons.
16432
164332001-12-10 Akim Demaille <akim@epita.fr>
16434
16435 * src/output.c (output, prepare): Make sure the values of the
16436 muscles `action' and `prologue' are 0-terminated.
16437
164382001-12-10 Akim Demaille <akim@epita.fr>
16439
16440 Clean up GCC warnings.
16441
16442 * src/reader.c (copy_action): `buf' is not used.
16443 (parse_skel_decl): Be static.
16444 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
16445 * src/options.h (create_long_option_table): Have a real prototype.
16446 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
16447 (hash_delete_at): Return const void *.
16448 Adjust casts to preserve the const.
16449
164502001-12-10 Akim Demaille <akim@epita.fr>
16451
16452 * configure.in: Require 2.52g.
16453 M4 is not needed, but AUTOM4TE is.
16454 * m4/m4.m4: Remove.
16455 * tests/Makefile.am: Adjust.
16456
164572001-12-10 Akim Demaille <akim@epita.fr>
16458
16459 One structure for states is enough, even though theoretically
16460 there are LR(0) states and LALR(1) states.
16461
16462 * src/lalr.h (state_t): Remove.
16463 (state_table): Be state_t **, not state_t *.
16464 * src/state.h (core, CORE_ALLOC): Rename as...
16465 (state_t, STATE_ALLOC): this.
16466 Add the LALR(1) members: shifts, reductions, errs.
16467 * src/LR0.c (state_table): Rename as...
16468 (state_hash): this, to avoid name clashes with the global
16469 `state_table'.
16470 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
16471 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
16472
164732001-12-10 Akim Demaille <akim@epita.fr>
16474
16475 Bison dumps core on bash.y.
16476 Reported by Pascal Bart.
16477
16478 * src/warshall.c (bitmatrix_print): New.
16479 (TC): Use it.
16480 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
16481 j must be the outer loop.
16482 * tests/regression.at (Broken Closure): New.
16483
164842001-12-05 Akim Demaille <akim@epita.fr>
16485
16486 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
16487 its argument.
16488 Reported by Peter Hamorsky.
16489
164902001-12-05 Akim Demaille <akim@epita.fr>
16491
16492 * src/conflicts.c (err_table): Remove.
16493 (resolve_sr_conflict): Adjust.
16494 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
16495 Rename as...
16496 (state_t.reductions, state_t.shifts): this.
16497
164982001-12-05 Akim Demaille <akim@epita.fr>
16499
16500 * src/reduce.c (reduce_grammar_tables): No longer disable the
16501 removal of useless rules via CPP but via `if (0)', so that the
16502 compiler still check the code is valid.
16503 For instance, it should have noticed `rline' no longer exists: use
16504 the `line' member of rule_t.
16505 * src/gram.c (dummy, rline): Remove, unused.
16506
165072001-12-05 Akim Demaille <akim@epita.fr>
16508
16509 * src/output.c (pack_vector): Use assert, not berror.
16510 * src/main.c (berror): Remove, unused.
16511
165122001-12-05 Akim Demaille <akim@epita.fr>
16513
16514 New experimental feature: if --verbose --trace output all the
16515 items of a state, not only its kernel.
16516
16517 * src/print.c (print_core): If `trace_flag', then invoke closure
16518 before outputting the items of the state (print_core is no longer
16519 a correct name them).
16520 (print_results): Invoke new_closure/free_closure if needed.
16521
165222001-12-05 Akim Demaille <akim@epita.fr>
16523
16524 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
16525 * src/closure.c, src/closure.h (itemsetsize): Rename as...
16526 (nitemset): for consistency with the rest of the project.
16527
165282001-12-05 Akim Demaille <akim@epita.fr>
16529
16530 * src/closure.c (print_closure): Improve.
16531 (closure): Use it for printing input and output.
16532
165332001-12-05 Akim Demaille <akim@epita.fr>
16534
16535 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
16536 indexed by nonterminals.
16537
165382001-12-05 Akim Demaille <akim@epita.fr>
16539
16540 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
16541 what it was!).
16542 * src/warshall.h: Remove accidental duplication of the content.
16543
165442001-12-05 Akim Demaille <akim@epita.fr>
16545
16546 * src/closure.c (set_fderives): De-obfuscate.
16547
165482001-12-05 Akim Demaille <akim@epita.fr>
16549
16550 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
16551
165522001-12-05 Akim Demaille <akim@epita.fr>
16553
16554 * src/closure.c (set_firsts): De-obfuscate.
16555
165562001-12-05 Akim Demaille <akim@epita.fr>
16557
16558 * src/output.c (action_row): De-obfuscate
16559 using the good o' techniques: arrays not pointers, variable
16560 locality, BITISSET, RESETBIT etc.
16561
165622001-12-05 Akim Demaille <akim@epita.fr>
16563
16564 Pessimize the code to simplify it: from now on, all the states
16565 have a valid SHIFTS, which NSHIFTS is possibly 0.
16566
16567 * src/LR0.c (shifts_new): Be global and move to..
16568 * src/state.c, src/state.h: here.
16569 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
16570 * src/print_graph: Adjust.
16571
165722001-12-05 Akim Demaille <akim@epita.fr>
16573
16574 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
16575 * src/conflicts.c: Use it.
16576 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
16577 incorrectly ``simplified''.
16578
165792001-12-05 Akim Demaille <akim@epita.fr>
16580
16581 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
16582 using the good o' techniques: arrays not pointers, variable
16583 locality, BITISSET, RESETBIT etc.
16584
165852001-12-05 Akim Demaille <akim@epita.fr>
16586
16587 * src/state.h (SHIFT_SYMBOL): New.
16588 * src/conflicts.c: Use it to deobfuscate.
16589
165902001-12-05 Akim Demaille <akim@epita.fr>
16591
16592 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
16593 (print_reductions): De-obfuscate using the good o' techniques:
16594 arrays not pointers, variable locality, BITISSET.
16595
165962001-12-05 Akim Demaille <akim@epita.fr>
16597
16598 * src/conflicts.c (print_reductions): Arrays, not pointers.
16599 Use BITISSET.
16600
166012001-12-05 Akim Demaille <akim@epita.fr>
16602
16603 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16604
166052001-12-05 Akim Demaille <akim@epita.fr>
16606
16607 * src/conflicts.c (print_reductions): Improve variable locality.
16608
166092001-12-05 Akim Demaille <akim@epita.fr>
16610
16611 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16612
166132001-12-05 Akim Demaille <akim@epita.fr>
16614
16615 * src/conflicts.c (print_reductions): Improve variable locality.
16616
166172001-12-05 Akim Demaille <akim@epita.fr>
16618
16619 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
16620 * src/lalr.c: Use them.
16621
166222001-12-05 Akim Demaille <akim@epita.fr>
16623
16624 * src/LR0.c (augment_automaton): Formatting changes.
16625 Better variable locality.
16626
166272001-12-05 Akim Demaille <akim@epita.fr>
16628
16629 * src/lalr.c (matrix_print): New.
16630 (transpose): Use it.
16631 Use arrays instead of pointers.
16632
166332001-12-05 Akim Demaille <akim@epita.fr>
16634
16635 * src/lalr.c (maxrhs): Move to...
16636 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
16637 * src/lalr.c (build_relations): Adjust.
16638
166392001-12-05 Akim Demaille <akim@epita.fr>
16640
16641 * src/lalr.c (transpose): Free the memory allocated to the
16642 argument, as it is replaced by the results by the unique caller.
16643 (build_relations): Merely invoke transpose: it handles the memory
16644 deallocation.
16645 Improve variable locality.
16646 Avoid variables used as mere abbreviations.
16647 (compute_lookaheads): Use arrays instead of pointers.
16648
166492001-12-05 Akim Demaille <akim@epita.fr>
16650
16651 * src/lalr.c (initialize_F): Improve variable locality.
16652 Avoid variables used as mere abbreviations.
16653
166542001-12-05 Akim Demaille <akim@epita.fr>
16655
16656 * src/derives.c (print_derives): Display the ruleno.
16657 * src/lalr.c (initialize_F, transpose): Better variable locality
16658 to improve readability.
16659 Avoid variables used as mere abbreviations.
16660
166612001-12-05 Akim Demaille <akim@epita.fr>
16662
16663 * src/lalr.c (traverse): Use arrays instead of pointers.
16664
166652001-12-05 Akim Demaille <akim@epita.fr>
16666
16667 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
16668 the handling of squeue.
16669 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16670
166712001-12-05 Akim Demaille <akim@epita.fr>
16672
16673 Because useless nonterminals are now kept alive (instead of being
16674 `destroyed'), we now sometimes examine them, and store information
16675 related to them. Hence we need to know their number, and adjust
16676 memory allocations.
16677
16678 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
16679 static.
16680 * src/LR0.c (allocate_itemsets): The memory allocated to
16681 `symbol_count' was used for two different purpose: once to count
16682 the number of occurrences of each symbol, and later reassigned to
16683 `shift_symbol', containing the symbol that can be shifted from a
16684 given state.
16685 Deobfuscate, i.e., allocate, use and free `symbol_count' here
16686 only, and...
16687 (new_itemsets): Allocate `shift_symbol' here.
16688 (allocate_itemsets): symbol_count includes useless nonterminals.
16689 Make room for them.
16690 (free_storage): Use `free', not `XFREE', for pointers that cannot
16691 be null.
16692
166932001-12-05 Akim Demaille <akim@epita.fr>
16694
16695 * src/nullable.c (set_nullable): Deobfuscate the handling of
16696 ritem.
16697 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16698
166992001-12-05 Akim Demaille <akim@epita.fr>
16700
16701 * src/gram.c, src/gram.h (ritem_print): New.
16702 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
16703 (This useless function was defined only to work around VMS linkers
16704 that can't handle compilation units with variables only).
16705 * src/reduce.c (dump_grammar): Use it to trace the construction of
16706 ritem.
16707
167082001-12-04 Paul Eggert <eggert@twinsun.com>
16709
16710 * src/bison.simple (union yyalloc): Change member names
16711 to be the same as the stack names.
16712 (yyparse): yyptr is now union yyalloc *, not char *.
16713 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
16714 and may generate better code on some machines.
16715 (yystpcpy): Use prototype if __STDC__ is defined, not just
16716 if __cplusplus is defined.
16717
167182001-11-30 Akim Demaille <akim@epita.fr>
16719
16720 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
16721 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
16722 Gettext doesn't compile cleanly, and dies with -Werror.
16723 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
16724 Include WARNING_CFLAGS here.
16725 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
16726 before being defined.
16727
167282001-11-27 Paul Eggert <eggert@twinsun.com>
16729
16730 * lib/quotearg.h (quotearg_n, quotearg_n_style):
16731 First arg is int, not unsigned.
16732 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
16733 (SIZE_MAX, UINT_MAX): New macros.
16734 (quotearg_n_options): Abort if N is negative.
16735 Avoid overflow check on hosts where size_t is 64 bits and int
16736 is 32 bits, as overflow is impossible there.
16737 Fix off-by-one typo that caused unnecessary reallocation.
16738
167392001-11-29 Paul Eggert <eggert@twinsun.com>
16740
16741 Name space cleanup in generated parser.
16742
16743 * doc/bison.texinfo (Bison Parser): Discuss system headers
16744 and their effect on the user name space.
16745
16746 * src/bison.simple:
16747 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
16748 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
16749 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
16750
16751 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
16752 on user names when possible.
16753
16754 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
16755 Simplify test for whather <alloca.h> exists.
16756
16757 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
16758
16759 (<stdio.h>): Include if YYDEBUG.
16760
16761 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
16762 ! defined (yyoverflow) && ! defined (yymemcpy).
16763
16764 (yymemcpy, yyparse): Rename local variables as needed so that
16765 they all begin with 'yy'.
16766
16767 (yystrlen, yystpcpy): New functions.
16768
16769 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
16770 All uses changed.
16771
16772 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
16773 instead of relying on string.h functions. Use YYSTACK_ALLOC
16774 and YYSTACK_FREE instead of malloc and free.
16775
167762001-11-30 Akim Demaille <akim@epita.fr>
16777
16778 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
16779 before their first uses.
16780 (YYBISON, YYPURE): Move to the top of the output.
16781
167822001-11-30 Akim Demaille <akim@epita.fr>
16783
16784 * tests/reduce.at (Useless Nonterminals): Fix.
16785
167862001-11-30 Akim Demaille <akim@epita.fr>
16787
16788 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
16789 if body instead of `;' to pacify GCC's warnings.
16790
167912001-11-30 Akim Demaille <akim@epita.fr>
16792
16793 Instead of mapping the LHS of unused rules to -1, keep the LHS
16794 valid, but flag the rules as invalid.
16795
16796 * src/gram.h (rule_t): `useful' is a new member.
16797 * src/print.c (print_grammar): Adjust.
16798 * src/derives.c (set_derives): Likewise.
16799 * src/reader.c (packgram, reduce_output): Likewise.
16800 * src/reduce.c (reduce_grammar_tables): Likewise.
16801 * tests/reduce.at (Underivable Rules, Useless Rules): New.
16802
168032001-11-30 Akim Demaille <akim@epita.fr>
16804
16805 * src/reduce.c (reduce_output): Formatting changes.
16806 * src/print.c (print_results, print_grammar): Likewise.
16807 * tests/regression.at (Rule Line Numbers)
16808 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
16809
168102001-11-30 Akim Demaille <akim@epita.fr>
16811
16812 * src/reduce.c (nonterminals_reduce): Instead of throwing away
16813 useless nonterminals, move them at the end of the symbol arrays.
16814 (reduce_output): Adjust.
16815 * tests/reduce.at (Useless Nonterminals): Adjust.
16816
168172001-11-30 Akim Demaille <akim@epita.fr>
16818
16819 * src/reduce.c: Various comment/formatting changes.
16820 (nonterminals_reduce): New, extracted from...
16821 (reduce_grammar_tables): here.
16822 (reduce_grammar): Call nonterminals_reduce.
16823
168242001-11-29 Paul Eggert <eggert@twinsun.com>
16825
16826 * src/bison.simple (YYSTACK_REALLOC): Remove.
16827 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
16828 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
16829 New macros.
16830 (union yyalloc): New type.
16831 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
16832 an arbitrary restriction on hosts where size_t is wider than int.
16833
16834 (yyparse): Don't dump core if alloca or malloc fails; instead, report
16835 a parser stack overflow. Allocate just one block of memory for all
16836 three stacks, instead of allocating three blocks; this typically is
16837 faster and reduces fragmentation.
16838
16839 Do not limit the number of items in the stack to a value that fits
16840 in 'int', as this is an arbitrary limit on hosts with 64-bit
16841 size_t and 32-bit int.
16842
168432001-11-29 Marc Autret <autret_m@epita.fr>
16844
16845 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
16846 of defining YYERROR_VERBOSE.
16847 [AT_DATA]: $4 is now out of C declarations in the prologue.
16848
168492001-11-28 Marc Autret <autret_m@epita.fr>
16850
16851 * src/reader.c (parse_dquoted_param): New.
16852 (parse_skel_decl): Use it.
16853 * src/lex.h: Add its prototype.
16854 * src/lex.c (literalchar): Become not static.
16855
168562001-11-28 Marc Autret <autret_m@epita.fr>
16857
16858 * src/output.h: And put its extern declaration here.
16859 * src/output.c (error_verbose): Define here.
16860 (prepare): Echo name modification.
16861 * src/getargs.h: Clean its extern declaration.
16862 * src/getargs.c (error_verbose_flag): Remove.
16863 (getargs): Remove case 'e'.
16864 * src/options.c (option_table): 'error-verbose' is now seen as simple
16865 percent option.
16866 Include output.h.
16867
16868 * src/reader.c (read_declarations): Remove case tok_include.
16869 (parse_include_decl): Remove.
16870 * src/lex.h (token_t): Remove tok_include.
16871 * src/options.c (option_table): 'include' is now a simple command line
16872 option.
16873
168742001-11-28 Marc Autret <autret_m@epita.fr>
16875
16876 * src/bison.simple: Adjust muscle names.
16877 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16878 * src/output.c (prepare): s/_/-/ for the muscles names.
16879 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16880
168812001-11-28 Marc Autret <autret_m@epita.fr>
16882
16883 * src/bison.simple: Fix debug.
16884 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16885
168862001-11-28 Akim Demaille <akim@epita.fr>
16887
16888 * src/LR0.c (shifts_new): New.
16889 (save_shifts, insert_start_shift, augment_automaton): Use it.
16890
168912001-11-28 Akim Demaille <akim@epita.fr>
16892
16893 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16894 keep ruleno only.
16895
168962001-11-28 Akim Demaille <akim@epita.fr>
16897
16898 * src/closure.c (closure): Instead of looping over word in array
16899 then bits in words, loop over bits in array.
16900
169012001-11-28 Akim Demaille <akim@epita.fr>
16902
16903 * src/closure.c (closure): No longer optimize the special case
16904 where all the bits of `ruleset[r]' are set to 0, to make the code
16905 clearer.
16906
169072001-11-28 Akim Demaille <akim@epita.fr>
16908
16909 * src/closure.c (closure): `r' and `c' are new variables, used to
16910 de-obfuscate accesses to RULESET and CORE.
16911
169122001-11-28 Akim Demaille <akim@epita.fr>
16913
16914 * src/reduce.c (reduce_print): Use ngettext.
16915 (dump_grammar): Improve the trace accuracy.
16916
169172001-11-28 Akim Demaille <akim@epita.fr>
16918
16919 * src/reduce.c (dump_grammar): Don't translate trace messages.
16920
169212001-11-28 Akim Demaille <akim@epita.fr>
16922
16923 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16924 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16925 as all tags are free'ed afterwards.
16926 From Enrico Scholz.
16927
169282001-11-27 Paul Eggert <eggert@twinsun.com>
16929
16930 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16931 use alloca when we didn't want to, and vice versa.
16932
169332001-11-27 Marc Autret <autret_m@epita.fr>
16934
16935 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16936 initialization.
16937 * src/output.c (prepare): Remove its update.
16938
169392001-11-27 Marc Autret <autret_m@epita.fr>
16940
16941 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16942 Use %error-verbose.
16943
169442001-11-27 Marc Autret <autret_m@epita.fr>
16945
16946 * src/bison.simple: Remove YYERROR_VERBOSE using.
16947 Use %%error_verbose.
16948 (yyparse): Likewise.
16949 * src/output.c (prepare): Give its final value.
16950 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16951 * src/getargs.h: Add its extern declaration.
16952 * src/getargs.c (error_verbose_flag): New int.
16953 (getargs): Update to catch new case.
16954 * src/options.c (option_table): 'error-verbose' is a new option.
16955 (shortopts): Update.
16956
169572001-11-27 Akim Demaille <akim@epita.fr>
16958
16959 * src/system.h: Use intl/libgettext.h.
16960 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16961
169622001-11-27 Akim Demaille <akim@epita.fr>
16963
16964 * tests/torture.at (Exploding the Stack Size with Malloc):
16965 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16966
169672001-11-27 Akim Demaille <akim@epita.fr>
16968
16969 * src/files.c: Include error.h.
16970 Reported by Hans Aberg.
16971
169722001-11-26 Marc Autret <autret_m@epita.fr>
16973
16974 * src/reader.c (parse_include_decl): New, not yet implemented.
16975 (read_declarations): Add case tok_include.
16976 * src/getargs.h (include): Add its extern definition.
16977 * src/getargs.c (include): New const char *.
16978 (getargs): Add case '-I'.
16979 * src/options.c (option_table): Add include as command line and
16980 percent option.
16981 * src/lex.h (token_t): Add tok_include.
16982
169832001-11-26 Akim Demaille <akim@epita.fr>
16984
16985 * src/reader.c (readgram): Make sure rules for mid-rule actions
16986 have a lineno equal to that of their host rule.
16987 Reported by Hans Aberg.
16988 * tests/regression.at (Rule Line Numbers): New.
16989
169902001-11-26 Akim Demaille <akim@epita.fr>
16991
16992 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16993 size_ts.
16994
169952001-11-26 Akim Demaille <akim@epita.fr>
16996
16997 * src/complain.c, src/complain.h (error): Remove, provided by
16998 lib/error.[ch].
16999
170002001-11-26 Akim Demaille <akim@epita.fr>
17001
17002 * src/reader.c (read_declarations): Don't abort on tok_illegal,
17003 issue an error message.
17004 * tests/regression.at (Invalid %directive): New.
17005 Reported by Hans Aberg.
17006
170072001-11-26 Akim Demaille <akim@epita.fr>
17008
17009 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
17010 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17011
170122001-11-26 Akim Demaille <akim@epita.fr>
17013
17014 * src/conflicts.c (conflicts_print): Don't complain at all when
17015 there are no reduce/reduce conflicts, and as many shift/reduce
17016 conflicts as expected.
17017 * tests/regression.at (%expect right): Adjust.
17018
170192001-11-23 Akim Demaille <akim@epita.fr>
17020
17021 * lib/alloca.c: Update, from fileutils.
17022
170232001-11-23 Akim Demaille <akim@epita.fr>
17024
17025 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
17026
170272001-11-23 Akim Demaille <akim@epita.fr>
17028
17029 * src/system.h: Include alloca.h.
17030 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
17031
170322001-11-23 Akim Demaille <akim@epita.fr>
17033
17034 * src/print_graph.c (print_actions): Remove `rule', unused.
17035 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
17036 pacify GCC's signed < unsigned warnings.
17037 * src/closure.c (itemsetsize): Likewise.
17038 * src/reader.c (symbol_list_new): Static.
17039
170402001-11-23 Akim Demaille <akim@epita.fr>
17041
17042 Attaching lineno to buckets is stupid, since only one copy of each
17043 symbol is kept, only the line of the first occurrence is kept too.
17044
17045 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
17046 * src/reader.c (rline_allocated): Remove, unused.
17047 (symbol_list): Have a `line' member.
17048 (symbol_list_new): New.
17049 (readgram): Use it.
17050 * src/print.c (print_grammar): Output the rule line numbers.
17051 * tests/regression.at (Solved SR Conflicts)
17052 (Unresolved SR Conflicts): Adjust.
17053 Reported by Hans Aberg.
17054
170552001-11-22 Marc Autret <autret_m@epita.fr>
17056
17057 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
17058
170592001-11-22 Marc Autret <autret_m@epita.fr>
17060
17061 * src/muscle_tab.c (muscle_init): Remove initialization of
17062 skeleton muscle.
17063 * src/output.c (output_master_parser): Do it here.
17064
170652001-11-20 Akim Demaille <akim@epita.fr>
17066
17067 * po/sv.po: New.
17068 * configure.in (ALL_LINGUAS): Adjust.
17069 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
17070 longer contains strings to translate.
17071
170722001-11-19 Akim Demaille <akim@epita.fr>
17073
17074 * src/conflicts.c (conflicts_print): Add a missing \n.
17075
170762001-11-19 Akim Demaille <akim@epita.fr>
17077
17078 * src/nullable.c (nullable_print): New.
17079 (set_nullable): Call it when tracing.
17080 Better locality of variables.
17081
170822001-11-19 Akim Demaille <akim@epita.fr>
17083
17084 * src/print.c (print_actions): Better locality of variables.
17085
170862001-11-19 Akim Demaille <akim@epita.fr>
17087
17088 * src/derives.c (print_derives): Fix and enrich.
17089 * src/closure.c (print_fderives): Likewise.
17090
170912001-11-19 Akim Demaille <akim@epita.fr>
17092
17093 * src/closure.c (itemsetend): Remove, replaced with...
17094 (itemsetsize): new.
17095
170962001-11-19 Akim Demaille <akim@epita.fr>
17097
17098 * src/LR0.c (kernel_end): Remove, replaced with...
17099 (kernel_size): new.
17100
171012001-11-19 Akim Demaille <akim@epita.fr>
17102
17103 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
17104 to clarify.
17105
171062001-11-19 Akim Demaille <akim@epita.fr>
17107
17108 * src/closure.c (closure): Use arrays instead of pointers to clarify.
17109
171102001-11-19 Akim Demaille <akim@epita.fr>
17111
17112 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
17113 trace messages.
17114 * src/LR0.c: Likewise.
17115 (allocate_itemsets): Use arrays instead of pointers to clarify.
17116
171172001-11-19 Akim Demaille <akim@epita.fr>
17118
17119 * src/getargs.c (statistics_flag): Replace with...
17120 (trace_flag): New.
17121 (longopts): Accept --trace instead of --statistics.
17122 * src/getargs.h, src/options.c: Adjust.
17123 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
17124 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
17125
171262001-11-19 Akim Demaille <akim@epita.fr>
17127
17128 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
17129 pointers to clarify the code.
17130 (save_reductions, save_shifts): Factor common parts of alternatives.
17131
171322001-11-19 Akim Demaille <akim@epita.fr>
17133
17134 * src/LR0.c (new_state, get_state): Complete TRACE code.
17135 * src/closure.c: Include `reader.h' to get `tags', needed by the
17136 trace code.
17137 Rename the conditional DEBUG as TRACE.
17138 Output consistently TRACEs to stderr, not stdout.
17139 * src/derives.c: Likewise.
17140 * src/reduce.c: (inaccessable_symbols): Using if is better style
17141 than goto.
17142 Use `#if TRACE' instead of `#if 0' for tracing code.
17143
171442001-11-19 Akim Demaille <akim@epita.fr>
17145
17146 * src/system.h (LIST_FREE, shortcpy): New.
17147 * src/LR0.c: Use them.
17148 * src/output.c (free_itemsets, free_reductions, free_shifts):
17149 Remove, replaced by LIST_FREE.
17150
171512001-11-19 Akim Demaille <akim@epita.fr>
17152
17153 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
17154 (REDUCTIONS_ALLOC): New.
17155 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
17156 allocation.
17157
171582001-11-19 Akim Demaille <akim@epita.fr>
17159
17160 * src/LR0.c (new_state): Complete trace code.
17161 * src/nullable.c (set_nullable): Don't translate traces.
17162
171632001-11-19 Akim Demaille <akim@epita.fr>
17164
17165 * src/print_graph.c (print_core): Better locality of variables.
17166 * src/print.c (print_core): Likewise.
17167
171682001-11-19 Akim Demaille <akim@epita.fr>
17169
17170 * src/vcg.c: You do the output, so you are responsible of the
17171 handling of VCG syntax, in particular: use quotearg.
17172 * src/print_graph.c: Don't.
17173 (print_actions): Don't output the actions as part of the nodes,
17174 since that's the job of the edges.
17175 (print_state): Don't output by hand: fill the node description,
17176 and ask for its output.
17177
171782001-11-19 Akim Demaille <akim@epita.fr>
17179
17180 * src/bison.simple (yyparse): When verbosely reporting an error,
17181 no longer put additional quotes around token names.
17182 * tests/calc.at: Adjust.
17183
171842001-11-19 Akim Demaille <akim@epita.fr>
17185
17186 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
17187 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
17188 * src/output.c: Adjust.
17189
171902001-11-19 Akim Demaille <akim@epita.fr>
17191
17192 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
17193 (rule_t): this.
17194 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
17195
171962001-11-19 Akim Demaille <akim@epita.fr>
17197
17198 * src/gram.h (rule_t): New.
17199 (rule_table): New.
17200 (rrhs, rlhs): Remove, part of state_t.
17201 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
17202 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17203 * src/reader.c, src/reduce.c: Adjust.
17204
172052001-11-19 Akim Demaille <akim@epita.fr>
17206
17207 * src/reader.c (symbols_output): New, extracted from...
17208 (packsymbols): Here.
17209 (reader): Call it.
17210
172112001-11-19 Akim Demaille <akim@epita.fr>
17212
17213 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
17214 (maxrhs): this new function.
17215
172162001-11-19 Akim Demaille <akim@epita.fr>
17217
17218 * src/lalr.c (F): New macro to access the variable F.
17219 Adjust.
17220
172212001-11-19 Akim Demaille <akim@epita.fr>
17222
17223 * src/lalr.h (LA): New macro to access the variable LA.
17224 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17225 * src/lalr.c: Adjust.
17226
172272001-11-19 Akim Demaille <akim@epita.fr>
17228
17229 * src/lalr.c (initialize_LA): Only initialize LA. Let...
17230 (set_state_table): handle the `lookaheads' members.
17231
172322001-11-19 Akim Demaille <akim@epita.fr>
17233
17234 * src/lalr.h (lookaheads): Removed array, whose contents is now
17235 a member of...
17236 (state_t): this structure.
17237 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17238 Adjust.
17239
172402001-11-19 Akim Demaille <akim@epita.fr>
17241
17242 * src/lalr.h (consistent): Removed array, whose contents is now
17243 a member of...
17244 (state_t): this structure.
17245 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17246 Adjust.
17247
172482001-11-19 Akim Demaille <akim@epita.fr>
17249
17250 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
17251 contents are now members of...
17252 (state_t): this structure.
17253 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17254 Adjust.
17255
172562001-11-19 Akim Demaille <akim@epita.fr>
17257
17258 * src/lalr.h (state_t): New.
17259 (state_table): Be a state_t * instead of a core **.
17260 (accessing_symbol): Remove, part of state_t.
17261 * src/lalr.c: Adjust.
17262 (set_accessing_symbol): Merge into...
17263 (set_state_table): this.
17264 * src/print_graph.c, src/conflicts.c: Adjust.
17265
172662001-11-14 Akim Demaille <akim@epita.fr>
17267
17268 * tests/calc.at, tests/output.at, tests/regression.at,
17269 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
17270 now the tests are run in private dirs, therefore AC_CLEANUP and
17271 family can be simplified to 0-ary.
17272 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
17273 use abs. path to find config.h.
17274 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
17275 stderr, there can be way too much random noise.
17276 Instead pass -Werror to GCC and rely on the exit status.
17277 Reported by Wolfram Wagner.
17278
172792001-11-14 Akim Demaille <akim@epita.fr>
17280
17281 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
17282 defined only if yyoverflow is defined, to avoid `warning: unused
17283 variable `yyvs1''.
17284 Reported by The Test Suite.
17285
172862001-11-14 Akim Demaille <akim@epita.fr>
17287
17288 * src/print.c: Include reduce.h.
17289 Reported by Hans Aberg.
17290
172912001-11-14 Akim Demaille <akim@epita.fr>
17292
17293 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
17294 Revert a previous patch: these are really const.
17295 * src/conflicts.c (conflict_report): Additional useless pair of
17296 braces to pacify GCC's warnings for `if () if () {} else {}'.
17297 * src/lex.c (parse_percent_token): Replace equal_offset with
17298 arg_offset.
17299 arg is const.
17300 Be sure to strdup `arg' when used, since there is no reason for
17301 token_buffer not to change.
17302
173032001-11-14 Akim Demaille <akim@epita.fr>
17304
17305 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
17306 definition.
17307 * src/main.c (main): Use them.
17308 Suggested by Hans Aberg.
17309
173102001-11-12 Akim Demaille <akim@epita.fr>
17311
17312 * src/system.h (ngettext): Now that we use ngettext, be sure to
17313 provide a default definition when NLS are not used.
17314
173152001-11-12 Akim Demaille <akim@epita.fr>
17316
17317 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
17318 Use @kbd to denote user input.
17319 (Language and Grammar): ANSIfy the example.
17320 Adjust its layout for info/notinfo.
17321 (Location Tracking Calc): Output error messages to stderr.
17322 Output locations in a more GNUtically correct way.
17323 Fix a couple of Englishos.
17324 Adjust @group/@end group pairs.
17325
173262001-11-12 Akim Demaille <akim@epita.fr>
17327
17328 %expect was not functioning at all.
17329
17330 * src/conflicts.c (expected_conflicts): Set to -1.
17331 (conflict_report): Use ngettext.
17332 (conflicts_print): Check %expect and make its violation an error.
17333 * doc/bison.texinfo (Expect Decl): Adjust.
17334 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
17335 * tests/regression.at (%expect not enough, %expect right)
17336 (%expect too much): New.
17337
173382001-11-12 Akim Demaille <akim@epita.fr>
17339
17340 * tests/regression.at (Conflicts): Rename as...
17341 (Unresolved SR Conflicts): this.
17342 (Solved SR Conflicts): New.
17343
173442001-11-12 Akim Demaille <akim@epita.fr>
17345
17346 * src/reduce.c (print_results): Rename as...
17347 (reduce_output): This.
17348 Output to OUT, passed as argument, instead of output_obstack.
17349 (dump_grammar): Likewise.
17350 (reduce_free): New.
17351 Also free V1.
17352 (reduce_grammar): No longer call reduce_output, since...
17353 * src/print.c (print_results): do it.
17354 * src/main.c (main): Call reduce_free;
17355
173562001-11-12 Akim Demaille <akim@epita.fr>
17357
17358 * src/conflicts.c (print_reductions): Accept OUT as argument.
17359 Output to it, not to output_obstack.
17360 * src/print.c (print_actions): Adjust.
17361
173622001-11-12 Akim Demaille <akim@epita.fr>
17363
17364 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
17365 the result instead of using...
17366 (src_total, rrc_total, src_count, rrc_count): Remove.
17367 (any_conflicts): Remove.
17368 (print_conflicts): Split into...
17369 (conflicts_print, conflicts_output): New.
17370 * src/conflicts.h: Adjust.
17371 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
17372 * src/print.c (print_grammar): Issue `\n' between two rules.
17373 * tests/regression.at (Conflicts): New.
17374 Reported by Tom Lane.
17375
173762001-11-12 Akim Demaille <akim@epita.fr>
17377
17378 * tests/regression.at (Invalid input): Remove, duplicate with
17379 ``Invalid input: 1''.
17380
173812001-11-12 Akim Demaille <akim@epita.fr>
17382
17383 * tests/torture.at (AT_DATA_STACK_TORTURE)
17384 (Exploding the Stack Size with Alloca)
17385 (Exploding the Stack Size with Malloc): New.
17386
173872001-11-12 Akim Demaille <akim@epita.fr>
17388
17389 * src/bison.simple (YYSTACK_REALLOC): New.
17390 (yyparse) [!yyoverflow]: Use it and free the old stack.
17391 Reported by Per Allansson.
17392
173932001-11-12 Pascal Bart <pascal.bart@epita.fr>
17394
17395 * src/bison.simple: Define type yystype instead of YYSTYPE, and
17396 define CPP macro, which substitute YYSTYPE by yystype.
17397 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
17398 with yyltype/YYLTYPE. This allows inclusion of the generated
17399 header within the parser if the compiler, such as GGC, accepts
17400 multiple equivalent #defines.
17401 From Akim.
17402
174032001-11-05 Akim Demaille <akim@epita.fr>
17404
17405 * src/reader.c (symbols_output): New, extracted from...
17406 (packsymbols): here.
17407 (reader): Adjust.
17408
174092001-11-05 Akim Demaille <akim@epita.fr>
17410
17411 * src/lex.c (parse_percent_token): s/quotearg/quote/.
17412
174132001-11-05 Akim Demaille <akim@epita.fr>
17414
17415 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
17416 pattern.
17417
174182001-11-05 Akim Demaille <akim@epita.fr>
17419
17420 * src/options.h (struct option_table_struct): set_flags is void*.
17421 * src/options.c (longopts): Support `--output' and `%output'.
17422 (usage): Adjust.
17423 * src/lex.h (tok_setopt): Remove, replaced with...
17424 (tok_intopt, tok_stropt): these new guys.
17425 * src/lex.c (getopt.h): Not needed.
17426 (token_buffer, unlexed_token_buffer): Not const.
17427 (percent_table): Promote `-' over `_' in directive names.
17428 Active `%name-prefix', `file-prefix', and `output'.
17429 (parse_percent_token): Accept possible arguments to directives.
17430 Promote `-' over `_' in directive names.
17431
174322001-11-04 Akim Demaille <akim@epita.fr>
17433
17434 * doc/bison.texinfo (Decl Summary): Split the list into
17435 `directives for grammars' and `directives for bison'.
17436 Sort'em.
17437 Add description of `%name-prefix', `file-prefix', and `output'.
17438 Promote `-' over `_' in directive names.
17439 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
17440 Simplify the description of `--name-prefix'.
17441 Promote `-' over `_' in directive names.
17442 Promote `--output' over `--output-file'.
17443 Fix the description of `--defines'.
17444 * tests/output.at: Exercise %file-prefix and %output.
17445
174462001-11-02 Akim Demaille <akim@epita.fr>
17447
17448 * doc/refcard.tex: Update.
17449
174502001-11-02 Akim Demaille <akim@epita.fr>
17451
17452 * src/symtab.h (SUNDEF): New.
17453 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
17454 stand for `uninitialized', instead of 0.
17455 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
17456 * src/lex.c (lex): Adjust.
17457
17458 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
17459 Number it 0.
17460 Let yylex return it instead of a plain 0.
17461 Reported by Dick Streefland.
17462
174632001-11-02 Akim Demaille <akim@epita.fr>
17464
17465 * tests/regression.at (Mixing %token styles): New test.
17466
174672001-11-02 Akim Demaille <akim@epita.fr>
17468
17469 * src/reader.c (parse_thong_decl): Formatting changes.
17470 (token_translations_init): New, extracted from...
17471 (packsymbols): Here.
17472 Adjust.
17473
174742001-11-01 Akim Demaille <akim@epita.fr>
17475
17476 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
17477 Check that `9foo.y' produces correct cpp guards.
17478 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
17479 guards.
17480 Reported by Wwp.
17481
174822001-11-01 Akim Demaille <akim@epita.fr>
17483
17484 * tests/regression.at (Invalid input: 2): New.
17485 * src/lex.c (unlexed_token_buffer): New.
17486 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
17487 too.
17488 Reported by Wwp.
17489
174902001-11-01 Akim Demaille <akim@epita.fr>
17491
17492 * tests/calc.at: Catch up with 1.30.
17493 * configure.in: Bump to 1.49a.
17494 Adjust to newer Autotest.
17495
174962001-10-19 Pascal Bart <pascal.bart@epita.fr>
17497
17498 * src/conflicts.c: Move global variables rrc_total and src_total ...
17499 (print_conflicts): here.
17500 * src/output.c (output): Free global variable user_toknums.
17501 * src/lex.c (token_obstack): Become static.
17502
175032001-10-18 Akim Demaille <akim@epita.fr>
17504
17505 * tests/atlocal.in (GCC): Add.
17506 * tests/calc.at: s/m4_match/m4_bmatch/.
17507 s/m4_patsubst/m4_bpatsubst/.
17508 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
17509 * configure.in: AC_SUBST(GCC).
17510
175112001-10-14 Marc Autret <autret_m@epita.fr>
17512
17513 * src/options.c (create_long_option_table): Fix.
17514
175152001-10-10 Akim Demaille <akim@epita.fr>
17516
17517 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
17518
175192001-10-04 Akim Demaille <akim@epita.fr>
17520
17521 * src/reader.c (parse_union_decl): Push the caracters in
17522 union_obstack, not attrs_obstack.
17523
175242001-10-04 Akim Demaille <akim@epita.fr>
17525
17526 Merge in the branch 1.29.
17527
17528 * src/reader.c (packsymbols): Use a temporary obstack for
17529 `%%tokendef', since output_stack is already used elsewhere.
17530
17531 2001-10-02 Akim Demaille <akim@epita.fr>
17532
17533 Bump 1.29d.
17534
17535 2001-10-02 Akim Demaille <akim@epita.fr>
17536
17537 Version 1.29c.
17538
17539 2001-10-02 Akim Demaille <akim@epita.fr>
17540
17541 * tests/regression.at (Invalid CPP headers): New.
17542 From Alexander Belopolsky.
17543 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
17544
17545 2001-10-02 Akim Demaille <akim@epita.fr>
17546
17547 * tests/regression.at (Invalid input): New.
17548 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
17549 Reported by Shura.
17550
17551 2001-10-02 Akim Demaille <akim@epita.fr>
17552
17553 * tests/calc.at: Now that --debug works, the tests must be adjusted.
17554
17555 2001-10-02 Akim Demaille <akim@epita.fr>
17556
17557 * src/output.c (output_parser): Assert `skeleton'.
17558 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
17559 systems.
17560 From Shura.
17561
17562 2001-10-01 Marc Autret <autret_m@epita.fr>
17563
17564 * src/lex.h: Echo modifications.
17565 * src/lex.c (unlex): Parameter is now token_t.
17566 From Hans Aberg.
17567
17568 2001-10-01 Marc Autret <autret_m@epita.fr>
17569
17570 * src/main.c: Include lex.h.
17571 From Hans Aberg.
17572
17573 2001-09-29 Akim Demaille <akim@epita.fr>
17574
17575 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
17576
17577 2001-09-28 Akim Demaille <akim@epita.fr>
17578
17579 * tests/testsuite.at: Update to newer Autotest.
17580 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
17581
17582 2001-09-27 Akim Demaille <akim@epita.fr>
17583
17584 Position independent wrapper.
17585
17586 * tests/bison: Remove.
17587 * tests/bison.in: New.
17588 * configure.in: Adjust.
17589
17590 2001-09-27 Paul Eggert <eggert@twinsun.com>
17591
17592 Port quotearg fixes from tar 1.13.24.
17593
17594 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
17595 tm to be declared.
17596 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
17597 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
17598
17599 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
17600 * m4/mbrtowc.m4: New file.
17601 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
17602 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
17603
17604 2001-09-27 Akim Demaille <akim@epita.fr>
17605
17606 Bump to 1.29c.
17607
17608 2001-09-27 Akim Demaille <akim@epita.fr>
17609
17610 Version 1.29b.
17611
17612 2001-09-25 Akim Demaille <akim@epita.fr>
17613
17614 * src/system.h: Include `xalloc.h'.
17615 Remove it from the C files.
17616 * src/files.c (output_files): Free the obstacks.
17617 * src/lex.c (init_lex): Rename as...
17618 (lex_init): this.
17619 (lex_free): New.
17620 * src/main.c (main): Use it.
17621
17622 2001-09-24 Marc Autret <autret_m@epita.fr>
17623
17624 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
17625 to output informations in fout (FILE*).
17626 (open_graph, close_graph): Likewise.
17627 (output_graph, output_edge, output_node): Likewise.
17628 * src/vcg.h: Update function prototypes.
17629 * src/print_graph.c (print_graph): Open output graph file.
17630 (print_actions): Adjust.
17631 * src/files.h: Remove extern declaration.
17632 * src/files.c: Remove graph_obstack declaration.
17633 (open_files): Remove graph_obstack initialization.
17634 (output_files): Remove graph_obstack saving.
17635
17636 2001-09-24 Marc Autret <autret_m@epita.fr>
17637
17638 * src/files.c (compute_output_file_names): Fix.
17639
17640 2001-09-24 Marc Autret <autret_m@epita.fr>,
17641 Akim Demaille <akim@epita.fr>
17642
17643 * src/reader.c (reader): Remove call to free_symtab ().
17644 * src/main.c (main): Call it here.
17645 Include symtab.h.
17646 * src/conflicts.c (initialize_conflicts): Rename as...
17647 (solve_conflicts): this.
17648 * src/print.c (print_core, print_actions, print_state)
17649 (print_grammar): Dump to a file instead a `output_obstack'.
17650 (print_results): Dump `output_obstack', and then proceed with the
17651 FILE *.
17652 * src/files.c (compute_output_file_names, close_files): New.
17653 (output_files): Adjust.
17654 * src/main.c (main): Adjust.
17655
17656 2001-09-23 Marc Autret <autret_m@epita.fr>
17657
17658 * src/files.c (compute_header_macro): Computes header macro name
17659 from spec_defines_file when given.
17660
17661 2001-09-23 Marc Autret <autret_m@epita.fr>
17662
17663 * src/files.c (output_files): Add default extensions.
17664
17665 2001-09-22 Akim Demaille <akim@epita.fr>
17666
17667 * src/conflicts.c (finalize_conflicts): Rename as...
17668 (free_conflicts): this.
17669
17670 2001-09-22 Akim Demaille <akim@epita.fr>
17671
17672 * src/gram.c (gram_free): Rename back as...
17673 (dummy): this.
17674 (output_token_translations): Free `token_translations'.
17675 * src/symtab.c (free_symtab): Free the tag field.
17676
17677 2001-09-22 Akim Demaille <akim@epita.fr>
17678
17679 Remove `translations' as it is always set to true.
17680
17681 * src/gram.h: Adjust.
17682 * src/reader.c (packsymbols, parse_token_decl): Adjust
17683 * src/print.c (print_grammar): Adjust.
17684 * src/output.c (output_token_translations): Adjust.
17685 * src/lex.c (lex): Adjust.
17686 * src/gram.c: Be sure the set pointers to NULL.
17687 (dummy): Rename as...
17688 (gram_free): this.
17689
17690 2001-09-22 Akim Demaille <akim@epita.fr>
17691
17692 * configure.in: Invoke AM_LIB_DMALLOC.
17693 * src/system.h: Use dmalloc.
17694 * src/LR0.c: Be sure to have pointers initialized to NULL.
17695 (allocate_itemsets): Allocate kernel_items only if needed.
17696
17697 2001-09-22 Akim Demaille <akim@epita.fr>
17698
17699 * configure.in: Bump to 1.29b.
17700 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
17701 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
17702 need xmalloc.c in calc.y.
17703 From Pascal Bart.
17704
17705 2001-09-21 Akim Demaille <akim@epita.fr>
17706
17707 Version 1.29a.
17708 * Makefile.maint, config/config.guess, config/config.sub,
17709 * config/missing: Update from masters.
17710 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
17711 upon package.m4.
17712 * configure.in (ALL_LINGUAS): Add `tr'.
17713
17714 2001-09-21 Akim Demaille <akim@epita.fr>
17715
17716 * tests/Makefile.am (package.m4): Move to...
17717 ($(srcdir)/$(TESTSUITE)): here.
17718
17719 2001-09-20 Akim Demaille <akim@epita.fr>
17720
17721 * src/complain.c: No longer try to be standalone: use system.h.
17722 Don't assume __STDC__ is defined to 1. Just test if it is defined.
17723 * src/complain.h: Likewise.
17724 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
17725 Remove the unused variable `n'.
17726 From Albert Chin-A-Young.
17727
17728 2001-09-18 Marc Autret <autret_m@epita.fr>
17729
17730 * doc/bison.1: Update.
17731 * doc/bison.texinfo (Bison Options): Update --defines and --graph
17732 descriptions.
17733 (Option Cross Key): Update.
17734 Add --graph.
17735
17736 2001-09-18 Marc Autret <autret_m@epita.fr>
17737
17738 * tests/regression.at: New test (comment in %union).
17739
17740 2001-09-18 Marc Autret <autret_m@epita.fr>
17741
17742 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
17743 do that.
17744 Reported by Keith Browne.
17745
17746 2001-09-18 Marc Autret <autret_m@epita.fr>
17747
17748 * tests/output.at: Add tests for --defines and --graph.
17749
17750 2001-09-18 Marc Autret <autret_m@epita.fr>
17751
17752 * tests/output.at: Removes tests of %{header,src}_extension features.
17753
17754 2001-09-18 Akim Demaille <akim@epita.fr>
17755
17756 * tests/Makefile.am (package.m4): New.
17757 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
17758 (_AT_CHECK_CALC_ERROR): Likewise.
17759 Factor the `, ' part of verbose error messages.
17760
17761 2001-09-18 Marc Autret <autret_m@epita.fr>
17762
17763 * src/getargs.c (longopts): Declare --defines and --graph as options
17764 with optional arguments.
17765 * src/files.h: Add extern declarations.
17766 * src/files.c (spec_graph_file, spec_defines_file): New.
17767 (output_files): Update.
17768 Remove CPP-outed code.
17769
17770 2001-09-18 Marc Autret <autret_m@epita.fr>
17771
17772 Turn off %{source,header}_extension feature.
17773
17774 * src/files.c (compute_exts_from_gf): Update.
17775 (compute_exts_from_src): Update.
17776 (output_files): CPP-out useless code.
17777 * src/files.h: Remove {header,source}_extension extern declarations.
17778 * src/reader.c (parse_dquoted_param): CPP-out.
17779 (parse_header_extension_decl): Remove.
17780 (parse_source_extension_decl): Remove.
17781 (read_declarations): Remove cases tok_{hdrext,srcext}.
17782 * src/lex.c (percent_table): Remove {header,source}_extension entries.
17783 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
17784
17785 2001-09-10 Akim Demaille <akim@epita.fr>
17786
17787 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
17788 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
17789 (AT_CHECK_OUTPUT): this.
17790 Merely check ls' exit status, its output is useless.
17791
17792 2001-09-10 Akim Demaille <akim@epita.fr>
17793
17794 * tests/calc.at: Use m4_match.
17795 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
17796
17797 2001-09-10 Marc Autret <autret_m@epita.fr>,
17798 Akim Demaille <akim@epita.fr>
17799
17800 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
17801 enum color_e.
17802 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
17803 to `normal'.
17804 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
17805 * src/lex.h: Adjust prototype.
17806 (token_t): Add `tok_undef'.
17807 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
17808 (parse_percent_token): Now returns token_t.
17809 Add default statement in switch.
17810 (lex): Separate `c' as an input variable, from the token_t result
17811 part.
17812 (unlexed): Is a token_t.
17813
17814 2001-09-10 Akim Demaille <akim@epita.fr>
17815
17816 * configure.in: Bump to 1.29a.
17817
17818 2001-09-07 Akim Demaille <akim@epita.fr>
17819
17820 Version 1.29.
17821
17822 2001-08-30 Akim Demaille <akim@epita.fr>
17823
17824 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
17825 * m4/atconfig.m4: Remove.
17826 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
17827 * tests/bison: New.
17828 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
17829 m4_if, m4_patsubst, and m4_regexp.
17830 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
17831 `input' file instead of echo.
17832
17833 2001-08-29 Akim Demaille <akim@epita.fr>
17834
17835 Bump to 1.28e.
17836
17837 2001-08-29 Akim Demaille <akim@epita.fr>
17838
17839 Version 1.28d.
17840
17841 2001-08-29 Paul Eggert <eggert@twinsun.com>
17842
17843 * src/bison.simple (yyparse): Don't take the address of an
17844 item before the start of an array, as that doesn't conform to
17845 the C Standard.
17846
17847 2001-08-29 Robert Anisko <anisko_r@epita.fr>
17848
17849 * doc/bison.texinfo (Location Tracking Calc): New node.
17850
17851 2001-08-29 Paul Eggert <eggert@twinsun.com>
17852
17853 * src/output.c (output): Do not define const, as this now
17854 causes more problems than it cures.
17855
17856 2001-08-29 Akim Demaille <akim@epita.fr>
17857
17858 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17859 the nodes.
17860 Be sure to tag the `detailmenu'.
17861
17862 2001-08-29 Akim Demaille <akim@epita.fr>
17863
17864 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17865 download in a tmp dir.
17866
17867 2001-08-28 Marc Autret <autret_m@epita.fr>
17868
17869 * config/depcomp: New file.
17870
17871 2001-08-28 Marc Autret <autret_m@epita.fr>
17872
17873 * doc/bison.1 (mandoc): Adjust.
17874 From Juan Manuel Guerrero.
17875
17876 2001-08-28 Marc Autret <autret_m@epita.fr>
17877
17878 * src/print_graph.c (print_state): Fix.
17879
17880 2001-08-27 Marc Autret <autret_m@epita.fr>
17881
17882 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17883 char * members.
17884 Echo modifications to the functions prototypes.
17885 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17886
17887 2001-08-27 Marc Autret <autret_m@epita.fr>
17888
17889 * src/vcg.c: Include `xalloc.h'.
17890 (add_colorentry): New.
17891 (add_classname): New.
17892 (add_infoname): New.
17893 * src/vcg.h: Add new prototypes.
17894
17895 2001-08-27 Akim Demaille <akim@epita.fr>
17896
17897 * Makefile.maint: Sync. again with CVS Autoconf.
17898
17899 2001-08-27 Akim Demaille <akim@epita.fr>
17900
17901 * Makefile.maint: Formatting changes.
17902 (po-update, cvs-update, update): New targets.
17903 (AMTAR): Remove.
17904
17905 2001-08-27 Akim Demaille <akim@epita.fr>
17906
17907 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17908 * Makefile.maint: Sync. with CVS Autoconf.
17909
17910 2001-08-27 Marc Autret <autret_m@epita.fr>
17911
17912 * src/vcg.h (struct infoname_s): New.
17913 (struct colorentry_s): New.
17914 (graph_s): New fields {vertical,horizontal}_order in structure.
17915 Add `infoname' field.
17916 Add `colorentry' field;
17917 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17918 (G_HORIZONTAL_ORDER): New.
17919 (G_INFONAME): New.
17920 (G_COLORENTRY): New.
17921 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17922 Add output of `infoname'.
17923 Add output of `colorentry'.
17924
17925 2001-08-27 Marc Autret <autret_m@epita.fr>
17926
17927 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17928 This one shadowed a global parameter.
17929
17930 2001-08-24 Marc Autret <autret_m@epita.fr>
17931
17932 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17933 instead of `unsigned'.
17934 (print_state): Do not call obstack_object_size () in obstack_grow ()
17935 to avoid macro variables shadowing.
17936
17937 2001-08-23 Marc Autret <autret_m@epita.fr>
17938
17939 * src/lex.c (percent_table): Typo: s/naem/name/.
17940 Add graph option.
17941 Normalize new options declarations.
17942
17943 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17944
17945 * tests/suite.at: Exercise %header_extension and %source_extension.
17946
17947 2001-08-16 Marc Autret <autret_m@epita.fr>
17948
17949 * src/reader.c (parse_dquoted_param): New.
17950 (parse_header_extension_decl): Use it.
17951 (parse_source_extension_decl): Likewise.
17952
17953 2001-08-16 Marc Autret <autret_m@epita.fr>
17954
17955 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17956 (get_xxxx_str): Use assert () instead of complain ().
17957 Remove return invokations in default cases.
17958 (get_decision_str): Modify default behaviour. Remove second argument.
17959 Echo modifications on calls.
17960 (output_graph): Fix.
17961
17962 2001-08-16 Marc Autret <autret_m@epita.fr>
17963
17964 * src/getargs.c (usage): Update with ``-g, --graph''.
17965
17966 2001-08-16 Marc Autret <autret_m@epita.fr>
17967
17968 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17969 (Option Cross Key): Likewise.
17970 * doc/bison.1: Update.
17971
179722001-09-25 Pascal Bart <pascal.bart@epita.fr>
17973
17974 * src/output.c (output_master_parser): Don't finish action_obstack.
17975 (output_parser): Don't care about the muscle action, here.
17976 (prepare): Copy the action_obstack in the action muscle.
17977 (output): Free action_obstack.
17978
179792001-09-23 Pascal Bart <pascal.bart@epita.fr>
17980
17981 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17982 will contain `%union' declaration.
17983 (parse_union_decl): Delete #line directive output.
17984 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17985 informations about %union.
17986 (parse_union_decl): Copy the union_obstack in the muscle stype.
17987 * src/bison.simple: Add new #line directive.
17988 Add typdef %%stype YYSTYPE.
17989
179902001-09-23 Pascal Bart <pascal.bart@epita.fr>
17991
17992 * src/bison.simple: Add new `#line' directive.
17993
179942001-09-22 Pascal Bart <pascal.bart@epita.fr>
17995
17996 * src/bison.simple: New `#line' directive.
17997 * src/output.c (output_parser): Support new dynamic muscle input_line.
17998
179992001-09-22 Marc Autret <autret_m@epita.fr>
18000
18001 * src/output.c (output_master_parser): New.
18002 (output_parser): Be more re-entrant.
18003
180042001-09-21 Marc Autret <autret_m@epita.fr>
18005
18006 * src/reader.c (copy_definition, parse_union_decl): Update and use
18007 `linef' muscle.
18008 (copy_action): Likewise.
18009 Use obstack_1grow ().
18010 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
18011
180122001-09-21 Marc Autret <autret_m@epita.fr>
18013
18014 * src/options.c (option_table): Adjust.
18015 * src/lex.c (parse_percent_token): Fix.
18016
180172001-09-20 Pascal Bart <pascal.bart@epita.fr>
18018
18019 * src/options.c (symtab.h): Include it, need by lex.h.
18020
180212001-09-20 Pascal Bart <pascal.bart@epita.fr>
18022
18023 * src/lex.c (parse_percent_token): Change type of variable `tx', which
18024 is now an option_table_struct*.
18025 (option_strcmp): New function option_strcmp.
18026 (parse_percent_token): Call option_strcmp.
18027 * src/getargs.c (xalloc.h, options.h): Include it.
18028 (getargs): Call create_long_option_table.
18029 (getargs): Free longopts at the end of the function.
18030 (shortopts): Move in options.c.
18031 * src/options.c (create_long_option_table): New function. Convert
18032 information from option_table to option structure.
18033 * src/reader.c (options.h): Include it.
18034
18035 * src/Makefile.am: Adjust.
18036 * src/options.c (option_table): Create from longopts and percent_table.
18037 * src/getargs.c (longopts): Delete.
18038 * src/lex.c (struct percent_table_struct): Delete.
18039 (percent_table): Delete.
18040 (options.h): Include it.
18041 * src/options.c: Create.
18042 * src/options.h: Create.
18043 Declare enum opt_access_e.
18044 Define struct option_table_struct.
18045
180462001-09-20 Marc Autret <autret_m@epita.fr>
18047
18048 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
18049 sections of Bison.
18050
180512001-09-19 Pascal Bart <pascal.bart@epita.fr>
18052
18053 * src/bison.simple: s/%%filename/%%skeleton.
18054 * src/muscle_tab.c (getargs.h): Include it.
18055 (muscle_init): Insert new muscle skeleton.
18056
180572001-09-18 Pascal Bart <pascal.bart@epita.fr>
18058
18059 * src/output.c (output_parser): Delete unused variable actions_dumped.
18060
180612001-09-07 Pascal Bart <pascal.bart@epita.fr>
18062
18063 * src/output.c (output): Delete call to reader_output_yylsp.
18064 * src/reader.c (reader): Likewise.
18065 * src/reader.h: Delete declaration of reader_output_yylsp.
18066
180672001-09-02 Marc Autret <autret_m@epita.fr>
18068
18069 * src/reader.c: Include muscle_tab.h.
18070 (parse_union_decl): Update.
18071 (parse_macro_decl): Rename parse_muscle_decl.
18072 Update to use renamed functions and variable.
18073 (read_declarations, copy_action, read_additionnal_code, : Updated
18074 with correct variables and functions names.
18075 (packsymbols, reader): Likewise.
18076
18077 * src/reader.h (muscle_obstack): Extern declaration update.
18078
18079 * src/output.c: Include muscle_tab.h
18080 In all functions using macro_insert, change by using muscle_insert ().
18081 (macro_obstack): Rename muscle_obstack.
18082 Echo modifications in the whole file.
18083 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
18084 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
18085 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
18086
18087 * src/muscle_tab.h: Update double inclusion macros.
18088 (macro_entry_s): Rename muscle_entry_s.
18089 Update prototypes.
18090
18091 * src/muscle_tab.c: Include muscle_tab.h.
18092 Rename macro_tabble to muscle_table.
18093 (mhash1, mhash2, mcmp): Use muscle_entry.
18094 (macro_init): Rename muscle_init. Update.
18095 (macro_insert): Rename muscle_insert. Update.
18096 (macro_find): Rename muscle_find. Update.
18097
18098 * src/main.c: Include muscle_tab.h.
18099 (main): Call muscle_init ().
18100 * src/Makefile.am (bison_SOURCES): Echo modifications.
18101
181022001-09-02 Marc Autret <autret_m@epita.fr>
18103
18104 Now the files macro_tab.[ch] are named muscle_tab.[ch].
18105
18106 * src/muscle_tab.c, src/muscle_tab.h: Add files.
18107
181082001-09-02 Marc Autret <autret_m@epita.fr>
18109
18110 * src/macrotab.c, src/macrotab.h: Remove.
18111
181122001-09-01 Pascal Bart <pascal.bart@epita.fr>
18113
18114 * src/reader.c (copy_guard): Use muscle to specify the `#line'
18115 filename.
18116
181172001-09-01 Marc Autret <autret_m@epita.fr>
18118
18119 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
18120 to an explicit value to activate the feature. We do it here.
18121
181222001-08-31 Pascal Bart <pascal.bart@epita.fr>
18123
18124 * src/output.c (prepare): Delete the `filename' muscule insertion.
18125 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
18126 (parse_union_decl): Likewise.
18127 * src/macrotab.c (macro_init): Initialize filename by infile.
18128
181292001-08-31 Marc Autret <autret_m@epita.fr>
18130
18131 * src/bison.simple (YYLSP_NEEDED): New definition.
18132 * src/output.c (prepare): Add macro insertion of `locations_flag'
18133
181342001-08-31 Pascal Bart <pascal.bart@epita.fr>
18135
18136 * src/output.c (prepare): Delete insertion of previous muscles,
18137 and insert the `prefix' muscles.
18138 * src/macrotab.c (macro_init): Likewise.
18139 (macro_init): Initialization prefix directive by `yy'.
18140 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
18141 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
18142 yylval, yydebug, yyerror, yynerrs and yyparse.
18143 New directive `#define' to substitute yydebug, ... with option
18144 name_prefix.
18145
181462001-08-31 Pascal Bart <pascal.bart@epita.fr>
18147
18148 * src/main.c (main): Standardize.
18149 * src/output.c (output_table_data, output_parser): Likewise.
18150 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
18151
181522001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
18153
18154 * src/reader.c (read_additionnal_code): Rename %%user_code to
18155 %%epilogue.
18156 * src/output.c (output): Rename %%declarations to %%prologue.
18157 * src/bison.simple: Echo modifications.
18158
181592001-08-31 Marc Autret <autret_m@epita.fr>
18160
18161 * src/reader.c (readgram): CleanUp.
18162 (output_token_defines): Likewise.
18163 (packsymbols): Likewise.
18164 (reader): Likewise.
18165 * src/output.c (output): CPP-out useless code.
18166
181672001-08-31 Pascal Bart <pascal.bart@epita.fr>
18168
18169 * src/reader.c (reader): Delete obsolete call to function
18170 output_trailers and output_headers.
18171 * src/output.h: Remove obsolete functions prototypes of output_headers
18172 and output_trailers.
18173
181742001-08-30 Pascal Bart <pascal.bart@epita.fr>
18175
18176 * src/main.c: Include macrotab.h.
18177 * src/macrotab.h (macro_entry_s): Constify fields.
18178 Adjust functions prototypes.
18179 * src/macrotab.c (macro_insert): Constify key and value.
18180 (macro_find): Constify key.
18181 (macro_insert): Include 'xalloc.h'
18182 (macro_insert): Use XMALLOC.
18183 (macro_find): Constify return value.
18184 * src/output.c (output_table_data): Rename table to table_data.
18185 (output_parser): Constify macro_key, macro_value.
18186
181872001-08-30 Marc Autret <autret_m@epita.fr>
18188
18189 * src/reader.c (parse_skel_decl): New.
18190 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
18191 * src/lex.h (token_t): New token `tok_skel'.
18192 * src/lex.c (percent_table): Add skeleton option entry.
18193 Standardize.
18194
181952001-08-29 Marc Autret <autret_m@epita.fr>
18196
18197 * src/bison.simple: Add %%user_code directive at the end.
18198 * src/reader.c (read_additionnal_code): New.
18199 (reader): Use it.
18200 * src/output.c (output_program): Remove.
18201 (output): Update.
18202
182032001-08-28 Marc Autret <autret_m@epita.fr>
18204
18205 * src/output.c (output_actions): Clean up.
18206 (output_gram): CPP-out useless code.
18207 * src/reader.c (reader): Clean up, CPP-out useless code.
18208
182092001-08-28 Pascal Bart <pascal.bart@epita.fr>
18210
18211 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
18212 directive.
18213 * src/bison.simple: Add `%%definitions'.
18214
182152001-08-28 Marc Autret <autret_m@epita.fr>
18216
18217 * config/depcomp: New file.
18218
182192001-08-27 Paul Eggert <eggert@twinsun.com>
18220
18221 * src/bison.simple (yyparse): Don't take the address of an
18222 item before the start of an array, as that doesn't conform to
18223 the C Standard.
18224
182252001-08-27 Robert Anisko <robert.anisko@epita.fr>
18226
18227 * src/output.c (output): Remove the initialization of the macro
18228 obstack. It was done too late here.
18229
18230 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
18231 completely wrong.
18232 (reader): Initialize the macro obstack here, since we need it to grow
18233 '%define' directives.
18234
18235 * src/reader.h: Declare the macro obstack as extern.
18236
182372001-08-27 Robert Anisko <robert.anisko@epita.fr>
18238
18239 * src/output.c (output_parser): Fix. Store single '%' characters in
18240 the output obstack instead of throwing them away.
18241
182422001-08-27 Akim Demaille <akim@epita.fr>
18243
18244 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18245
182462001-08-25 Robert Anisko <robert.anisko@epita.fr>
18247
18248 * lib/Makefile.am: Adjust.
18249
182502001-08-25 Robert Anisko <robert.anisko@epita.fr>
18251
18252 * src/bison.simple: Update and add '%%' directives.
18253
182542001-08-25 Robert Anisko <robert.anisko@epita.fr>
18255
18256 * src/reader.c (reader): Remove calls to 'output_headers' and
18257 'output_trailers'. Remove some C output.
18258 (readgram): Disable a piece of code that was writing a default
18259 definition for 'YYSTYPE'.
18260 (reader_output_yylsp): Remove.
18261 (packsymbols): Output token defintions to a macro.
18262 (copy_definition): Disable C output.
18263
18264 * src/reader.c (parse_macro_decl): New function used to parse macro
18265 declarations.
18266 (copy_string2): Put the body of copy_string into this new function.
18267 Add a parameter to let the caller choose whether he wants to copy the
18268 string delimiters or not.
18269 (copy_string): Be a simple call to copy_string2 with the last argument
18270 bound to true.
18271 (read_declarations): Add case for macro definition.
18272 (copy_identifier): New.
18273 (parse_macro_decl): Read macro identifiers using copy_identifier
18274 rather than lex.
18275
182762001-08-25 Robert Anisko <robert.anisko@epita.fr>
18277
18278 * src/output.c (prepare): Add prefixed names.
18279 (output_parser): Output semantic actions.
18280 (output_parser): Fix bug on '%%line' directives.
18281
18282 * src/output.c (output_headers): Remove. The C code printed by this
18283 function should now be in the skeletons.
18284 (output_trailers): Remove.
18285 (output): Disable call to 'reader_output_yylsp'.
18286 (output_rule_data): Do not output tables to the table obstack.
18287
18288 * src/output.c: Remove some C dedicated output.
18289 Improve the use of macro and output obstacks.
18290 (output_defines): Remove.
18291
18292 * src/output.c (output_token_translations): Associate 'translate'
18293 table with a macro. No output to the table obstack.
18294 (output_gram): Same for 'rhs' and 'prhs'.
18295 (output_stos): Same for 'stos'.
18296 (output_rule_data): Same for 'r1' and 'r2'.
18297 (token_actions): Same for 'defact'.
18298 (goto_actions): Same for 'defgoto'.
18299 (output_base): Same for 'pact' and 'pgoto'.
18300 (output_table): Same for 'table'.
18301 (output_check): Same for 'check'.
18302
18303 * src/output.c (output_table_data): New function.
18304 (output_short_table): Remove.
18305 (output_short_or_char_table): Remove.
18306
18307 * src/output.c (output_parser): Replace most of the skeleton copy code
18308 with something new. Skeletons are now processed character by character
18309 rather than line by line, and Bison looks for '%%' macros. This is the
18310 first step in making Bison's output process (a lot) more flexible.
18311 (output_parser): Use the macro table.
18312
183132001-08-25 Robert Anisko <robert.anisko@epita.fr>
18314
18315 * src/main.c (main): Initialize the macro table.
18316
183172001-08-25 Robert Anisko <robert.anisko@epita.fr>
18318
18319 * src/lex.c (percent_table): Add tok_define.
18320 * src/lex.h: Add tok_define.
18321
183222001-08-25 Robert Anisko <robert.anisko@epita.fr>
18323
18324 * src/macrotab.c: New file.
18325 * src/macrotab.h: New file.
18326 * src/Makefile.am: Update.
18327
183282001-08-25 Robert Anisko <robert.anisko@epita.fr>
18329
18330 * lib/hash.c: New file.
18331 * lib/hash.h: New file.
18332 * lib/Makefile.am: Update.
18333
183342001-08-15 Akim Demaille <akim@epita.fr>
18335
18336 Version 1.28c.
18337
183382001-08-15 Marc Autret <autret_m@epita.fr>
18339
18340 * src/reader.c (readgram): Indent output macro YYSTYPE.
18341 (packsymbols): Likewise.
18342 (output_token_defines): Likewise.
18343 * src/files.c: Standardize.
18344 (compute_header_macro): New.
18345 (defines_obstack_save): New. Use compute_header_macro.
18346 (output_files): Update. Use defines_obstack_save.
18347
183482001-08-15 Akim Demaille <akim@epita.fr>
18349
18350 * doc/bison.texinfo (Table of Symbols): Document
18351 YYSTACK_USE_ALLOCA.
18352
183532001-08-15 Akim Demaille <akim@epita.fr>
18354
18355 * missing: Update from CVS Automake.
18356 * config/config.guess, config/config.sub, config/texinfo.tex:
18357 Update from gnu.org.
18358
183592001-08-15 Akim Demaille <akim@epita.fr>
18360
18361 * Makefile.maint: Sync with CVS Autoconf.
18362
183632001-08-14 Pascal Bart <pascal.bart@epita.fr>
18364
18365 * doc/bison.texinfo: Include GNU Free Documentation License from
18366 `fdl.texi'.
18367 * doc/fdl.texi: Add to package.
18368
183692001-08-14 Marc Autret <autret_m@epita.fr>
18370
18371 Turn on %{source,header}_extension features.
18372
18373 * src/lex.c (percent_table): Un-CPP out header_extension and
18374 source_extension.
18375 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
18376 (compute_exts_from_src): Remove conditions. It restores priorities
18377 between options.
18378
183792001-08-14 Marc Autret <autret_m@epita.fr>
18380
18381 * src/files.c (compute_base_names): Add extensions computing when
18382 `--file-prefix' used.
18383 Standardize function calls.
18384
183852001-08-13 Marc Autret <autret_m@epita.fr>
18386
18387 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
18388 defining it (defined but null disables alloca).
18389
183902001-08-13 Marc Autret <autret_m@epita.fr>
18391
18392 * src/bison.simple (_yy_memcpy): CPP reformat.
18393
183942001-08-13 Pascal Bart <pascal.bart@epita.fr>
18395
18396 * tests/atconfig.in (CPPFLAGS): Fix.
18397
183982001-08-10 Pascal Bart <pascal.bart@epita.fr>
18399
18400 * doc/bison.texinfo: Include GNU General Public License from
18401 `gpl.texi'.
18402 * doc/gpl.texi: Add to package.
18403
184042001-08-10 Marc Autret <autret_m@epita.fr>
18405
18406 * src/print_graph.h: Fix.
18407 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
18408
184092001-08-10 Akim Demaille <akim@epita.fr>
18410
18411 * src/system.h: Provide default declarations for stpcpy, strndup,
18412 and strnlen.
18413
184142001-08-10 Robert Anisko <anisko_r@epita.fr>
18415
18416 * doc/bison.texinfo (Locations): Update @$ stuff.
18417
184182001-08-09 Robert Anisko <anisko_r@epita.fr>
18419
18420 * src/bison.simple (YYLLOC_DEFAULT): Update.
18421 (yyparse): Adjust.
18422
184232001-08-08 Marc Autret <autret_m@epita.fr>
18424
18425 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
18426 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
18427 Reported by Fabrice Bauzac.
18428
184292001-08-08 Marc Autret <autret_m@epita.fr>
18430
18431 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
18432 * src/vcg.c (output_node): Fix.
18433 * src/vcg.h: Cleanup.
18434 * src/print_graph.c: Add comments.
18435 (node_output_size): New global variable. Simplify the formatting of
18436 the VCG graph output.
18437 (print_actions): Unused code is now used. It notifies the final state
18438 and no action states in the VCG graph. It also give the reduce actions.
18439 The `shift and goto' edges are red and the `go to state' edges are
18440 blue.
18441 Get the current node name and node_obstack by argument.
18442 (node_obstack): New variable.
18443 (print_state): Manage node_obstack.
18444 (print_core): Use node_obstack given by argument.
18445 A node is not only computed here but in print_actions also.
18446 (print_graph): CPP out useless code instead of commenting it.
18447
184482001-08-07 Pascal Bart <pascal.bart@epita.fr>
18449
18450 * tests/atconfig.in (CPPFLAGS): Fix.
18451
184522001-08-07 Akim Demaille <akim@epita.fr>
18453
18454 * src/print_graph.c (quote): New.
18455 (print_core): Use it.
18456
184572001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
18458
18459 * src/vcg.c (complain.h): Include it.
18460 Unepitaize `return' invocations.
18461 [NDEBUG] (main): Remove.
18462 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
18463 * src/files.c (open_files): Initialize graph_obstack.
18464 * src/print_graph.c (print_actions): CPP out useless code.
18465 (print_core): Don't output the last `\n' in labels.
18466 Use `quote'.
18467 * src/files.c (output_files): Output the VCG file.
18468 * src/main.c (main): Invoke print_graph ();
18469
184702001-08-06 Marc Autret <autret_m@epita.fr>
18471
18472 Automaton VCG graph output.
18473 Using option ``-g'' or long option ``--graph'', you can generate
18474 a gram_filename.vcg file containing a VCG description of the LALR (1)
18475 automaton of your grammar.
18476
18477 * src/main.c: Call to print_graph() function.
18478 * src/getargs.h: Update.
18479 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
18480 (graph_flag): New flag.
18481 (longopts): Update.
18482 (getargs): Add case `g'.
18483 * src/files.c (graph_obstack): New obstack struct.
18484 (open_files): Initialize new obstack.
18485 (output_files): Saves graph_obstack if required.
18486 * src/files.h (graph_obstack): New extern declaration.
18487 * src/Makefile.am: Add new source files.
18488
184892001-08-06 Marc Autret <autret_m@epita.fr>
18490
18491 * src/print_graph.c, src/print_graph.h (graph): New.
18492 * src/vcg.h: New file.
18493 * src/vcg.c: New file, VCG graph handling.
18494
184952001-08-06 Marc Autret <autret_m@epita.fr>
18496
18497 Add of %source_extension and %header_extension which specify
18498 the source or/and the header output file extension.
18499
18500 * src/files.c (compute_base_names): Remove initialisation of
18501 src_extension and header_extension.
18502 (compute_exts_from_gf): Update.
18503 (compute_exts_from_src): Update.
18504 (output_files): Update.
18505 * src/reader.c (parse_header_extension_decl): New.
18506 (parse_source_extension_decl): New.
18507 (read_declarations): New case statements for the new tokens.
18508 * src/lex.c (percent_table): Add entries for %source_extension
18509 and %header_extension.
18510 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
18511
185122001-08-06 Marc Autret <autret_m@epita.fr>
18513
18514 * configure.in: Bump to 1.28c.
18515 * doc/bison.texinfo: Texinfo thingies.
18516
185172001-08-04 Pascal Bart <pascal.bart@epita.fr>
18518
18519 * tests/atconfig.in (CPPFLAGS): Add.
18520 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
18521
185222001-08-03 Akim Demaille <akim@epita.fr>
18523
18524 Version 1.28b.
18525
185262001-08-03 Akim Demaille <akim@epita.fr>
18527
18528 * tests/Makefile.am (check-local): Ship testsuite.
18529 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
18530 Include `string.h'.
18531
185322001-08-03 Akim Demaille <akim@epita.fr>
18533
18534 * configure.in: Try using -Wformat when compiling.
18535
185362001-08-03 Akim Demaille <akim@epita.fr>
18537
18538 * configure.in: Bump to 1.28b.
18539
185402001-08-03 Akim Demaille <akim@epita.fr>
18541
18542 * src/complain.c: Adjust strerror_r portability issues.
18543
185442001-08-03 Akim Demaille <akim@epita.fr>
18545
18546 Version 1.28a.
18547
185482001-08-03 Akim Demaille <akim@epita.fr>
18549
18550 * src/getargs.c, src/getarg.h (skeleton)): Constify.
18551 * src/lex.c (literalchar): Avoid name clashes on `buf'.
18552 * src/getargs.c: Include complain.h.
18553 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
18554 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
18555
185562001-08-03 Akim Demaille <akim@epita.fr>
18557
18558 * src/reader.c (readgram): Display hidden chars in error messages.
18559
185602001-08-03 Akim Demaille <akim@epita.fr>
18561
18562 Update to gettext 0.10.39.
18563
185642001-08-03 Akim Demaille <akim@epita.fr>
18565
18566 * lib/strspn.c: New.
18567
185682001-08-01 Marc Autret <autret_m@epita.fr>
18569
18570 * doc/bison.texinfo: Update.
18571 * doc/bison.1 (mandoc): Update.
18572 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
18573 * src/files.c: Support output files extensions computing.
18574 (src_extension): New static variable.
18575 (header_extension): New static variable.
18576 (tr): New function.
18577 (get_extension_index): New function, gets the index of an extension
18578 filename in a string.
18579 (compute_exts_from_gf): New function, computes extensions from the
18580 grammar file extension.
18581 (compute_exts_from_src): New functions, computes extensions from the
18582 C source file extension, file given by ``-o'' option.
18583 (compute_base_names): Update.
18584 (output_files): Update.
18585
185862001-08-01 Robert Anisko <anisko_r@epita.fr>
18587
18588 * doc/bison.texi: Document @$.
18589 (Locations): New section.
18590
185912001-07-18 Akim Demaille <akim@epita.fr>
18592
18593 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
18594 * config/prev-version.txt, config/move-if-change: New.
18595 * Makefile.am: Adjust.
18596
185972001-07-08 Pascal Bart <pascal.bart@epita.fr>
18598
18599 * src/bison.simple (yyparse): Suppress warning `comparaison
18600 between signed and unsigned'.
18601
186022001-07-05 Pascal Bart <pascal.bart@epita.fr>
18603
18604 * src/getargs.h (raw_flag): Remove.
18605 * src/getargs.c: Die on `-r'/`--raw'.
18606 * src/lex.c (parse_percent_token): Die on `%raw'.
18607 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
18608 * tests/calc.at: Suppress test with option `--raw'.
18609
186102001-07-14 Akim Demaille <akim@epita.fr>
18611
18612 * config/: New.
18613 * configure.in: Require Autoconf 2.50.
18614 Update to gettext 0.10.38.
18615
186162001-03-16 Akim Demaille <akim@epita.fr>
18617
18618 * doc/bison.texinfo: ANSIfy the examples.
18619
186202001-03-16 Akim Demaille <akim@epita.fr>
18621
18622 * getargs.c (skeleton): New variable.
18623 (longopts): --skeleton is a new option.
18624 (shortopts, getargs): -S is a new option.
18625 * getargs.h: Declare skeleton.
18626 * output.c (output_parser): Use it.
18627
186282001-03-16 Akim Demaille <akim@epita.fr>
18629
18630 * m4/strerror_r.m4: New.
18631 * m4/error.m4: Run AC_FUNC_STRERROR_R.
18632 * lib/error.h, lib/error.c: Update.
18633
186342001-03-16 Akim Demaille <akim@epita.fr>
18635
18636 * src/getargs.c (longopts): Clean up.
18637
186382001-02-21 Akim Demaille <akim@epita.fr>
18639
18640 * src/reader.c (gensym): `gensym_count' is your own.
18641 Use a static buf to create the symbol name, as token_buffer is no
18642 longer a buffer.
18643
186442001-02-08 Akim Demaille <akim@epita.fr>
18645
18646 * src/conflicts.c (conflict_report): Be sure not to append to res
18647 between two calls, which could happen if both first sprintf were
18648 skipped, but not the first cp += strlen.
18649
186502001-02-08 Akim Demaille <akim@epita.fr>
18651
18652 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
18653 New, from fileutils 4.0.37.
18654 * configure.in: Require Autoconf 2.49c. I took some time before
18655 making this decision. This is the only way out for portability
18656 issues in Bison, it would mean way too much duplicate effort to
18657 import in Bison features implemented in 2.49c since 2.13.
18658 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
18659
186602001-02-02 Akim Demaille <akim@epita.fr>
18661
18662 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
18663 * lib/xalloc.h, lib/xmalloc.c: Update.
18664
186652001-01-19 Akim Demaille <akim@epita.fr>
18666
18667 Get rid of the ad hoc handling of token_buffer in the scanner: use
18668 the obstacks.
18669
18670 * src/lex.c (token_obstack): New.
18671 (init_lex): Initialize it. No longer call...
18672 (grow_token_buffer): this. Remove it.
18673 Adjust all the places which used it to use the obstack.
18674
186752001-01-19 Akim Demaille <akim@epita.fr>
18676
18677 * src/lex.h: Rename all the tokens:
18678 s/\bENDFILE\b/tok_eof/g;
18679 s/\bIDENTIFIER\b/tok_identifier/g;
18680 etc.
18681 Let them be enums, not #define, to ease debugging.
18682 Adjust all the code.
18683
186842001-01-18 Akim Demaille <akim@epita.fr>
18685
18686 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
18687 * src/lex.c (maxtoken, grow_token_buffer): Static.
18688
186892001-01-18 Akim Demaille <akim@epita.fr>
18690
18691 Since we now use obstacks, more % directives can be enabled.
18692
18693 * src/lex.c (percent_table): Also accept `%yacc',
18694 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
18695 `%debug'.
18696 Handle the actions for `%semantic_parser' and `%pure_parser' here,
18697 instead of returning a token.
18698 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
18699 * src/reader.c (read_declarations): Adjust.
18700 * src/files.c (open_files): Don't call `compute_base_names', don't
18701 compute `attrsfile' since they depend upon data which might be
18702 *in* the input file now.
18703 (output_files): Do it here.
18704 * src/output.c (output_headers): Document the fact that this patch
18705 introduces a guaranteed SEGV for semantic parsers.
18706 * doc/bison.texinfo: Document them.
18707 * tests/suite.at: Exercise these %options.
18708
187092000-12-20 Akim Demaille <akim@epita.fr>
18710
18711 Also handle the output file (--verbose) with obstacks.
18712
18713 * files.c (foutput): Remove.
18714 (output_obstack): New.
18715 Adjust all dependencies.
18716 * src/conflicts.c: Return a string.
18717 * src/system.h (obstack_grow_string): Rename as...
18718 (obstack_sgrow): this. Be ready to work with non literals.
18719 (obstack_fgrow4): New.
18720
187212000-12-20 Akim Demaille <akim@epita.fr>
18722
18723 * src/files.c (open_files): Fix the computation of short_base_name
18724 in the case of `-o foo.tab.c'.
18725
187262000-12-20 Akim Demaille <akim@epita.fr>
18727
18728 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
18729 (copy_dollar): Now that everything uses obstacks, get rid of the
18730 FILE * parameters.
18731
187322000-12-20 Akim Demaille <akim@epita.fr>
18733
18734 * src/files.c (open_files): Actually the `.output' file is based
18735 on the short_base_name, not base_name.
18736 * tests/suite.at (Checking output file names): Adjust.
18737
187382000-12-20 Akim Demaille <akim@epita.fr>
18739
18740 * src/bison.s1: Remove, we now use directly...
18741 * src/bison.simple: this.
18742 * src/Makefile.am: Use pkgdata instead of data.
18743
187442000-12-20 Akim Demaille <akim@epita.fr>
18745
18746 * src/files.c (guard_obstack): New.
18747 (open_files): Initialize it.
18748 (output_files): Dump it...
18749 * src/files.h: Export it.
18750 * src/reader.c (copy_guard): Use it.
18751
187522000-12-19 Akim Demaille <akim@epita.fr>
18753
18754 * src/files.c (outfile, defsfile, actfile): Removed as global
18755 vars.
18756 (open_files): Don't compute them.
18757 (output_files): Adjust.
18758 (base_name, short_base_name): Be global.
18759 Adjust dependencies.
18760
187612000-12-19 Akim Demaille <akim@epita.fr>
18762
18763 * src/files.c (strsuffix): New.
18764 (stringappend): Be just like strcat but allocate.
18765 (base_names): Eve out from open_files.
18766 Try to simplify the rather hairy computation of base_name and
18767 short_base_name.
18768 (open_files): Use it.
18769 * tests/suite.at (Checking output file names): New test.
18770
187712000-12-19 Akim Demaille <akim@epita.fr>
18772
18773 * src/system.h (obstack_grow_literal_string): Rename as...
18774 (obstack_grow_string): this.
18775 * src/output.c (output_parser): Recognize `%% actions' instead of
18776 `$'.
18777 * src/bison.s1: s/$/%% actions/.
18778 * src/bison.hairy: Likewise.
18779
187802000-12-19 Akim Demaille <akim@epita.fr>
18781
18782 * src/output.c (output_parser): Compute the `#line' lines when
18783 there are.
18784 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
18785 Suggested by Hans Aberg.
18786
187872000-12-19 Akim Demaille <akim@epita.fr>
18788
18789 Let the handling of the skeleton files be local to the procedures
18790 that use it.
18791
18792 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
18793 longer static.
18794 (fparser, open_extra_files): Remove.
18795 (open_files, output_files): Don't take care of fparser.
18796 * src/files.h: Adjust.
18797 * src/output.c (output_parser): Open and close the file to the
18798 skeleton.
18799 * src/reader.c (read_declarations): When %semantic_parser, open
18800 fguard.
18801
188022000-12-19 Akim Demaille <akim@epita.fr>
18803
18804 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
18805 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
18806
188072000-12-19 Akim Demaille <akim@epita.fr>
18808
18809 * src/files.c (open_files): Yipee! We no longer need all the code
18810 looking for `/tmp' since we have no tmp file.
18811
188122000-12-19 Akim Demaille <akim@epita.fr>
18813
18814 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
18815 New macros.
18816 * src/files.c (open_files): Less dependency on MSDOS etc.
18817
188182000-12-14 Akim Demaille <akim@epita.fr>
18819
18820 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
18821 Provide a default definition.
18822 Use it when executing the default @ action.
18823 * src/reader.c (reader_output_yylsp): No longer include
18824 `timestamp' and `text' in the default YYLTYPE.
18825
188262000-12-12 Akim Demaille <akim@epita.fr>
18827
18828 * src/reader.c (copy_definition, parse_union_decl, copy_action)
18829 (copy_guard): Quote the file names.
18830 Reported by Laurent Mascherpa.
18831
188322000-12-12 Akim Demaille <akim@epita.fr>
18833
18834 * src/output.c (output_headers, output_program, output): Be sure
18835 to escape special characters when outputting filenames.
18836 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
18837 (output_headers): Don't depend on them, Use ACTSTR.
18838
188392000-11-17 Akim Demaille <akim@epita.fr>
18840
18841 * lib/obstack.h: Formatting changes.
18842 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
18843 prevents type checking.
18844 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
18845 cast the value to (void *): assigning a `foo *' to a `void *'
18846 variable is valid.
18847 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
18848 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
18849 append characters.
18850
188512000-11-17 Akim Demaille <akim@epita.fr>
18852
18853 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
18854 as...
18855 (suite.m4, regression.m4, calc.m4): these.
18856 * tests/atgeneral.m4: Update from CVS Autoconf.
18857
188582000-11-17 Akim Demaille <akim@epita.fr>
18859
18860 * tests/regression.m4 (%union and --defines): New test,
18861 demonstrating a current bug in the obstack implementation.
18862
188632000-11-17 Akim Demaille <akim@epita.fr>
18864
18865 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18866 macros.
18867 Use them to declare the variables which are global or local to
18868 `yyparse'.
18869
188702000-11-17 Akim Demaille <akim@epita.fr>
18871
18872 * acconfig.h: Remove, no longer used.
18873
188742000-11-07 Akim Demaille <akim@epita.fr>
18875
18876 * src: s/Copyright (C)/Copyright/g.
18877
188782000-11-07 Akim Demaille <akim@epita.fr>
18879
18880 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18881 defining.
18882 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18883
188842000-11-07 Akim Demaille <akim@epita.fr>
18885
18886 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18887 Merge in a single CPP if/else.
18888
188892000-11-07 Akim Demaille <akim@epita.fr>
18890
18891 * src/output.c (output): Remove useless variables.
18892 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18893 argument `data' for consistency with the prototypes.
18894 Qualify it `const'.
18895 (obstack_copy, obstack_copy0): Rename the second argument as
18896 `address' for consistency. Qualify it `const'.
18897 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18898 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18899 `const' their input argument (`data' or `address').
18900 Adjust the corresponding macros to include `const' in casts.
18901
189022000-11-03 Akim Demaille <akim@epita.fr>
18903
18904 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18905 s/PFILE1/BISON_HAIRY/.
18906 Adjust dependencies.
18907
189082000-11-03 Akim Demaille <akim@epita.fr>
18909
18910 For some reason, this was not applied.
18911
18912 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18913 `unlink': it's no longer used.
18914
189152000-11-03 Akim Demaille <akim@epita.fr>
18916
18917 * src/files.c (skeleton_find): New function, eved out of...
18918 (open_files, open_extra_files): here.
18919
189202000-11-03 Akim Demaille <akim@epita.fr>
18921
18922 Don't use `atexit'.
18923
18924 * src/files.c (obstack_save): New function.
18925 (done): Rename as...
18926 (output_files): this.
18927 Use `obstack_save'.
18928 * src/main.c (main): Don't use `atexit' to register `done', since
18929 it no longer has to remove tmp files, just call `output_files'
18930 when there are no errors.
18931
189322000-11-02 Akim Demaille <akim@epita.fr>
18933
18934 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18935 `unlink': it's no longer used.
18936 * src/files.h: Formatting changes.
18937
189382000-11-02 Akim Demaille <akim@epita.fr>
18939
18940 Remove the last uses of mktemp and unlink/delete.
18941
18942 * src/files.c (fdefines, ftable): Removed.
18943 (defines_ostack, table_obstack): New.
18944 Adjust dependencies of the former into uses of the latter.
18945 * src/output.c (output_short_or_char_table, output_short_table):
18946 Convert to using obstacks.
18947 * src/reader.c (copy_comment2): Accept one FILE * and two
18948 obstacks.
18949 (output_token_defines, reader_output_yylsp): Use obstacks.
18950 * src/system.h (obstack_fgrow3): New.
18951 * po/POTFILES.in: Adjust.
18952
189532000-11-01 Akim Demaille <akim@epita.fr>
18954
18955 Change each use of `fattrs' into a use of `attrs_obstack'.
18956
18957 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18958 * src/files.c (fattrs): Remove.
18959 (attrs_obstack): New.
18960 Adjust all dependencies.
18961 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18962
189632000-11-01 Akim Demaille <akim@epita.fr>
18964
18965 Introduce obstacks.
18966 Change each use of `faction' into a use of `action_obstack'.
18967
18968 * lib/obstack.h, lib/obstack.c: New files.
18969 * src/files.c (faction): Remove.
18970 (action_obstack): New.
18971 Adjust all dependencies.
18972
189732000-10-20 Akim Demaille <akim@epita.fr>
18974
18975 * lib/quote.h (PARAMS): New macro. Use it.
18976
189772000-10-16 Akim Demaille <akim@epita.fr>
18978
18979 * src/output.c (output_short_or_char_table): New function.
18980 (output_short_table, output_token_translations): Use it.
18981 (goto_actions): Use output_short_table.
18982
189832000-10-16 Akim Demaille <akim@epita.fr>
18984
18985 * src/symtab.c (bucket_new): New function.
18986 (getsym): Use it.
18987
18988 * src/output.c (output_short_table): New argument to display the
18989 comment associated with the table.
18990 Adjust dependencies.
18991 (output_gram): Use it.
18992 (output_rule_data): Nicer output layout for YYTNAME.
18993
189942000-10-16 Akim Demaille <akim@epita.fr>
18995
18996 * src/lex.c (read_typename): New function.
18997 (lex): Use it.
18998 * src/reader.c (copy_dollar): Likewise.
18999
190002000-10-16 Akim Demaille <akim@epita.fr>
19001
19002 * src/reader.c (copy_comment2): Expect the input stream to be on
19003 the `/' which is suspected to open a comment, instead of being
19004 called after `//' or `/*' was read.
19005 (copy_comment, copy_definition, parse_union_decl, copy_action)
19006 (copy_guard): Adjust.
19007
190082000-10-16 Akim Demaille <akim@epita.fr>
19009
19010 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
19011 `read_signed_integer'.
19012
190132000-10-16 Akim Demaille <akim@epita.fr>
19014
19015 * src/reader.c (copy_dollar): New function.
19016 (copy_guard, copy_action): Use it.
19017
190182000-10-16 Akim Demaille <akim@epita.fr>
19019
19020 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
19021 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
19022 New files, from Fileutils 4.0.27.
19023 * src/main.c (printable_version): Remove.
19024 * src/lex.c, src/reader.c: Use `quote'.
19025
190262000-10-04 Akim Demaille <akim@epita.fr>
19027
19028 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
19029
190302000-10-04 Akim Demaille <akim@epita.fr>
19031
19032 * doc/bison.texinfo: Various typos spotted by Neil Booth.
19033
190342000-10-04 Akim Demaille <akim@epita.fr>
19035
19036 When a literal string is used to define two different tokens,
19037 `bison -v' segfaults.
19038 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
19039
19040 * tests/regression.m4: New file.
19041 Include the core of the sample provided by Piotr Gackiewicz.
19042 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
19043 properly.
19044
190452000-10-04 Akim Demaille <akim@epita.fr>
19046
19047 * src/reader.c (parse_expect_decl): Keep `count' within the size
19048 of `buffer'.
19049 From Neil Booth.
19050
190512000-10-02 Paul Eggert <eggert@twinsun.com>
19052
19053 * bison.s1 (yyparse): Assign the default value
19054 unconditionally, to avoid a GCC warning and make the parser a
19055 tad smaller.
19056
190572000-10-02 Akim Demaille <akim@epita.fr>
19058
19059 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
19060 options.
19061
190622000-10-02 Akim Demaille <akim@epita.fr>
19063
19064 * src/derives.c, src/print.c, src/reduce.c: To ease the
19065 translation, move some `\n' out of the translated strings.
19066
190672000-10-02 Akim Demaille <akim@epita.fr>
19068
19069 The location tracking mechanism is precious for parse error
19070 messages. Nevertheless, it is enabled only when `@n' is used in
19071 the grammar, which is a different issue (you can use it in error
19072 message, but not in the grammar per se). Therefore, there should
19073 be another means to enable it.
19074
19075 * src/getargs.c (getargs): Support `--locations'.
19076 (usage): Report it.
19077 * src/getargs.h (locationsflag): Export it.
19078 * src/lex.c (percent_table): Support `%locations'.
19079 * src/reader.c (yylsp_needed): Remove this variable, now replaced
19080 with `locationsflag'.
19081 * doc/bison.texinfo: Document `--locations' and `%locations'.
19082 Sort the options.
19083 * tests/calc.m4: Test it.
19084
19085 For regularity of the names, replace each
19086 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
19087 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
19088 In addition replace each `flag' with `_flag'.
19089
190902000-10-02 Akim Demaille <akim@epita.fr>
19091
19092 Also test parse error messages, including with YYERROR_VERBOSE.
19093
19094 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
19095 associative).
19096 Use it to check the computations.
19097 Use it to check `nonassoc' is honored.
19098 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
19099 `--yyerror-verbose'.
19100 (_AT_CHECK_CALC): Adjust to this option.
19101 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
19102
191032000-10-02 Akim Demaille <akim@epita.fr>
19104
19105 Test also `--verbose', `--defines' and `--name-prefix'. Testing
19106 the latter demonstrates a flaw in the handling of non debugging
19107 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
19108 was used in order to simplify:
19109
19110 #if YYDEBUG
19111 if (yydebug)
19112 {
19113 ...
19114 }
19115 #endif
19116
19117 into
19118
19119 if (yydebug)
19120 {
19121 ...
19122 }
19123
19124 unfortunately this leads to a CPP conflict when
19125 `--name-prefix=foo' is used since it produces `#define yydebug
19126 foodebug'.
19127
19128 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
19129 (YYDPRINTF): New macro.
19130 Spread its use.
19131 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
19132 the bison options.
19133 Also test `--verbose', `--defines' and `--name-prefix'.
19134
191352000-10-02 Akim Demaille <akim@epita.fr>
19136
19137 Improve the readability of the produced parsers.
19138
19139 * src/bison.s1: Formatting changes.
19140 Improve the comment related to the `$' mark.
19141 (yydefault): Don't fall through to `yyresume': `goto' there.
19142 * src/output.c (output_parser): When the `$' is met, skip the end
19143 of its line.
19144 New variable, `number_of_dollar_signs', to check there's exactly
19145 one `$' in the parser skeleton.
19146
191472000-10-02 Akim Demaille <akim@epita.fr>
19148
19149 * lib/xstrdup.c: New file, from the fileutils.
19150 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
19151 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
19152 instead of strlen + xmalloc + strcpy.
19153 * src/symtab.c (copys): Remove, use xstrdup instead.
19154
191552000-10-02 Akim Demaille <akim@epita.fr>
19156
19157 * src/gram.h (associativity): New enum type which replaces the
19158 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
19159 `right_assoc', `left_assoc' and `non_assoc'.
19160 Adjust all dependencies.
19161 * src/reader.c: Formatting changes.
19162 (LTYPESTR): Don't define it, use it as a literal in
19163 `reader_output_yylsp'.
19164 * src/symtab.h (symbol_class): New enum type which replaces the
19165 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
19166 `sunknown', `stoken and `snterm'.
19167
191682000-10-02 Akim Demaille <akim@epita.fr>
19169
19170 * src/getargs.c (fixed_outfiles): Rename as...
19171 (yaccflag): for consistency and accuracy.
19172 Adjust dependencies.
19173
191742000-10-02 Akim Demaille <akim@epita.fr>
19175
19176 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
19177 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
19178 difficult and introduced a lot of core dump. It turns out that
19179 Bison used an implementation of `xmalloc' based on `calloc', and
19180 at various places it does depend upon the initialization to 0. I
19181 have not tried to isolate the pertinent places, and all the former
19182 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
19183 someone should address this issue.
19184
19185 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
19186 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
19187 files.
19188 Adjust dependencies.
19189 * src/warshall.h: New file.
19190 Propagate.
19191
191922000-10-02 Akim Demaille <akim@epita.fr>
19193
19194 Various anti-`extern in *.c' changes.
19195
19196 * src/system.h: Include `assert.h'.
19197
191982000-10-02 Akim Demaille <akim@epita.fr>
19199
19200 * src/state.h (nstates, final_state, first_state, first_shift)
19201 (first_reduction): Move their exportation from here...
19202 * src/LR0.h: to here.
19203 Adjust dependencies.
19204 * src/getargs.c (statisticsflag): New variable.
19205 Add support for `--statistics'.
19206 Adjust dependencies.
19207
19208 Remove a lot of now useless `extern' statements in most files.
19209
192102000-10-02 Akim Demaille <akim@epita.fr>
19211
19212 * src/LR0.h: New file.
19213 Propagate its use.
19214
192152000-10-02 Akim Demaille <akim@epita.fr>
19216
19217 * src/print.h: New file.
19218 Propagate its use.
19219 * src/print.c: Formatting and ordering changes.
19220 (verbose, terse): Replace with...
19221 (print_results): this new function.
19222 Adjust dependencies.
19223
192242000-10-02 Akim Demaille <akim@epita.fr>
19225
19226 * src/conflicts.c (conflict_report): New function.
19227 (conflict_log, verbose_conflict_log): Replace with...
19228 (print_conflicts): this function.
19229 Adjust dependencies.
19230 * src/conflicts.h: New file.
19231 Propagate its inclusion.
19232
192332000-10-02 Akim Demaille <akim@epita.fr>
19234
19235 * src/nullable.h: New file.
19236 Propagate its inclusion.
19237 * src/nullable.c: Formatting changes.
19238
192392000-10-02 Akim Demaille <akim@epita.fr>
19240
19241 * src/reduce.h: New file.
19242 Propagate its inclusion.
19243 * src/reduce.c: Topological sort and other formatting changes.
19244 (bool, TRUE, FALSE): Move their definition to...
19245 * src/system.h: here.
19246
192472000-10-02 Akim Demaille <akim@epita.fr>
19248
19249 * src/files.c: Formatting changes.
19250 (tryopen, tryclose, openfiles): Rename as...
19251 (xfopen, xfclose, open_files): this.
19252 (stringappend): static.
19253 * src/files.h: Complete the list of exported symbols.
19254 Propagate its use.
19255
192562000-10-02 Akim Demaille <akim@epita.fr>
19257
19258 * src/reader.h: New file.
19259 Propagate its use instead of tedious list of `extern' and
19260 prototypes.
19261 * src/reader.c: Formatting changes, topological sort,
19262 s/register//.
19263
192642000-10-02 Akim Demaille <akim@epita.fr>
19265
19266 * src/lex.h: Prototype `lex.c' exported functions.
19267 * src/reader.c: Adjust.
19268 * src/lex.c: Formatting changes.
19269 (safegetc): Rename as...
19270 (xgetc): this.
19271
192722000-10-02 Akim Demaille <akim@epita.fr>
19273
19274 * src/lalr.h: New file.
19275 Propagate its inclusion instead of prototypes and `extern'.
19276 * src/lalr.c: Formatting changes, topological sorting etc.
19277
192782000-10-02 Akim Demaille <akim@epita.fr>
19279
19280 * src/output.c (token_actions): Introduce a temporary array,
19281 YYDEFACT, that makes it possible for this function to use
19282 output_short_table.
19283
192842000-10-02 Akim Demaille <akim@epita.fr>
19285
19286 `user_toknums' is output as a `short[]' in `output.c', while it is
19287 defined as a `int[]' in `reader.c'. For consistency with the
19288 other output tables, `user_toknums' is now defined as a table of
19289 shorts.
19290
19291 * src/reader.c (user_toknums): Be a short table instead of an int
19292 table.
19293 Adjust dependencies.
19294
19295 Factor the short table outputs.
19296
19297 * src/output.c (output_short_table): New function.
19298 * src/output.c (output_gram, output_stos, output_rule_data)
19299 (output_base, output_table, output_check): Use it.
19300
193012000-10-02 Akim Demaille <akim@epita.fr>
19302
19303 * src/output.c (output): Topological sort of the functions, in
19304 order to get rid of the `static' prototypes.
19305 No longer use `register'.
19306 * src/output.h: New file.
19307 Propagate its inclusion in files explicitly prototyping functions
19308 from output.c.
19309
193102000-09-21 Akim Demaille <akim@epita.fr>
19311
19312 * src/atgeneral.m4: Update from Autoconf.
19313
193142000-09-21 Akim Demaille <akim@epita.fr>
19315
19316 * src/closure.h: New file.
19317 * src/closure.c: Formatting changes, topological sort over the
19318 functions, use of closure.h.
19319 (initialize_closure, finalize_closure): Rename as...
19320 (new_closure, free_closure): these. Adjust dependencies.
19321 * src/LR0.c: Formatting changes, topological sort, use of
19322 cloture.h.
19323 (initialize_states): Rename as...
19324 (new_states): this.
19325 * src/Makefile.am (noinst_HEADERS): Adjust.
19326
193272000-09-20 Akim Demaille <akim@epita.fr>
19328
19329 * src/acconfig.h: Don't protect config.h against multiple
19330 inclusion.
19331 Don't define PARAMS.
19332 * src/system.h: Define PARAMS.
19333 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
19334 purpose of config.h. system.h must not try to fix wrong
19335 definitions in config.h.
19336
193372000-09-20 Akim Demaille <akim@epita.fr>
19338
19339 * src/derives.h: New file.
19340 * src/main.c, src/derives.h: Use it.
19341 Formatting changes.
19342 * src/Makefile.am (noinst_HEADERS): Adjust.
19343
193442000-09-20 Akim Demaille <akim@epita.fr>
19345
19346 * tests/atgeneral.m4: Update from Autoconf.
19347 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
19348 (AT_CHECK_CALC): New macros.
19349 Use these macros to test bison with options `', `--raw',
19350 `--debug', `--yacc', `--yacc --debug'.
19351
193522000-09-19 Akim Demaille <akim@epita.fr>
19353
19354 * src/output.c: Formatting changes.
19355 * src/machine.h: Remove, leaving its contents in...
19356 * src/system.h: here.
19357 Include stdio.h.
19358 Adjust all dependencies on stdio.h and machine.h.
19359 * src/getargs.h: New file.
19360 Let all `extern' declarations about getargs.c be replaced with
19361 inclusion of `getargs.h'.
19362 * src/Makefile.am (noinst_HEADERS): Adjust.
19363
19364 * tests/calc.m4 (yyin): Be initialized in main, not on the global
19365 scope.
19366 (yyerror): Returns void, not int.
19367 * doc/bison.texinfo: Formatting changes.
19368
193692000-09-19 Akim Demaille <akim@epita.fr>
19370
19371 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
19372 portable.
19373
193742000-09-18 Akim Demaille <akim@epita.fr>
19375
19376 * configure.in: Append WARNING_CFLAGS to CFLAGS.
19377 * src/Makefile.am (INCLUDES): Don't.
19378 Be ready to fetch headers in lib/.
19379
193802000-09-18 Akim Demaille <akim@epita.fr>
19381
19382 * doc/bison.texinfo: Update the copyright.
19383 ANSIfy and GNUify the examples.
19384 Remove the old menu.
19385
193862000-09-18 Akim Demaille <akim@epita.fr>
19387
19388 First set of tests: use the `calc' example from the documentation.
19389
19390 * src/bison.s1 (yyparse): Condition the code using `yytname' which
19391 is defined only when YYDEBUG is.
19392 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
19393 * src/files.c (tryopen, tryclose): Formatting changes.
19394 Move to the top and be static.
19395 * src/reader.c (read_signed_integer): Likewise.
19396 * tests/calc.m4: New file.
19397 * Makefile.am, suite.m4: Adjust.
19398 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
19399
194002000-09-18 Akim Demaille <akim@epita.fr>
19401
19402 Add support for an Autotest test suite for Bison.
19403
19404 * m4/m4.m4, m4/atconfig.m4: New files.
19405 * m4/Makefile.am (EXTRA_DIST): Adjust.
19406 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
19407 files.
19408 * src/getargs.c: Display a more standard --version message.
19409 * src/reader.c (reader): Formatting changes.
19410 No longer depend upon VERSION_STRING.
19411 * configure.in: No longer use `dnl'.
19412 Set up the test suite and the new directory `tests/.
19413 (VERSION_STRING): Remove.
19414
194152000-04-14 Akim Demaille <akim@epita.fr>
19416
19417 * src/reader.c (copy_comment2): New function, same as former
19418 `copy_comment', but outputs into two FILE *.
19419 (copy_comment): Use it.
19420 (parse_union_decl): Use it.
19421 (get_type, parse_start_decl): Use the same `invalid' message.
19422 (parse_start_decl, parse_union_decl): Use the same `multiple'
19423 message.
19424 (parse_union_decl, copy_guard, copy_action): Use the same
19425 `unmatched' message.
19426 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
19427
194282000-03-31 Akim Demaille <akim@epita.fr>
19429
19430 * src/files.c (tryopen, tryclose): Move to the top.
19431 Be static.
19432
194332000-03-31 Akim Demaille <akim@epita.fr>
19434
19435 * src/main.c (main): Don't call `done', exit does it.
19436
194372000-03-31 Akim Demaille <akim@epita.fr>
19438
19439 * allocate.c: s/return (foo)/return foo/.
19440 * lalr.c: Likewise.
19441 * LR0.c: Likewise.
19442 * output.c: Likewise.
19443 * reader.c: Likewise.
19444 * symtab.c: Likewise.
19445 * vmsgetargs.c: Likewise.
19446
194472000-03-31 Akim Demaille <akim@epita.fr>
19448
19449 Clean up the error reporting functions.
19450
19451 * src/report.c: New file.
19452 * src/report.h: Likewise.
19453 * src/Makefile.am: Adjust.
19454 * m4/error.m4: New file.
19455 * m4/Makefile.am: Adjust.
19456 * configure.in (jm_PREREQ_ERROR): Call it.
19457 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
19458 Remove.
19459 (fatal, fatals): Remove. All callers use complain.c::fatal.
19460 (warn, warni, warns, warnss, warnss): Remove. All callers use
19461 complain.c::complain.
19462 (toomany): Remove, use fatal instead.
19463 * src/files.c (done): No argument, use complain_message_count.
19464 * src/main.c (main): Register `done' to `atexit'.
19465
19466 * src/getargs.c (usage): More `fputs', less `fprintf'.
19467
194682000-03-28 Akim Demaille <akim@epita.fr>
19469
19470 * lib/: New directory.
19471 * Makefile.am (SUBDIRS): Adjust.
19472 * configure.in: Adjust.
19473 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
19474 useless.
19475 * src/alloca.c: Moved to lib/.
19476 * src/getopt.c: Likewise.
19477 * src/getopt1.c: Likewise.
19478 * src/getopt.h: Likewise.
19479 * src/ansi2knr.c: Likewise.
19480 * src/ansi2knr.1: Likewise.
19481 * src/Makefile.am: Adjust.
19482 * lib/Makefile.am: New file.
19483
194842000-03-28 Akim Demaille <akim@epita.fr>
19485
19486 * src/getargs.c (usage): Refresh the help message.
19487
194882000-03-17 Akim Demaille <akim@epita.fr>
19489
19490 * src/getopt1.c: Updated from textutils 2.0e
19491 * src/getopt.c: Likewise.
19492 * src/getopt.h: Likewise.
19493
194942000-03-17 Akim Demaille <akim@epita.fr>
19495
19496 * src/Makefile.am (bison.simple): Fix the awk program: quote only
19497 the file name, not the whole `#line LINE FILE'.
19498
194992000-03-17 Akim Demaille <akim@epita.fr>
19500
19501 On syntax errors, report the token on which we choked.
19502
19503 * src/bison.s1 (yyparse): In the label yyerrlab, when
19504 YYERROR_VERBOSE, add yychar in msg.
19505
195062000-03-17 Akim Demaille <akim@epita.fr>
19507
19508 * src/reader.c (copy_at): New function.
19509 (copy_guard): Use it.
19510 (copy_action): Use it.
19511
195122000-03-17 Akim Demaille <akim@epita.fr>
19513
19514 Be kind to translators, save some useless translations.
19515
19516 * src/main.c (banner): New function.
19517 (fatal_banner): Use it.
19518 (warn_banner): Use it.
19519
195202000-03-17 Akim Demaille <akim@epita.fr>
19521
19522 * src/reader.c (copy_definition): Use copy_string and
19523 copy_comment. Removed now unused `match', `ended',
19524 `cplus_comment'.
19525 (copy_comment, copy_string): Moved, to be visible from
19526 copy_definition.
19527
195282000-03-17 Akim Demaille <akim@epita.fr>
19529
19530 * src/reader.c (copy_string): Declare `static inline'. No
19531 problems with inline, since it is checked by configure.
19532 (copy_comment): Likewise.
19533
195342000-03-17 Akim Demaille <akim@epita.fr>
19535
19536 * src/reader.c (packsymbols): Formatting changes.
19537
195382000-03-17 Akim Demaille <akim@epita.fr>
19539
19540 * src/reader.c (copy_comment): New function, factored out from:
19541 (copy_action): Use it. Removed now unused `match', `ended',
19542 `cplus_comment'.
19543 (copy_guard): Likewise.
19544
195452000-03-17 Akim Demaille <akim@epita.fr>
19546
19547 * src/reader.c (copy_string): New function, factored out from:
19548 (copy_action): Use it.
19549 (copy_guard): Likewise.
19550
195512000-03-17 Akim Demaille <akim@epita.fr>
19552
19553 Change the handling of @s so that they behave exactly like $s.
19554 There is now a pseudo variable @$ (readble and writable), location
19555 of the lhs of the rule (by default ranging from the location of
19556 the first symbol of the rhs, to the location of the last symbol,
19557 or, if the rhs is empty, YYLLOC).
19558
19559 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
19560 yyval.
19561 (yyparse): When providing a default semantic action, provide a
19562 default location action.
19563 (after the $): No longer change `*YYLSP', just stack YYLOC the
19564 same way you stack YYVAL.
19565 * src/reader.c (read_declarations): Use warns.
19566 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
19567 (copy_action, case '@'): Likewise.
19568 Use a standard error message, to save useless work from
19569 translators.
19570
195712000-03-17 Akim Demaille <akim@epita.fr>
19572
19573 * src/bison.s1: Formatting and cosmetics changes.
19574 * src/reader.c: Likewise.
19575 Update the Copyright notice.
19576
195772000-03-17 Akim Demaille <akim@epita.fr>
19578
19579 * src/bison.s1 (#line): All set to `#line' only, since the
19580 Makefile now handles them.
19581
195822000-03-16 Akim Demaille <akim@epita.fr>
19583
19584 * src/output.c (output_rule_data): Output the documentation of
19585 some of the tables.
19586 (Copyright notice): Update.
19587 Formatting changes.
19588
195892000-03-16 Akim Demaille <akim@epita.fr>
19590
19591 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
19592 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
19593 One `#if YYDEBUG' remains, since it uses variables which are
19594 defined only if `YYDEBUG != 0'.
19595
195962000-03-16 Akim Demaille <akim@epita.fr>
19597
19598 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
19599 and related variables so that the similarities are highlighted.
19600
196012000-03-16 Akim Demaille <akim@epita.fr>
19602
19603 * src/bison.s1: Properly indent CPP directives.
19604
196052000-03-16 Akim Demaille <akim@epita.fr>
19606
19607 * src/bison.s1: Properly indent the `alloca' CPP section.
19608
196092000-03-16 Akim Demaille <akim@epita.fr>
19610
19611 Do not hard code values of directories in `configure.in'.
19612 Update the `configure' tool chain.
19613
19614 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
19615 src/makefile.am.
19616 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
19617 (AC_OUTPUT): Add m4/Makefile.
19618 Bump to bison 1.28a, 1.29 has never been released.
19619 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
19620 handled via src/Makefile.am.
19621 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
19622 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
19623 autoheader.
19624 * Makefile.am (SUBDIRS): Add m4.
19625 (ACLOCAL_AM_FLAGS): New variable.
19626 (AUTOMAKE_OPTIONS): Add check-news.
19627 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
19628 the proper line number and file name.
19629 (DEFS): Propagate the location of bison library files and of the
19630 locale files.
19631 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
19632 builddir.
19633 * acinclude.m4: Remove, replaced by the directory m4.
19634 * m4/Makefile.am (EXTRA_DIST): New variable.
19635 * m4/gettext.m4: New file, from the fileutils.
19636 * m4/lcmessage.m4: Likewise
19637 * m4/progtest.m4: Likewise.
19638 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
19639
196402000-03-10 Akim Demaille <akim@epita.fr>
19641
19642 * src/closure.c:
19643 Formatting changes of various comments.
19644 Respect the GNU coding standards at various places.
19645 Don't use `_()' when no translation is needed.
19646
196471999-12-13 Jesse Thilo <jthilo@gnu.org>
19648
19649 * src/files.c:
19650 OS/2 honors TMPDIR environment variable.
19651
196521999-12-13 Jesse Thilo <jthilo@gnu.org>
19653
19654 * doc/bison.texinfo: Tweaked spelling and grammar.
19655 Updated ISBN.
19656 Removed reference to price of printed copy.
19657 Mention BISON_SIMPLE and BISON_HAIRY.
19658
196591999-12-13 Jesse Thilo <jthilo@gnu.org>
19660
19661 * configure.in, NEWS:
19662 Bison 1.29 released.
19663
196641999-10-27 Jesse Thilo <jthilo@gnu.org>
19665
19666 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
19667 Added reference card.
19668
196691999-07-26 Jesse Thilo <jthilo@gnu.org>
19670
19671 * po/ru.po: Added Russian translation.
19672
196731999-07-26 Jesse Thilo <jthilo@gnu.org>
19674
19675 * configure.in: Added Russian translation.
19676
196771999-07-06 Jesse Thilo <jthilo@gnu.org>
19678
19679 * configure.in, NEWS, README:
19680 Released version 1.28.
19681
196821999-06-14 Jesse Thilo <jthilo@gnu.org>
19683
19684 * src/system.h:
19685 Squashed redefinition warning on some systems.
19686
19687 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
19688 Have configure build version string instead of relying on ANSI string
19689 concatentation.
19690
196911999-06-14 Jesse Thilo <jthilo@gnu.org>
19692
19693 * po/POTFILES.in: Got rid of version.c.
19694
196951999-06-14 Jesse Thilo <jthilo@gnu.org>
19696
19697 * acconfig.h, configure.in:
19698 Have configure build version string instead of relying on ANSI string
19699 concatentation.
19700
197011999-06-08 Jesse Thilo <jthilo@gnu.org>
19702
19703 * doc/bison.1:
19704 Dropped mention of `+' for long-named options.
19705
197061999-05-30 Jesse Thilo <jthilo@gnu.org>
19707
19708 * src/files.c: Added <unistd.h> for unlink().
19709
19710 * src/Makefile.am, src/system.h:
19711 I18n fixes.
19712
197131999-05-30 Jesse Thilo <jthilo@gnu.org>
19714
19715 * README: Added a FAQ list.
19716
19717 * configure.in, acconfig.h:
19718 I18n fixes.
19719
197201999-05-30 Jesse Thilo <jthilo@gnu.org>
19721
19722 * doc/FAQ, doc/Makefile.am:
19723 Added a FAQ list.
19724
197251999-05-19 Jesse Thilo <jthilo@gnu.org>
19726
19727 * src/alloc.h, src/symtab.h, src/version.c:
19728 Protected inclusion of "config.h" with HAVE_CONFIG_H.
19729
197301999-04-18 Jesse Thilo <jthilo@gnu.org>
19731
19732 * src/.cvsignore, src/Makefile.am:
19733 Reorganized: sources in `src', documentation in `doc'.
19734
19735 * src/lex.c (literalchar):
19736 fixed the code for escaping double quotes (thanks
19737 Jonathan Czisny.)
19738
197391999-04-18 Jesse Thilo <jthilo@gnu.org>
19740
19741 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
19742 Adjusted paths to reflect directory reorganization.
19743
197441999-04-18 Jesse Thilo <jthilo@gnu.org>
19745
19746 * doc/.cvsignore, doc/Makefile.am:
19747 Reorganized: sources in `src', documentation in `doc'.
19748
197491999-04-18 Jesse Thilo <jthilo@gnu.org>
19750
19751 * configure.in:
19752 Updated AC_INIT file to reflect directory reorganization.
19753
19754 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
19755 Reorganized: sources in `src', documentation in `doc'.
19756
197571999-04-13 Jesse Thilo <jthilo@gnu.org>
19758
19759 * src/allocate.c:
19760 Don't declare calloc() and realloc() if not necessary.
19761
197621999-04-13 Jesse Thilo <jthilo@gnu.org>
19763
19764 * configure.in, acconfig.h, acinclude.m4:
19765 Don't declare calloc() and realloc() if not necessary.
19766
197671999-03-23 Jesse Thilo <jthilo@gnu.org>
19768
19769 * po/.cvsignore: Added i18n support.
19770
197711999-03-23 Jesse Thilo <jthilo@gnu.org>
19772
19773 * acconfig.h, configure.in, Makefile.am:
19774 Added i18n support.
19775
197761999-03-22 Jesse Thilo <jthilo@gnu.org>
19777
19778 * src/bison.s1: Fixed #line numbers.
19779
197801999-03-15 Jesse Thilo <jthilo@gnu.org>
19781
19782 * po/es.po, po/fr.po, po/nl.po, po/de.po:
19783 Added PO files from Translation Project.
19784
197851999-03-03 Jesse Thilo <jthilo@gnu.org>
19786
19787 * Makefile.am:
19788 Added support for non-ANSI compilers (ansi2knr).
19789
197901999-02-16 Jesse Thilo <jthilo@gnu.org>
19791
19792 * configure.in: Bumped version number to 1.27.
19793
19794 * Makefile.am:
19795 Added `bison.simple' to list of files removed by `make distclean'.
19796
197971999-02-12 Jesse Thilo <jthilo@gnu.org>
19798
19799 * src/files.c, src/files.h:
19800 Defined locations of parser files in config.h instead of Makefile.
19801
198021999-02-12 Jesse Thilo <jthilo@gnu.org>
19803
19804 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
19805 Defined locations of parser files in config.h instead of Makefile.
19806
198071999-02-09 Jesse Thilo <jthilo@gnu.org>
19808
19809 * Makefile.am:
19810 Removed inappropriate use of $< macro.
19811
198121999-02-05 Jesse Thilo <jthilo@gnu.org>
19813
19814 * po/Makefile.in.in, po/POTFILES.in:
19815 Add `po' directory skeleton.
19816
198171999-01-27 Jesse Thilo <jthilo@gnu.org>
19818
19819 * README: Document help-bison list.
19820
19821 * configure.in: Add check for mkstemp().
19822
198231999-01-20 Jesse Thilo <jthilo@gnu.org>
19824
19825 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
19826 Hush a few compiler warnings.
19827
19828 * src/files.c:
19829 Add tryclose(), which verifies that fclose was successful.
19830 Hush a couple of compiler warnings.
19831
198321999-01-20 Jesse Thilo <jthilo@gnu.org>
19833
19834 * Makefile.am, OChangeLog:
19835 ChangeLog is now automatically generated. Include the old version as
19836 OChangeLog.
19837
198381999-01-14 Jesse Thilo <jthilo@gnu.org>
19839
19840 * 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:
19841 Update FSF address.
19842
198431999-01-14 Jesse Thilo <jthilo@gnu.org>
19844
19845 * doc/bison.texinfo: Fix formatting glitch.
19846
19847 * doc/bison.texinfo: Update FSF address.
19848
198491999-01-14 Jesse Thilo <jthilo@gnu.org>
19850
19851 * acconfig.h: Update FSF address.
19852
198531999-01-08 Jesse Thilo <jthilo@gnu.org>
19854
19855 * src/system.h:
19856 Don't define PACKAGE here, since config.h defines it.
19857
198581998-12-30 Jesse Thilo <jthilo@gnu.org>
19859
19860 * src/reader.c: Update copyright date.
19861
19862 * src/main.c:
19863 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19864 favor of output directly to stderr (avoids buffer overruns).
19865
19866 * src/reader.c: Some checks for premature EOF.
19867
19868 * 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:
19869 Use prototypes if the compiler understands them.
19870
19871 * src/files.c: Honor TMPDIR on Unix hosts.
19872 Use prototypes if the compiler understands them.
19873
19874 * src/reader.c:
19875 Fix a couple of buffer overrun bugs.
19876 Use prototypes if the compiler understands them.
19877
19878 * src/system.h: Include unistd.h and ctype.h.
19879 Use #ifdef instead of #if for NLS symbols.
19880
198811998-12-30 Jesse Thilo <jthilo@gnu.org>
19882
19883 * doc/bison.texinfo:
19884 Delete comment "consider using @set for edition number, etc..." since
19885 we now are doing so.
19886
198871998-12-30 Jesse Thilo <jthilo@gnu.org>
19888
19889 * configure.in:
19890 Use prototypes if the compiler understands them.
19891
19892 * NEWS: Document 1.26 highlights.
19893
19894 * Makefile.am: Require Automake 1.3 or later.
19895
19896 * acconfig.h:
19897 Use prototypes if the compiler understands them.
19898
198991998-12-29 Jesse Thilo <jthilo@gnu.org>
19900
19901 * src/version.c:
19902 Use VERSION symbol from automake for version number.
19903
199041998-12-29 Jesse Thilo <jthilo@gnu.org>
19905
19906 * acconfig.h, configure.in, version.cin:
19907 Use VERSION symbol from automake for version number.
19908
199091998-11-28 Jesse Thilo <jthilo@gnu.org>
19910
19911 * Makefile.am:
19912 Distribute original version of simple parser (bison.s1), not built
19913 version (bison.simple).
19914
199151998-11-28 Jesse Thilo <jthilo@gnu.org>
19916
19917 * doc/bison.texinfo: Add info dir entry.
19918
19919 * doc/bison.texinfo:
19920 Let automake put version number into documentation.
19921
199221998-11-26 Jesse Thilo <jthilo@gnu.org>
19923
19924 * src/bison.cld, src/build.com, src/vmshlp.mar:
19925 Add non-RCS files from /gd/gnu/bison.
19926
199271998-11-26 Jesse Thilo <jthilo@gnu.org>
19928
19929 * doc/bison.1:
19930 Document the BISON_HAIRY and BISON_SIMPLE variables.
19931
199321998-11-25 Jesse Thilo <jthilo@gnu.org>
19933
19934 * src/version.c: Build version.c automatically.
19935
19936 * src/reader.c:
19937 Fix token numbering (used to start at 258, not 257).
19938
19939 * src/system.h: Include config.h.
19940
19941 * src/getargs.c: Update bug report address.
19942
19943 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19944 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19945
199461998-11-25 Jesse Thilo <jthilo@gnu.org>
19947
19948 * Makefile.am:
19949 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19950
19951 * configure.in, version.cin:
19952 Build version.c automatically.
19953
19954 * AUTHORS: Add AUTHORS file.
19955
19956 * README: Update bug report address.
19957
19958 * bison.simple:
19959 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19960
19961 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19962 Add automake stuff.
19963
199641998-11-25 Jesse Thilo <jthilo@gnu.org>
19965
19966 * doc/bison.texinfo: Clean up some formatting.
19967
199681998-05-05 Richard Stallman <rms@gnu.org>
19969
19970 * doc/bison.texinfo:
19971 Explain better why to make a pure parser.
19972
199731998-01-05 Richard Stallman <rms@gnu.org>
19974
19975 * src/files.c (openfiles):
19976 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19977 find a temporary directory, if possible. Do not unlink files while
19978 they are open.
19979
199801997-08-25 Richard Stallman <rms@gnu.org>
19981
19982 * src/reader.c (stack_offset;):
19983 Change some warni to warns.
19984
19985 * src/lex.c (literalchar): Use warns, not warni.
19986
199871997-06-28 Richard Stallman <rms@gnu.org>
19988
19989 * src/bison.s1: Add a Bison version comment.
19990
19991 * src/main.c (fatal, warn, berror):
19992 Use program_name.
19993
199941997-06-28 Richard Stallman <rms@gnu.org>
19995
19996 * Makefile.in (bison_version): New variable.
19997 (dist): Use that variable.
19998 (bison.s1): Substitute the Bison version into bison.simple.
19999
20000 * bison.simple: Add a Bison version comment.
20001
200021997-06-18 Richard Stallman <rms@gnu.org>
20003
20004 * src/main.c (fatal, warn, berror):
20005 Make error messages standard.
20006 (toomany): Improve error message text.
20007
20008 * 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:
20009 new.h renamed to alloc.h.
20010
200111997-06-18 Richard Stallman <rms@gnu.org>
20012
20013 * Makefile.in: new.h renamed to alloc.h.
20014
200151997-05-24 Richard Stallman <rms@gnu.org>
20016
20017 * src/lex.c (literalchar):
20018 Fix the code for escaping \, " and '.
20019
20020 (lex): Avoid trouble when there are many chars
20021 to discard in a char literal with just several chars in it.
20022
200231997-05-17 Richard Stallman <rms@gnu.org>
20024
20025 * src/bison.s1:
20026 Use malloc, if using alloca is troublesome.
20027 (YYSTACK_USE_ALLOCA): New flag macro.
20028 Define it for some systems and compilers.
20029 (YYSTACK_ALLOC): New macro.
20030 (yyparse): Use YYSTACK_ALLOC to allocate stack.
20031 If it was malloc'd, free it.
20032
200331997-05-17 Richard Stallman <rms@gnu.org>
20034
20035 * bison.simple:
20036 Use malloc, if using alloca is troublesome.
20037 (YYSTACK_USE_ALLOCA): New flag macro.
20038 Define it for some systems and compilers.
20039 (YYSTACK_ALLOC): New macro.
20040 (yyparse): Use YYSTACK_ALLOC to allocate stack.
20041 If it was malloc'd, free it.
20042
200431997-04-23 Richard Stallman <rms@gnu.org>
20044
20045 * src/bison.s1:
20046 (alloca) [__hpux]: Always define as __builtin_alloca.
20047
200481997-04-23 Richard Stallman <rms@gnu.org>
20049
20050 * bison.simple:
20051 (alloca) [__hpux]: Always define as __builtin_alloca.
20052
200531997-04-22 Richard Stallman <rms@gnu.org>
20054
20055 * src/bison.s1:
20056 [__hpux]: Include alloca.h (right for HPUX 10)
20057 instead of declaring alloca (right for HPUX 9).
20058
20059 * src/bison.s1 (__yy_memcpy):
20060 Declare arg `count' as unsigned int.
20061 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
20062
200631997-04-22 Richard Stallman <rms@gnu.org>
20064
20065 * bison.simple:
20066 [__hpux]: Include alloca.h (right for HPUX 10)
20067 instead of declaring alloca (right for HPUX 9).
20068
20069 * bison.simple (__yy_memcpy):
20070 Declare arg `count' as unsigned int.
20071 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
20072
200731997-01-03 Richard Stallman <rms@gnu.org>
20074
20075 * src/allocate.c: [__STDC__ or _MSC_VER]:
20076 Declare calloc and realloc to return void *.
20077
200781997-01-02 Richard Stallman <rms@gnu.org>
20079
20080 * src/system.h:
20081 [_MSC_VER]: Include stdlib.h and process.h.
20082 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
20083
20084 * src/main.c (main): Return FAILURE as a value.
20085 (printable_version): Declare arg as int, not char.
20086
200871997-01-02 Richard Stallman <rms@gnu.org>
20088
20089 * Makefile.in (dist):
20090 Explicitly check for symlinks, and copy them.
20091
200921996-12-19 Richard Stallman <rms@gnu.org>
20093
20094 * src/files.c:
20095 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
20096
200971996-12-18 Paul Eggert <eggert@gnu.org>
20098
20099 * src/bison.s1 (yyparse):
20100 If __GNUC__ and YYPARSE_PARAM are both defined,
20101 declare yyparse to have a void * argument.
20102
201031996-12-18 Paul Eggert <eggert@gnu.org>
20104
20105 * bison.simple (yyparse):
20106 If __GNUC__ and YYPARSE_PARAM are both defined,
20107 declare yyparse to have a void * argument.
20108
201091996-12-17 Richard Stallman <rms@gnu.org>
20110
20111 * src/reduce.c (nbits): Add some casts.
20112
201131996-08-12 Richard Stallman <rms@gnu.org>
20114
20115 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
20116
201171996-08-12 Richard Stallman <rms@gnu.org>
20118
20119 * bison.simple: Test _MSDOS as well as _MSDOS_.
20120
201211996-07-31 Richard Stallman <rms@gnu.org>
20122
20123 * src/bison.s1:
20124 [__sun && __i386]: Include alloca.h.
20125
201261996-07-31 Richard Stallman <rms@gnu.org>
20127
20128 * bison.simple:
20129 [__sun && __i386]: Include alloca.h.
20130
201311996-07-30 Richard Stallman <rms@gnu.org>
20132
20133 * src/bison.s1: Comment change.
20134
20135 * src/bison.s1: Test _MSDOS_, not MSDOS.
20136
201371996-07-30 Richard Stallman <rms@gnu.org>
20138
20139 * bison.simple: Comment change.
20140
20141 * bison.simple: Test _MSDOS_, not MSDOS.
20142
201431996-06-01 Richard Stallman <rms@gnu.org>
20144
20145 * 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:
20146 Insert `_' macro around many string constants.
20147
20148 * src/main.c:
20149 Insert `_' macro around many string constants.
20150
20151 (main): Call setlocale, bindtextdomain and textdomain.
20152
20153 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
20154 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
20155 [ENABLE_NLS]: Include libintl.h.
20156 [ENABLE_NLS] (gettext): Define.
20157 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
20158 (N_, PACKAGE, LOCALEDIR): New macros.
20159
201601996-06-01 Richard Stallman <rms@gnu.org>
20161
20162 * POTFILES.in: New file.
20163
20164 * Makefile.in (allocate.o):
20165 Define target explicitly.
20166
20167 * Makefile.in (CFLAGS): Set to @CFLAGS@.
20168 (LDFLAGS): Set to @LDFLAGS@.
20169 (configure): Run autoconf only if preceding `cd' succeeds.
20170 (bison.s1): Redirect output to temporary file then move the
20171 temporary to the target, rather than redirecting directly to bison.s1.
20172 (clean): Remove config.status and config.log.
20173 (distclean): Don't remove config.status here.
20174
201751996-05-12 Richard Stallman <rms@gnu.org>
20176
20177 * src/bison.s1:
20178 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20179
201801996-05-12 Richard Stallman <rms@gnu.org>
20181
20182 * bison.simple:
20183 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20184
201851996-05-11 Richard Stallman <rms@gnu.org>
20186
20187 * src/bison.s1 (__yy_memcpy):
20188 Really reorder the args, as was supposedly done on Feb 14 1995.
20189 (yyparse): Calls changed accordingly.
20190
201911996-05-11 Richard Stallman <rms@gnu.org>
20192
20193 * Makefile.in (dist): Don't use $(srcdir).
20194
20195 * bison.simple (__yy_memcpy):
20196 Really reorder the args, as was supposedly done on Feb 14 1995.
20197 (yyparse): Calls changed accordingly.
20198
201991996-01-27 Richard Stallman <rms@gnu.org>
20200
20201 * src/output.c (output_rule_data):
20202 Test YYERROR_VERBOSE in the conditional
20203 around the definition of ttyname.
20204
202051995-12-29 Richard Stallman <rms@gnu.org>
20206
20207 * src/bison.s1:
20208 Fix line numbers in #line commands.
20209
202101995-12-29 Richard Stallman <rms@gnu.org>
20211
20212 * bison.simple:
20213 Fix line numbers in #line commands.
20214
202151995-12-27 Richard Stallman <rms@gnu.org>
20216
20217 * src/bison.s1 (YYPARSE_PARAM_DECL):
20218 In C++, make it always null.
20219 (YYPARSE_PARAM_ARG): New macro.
20220 (yyparse): Use YYPARSE_PARAM_ARG.
20221
202221995-12-27 Richard Stallman <rms@gnu.org>
20223
20224 * bison.simple (YYPARSE_PARAM_DECL):
20225 In C++, make it always null.
20226 (YYPARSE_PARAM_ARG): New macro.
20227 (yyparse): Use YYPARSE_PARAM_ARG.
20228
202291995-11-29 Richard Stallman <rms@gnu.org>
20230
20231 * doc/bison.texinfo:
20232 Describe literal string tokens, %raw, %no_lines, %token_table.
20233
202341995-11-29 Daniel Hagerty <hag@gnu.org>
20235
20236 * doc/bison.texinfo: Fixed update date
20237
202381995-10-16 Richard Stallman <rms@gnu.org>
20239
20240 * src/version.c: Version 1.25.
20241
202421995-10-16 Richard Stallman <rms@gnu.org>
20243
20244 * NEWS: *** empty log message ***
20245
202461995-10-16 Richard Stallman <rms@gnu.org>
20247
20248 * doc/bison.1, doc/bison.rnh:
20249 Add new options.
20250
202511995-10-15 Richard Stallman <rms@gnu.org>
20252
20253 * src/vmsgetargs.c, src/getargs.c:
20254 Added -n, -k, and -raw switches.
20255 (noparserflag, toknumflag, rawtoknumflag): New variables.
20256
20257 * src/symtab.h (SALIAS):
20258 New #define for adding aliases to %token.
20259 (struct bucket): Added `alias' field.
20260
20261 * src/reduce.c (reduce_grammar):
20262 Revise error message.
20263 (print_notices): Remove final `.' from error message.
20264
20265 * src/reader.c (reader_output_yylsp):
20266 New function.
20267 (readgram): Use `#if 0' around code that accepted %command
20268 inside grammar rules: The documentation doesn't allow it,
20269 and it will fail since the %command processors scan for the next %.
20270 (parse_token_decl): Extended the %token
20271 declaration to allow a multi-character symbol as an alias.
20272 (parse_thong_decl): New function.
20273 (read_declarations): Added %thong declarations.
20274 (read_declarations): Handle NOOP to deal with allowing
20275 % declarations as another means to specify the flags.
20276 (readgram): Allow %prec prior to semantics embedded in a rule.
20277 (skip_to_char, read_declarations, copy_definition)
20278 (parse_token_decl, parse_start_decl, parse_type_decl)
20279 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
20280 (get_type_name, copy_guard, copy_action, readgram)
20281 (get_type, packsymbols): Revised most error messages.
20282 Changed `fatal' to `warnxxx' to avoid aborting for error.
20283 Revised and use multiple warnxxx functions to avoid using VARARGS1.
20284 (read_declarations): Improve the error message for
20285 an invalid character. Do not abort.
20286 (read_declarations, copy_guard, copy_action): Use
20287 printable_version to avoid unprintable characters in printed output.
20288 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
20289 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
20290 Allow the type of a non-terminal can be given
20291 more than once, as long as all specifications give the same type.
20292
20293 * src/output.c:
20294 (output_headers, output_trailers, output, output_gram)
20295 (output_rule_data): Implement noparserflag variable.
20296 Implement toknumflag variable.
20297 (output): Call reader_output_yylsp to output LTYPESTR.
20298
20299 * src/main.c (main):
20300 If reader sees an error, don't process the grammar.
20301 (fatals): Updated to not use VARARGS1.
20302 (printable_version, int_to_string, warn, warni, warns, warnss)
20303 (warnsss): New error reporting functions. Avoid abort for error.
20304
20305 * src/lex.h:
20306 Added THONG and NOOP for alias processing.
20307 Added SETOPT for the new code that allows setting options with %flags.
20308
20309 * src/lex.c:
20310 Include getopt.h. Add some extern decls.
20311 (safegetc): New function to deal with EOF gracefully.
20312 (literalchar); new function to deal with reading \ escapes.
20313 (lex): Use literalchar.
20314 (lex): Implemented "..." tokens.
20315 (literalchar, lex, parse_percent_token): Made tokenbuffer
20316 always contain the token. This includes growing the token
20317 buffer while reading an integer.
20318 (parse_percent_token): Replaced if-else statement with percent_table.
20319 (parse_percent_token): Added % declarations as another
20320 way to specify the flags -n, -l, and -r. Also added hooks for
20321 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
20322 major changes to files.c.
20323 (lex) Retain in the incoming stream a character following
20324 an incorrect '/'.
20325 (skip_white_space, lex): Revised most error messages
20326 and changed fatal to warn to avoid aborting.
20327 (percent_table): Added %thong declarations.
20328
20329 * src/gram.h: Comment changes.
20330
20331 * src/files.c (openfiles, open_extra_files, done):
20332 Add faction flag
20333 and actfile file. Handle noparserflag. Both for -n switch.
20334
20335 * src/conflicts.c (resolve_sr_conflict):
20336 Remove use of alloca.
20337
203381995-06-01 Jim Meyering <meyering@gnu.org>
20339
20340 * doc/bison.texinfo: *** empty log message ***
20341
203421995-05-06 Richard Stallman <rms@gnu.org>
20343
20344 * src/bison.s1: Comment change.
20345
203461995-05-06 Richard Stallman <rms@gnu.org>
20347
20348 * bison.simple: Comment change.
20349
203501995-05-03 Richard Stallman <rms@gnu.org>
20351
20352 * src/version.c: Version now 1.24.
20353
20354 * src/bison.s1: Change distribution terms.
20355
20356 * src/version.c: Version now 1.23.
20357
203581995-05-03 Richard Stallman <rms@gnu.org>
20359
20360 * doc/bison.texinfo:
20361 Rewrite "Conditions for Using Bison".
20362 Update version to 1.24.
20363
203641995-05-03 Richard Stallman <rms@gnu.org>
20365
20366 * bison.simple: Change distribution terms.
20367
203681995-02-23 Richard Stallman <rms@gnu.org>
20369
20370 * src/files.c: Test __VMS_POSIX as well as VMS.
20371
203721995-02-14 Jim Meyering <meyering@gnu.org>
20373
20374 * src/bison.s1 (__yy_memcpy):
20375 Renamed from __yy_bcopy to avoid
20376 confusion. Reverse FROM and TO arguments to be consistent with
20377 those of memcpy.
20378
203791995-02-14 Jim Meyering <meyering@gnu.org>
20380
20381 * bison.simple (__yy_memcpy):
20382 Renamed from __yy_bcopy to avoid
20383 confusion. Reverse FROM and TO arguments to be consistent with
20384 those of memcpy.
20385
203861994-11-10 David J. MacKenzie <djm@gnu.org>
20387
20388 * NEWS: reformat
20389
20390 * NEWS: New file.
20391
20392 * Makefile.in (DISTFILES): Include NEWS.
20393
20394 * Makefile.in (DISTFILES):
20395 Include install-sh, not install.sh.
20396
20397 * configure.in: Update to Autoconf v2 macro names.
20398
203991994-10-05 David J. MacKenzie <djm@gnu.org>
20400
20401 * Makefile.in: fix typo
20402
20403 * Makefile.in (prefix, exec_prefix):
20404 Let configure set them.
20405
204061994-09-28 David J. MacKenzie <djm@gnu.org>
20407
20408 * Makefile.in: Set datadir to $(prefix)/share.
20409
204101994-09-15 Richard Stallman <rms@gnu.org>
20411
20412 * src/bison.s1:
20413 Update copyright notice and GPL version.
20414
204151994-09-15 Richard Stallman <rms@gnu.org>
20416
20417 * bison.simple:
20418 Update copyright notice and GPL version.
20419
204201994-07-12 Richard Stallman <rms@gnu.org>
20421
20422 * src/reduce.c, src/reader.c:
20423 entered into RCS
20424
204251994-05-05 David J. MacKenzie <djm@gnu.org>
20426
20427 * Makefile.in: entered into RCS
20428
204291994-03-26 Richard Stallman <rms@gnu.org>
20430
20431 * src/bison.s1: entered into RCS
20432
204331994-03-26 Richard Stallman <rms@gnu.org>
20434
20435 * bison.simple: entered into RCS
20436
204371994-03-25 Richard Stallman <rms@gnu.org>
20438
20439 * src/main.c: entered into RCS
20440
204411994-03-24 Richard Stallman <rms@gnu.org>
20442
20443 * src/conflicts.c: entered into RCS
20444
204451994-01-02 Richard Stallman <rms@gnu.org>
20446
20447 * Makefile.in: *** empty log message ***
20448
204491993-11-21 Richard Stallman <rms@gnu.org>
20450
20451 * src/bison.s1: *** empty log message ***
20452
204531993-11-21 Richard Stallman <rms@gnu.org>
20454
20455 * doc/bison.texinfo: entered into RCS
20456
20457 * doc/bison.texinfo: *** empty log message ***
20458
204591993-11-21 Richard Stallman <rms@gnu.org>
20460
20461 * bison.simple: *** empty log message ***
20462
204631993-10-25 David J. MacKenzie <djm@gnu.org>
20464
20465 * doc/bison.texinfo: *** empty log message ***
20466
204671993-10-19 Richard Stallman <rms@gnu.org>
20468
20469 * src/bison.s1: *** empty log message ***
20470
204711993-10-19 Richard Stallman <rms@gnu.org>
20472
20473 * bison.simple: *** empty log message ***
20474
204751993-10-14 Richard Stallman <rms@gnu.org>
20476
20477 * src/bison.s1: *** empty log message ***
20478
204791993-10-14 Richard Stallman <rms@gnu.org>
20480
20481 * bison.simple: *** empty log message ***
20482
204831993-09-14 David J. MacKenzie <djm@gnu.org>
20484
20485 * doc/bison.texinfo: *** empty log message ***
20486
204871993-09-13 Noah Friedman <friedman@gnu.org>
20488
20489 * Makefile.in: *** empty log message ***
20490
204911993-09-10 Richard Stallman <rms@gnu.org>
20492
20493 * src/conflicts.c: *** empty log message ***
20494
20495 * src/system.h: entered into RCS
20496
204971993-09-10 Richard Stallman <rms@gnu.org>
20498
20499 * doc/bison.1: entered into RCS
20500
205011993-09-06 Noah Friedman <friedman@gnu.org>
20502
20503 * src/version.c: entered into RCS
20504
205051993-09-06 Noah Friedman <friedman@gnu.org>
20506
20507 * Makefile.in: *** empty log message ***
20508
205091993-07-30 David J. MacKenzie <djm@gnu.org>
20510
20511 * Makefile.in: *** empty log message ***
20512
205131993-07-24 Richard Stallman <rms@gnu.org>
20514
20515 * src/bison.s1: *** empty log message ***
20516
205171993-07-24 Richard Stallman <rms@gnu.org>
20518
20519 * bison.simple: *** empty log message ***
20520
205211993-07-08 David J. MacKenzie <djm@gnu.org>
20522
20523 * Makefile.in: *** empty log message ***
20524
205251993-07-04 Richard Stallman <rms@gnu.org>
20526
20527 * src/bison.s1: *** empty log message ***
20528
205291993-07-04 Richard Stallman <rms@gnu.org>
20530
20531 * bison.simple: *** empty log message ***
20532
205331993-06-26 David J. MacKenzie <djm@gnu.org>
20534
20535 * src/getargs.c: entered into RCS
20536
205371993-06-26 David J. MacKenzie <djm@gnu.org>
20538
20539 * doc/bison.texinfo: *** empty log message ***
20540
20541 * doc/bison.1: New file.
20542
205431993-06-25 Richard Stallman <rms@gnu.org>
20544
20545 * src/getargs.c: New file.
20546
205471993-06-16 Richard Stallman <rms@gnu.org>
20548
20549 * src/bison.s1: *** empty log message ***
20550
205511993-06-16 Richard Stallman <rms@gnu.org>
20552
20553 * bison.simple: *** empty log message ***
20554
205551993-06-03 Richard Stallman <rms@gnu.org>
20556
20557 * src/bison.s1: New file.
20558
205591993-06-03 Richard Stallman <rms@gnu.org>
20560
20561 * doc/bison.texinfo: *** empty log message ***
20562
205631993-06-03 Richard Stallman <rms@gnu.org>
20564
20565 * bison.simple: New file.
20566
205671993-05-19 Richard Stallman <rms@gnu.org>
20568
20569 * doc/bison.texinfo: New file.
20570
205711993-05-07 Noah Friedman <friedman@gnu.org>
20572
20573 * Makefile.in: *** empty log message ***
20574
205751993-04-28 Noah Friedman <friedman@gnu.org>
20576
20577 * src/reader.c: *** empty log message ***
20578
205791993-04-23 Noah Friedman <friedman@gnu.org>
20580
20581 * src/alloc.h: entered into RCS
20582
205831993-04-20 David J. MacKenzie <djm@gnu.org>
20584
20585 * src/version.c: *** empty log message ***
20586
20587 * src/files.c, src/allocate.c:
20588 entered into RCS
20589
20590 * src/reader.c: *** empty log message ***
20591
20592 * src/lex.c: entered into RCS
20593
20594 * src/conflicts.c: New file.
20595
20596 * src/symtab.c: entered into RCS
20597
20598 * src/alloc.h: New file.
20599
20600 * src/LR0.c: entered into RCS
20601
206021993-04-18 Noah Friedman <friedman@gnu.org>
20603
20604 * src/reader.c: New file.
20605
20606 * src/version.c: *** empty log message ***
20607
206081993-04-18 Noah Friedman <friedman@gnu.org>
20609
20610 * Makefile.in: *** empty log message ***
20611
206121993-04-17 Noah Friedman <friedman@gnu.org>
20613
20614 * Makefile.in: *** empty log message ***
20615
206161993-04-15 Richard Stallman <rms@gnu.org>
20617
20618 * src/main.c, src/files.c:
20619 New file.
20620
206211993-04-15 Noah Friedman <friedman@gnu.org>
20622
20623 * configure.in: entered into RCS
20624
20625 * configure.in: *** empty log message ***
20626
20627 * configure.in: New file.
20628
206291993-04-14 Richard Stallman <rms@gnu.org>
20630
20631 * Makefile.in: New file.
20632
206331993-04-13 Richard Stallman <rms@gnu.org>
20634
20635 * src/version.c: New file.
20636
206371993-03-25 Richard Stallman <rms@gnu.org>
20638
20639 * src/output.c: entered into RCS
20640
206411992-09-25 Richard Stallman <rms@gnu.org>
20642
20643 * configure.bat: entered into RCS
20644
206451992-06-22 Richard Stallman <rms@gnu.org>
20646
20647 * src/vmsgetargs.c: entered into RCS
20648
206491992-06-22 Richard Stallman <rms@gnu.org>
20650
20651 * doc/bison.rnh: entered into RCS
20652
206531992-04-20 David J. MacKenzie <djm@gnu.org>
20654
20655 * README: entered into RCS
20656
206571992-01-22 Richard Stallman <rms@gnu.org>
20658
20659 * src/machine.h: entered into RCS
20660
206611991-12-21 Richard Stallman <rms@gnu.org>
20662
20663 * src/lalr.c, src/closure.c:
20664 entered into RCS
20665
206661991-12-20 Richard Stallman <rms@gnu.org>
20667
20668 * src/state.h: entered into RCS
20669
206701991-12-18 Richard Stallman <rms@gnu.org>
20671
20672 * src/print.c, src/nullable.c, src/derives.c:
20673 entered into RCS
20674
206751991-11-03 David J. MacKenzie <djm@gnu.org>
20676
20677 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
20678 entered into RCS
20679
206801988-09-09 Richard Stallman <rms@gnu.org>
20681
20682 * src/bison.hairy: entered into RCS
20683
206841987-12-16 Richard Stallman <rms@gnu.org>
20685
20686 * REFERENCES: entered into RCS
20687
20688
20689 -----
20690
20691 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
20692 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
20693 Free Software Foundation, Inc.
20694
20695 Copying and distribution of this file, with or without
20696 modification, are permitted provided the copyright notice and this
20697 notice are preserved.