]> git.saurik.com Git - bison.git/blob - ChangeLog
Remove remaining dependence on CVS Id keyword.
[bison.git] / ChangeLog
1 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Remove remaining dependence on CVS Id keyword.
4 * ChangeLog: For the sake of people still using CVS, don't use dollars
5 when mentioning Id.
6 * data/xslt/bison.xsl: Remove Id from header comments, where it was
7 unusual anyway.
8 * data/xslt/xml2dot.xsl: Likewise.
9 * data/xslt/xml2text.xsl: Likewise.
10 * data/xslt/xml2xhtml.xsl: Likewise.
11 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
12 * doc/Makefile.am (neutralize): Remove, no longer needed.
13 (.x.1): Don't use neutralize.
14 (edit): Don't substitute for ID.
15 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
16
17 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
18
19 Fix dependence on computed configure variables.
20 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
21 $(top_srcdir)/configure.ac so that changes to computed variables, such
22 as PACKAGE_VERSION, are seen.
23 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
24
25 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
26
27 Update copyright dates for recent changes.
28 * Makefile.am: Here.
29 * src/Makefile.am: Here.
30 * src/reduce.c: Here.
31 * tests/reduce.at: Here.
32
33 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
34
35 Use git-version-gen for version names between releases.
36 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
37 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
38 * .prev-version: New.
39 * .version.in: Remove.
40 * ChangeLog: Remove the Id previously used for capturing the CVS
41 revision.
42 * GNUmakefile: Remove, now copied from Gnulib.
43 * Makefile.am: Add code suggested by comments in
44 build-aux/git-version-gen.
45 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
46 .prev-version, and .version.
47 * NEWS (2.3b+): Rename to...
48 (?.?): ... this because we're dropping the "+" version naming scheme,
49 but, in general, we still can't be sure of our next release name.
50 * bootstrap: Add a quick hack to remove from .gitignore the
51 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
52 entry. This should really be fixed in gnulib instead.
53 * bootstrap.conf (gnulib_modules): Add gnumakefile.
54 * configure.ac (AC_INIT): Set version name by invoking
55 build-aux/git-version-gen.
56 (AC_CONFIG_FILES): Remove .version, now generated by
57 build-aux/git-version-gen.
58 * maint.mk: New, copied from coreutils.
59 * doc/.cvsignore (bison.1): Add.
60 * doc/.gitignore (/bison.1): Add.
61 * doc/bison.1: Remove, generated.
62 * src/.cvsignore (revision.c): Remove.
63 * src/.gitignore (/revision.c): Remove.
64 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
65 (BUILT_SOURCES): Remove revision.c.
66 (revision.c): Remove.
67 * src/getargs.c (version): Don't print revision after the VERSION.
68 * src/revision.h: Remove.
69
70 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
71
72 Fix untranslatable composition of sentences. Reported by Goran
73 Uddeborg at
74 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
75 * THANKS (Goran Uddeborg): Add.
76 * src/reduce.c (reduce_print): Report the number of nonterminals and
77 rules useless in the grammar in separate sentences.
78 * tests/reduce.at (Useless Rules): Update output.
79 (Reduced Automaton): Likewise.
80 (Underivable Rules): Likewise.
81 (Empty Language): Likewise.
82
83 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
84
85 Fix some .gitignore and .cvsignore problems.
86 * bootstrap (insert_sorted_if_absent): Replace all uses with...
87 (insert_vc_ignore): ... this new function, which prepends `/' to all
88 .gitignore entries before passing them to insert_sorted_if_absent.
89 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
90 .cvsignore files are maintained even though Bison developers run
91 bootstrap while using Git.
92 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
93 unneeded by Bison.
94 (gnulib): Add.
95 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
96 unneeded. Reported by Eric Blake.
97 * lib/.gitignore (/*~): Add.
98 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
99 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
100 Blake.
101 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
102
103 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
104
105 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
106 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
107 * bootstrap.conf (gnulib_modules): Add unsetenv.
108 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
109 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
110 (/setenv.m4): Add.
111 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
112 the first argument because it may become position-dependent, and unset
113 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
114 Add comments explaining these issues in more detail.
115
116 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
117
118 Add .gitignore everywhere based on .cvsignore.
119 * .gitignore: New.
120 * build-aux/.gitignore: New.
121 * data/.gitignore: New.
122 * doc/.gitignore: New.
123 * etc/.gitignore: New.
124 * examples/.gitignore: New.
125 * examples/calc++/.gitignore: New.
126 * lib/.gitignore: New.
127 * m4/.gitignore: New.
128 * po/.gitignore: New.
129 * runtime-po/.gitignore: New.
130 * src/.gitignore: New.
131 * tests/.gitignore: New.
132
133 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
134
135 * NEWS (2.3b+): New section, empty for now.
136 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
137
138 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
139
140 * NEWS (2.3b): Update release date since there has been a delay in
141 getting the announcements and tarballs out.
142
143 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
144
145 * NEWS: Version 2.3b.
146 * configure.ac (AC_INIT): Likewise.
147 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
148
149 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
150
151 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
152 been doing it for years.
153 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
154 (Release Procedure): Add FIXME about make alpha being unmaintained.
155
156 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
157
158 * data/yacc.c: Reformat m4 a little for readability.
159 * src/lalr.c (build_relations): Correct comment.
160
161 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
162
163 DJGPP specific issue.
164 * djgpp/config.sed: Fixes required to run configure scripts generated
165 by autoconf 2.62.
166
167 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
168
169 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
170 coordinator@translationproject.org.
171
172 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
173
174 * THANKS: Add Eric Blake.
175
176 2008-04-23 Eric Blake <ebb9@byu.net>
177
178 Revert prior patch, by working around autoconf regression.
179 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
180 ("Output file name: ("): Uncomment test.
181 ("Output file name: )"): Likewise.
182 Based on an idea from Noah Misch.
183
184 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
185
186 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
187 2.61. Reported by Juan Manuel Guerrero at
188 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
189 * tests/output.at ("Output file name: ("): Comment out test case for
190 now.
191 ("Output file name: )"): Likewise.
192
193 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
194
195 * GNUmakefile: Update git-version-gen invocation so make dist
196 succeeds.
197
198 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
199
200 Update to the current gnulib CVS repository, and fix trigraph handling
201 in Bison.
202 * bootstrap: Update gnulib CVS repository URL.
203 (symlink_to_dir): Encapsulate the code that guarantees the destination
204 directory exists into...
205 (check_dst_dir): ... this new function, and...
206 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
207 fail when copying files into lib/uniwidth/.
208 * src/output.c (prepare_symbols): When writing yytname muscles, where
209 symbol names will be encoded in C-string literals, tell quotearg to
210 escape trigraphs. This used to be the default in gnulib.
211 * tests/regression.at (Token definitions): Because of the change in
212 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
213 escapes trigraphs in symbol names. Thus, yytname no longer has
214 trigraphs unnecessarily doubly escaped. Update test case output.
215 Extend test case to be sure Bison's own error messages will no longer
216 have trigraphs in symbol names unnecessarily escaped once.
217
218 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
219
220 Fix make dist infinite loop reported by Juan Manuel Guerrero at
221 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
222 * .cvsignore: Add .version.
223 * .version.in: New.
224 * bootstrap.conf (gnulib_modules): Add git-version-gen.
225 * configure.ac (AC_CONFIG_FILES): Add .version.
226 * build-aux/.cvsignore: Add git-version-gen.
227
228 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
229
230 * NEWS (2.3a+): Mention that -g now takes an argument.
231 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
232 consistency. Update the -g and -x entries now that they take
233 arguments. Use brackets to indicate optional arguments.
234 * src/getargs.c (usage): Explain the relationship between arguments of
235 long and short options more completely. Document --defines and -d
236 separately since the former takes an argument but, for POSIX Yacc, the
237 latter does not.
238 (short_options): Let -W take an optional argument like --warnings.
239 (getargs): Sort cases.
240
241 2008-02-28 Akim Demaille <demaille@gostai.com>
242
243 * doc/bison.texinfo: Fix a few typos.
244
245 2008-02-28 Akim Demaille <akim@epita.fr>
246
247 * doc/bison.texinfo (Bison Options): Document -W.
248 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
249
250 2008-02-28 Akim Demaille <akim@epita.fr>
251
252 * src/getargs.c (short_options): Split and sort for readability.
253 -g and -x take optional arguments, just like their long options.
254 * build-aux/cross-options.pl: Use /x to make the regexp easier to
255 understand.
256 Fix the handling of $opt which resulted in all the argument to be
257 considered as optional.
258
259 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
260
261 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
262 say its interface is experimental.
263 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
264 Java.
265 (Bison Options): In the -L and --language entry, mention Java.
266 (Java Bison Interface): Say the interface is experimental.
267 * src/getargs.c (usage): Mention -L and --language.
268
269 * NEWS (2.3a+): Say the push parsing interface is experimental.
270 * doc/bison.texinfo (Push Decl): Likewise.
271 (Decl Summary): Likewise in the "%define api.push_pull" entry.
272 (Push Parser Function): Likewise.
273 (Pull Parser Function): Likewise.
274 (Parser Create Function): Likewise.
275 (Parser Delete Function): Likewise.
276 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
277 yypull_parse, and yypush_parse entries.
278
279 * NEWS (2.3a+): Mention XML support, and say the schema is
280 experimental.
281 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
282 * src/getargs.c (usage): Say the XML schema is experimental.
283
284 * NEWS (2.3a+): Say option instead of flag.
285
286 2008-02-21 Wojciech Polak <polak@gnu.org>
287
288 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
289 text.
290
291 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
292
293 Fix impure push parser compile error reported by Bob Rossi at
294 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
295 * data/yacc.c: Clean up whitespace in the output a little.
296 (yypstate_allocated): Define for impure push parsers regardless of
297 whether the pull interface is also requested.
298 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
299 check impure push parsers without the pull interface.
300
301 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
302 yyerror takes arguments specified by %parse-param while yypstate_new
303 does not.
304 * doc/bison.texinfo (Parser Create Function): Document that
305 yypstate_new returns 0 for multiple impure parser instances.
306 * tests/push.at (Push Parsing: Multiple impure instances): Update
307 expected stderr output.
308
309 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
310
311 * runtime-po/POTFILES.in (push.c): Remove.
312
313 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
314
315 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
316 * data/push.c: Rename to...
317 * data/yacc.c: ... this, overwriting it.
318 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
319 `%push-pull-parser' -> `%define api.push_pull "both"'.
320 Remove old yacc.c tests, and update push.c tests to yacc.c.
321
322 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
323
324 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
325 `"%code top" blocks' instead of `%code "top" blocks'.
326 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
327 Clean up whitespace in the output a little.
328
329 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
330
331 Fix documentation problems reported by Tim Josling at
332 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
333 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
334 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
335 integers. Explain the effect of literal string aliases on error
336 messages. Copy token 0 documentation from the C++ skeleton
337 documentation.
338
339 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
340
341 Accept a token number in a %left, %right, or %nonassoc for POSIX
342 conformance. Reported by Tim Josling at
343 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
344 * NEWS (2.3a+): Mention.
345 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
346 and code numbers are treated by precedence declarations.
347 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
348 of symbols.1.
349 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
350 of symbol.
351 (symbol.prec): New, just like symbol but allows INT.
352 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
353 longer holds.
354 * tests/regression.at (Token number in precedence declaration): New
355 test case.
356
357 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
358
359 DJGPP specific issues.
360 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
361 be changed. Copyright timestamp adjusted.
362 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
363 be changed. Copyright timestamp adjusted.
364 * djgpp/config.site: Copyright timestamp adjusted.
365 * djgpp/config_h.sed: Copyright timestamp adjusted.
366 * djgpp/djunpack.bat: Copyright timestamp adjusted.
367 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
368 filename translation list.
369 * djgpp/subpipe.c (init_subpipe): Check the environment variables
370 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
371 files shall be created. Before trying to use the temp dir where the
372 environment variable points to check that the dir really exists. If
373 not default to the cwd as temp dir. Copyright timestamp adjusted.
374 * djgpp/subpipe.h: Copyright timestamp adjusted.
375 * djgpp/testsuite.sed: Copyright timestamp adjusted.
376
377 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
378
379 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
380
381 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
382
383 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
384 Problem reported by Claudio Saavedra in
385 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
386
387 2008-01-05 Wojciech Polak <polak@gnu.org>
388
389 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
390 document's title with the input grammar file name.
391
392 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
393
394 Automate regression testing of the XML/XSLT implementation. Discussed
395 starting at
396 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
397 * configure.ac (XSLTPROC): New substitution.
398 * Makefile.am (maintainer-xml-check): New phony target invoking...
399 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
400 invoking make maintainer-check with BISON_TEST_XML=1.
401 * tests/atlocal.in (XSLTPROC): New.
402 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
403 not to report reachable memory when Bison is expected to have a
404 non-zero exit status and (2) to compare XML/XSLT output with --graph
405 and --report=all output for every working grammar when
406 BISON_TEST_XML=1.
407 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
408 (AT_BISON_CHECK_XML): New.
409 (AT_QUELL_VALGRIND): New.
410 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
411 (AT_CHECK): ... don't redefine this since this was the old way to
412 quell Valgrind.
413 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
414 AT_BISON_CHECK invocations.
415 * tests/c++.at: Likewise.
416 * tests/calc.at: Likewise.
417 * tests/conflicts.at: Likewise.
418 * tests/cxx-type.at: Likewise.
419 * tests/existing.at: Likewise.
420 * tests/glr-regression.at: Likewise.
421 * tests/headers.at: Likewise.
422 * tests/input.at: Likewise.
423 * tests/java.at: Likewise.
424 * tests/output.at: Likewise.
425 * tests/push.at: Likewise.
426 * tests/reduce.at: Likewise.
427 * tests/regression.at: Likewise.
428 * tests/sets.at: Likewise.
429 * tests/skeletons.at: Likewise.
430 * tests/synclines.at: Likewise.
431 * tests/torture.at: Likewise.
432 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
433 tends to hang xsltproc.
434 (Big horizontal): Likewise.
435
436 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
437
438 In XML output, remove redundant class attribute on symbol element.
439 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
440 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
441 look up a symbol to determine whether it's a nonterminal or terminal.
442 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
443 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
444
445 Add prec/assoc information to XML output.
446 * src/gram.c (grammar_rules_print_xml): For each rule that has a
447 %prec, add a percent_prec attribute.
448 * src/print-xml.c (print_grammar): For each terminal that has a
449 precedence or associativity, add a prec or assoc attribute.
450 (xml_indent): New.
451 (xml_puts): Use xml_indent.
452 (xml_printf): Use xml_indent.
453 * src/print-xml.h (xml_indent): Prototype.
454
455 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
456 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
457
458 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
459
460 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
461 (bison:ruleByNumber): ... this for clarity.
462 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
463 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
464 (xsl:template match="reduction"): Update.
465 (xsl:template match="item"): Update.
466 (xsl:template match="reduction"): Update.
467
468 In the XML output, don't print the list of rules where symbols appear.
469 Compute it in XSLT instead. Discussed at
470 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
471 * data/xslt/bison.xsl (bison:ruleByLhs): New.
472 (bison:ruleByRhs): New.
473 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
474 bison:ruleByRhs.
475 (xsl:template match="terminal/rule"): Remove.
476 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
477 bison:ruleByRhs.
478 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
479 Remove.
480 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
481 bison:ruleByRhs and mode="number-link" for rule template.
482 (xsl:template match="terminal/rule"): Remove.
483 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
484 bison:ruleByRhs and mode="number-link" for rule template.
485 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
486 Rewrite as...
487 (xsl:template match="rule" mode="number-link"): ... this.
488 * src/print-xml.c (print_grammar): Don't print the list of rules.
489
490 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
491
492 Don't let --report affect XML output; always print all information.
493 Discussed at
494 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
495 * src/conflicts.c (log_resolution): Implement.
496 * src/print-xml.c (print_core): Implement.
497 (print_state): Implement.
498 (print_xml): Implement.
499
500 * NEWS (2.3a+): Fix quotes.
501 * src/parse-gram.y (prologue_declaration): For consistency with -v,
502 don't let %verbose clear the list specified by --report.
503
504 2007-11-26 Akim Demaille <akim@epita.fr>
505
506 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
507
508 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
509
510 In the XML output, list useless and unused symbols and rules with the
511 useful ones and add a "usefulness" attribute. Discussed starting at
512 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
513 * src/gram.c (grammar_rules_partial_print_xml): Remove.
514 (grammar_rules_print_xml): Print all rules instead of just those
515 useful in the grammar, and add a "usefulness" attribute.
516 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
517 * src/print-xml.c (print_rules_useless_in_parser): Remove.
518 (print_grammar): Print all nonterminals instead of just useful ones,
519 and add a "usefulness" attribute to nonterminals and terminals.
520 (print_xml): Don't print a separate "reductions" or
521 "rules-useless-in-parser" element.
522 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
523 (reduce_xml): Remove.
524 (reduce_token_unused_in_grammar): New.
525 (reduce_nonterminal_useless_in_grammar): New.
526 * src/reduce.h (reduce_xml): Remove prototype.
527 (reduce_token_unused_in_grammar): Add prototype.
528 (reduce_nonterminal_useless_in_grammar): Add prototype.
529 * data/xslt/xml2text.xsl: Update for XML changes.
530 * data/xslt/xml2xhtml.xsl: Update for XML changes.
531 * tests/reduce.at (Useless Terminals): Update output.
532 (Useless Rules): Update output.
533 (Reduced Automaton): Update output.
534
535 Say "Terminals unused in grammar" instead of "Unused terminals".
536 * NEWS (2.3a+): Update.
537 * doc/bison.texinfo (Understanding): Update example output.
538 * src/reduce.c (reduce_output): Implement.
539 * data/xslt/xml2text.xsl: Implement.
540 * data/xslt/xml2xhtml.xsl: Implement.
541
542 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
543
544 Accept --report-file=FILE to override the default `.output' filename.
545 * NEWS (2.3a+): Mention.
546 * doc/bison.texinfo (Bison Options): Add an entry.
547 * src/files.c (compute_output_file_names): Don't override
548 spec_verbose_file if already set.
549 * src/getargs.c (usage): Document --report-file.
550 (REPORT_FILE_OPTION): New anonymous enum member.
551 (long_options): Add entry for it.
552 (getargs): Add case for it setting spec_verbose_file.
553
554 * build-aux/cross-options.pl: Don't record a short option just because
555 there's an arg.
556 * doc/.cvsignore: Add yacc.1.
557
558 2007-11-14 Akim Demaille <akim@epita.fr>
559
560 * doc/yacc.1.in: New.
561 * configure.ac, doc/Makefile.am: Adjust.
562 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
563 config.h symbol.
564 Use AC_SUBST for assignments too.
565 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
566
567 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
568
569 * src/gram.c: Remove comments that duplicate comments in gram.h.
570
571 When reporting useless rules and nonterminals, say "useless in grammar"
572 instead of "useless", and say "useless in parser" instead of "never
573 reduced". Discussed starting at
574 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
575 * NEWS (2.3a+): Mention this change.
576 * data/xslt/xml2text.xsl: Update output text and expected input XML
577 element names to match changes below.
578 * data/xslt/xml2xhtml.xsl: Likewise.
579 (xsl:template match="bison-xml-report"): Add missing entry in Table of
580 Contents: "Rules useless in parser due to conflicts".
581 * doc/bison.texinfo (Decl Summary): Reword a little.
582 (Understanding): Update example output for changes below.
583 * src/gram.c: (rule_useful_p): Rename to...
584 (rule_useful_in_grammar_p): ... this.
585 (rule_useless_p): Rename to...
586 (rule_useless_in_grammar_p): ... this.
587 (rule_never_reduced_p): Rename to...
588 (rule_useless_in_parser_p): ... this.
589 (grammar_rules_print): Update for renames.
590 (grammar_rules_print_xml): Update for renames.
591 (grammar_rules_never_reduced_report): Rename to...
592 (grammar_rules_useless_report): ... this since it is used for either
593 kind of useless rule.
594 * src/gram.h: Reword comments and update function names in prototypes.
595 * src/main.c (main): Say "rule useless in parser due to conflicts".
596 * src/print-xml.c (print_rules_never_reduced): Rename to...
597 (print_rules_useless_in_parser): ... this, and rename output XML
598 element "rules-never-reduced" to "rules-useless-in-parser".
599 (print_xml): Update for rename.
600 * src/print.c (print_results): Say "Rules useless in parser due to
601 conflicts".
602 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
603 (nonterminals_reduce): Say "nonterminal useless in grammar".
604 (reduce_output): Say "Nonterminals useless in grammar".
605 Say "Rules useless in grammar".
606 (reduce_xml): Rename output XML element "useless" to
607 "useless-in-grammar".
608 (reduce_print): Don't report the count of grammatically useless rules
609 as "rules never reduced" just because %yacc is specified.
610 In the correct report of this count, say nonterminal(s) and rule(s)
611 "useless in grammar".
612 * tests/conflicts.at (S/R in initial): Update expected output.
613 (Defaulted Conflicted Reduction): Likewise.
614 (Unreachable States After Conflict Resolution): Likewise.
615 * tests/existing.at (GNU pic Grammar): Likewise.
616 * tests/reduce.at (Useless Nonterminals): Likewise.
617 (Useless Rules): Likewise.
618 (Reduced Automaton): Likewise.
619 (Underivable Rules): Likewise.
620 (Empty Language): Likewise.
621
622 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
623
624 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
625 here document and before the EOF so that BSD's implementation of Bourne
626 shell doesn't parse the delimiter as part of the here document.
627 * doc/.cvsignore: Add cross-options.texi.
628 * src/getargs.c (usage): Add a blank line after the warning categories.
629
630 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
631
632 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
633
634 2007-11-05 Akim Demaille <akim@epita.fr>
635
636 Remove Id: from bison.1.
637 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
638 (perl -0777 -pi -e 's/\.PP\nId): New.
639 (.x.1): Use it to ignore the version control revision.
640
641 2007-11-05 Akim Demaille <demaille@gostai.com>
642
643 * build-aux/Makefile.am: Ship cross-options.pl.
644 * doc/Makefile.am: Always refer to cross-options.texi with
645 $(srcdir).
646 (MAINTAINERCLEANFILES): Add it.
647
648 2007-11-04 Akim Demaille <demaille@gostai.com>
649
650 Generate the long/short option cross-table.
651 * build-aux/cross-options.pl: New.
652 * doc/Makefile.am (cross-options.texi): New.
653 * doc/bison.texinfo: Use it.
654
655 2007-11-04 Akim Demaille <demaille@gostai.com>
656
657 Generate bison.1 using help2man.
658 * doc/common.x, doc/bison.x: New.
659 * doc/Makefile.am (bison.1, .x.1): New.
660 The code is taken from autoconf-2.61/man/Makefile.am.
661 * configure.ac: Look for help2man.
662
663 2007-11-04 Akim Demaille <demaille@gostai.com>
664
665 Complete --help.
666 * src/getargs.c (usage): Document -W, make it clear that -d,
667 -g and -x have optional arguments.
668
669 2007-11-04 Akim Demaille <demaille@gostai.com>
670
671 Find sha1sum when named gsha1sum.
672 * bootstrap (find_tool): New.
673 ($SHA1SUM): New.
674
675 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
676
677 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
678 at
679 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
680 * NEWS (2.3a+): Mention.
681 * data/bison.m4 (b4_pure_if): Don't define it here.
682 * data/c.m4 (b4_identification): Depend on individual skeletons to
683 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
684 values of the %define variables api.pure or api.push_pull. Define
685 YYPURE, YYPUSH, and YYPULL accordingly.
686 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
687 glr.cc has already defined b4_pure_flag.
688 * data/push.c: Define b4_pure_if based on `%define api.pure'.
689 Remove YYPUSH and YYPULL since they're back in b4_identification again.
690 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
691 * doc/bison.texinfo (Pure Decl): Update.
692 (Push Decl): Update.
693 (Decl Summary): Add api.pure to %define entry.
694 In %pure-parser entry, say it's deprecated and reference %define.
695 (Pure Calling): Update.
696 (Error Reporting): Update.
697 (C++ Scanner Interface): Update.
698 (How Can I Reset the Parser): Update.
699 (Table of Symbols): In %pure-parser entry, say it's deprecated and
700 reference %define.
701 * src/getargs.c (pure_parser): Remove global variable.
702 * src/getargs.h (pure_parser): Remove extern.
703 * src/output.c (prepare): Don't define pure_flag muscle.
704 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
705 wrapper around `%define api.pure'.
706 * tests/calc.at (Simple LALR Calculator): Update.
707 (Simple GLR Calculator): Update.
708 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
709 Update.
710 (GLR: Resolve ambiguity, pure, locations): Update.
711 (GLR: Merge conflicting parses, pure, no locations): Update.
712 (GLR: Merge conflicting parses, pure, locations): Update.
713 * tests/glr-regression.at (Uninitialized location when reporting
714 ambiguity): Update
715 * tests/input.at (Unused %define api.pure): New test case.
716 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
717 AT_PURE_IF and AT_PURE_AND_LOC_IF.
718 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
719
720 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
721
722 %define push_pull -> %define api.push_pull. Discussed starting at
723 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
724 * data/push.c: Expect the new name.
725 * data/yacc.c: Likewise.
726 * doc/bison.texinfo (Push Decl): Update.
727 (Decl Summary): Update %define entry.
728 (Push Parser Function): Update.
729 (Pull Parser Function): Update.
730 (Parser Create Function): Update.
731 (Parser Delete Function): Update.
732 * tests/calc.at (Simple LALR Calculator): Update.
733 * tests/input.at (%define enum variables): Update.
734 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
735 (Push Parsing: Multiple impure instances): Update.
736 (Push Parsing: Unsupported Skeletons): Update.
737 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
738 (Exploding the Stack Size with Malloc): Update.
739
740 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
741 other entries some.
742
743 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
744
745 For the XML output's terminal element, rename @number to @token-number,
746 and add @symbol-number. In the nonterminal element, rename @number to
747 @symbol-number. Discussed starting at
748 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
749 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
750 renames.
751 (xsl:template match="nonterminal"): Likewise.
752 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
753 (xsl:template match="nonterminal"): Likewise.
754 * src/print-xml.c (print_grammar): Implement.
755
756 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
757
758 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
759 2007-10-11 change, the child elements here are items not rules.
760 (xsl:template match="item"): New.
761 (xsl:template match="rule"): Update for new reduced itemset.
762 (xsl:template match="point"): Remove.
763 (xsl:template match="empty"): For consistency with --graph, don't
764 output "/* empty */".
765 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
766 line-wrap, don't pass a negative value as first-line-length since this
767 won't work with the following changes.
768 (xsl:template name="line-wrap"): Simplify slightly.
769 (xsl:template name="ws-search"): Eliminate recursion.
770 * src/print_graph.c (print_core): Don't print a reduction's lookahead
771 set next to an item whose dot is not at the end of the RHS even if it
772 happens to be associated with the same rule.
773
774 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
775
776 Add %define lr.keep_unreachable_states.
777 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
778 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
779 * src/main.c (main): Implement it.
780 * tests/conflicts.at (Unreachable States After Conflict Resolution):
781 Extend to test it, and fix a typo.
782
783 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
784
785 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
786 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
787 the example .output text.
788 * tests/regression.at (Extra lookahead sets in report): Improve wording
789 of comments.
790
791 2007-10-17 Wojciech Polak <polak@gnu.org>
792
793 * src/print-xml.c (print_grammar): Renamed
794 <terminal> and <nonterminal> attributes:
795 "type" to "number" and "symbol" to "name".
796 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
797 Use new attribute names.
798 (xsl:template match="nonterminal"): Likewise.
799 * data/xslt/xml2xhtml.xsl: Likewise.
800
801 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
802
803 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
804 (Option Cross Key): Likewise.
805
806 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
807 next to an item whose dot is not at the end of the RHS even if it
808 happens to be associated with the same rule.
809 * src/print.c (print_core): Likewise.
810 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
811 (Resolved SR Conflicts): Update output.
812 * tests/regression.at (Extra lookahead sets in report): New test case.
813
814 2007-10-11 Wojciech Polak <polak@gnu.org>
815
816 * src/print-xml.c (print_core): Remove item set
817 redundancy.
818 * data/xslt/bison.xsl (bison:ruleNumber): New key.
819 Improve processing time. Suggested by Joel E. Denny.
820 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
821 Write xsl:param "required" attribute as comment.
822 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
823 (xsl:template match="rule"): Support new reduced itemset.
824 (xsl:template match="point"): Remove.
825 * data/xslt/xml2xhtml.xsl: Likewise.
826
827 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
828
829 * src/getargs.c (version): Update copyright year.
830
831 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
832
833 Make xml2dot.xsl and --graph produce the same output.
834 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
835 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
836 escaped later.
837 (xsl:template name="output-node"): Use the new escape template instead
838 of the string-replace template directly.
839 (xsl:template name="output-edge"): Likewise.
840 (xsl:template name="escape"): New, escapes backslashes and newlines in
841 addition to quotation marks.
842 * src/graphviz.c (start_graph, output_node, output_edge): Add
843 whitespace to output for legibility.
844
845 Make xml2text.xsl and --report produce the same output, and remove the
846 XML "conflicts" element since a conflict summary is easily extracted
847 from the automaton.
848 * data/xslt/bison.xsl: New.
849 (xsl:template match="state" mode="bison:count-conflicts): New.
850 * data/xslt/xml2text.xsl: Import bison.xsl.
851 (xsl:template match="bison-xml-report"): Instead of styling the
852 "conflicts" element, style the "automaton" element with mode
853 "conflicts". Unlike the former, the latter lists S/R and R/R
854 conflicts for a state on the same line.
855 (xsl:template match="conflicts"): Remove.
856 (xsl:template match="conflict"): Remove.
857 (xsl:template match="terminal"): Line-wrap the list of rules in which
858 the terminal is used.
859 (xsl:template match="nonterminal"): Likewise for nonterminals.
860 (xsl:template match="automaton" mode="conflicts"): New.
861 (xsl:template match="state" mode="conflicts"): New.
862 (xsl:template name="line-wrap"): New.
863 (xsl:template name="ws-search"): New.
864 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
865 (xsl:template match="bison-xml-report"): Instead of styling the
866 "conflicts" element, style the "automaton" element with mode
867 "conflicts."
868 (xsl:template match="conflicts"): Remove.
869 (xsl:template match="conflict"): Remove.
870 (xsl:template match="automaton" mode="conflicts"): New.
871 (xsl:template match="state" mode="conflicts): New.
872 * src/conflicts.c (conflicts_output_xml): Remove.
873 * src/conflicts.h (conflicts_output_xml): Remove prototype.
874 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
875 * src/print.c (print_grammar): Consistently wrap at the 66th column so
876 the corresponding XSLT is easier. Also, never wrap between a word and
877 the comma that follows it.
878
879 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
880
881 Improve C++ namespace support. Discussed starting at
882 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
883 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
884 b4_namespace_close): New macros that interpret the %define variable
885 "namespace" so its value can contain "::" to indicate nested
886 namespaces.
887 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
888 the above macros.
889 * data/lalr1.cc (b4_namespace): Likewise.
890 * data/location.cc (b4_namespace): Likewise.
891 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
892 inside a new table in the general %define entry. Document `%define
893 namespace' there as well. Point the %name-prefix entry to it since it
894 explains it more completely in the case of C++.
895 (C++ Bison Interface): Mention `%define namespace' instead of
896 %name-prefix.
897 (Table of Symbols): Remove the `%define push_pull' entry. The %define
898 entry suffices.
899 * tests/c++.at (Relative namespace references): New test case.
900 (Absolute namespace references): New test case.
901 (Syntactically invalid namespace references): New test case.
902 * tests/input.at (C++ namespace reference errors): New test case.
903
904 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
905
906 Add syncline support and location accessor to internal %define
907 interfaces.
908 * data/bison.m4 (b4_percent_define_get_loc): New.
909 (b4_percent_define_get_syncline): New.
910 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
911 (b4_percent_define_default): Record defining location as line 1 rather
912 than 0 for the sake of synchronizing #line's, and define
913 b4_percent_define_syncline(VARIABLE).
914 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
915 * src/muscle_tab.c (muscle_syncline_grow): New.
916 (muscle_code_grow): Use muscle_syncline_grow.
917 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
918 define b4_percent_define_syncline(VARIABLE).
919 (muscle_percent_define_get_loc): New.
920 (muscle_percent_define_get_syncline): New.
921 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
922 remove some unused variables.
923 (muscle_percent_define_default): Record defining location as line 1
924 rather than 0 for the sake of synchronizing #line's, and define
925 b4_percent_define_syncline(VARIABLE).
926 (muscle_percent_define_check_values): Use
927 muscle_percent_define_get_loc.
928 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
929 (muscle_percent_define_get_syncline): Prototype.
930 * tests/skeletons.at (%define Boolean variables: invalid skeleton
931 defaults): Update output for location change.
932 (Complaining during macro argument expansion): Extend to test
933 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
934
935 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
936
937 Fix some error-reporting macro bugs.
938 * data/bison.m4 (b4_cat): New.
939 (b4_error, b4_error_at): Use b4_cat to send error directives directly
940 to stdout so they don't become arguments to other macros. Update
941 comments and add examples.
942 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
943 add examples.
944 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
945 after printing the error directive so that M4 doesn't report subsequent
946 problems that are induced by this problem.
947 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
948 instead of just in them. Recognize @\n in both places. Both expand to
949 the empty string. Needed by b4_cat.
950 * tests/skeletons.at (Complaining during macro argument expansion):
951 New test case.
952 (Fatal errors make M4 exit immediately): New test case.
953
954 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
955
956 Implement --print-datadir.
957 * src/getargs.c (usage): Mention.
958 (PRINT_DATADIR_OPTION): New anonymous enum member.
959 (long_options): Add entry for it.
960 (getargs): Add case for it calling compute_pkgdatadir.
961 * src/output.c (output_skeleton): Encapsulate data directory
962 computation from here...
963 (prepare): ... and from here...
964 (compute_pkgdatadir): ... into this new function.
965 * src/output.h (compute_pkgdatadir): Prototype.
966
967 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
968
969 * src/print-xml.c (escape_bufs): New static global variable
970 replacing...
971 (xml_escape_n): ... the static local variable buf here.
972 (print_xml): Free memory for escape_bufs.
973 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
974
975 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
976
977 Replace `%push-parser' and `%push-pull-parser' with
978 `%define push_pull "push"' and `%define push_pull "both"'.
979 `%define push_pull "pull"' is the default.
980 * doc/bison.texinfo (Push Decl, Push Parser Function,
981 Pull Parser Function, Parser Create Function, Parser Delete Function):
982 Update declarations.
983 (Decl Summary, Table of Symbols): Replace %push-parser and
984 %push-pull-parser entries with a %define push_pull entry.
985 * data/bison.m4 (b4_percent_define_check_values): New macro.
986 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
987 definitions...
988 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
989 definitions...
990 * data/push.c: ... to here and compute them from the value of the
991 %define variable push_pull.
992 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
993 parsing requests here...
994 * data/yacc.c: ... hack this to switch to push.c any time
995 b4_use_push_pull_flag or the %define variable push_pull is set. This
996 will go away when we mv push.c yacc.c.
997 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
998 push parsing is not supported since unused %define variables are
999 reported anyway.
1000 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
1001 * src/muscle_tab.h (muscle_percent_define_check_values): Update
1002 comments for consistency with b4_percent_define_check_values.
1003 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
1004 muscles.
1005 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
1006 Remove.
1007 (prologue_declaration): Remove %push-parser and %push-pull-parser
1008 rules.
1009 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
1010 * tests/calc.at: Update declarations.
1011 * tests/input.at (%define enum variables): New test case.
1012 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
1013 declaration.
1014 (Push Parsing: Multiple impure instances): Update declaration.
1015 (Push Parsing: Unsupported Skeletons): New test case.
1016 * tests/torture.at (Exploding the Stack Size with Alloca): Update
1017 declaration.
1018 (Exploding the Stack Size with Malloc): Update declaration.
1019
1020 2007-09-24 Wojciech Polak <polak@gnu.org>
1021
1022 Add XSLT transformations.
1023
1024 * data/xslt/xml2dot.xsl: Transform XML into DOT.
1025 * data/xslt/xml2text.xsl: Transform XML into plain text.
1026 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
1027 * data/Makefile.am (xsltdir): New variable.
1028 (dist_xslt_DATA): Add xslt/*.xsl files.
1029
1030 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
1031
1032 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
1033 Problem reported by Wojciech Polak.
1034 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
1035 (xml_printf): Undo change I made on 21 September; that is,
1036 indent 2 spaces, not 1.
1037
1038 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
1039
1040 Pacify ./configure --enable-gcc-warnings.
1041 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
1042 `char const *' instead of `char *'.
1043 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
1044 local variable `sep'.
1045
1046 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
1047
1048 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
1049 elsewhere.
1050 * src/print-xml.c: Prefer "const" after types; that's more consistent.
1051 (xml_printf): Indent just 1 space for level.
1052 (e_char, xlate_char): Remove.
1053 (xml_escape_string): Rewrite to avoid undefined behavior (used
1054 storage that was freed from the stack).
1055 (xml_escape_n): Don't bother checking for subscript error.
1056
1057 2007-09-21 Wojciech Polak <polak@gnu.org>
1058
1059 Add Bison XML Automaton Report.
1060
1061 Add support for an -x option to generate an XML report.
1062 It is not documented yet.
1063 * src/print-xml.c: New file.
1064 * src/print-xml.h: Likewise.
1065 * lib/timevar.def (TV_XML): New var.
1066 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
1067 * src/conflicts.c: Include print-xml.h.
1068 (solved_conflicts_xml_obstack): New var.
1069 (log_resolution, conflicts_solve, conflicts_free):
1070 Add support for XML report.
1071 (conflicts_output_val): New function.
1072 * src/conflicts.h (conflicts_output_val): New decl.
1073 * src/files.c (spec_xml_file): New var.
1074 (compute_output_file_names, output_file_names_free): Add XML support.
1075 * src/files.h (spec_xml_file): New decl.
1076 * src/getargs.c (xml_flag): New var.
1077 (usage, short_options, long_options, getargs): Add XML support.
1078 * src/getargs.h (xml_flag): New decl.
1079 * src/gram.c: Include print-xml.h.
1080 (rule_lhs_print_xml, rule_rhs_print_xml):
1081 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
1082 New functions.
1083 * src/gram.h: Declare external ones.
1084 * src/main.c: Include print-xml.h.
1085 (main): Add XML support.
1086 * src/reduce.c: Include print-xml.h.
1087 (reduce_xml): New function.
1088 * src/reduce.h: Declare it.
1089 * src/state.c: Include print-xml.h.
1090 (state_new): Add XML support.
1091 (state_rule_lookahead_tokens_print_xml): New function.
1092 * src/state.h: Declare it.
1093 (struct state): New member solved_conflicts_xml.
1094 * src/symtab.c (symbol_class_get_string): New function.
1095 * src/symtab.h: Declare it.
1096
1097 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
1098
1099 * GNUmakefile: Switch to coreutils's version.
1100 * bootstrap: Likewise.
1101 * Makefile.cfg: Adjust to new GNUmakefile.
1102 * README-hacking: Likewise.
1103
1104 Import from gnulib:
1105
1106 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
1107 Bruno Haible <bruno@clisp.org>
1108
1109 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
1110 and is a script that invokes bison. Tighten the code. Add comments.
1111
1112 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
1113
1114 Spell "boolean" as "Boolean". Reported by Akim Demaille.
1115 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
1116 * doc/bison.texinfo (Decl Summary): Fix.
1117 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
1118 * tests/input.at (Boolean %define variables): Update output.
1119 * tests/skeletons.at (%define boolean variables: invalid skeleton
1120 defaults): Rename to...
1121 (%define Boolean variables: invalid skeleton defaults): ... this and
1122 update output.
1123
1124 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
1125
1126 In impure push mode, don't allow more than one yypstate to be allocated
1127 since multiple impure parsers would corrupt yynerrs.
1128 * data/push.c (yypstate_allocated): New static global variable
1129 initialized to 0.
1130 (yypull_parse): If yypstate_new returns 0, don't report it as memory
1131 exhaustion if yypstate_allocated is 1, but still return 2.
1132 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
1133 already 1. Otherwise, set it to 1.
1134 (yypstate_delete): Set it to 0.
1135 * tests/push.at (Push Parsing: Multiple impure instances): New test
1136 case.
1137
1138 2007-08-17 Bob Rossi <bob@brasko.net>
1139
1140 * doc/bison.texinfo (Push Decl): Document the push parser.
1141 (Table of Symbols): Ditto.
1142 (Pure Decl): Ditto.
1143 (Decl Summary): Ditto.
1144 (Multiple Parsers, Push Parser Function, Pull Parser Function,
1145 Parser Create Function, Parser Delete Function):
1146 Add new push parser symbols.
1147 (Table of Symbols): Document push-parser, push-pull-parser,
1148 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
1149
1150 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
1151
1152 Update to GPLv3.
1153 * doc/gpl-3.0.texi: New file.
1154 * doc/gpl.texi: Remove.
1155 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
1156 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
1157 * README-hacking, TODO, bootstrap, bootstrap.conf:
1158 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
1159 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
1160 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
1161 * data/lalr1.cc, data/lalr1.java, data/location.cc:
1162 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
1163 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
1164 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
1165 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
1166 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
1167 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
1168 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
1169 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
1170 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
1171 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
1172 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
1173 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
1174 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
1175 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
1176 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
1177 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
1178 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
1179 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
1180 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
1181 * src/complain.c, src/complain.h, src/conflicts.c:
1182 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
1183 * src/files.h, src/flex-scanner.h, src/getargs.c:
1184 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
1185 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
1186 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
1187 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
1188 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
1189 * src/print.c, src/print.h, src/print_graph.c:
1190 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
1191 * src/reduce.h, src/relation.c, src/relation.h:
1192 * src/revision.h, src/scan-code.h, src/scan-code.l:
1193 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
1194 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
1195 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
1196 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
1197 * tests/Makefile.am, tests/actions.at, tests/c++.at:
1198 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
1199 * tests/existing.at, tests/glr-regression.at:
1200 * tests/headers.at, tests/input.at, tests/java.at:
1201 * tests/local.at, tests/output.at, tests/push.at:
1202 * tests/reduce.at, tests/regression.at, tests/sets.at:
1203 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
1204 * tests/torture.at:
1205 Update to GPLv3.
1206
1207 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1208
1209 Get rid of broken %no-parser, -n, and --no-parser implementation and
1210 documentation.
1211 * TODO: Don't mention them.
1212 * doc/bison.1: Likewise.
1213 * doc/bison.texinfo (Decl Summary): Likewise.
1214 (Bison Options): Likewise.
1215 (Option Cross Key): Likewise.
1216 * src/getargs.c (no_parser_flag): Remove global variable.
1217 (usage): Don't print description of -n and --no-parser.
1218 (long_options): Remove --no-parser entry here.
1219 (getargs): Remove -n case in the switch here.
1220 * src/getargs.h (no_parser_flag): Remove extern.
1221 * tests/regression.at (Web2c Actions): Remove comment that mentions
1222 --no-parser.
1223
1224 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1225
1226 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
1227 name user variables starting with `yy'. Just pass NULL instead of a
1228 dummy local &yylval to yypush_parse.
1229 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
1230 starting with `yy'.
1231
1232 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
1233
1234 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
1235 true since it's then always used regardless of whether yyoverflow is
1236 defined. Reported by Christian Burger at
1237 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
1238 * THANKS: Add Christian Burger.
1239
1240 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1241 node names: say "Decl Summary" not "Bison Declaration Summary".
1242
1243 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
1244
1245 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
1246 determine whether this function has already complained about an invalid
1247 value for a %define boolean variable, don't check whether Bison has
1248 ever examined the value. As written, the check was a tautology.
1249 Instead, record and check for this complaint using a separate muscle.
1250
1251 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1252
1253 Fix push parsing memory leak reported by Brandon Lucia at
1254 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
1255 * THANKS: Add Brandon Lucia.
1256 * data/push.c (yypstate_delete): Free the stack if it was reallocated
1257 but the parse never completed and thus freed it.
1258 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
1259 * tests/testsuite.at: Include push.at.
1260 * test/push.at: New.
1261 (Push Parsing: Memory Leak for Early Deletion): New test case.
1262
1263 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
1264
1265 Improve handling of multiple S/R conflicts in the same state and of S/R
1266 conflicts involving multiple reductions.
1267 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
1268 set for a state here or Bison will abort if it is reassigned on a
1269 later conflicted reduction in the same state.
1270 Similarly, don't finalize and assign the solved conflicts report here
1271 or it will be lost if it is reassigned on a later conflicted reduction
1272 in the same state.
1273 (set_conflicts): Instead, assign them both here after all S/R conflicts
1274 in the state have been fully examined.
1275 * src/print.c (shift_set): Rename to...
1276 (no_reduce_set): ... this.
1277 (print_reductions): Update for rename, and add %nonassoc error action
1278 tokens to no_reduce_set so that, when printing the first remaining
1279 reduction on an error action token, the reduction is enclosed in
1280 brackets.
1281 (print_results): Update for rename.
1282 * tests/conflicts.at (Solved conflicts report for multiple reductions
1283 in a state): New test case.
1284 (%nonassoc error actions for multiple reductions in a state): New test
1285 case.
1286
1287 * src/main.c (main): Don't depend on C99 features.
1288
1289 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1290
1291 * build-aux/.cvsignore: Add compile.
1292 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
1293 uniwidth.
1294
1295 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
1296
1297 * bootstrap (slurp): Create target directories that don't exist.
1298 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
1299
1300 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1301
1302 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
1303 than item number.
1304 * closure.c (closure): Likewise.
1305 * state.h (reductions): Comment sorting of rules.
1306 (state): Comment sorting of items.
1307
1308 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
1309
1310 Fix C++ test cases after recent Gnulib changes. Discussed starting at
1311 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
1312 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
1313 definition in order to avoid Gnulib headers since we don't use config.h
1314 here.
1315 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
1316 rather than AT_DATA so that config.h is included.
1317
1318 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
1319
1320 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
1321 instead of fprintf. Guard these functions with #if YYDEBUG instead of
1322 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
1323 and so that YYFPRINTF is guaranteed to be defined here.
1324
1325 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1326
1327 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
1328 with...
1329 (muscle_percent_define_check_values): ... this more helpful function.
1330 Again, it's not used yet, but it will be.
1331 * src/muscle_tab.h: Likewise.
1332
1333 Improve some comments in parser table construction.
1334 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
1335 (generate_states): Don't mention ruleset, which is internal to closure.
1336 * src/closure.c (closure): Explain sorting of core and itemset, which
1337 is required for this function to behave correctly.
1338 * src/closure.h (closure): Mention sorting.
1339
1340 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
1341
1342 * src/lalr.c (state_lookahead_tokens_count): For code readability,
1343 move the check for disabled transitions to an aver since conflict
1344 resolution hasn't happened yet.
1345
1346 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
1347 labels a state as inconsistent just because it has error transitions.
1348 The original form of this check appeared in revision 1.1 of lalr.c,
1349 which was committed on 1991-12-21. Now (at least), changing the
1350 consistency label on such a state appears to have no useful effect in
1351 any of the places it is examined, which I enumerate below. The key
1352 point to understanding each item in this enumeration is that a state
1353 with an error transition is labelled consistent in the first place only
1354 if it has no rules, so the check cannot matter for states that have
1355 rules. (1) Labelling a state as inconsistent will cause set_conflicts
1356 to try to identify its conflicts, and a state must have *rules* to have
1357 conflicts. (2) Labelling a state as inconsistent will affect how
1358 action_row sets the default *rule* for the state. (3) Labelling a
1359 state as inconsistent will cause build_relations to add lookback edges
1360 to *rules* in that state.
1361 * src/state.h (struct state): Word the comment for member consistent
1362 more carefully.
1363
1364 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1365
1366 Don't depend on C99 features.
1367 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
1368 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
1369 * src/reader.c (check_and_convert_grammar): Fix for-loop.
1370 * src/state.c (state_mark_reachable_states): Fix for-loop.
1371 (state_remove_unreachable_states): Fix for-loop.
1372
1373 Don't widen struct state with member reachable just to temporarily
1374 record reachability. Instead, use a local bitset.
1375 * src/state.h (struct state): Remove member.
1376 * src/state.c (state_new): Don't initialize it.
1377 (state_mark_reachable_states): Rename to...
1378 (state_record_reachable_states): ... this, and use bitset.
1379 (state_remove_unreachable_states): Use bitset.
1380
1381 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
1382
1383 * src/Makefile.am (yacc): Quote target action commands properly so
1384 that the yacc script isn't corrupt. Reported by Hans Aberg at
1385 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
1386
1387 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
1388 the case of pure parsers. Reported by Frans Englich at
1389 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
1390 * THANKS: Add Frans Englich.
1391
1392 * NEWS (2.3a+): In the %code entry, reference section `Bison
1393 Declaration Summary' from the manual now since the %code summary has
1394 moved there.
1395 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
1396 in the rules section must be terminated by semicolons.
1397
1398 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1399
1400 Extend the front-end API for %define variables to more completely
1401 mirror the back-end. This will be useful in the future.
1402 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
1403 Update comments to mention the new front-end counterparts of these
1404 macros.
1405 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
1406 for muscle_string_decode and muscle_location_decode.
1407 (muscle_string_decode): New static function.
1408 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
1409 (muscle_percent_define_get, muscle_percent_define_ifdef): New
1410 functions.
1411 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
1412 muscle_percent_define_get to mimic the b4_percent_define_flag_if
1413 implementation more closely.
1414 (muscle_percent_define_invalid_value): New function.
1415 * src/muscle_tab.h (muscle_percent_define_get,
1416 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
1417 Prototype.
1418
1419 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1420
1421 * NEWS (2.3a+): Mention yesterday's state-removal change.
1422 (2.3a): Remove the %language entry, which was added after 2.3a.
1423 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
1424 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
1425 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
1426 tests/existing.at: Update copyright date.
1427
1428 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1429
1430 If conflict resolution makes states unreachable, remove those states,
1431 report rules that are then unused, and don't report conflicts in those
1432 states.
1433 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
1434 New global function.
1435 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
1436 function.
1437 * src/main.c (main): After conflict resolution, remove the unreachable
1438 states and update all data structures that reference states by number.
1439 * src/state.c (state_new): Initialize each state's reachable member to
1440 false.
1441 (state_mark_reachable_states): New static function.
1442 (state_remove_unreachable_states): New global function.
1443 * src/state.h (struct state): Add member bool reachable.
1444 (state_remove_unreachable_states): Prototype.
1445 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1446 New test case.
1447 * tests/existing.at (GNU pic Grammar): Update test case output now that
1448 an unused rule is discovered.
1449
1450 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1451
1452 Minor code cleanup in parser table construction.
1453 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
1454 (new_itemsets, save_reductions): Update for rename to nitemset.
1455 * src/closure.c (nritemset): Rename to...
1456 (nitemset): ... this since the "r" appears to meaningless and isn't
1457 used in the comments.
1458 (closure): Update for rename.
1459 * src/closure.h (nritemset): Update extern to...
1460 (nitemset): ... this.
1461 * src/lalr.c (LA): Fix a typo in comments.
1462 * src/print.c (print_core): Update for rename to nitemset.
1463 * src/print_graph.c (print_graph): Likewise.
1464 * src/state.h: Fix some typos in header comments.
1465
1466 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
1467
1468 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
1469 still sticks to ASCII. Sorry!
1470
1471 * README-hacking: New file, taken mostly from coreutils, with changes
1472 for Bison. Contains much of the contents of:
1473 * README-cvs: Remove.
1474 * bootstrap: Sync from gnulib.
1475 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
1476 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
1477
1478 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
1479
1480 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
1481 Setzer.
1482 (Java Differences): Fix some typos.
1483 * THANKS: Add Sebastian Setzer.
1484
1485 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
1486
1487 * data/java.m4 (b4_single_class_if): Remove.
1488 (b4_abstract_if): Look at "%define abstract".
1489 (b4_lexer_if): New.
1490 (b4_union_name): Rename...
1491 (b4_yystype): ... to this. Map to "%define stype".
1492 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
1493 b4_maybe_throws): Fix quoting.
1494 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
1495 * data/lalr1.java (Lexer interface): Always define.
1496 (Lexer interface within parser class): Remove.
1497 (YYLexer class): New, used when "%code lexer" is present.
1498 (constructor): When "%code lexer" is used, pass %lex-param
1499 to the lexer constructor.
1500 (yylex, yyparse): Remove %lex-param from method invocations
1501 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
1502
1503 * doc/bison.texinfo (Java Bison Interface): Mention "%define
1504 abstract". Rename "%define union_name" to "%define stype".
1505 Rename method names according to previous patch.
1506 (Java Scanner Interface): Describe "%code lexer" instead of
1507 "%pure-parser" and "%define single_class".
1508 (Java Differences): Mention "%code lexer".
1509
1510 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
1511 Include scanner here, using macros from tests/local.at.
1512 (AT_DATA_CALC_Y): Remove final argument.
1513 (_AT_CHECK_JAVA_CALC): Likewise.
1514 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
1515 of %locations and %error-verbose.
1516 (main): Test with and without %lex-param.
1517 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
1518 (AT_BISON_OPTION_POPDEFS): Pop it.
1519
1520 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1521
1522 DJGPP spefic issue. Inhibit the use of disallowed characters for
1523 file name genertion on Win98, WinXP, etc. These are |<>":?*\
1524 and concern testsuite case 46.
1525 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
1526 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
1527 * djgpp/config.bat: Inhibit the use of disallowed characters.
1528
1529 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1530
1531 Miscellaneous %define and %code cleanup.
1532 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
1533 values are interpreted.
1534 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
1535 documentation a little more.
1536 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
1537 muscle_percent_define_insert, muscle_percent_code_grow): New
1538 functions/macros.
1539 * src/muscle_tab.h (muscle_percent_define_insert,
1540 muscle_percent_code_grow): Prototype.
1541 * src/parse-gram.y (prologue_declaration): Use
1542 muscle_percent_define_insert and muscle_percent_code_grow when parsing
1543 %define and %code directives.
1544
1545 Make it easy to share %define boolean variables between the front-end
1546 and back-end. Though not used yet, this will be useful in the future.
1547 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
1548 Bison uses of names rather than just skeleton uses of names.
1549 (b4_percent_define_get, b4_percent_define_ifdef): Rename
1550 b4_percent_define_skeleton_variables(VARIABLE) to
1551 b4_percent_define_bison_variables(VARIABLE).
1552 (b4_percent_code_get, b4_percent_code_ifdef): Rename
1553 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
1554 b4_percent_code_bison_qualifiers(QUALIFIER).
1555 (b4_check_user_names_wrap): Update for renames.
1556 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
1557 muscle_percent_define_default): New functions mimicking
1558 b4_percent_define_flag_if and b4_percent_define_default.
1559
1560 For %define variables, report locations for invalid values and
1561 redefinitions.
1562 * data/bison.m4 (b4_percent_define_flag_if): Read
1563 b4_percent_define_loc(VARIABLE) to report the location of an invalid
1564 value for VARIABLE.
1565 (b4_percent_define_default): Save a special location in
1566 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
1567 must later be reported as invalid.
1568 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
1569 functions.
1570 (muscle_percent_define_insert): Record the location of VARIABLE in
1571 muscle percent_define_loc(VARIABLE), and use it to report the previous
1572 location for a redefinition.
1573 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
1574 (muscle_percent_define_default): Update like b4_percent_define_default.
1575 (muscle_grow_user_name_list): Rename to...
1576 (muscle_user_name_list_grow): ... this for consistency and use
1577 muscle_location_grow.
1578 * src/muscle_tab.h (muscle_location_grow): Prototype.
1579 * tests/input.at (%define errors): Update expected output.
1580 * tests/skeletons.at (%define boolean variables: invalid skeleton
1581 defaults): New test case.
1582
1583 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
1584
1585 * src/print.c (lookahead_set, state_default_rule): Remove.
1586 (print_reductions): Replace state_default_rule invocation with
1587 equivalent use of yydefact, which was computed in token_actions in
1588 tables.c.
1589 (print_results): Don't allocate lookahead_set.
1590
1591 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
1592
1593 * data/lalr1.java: Prefix all private members with yy.
1594
1595 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
1596
1597 Use YYFPRINTF instead of fprintf where appropriate. Reported by
1598 Sebastien Fricker at
1599 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
1600 * THANKS: Add Sebastien Fricker.
1601 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
1602 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
1603 accept a variable number of arguments.
1604
1605 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1606
1607 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
1608
1609 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1610
1611 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
1612 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
1613 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
1614
1615 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
1616
1617 Undo my 2007-02-07 change, switching back to the c-strcase module
1618 introduced in the 2007-02-03 change. Bruno Haible reported that
1619 the 2007-02-07 change would be dangerous in Turkish if we add a
1620 language whose name contains "i", since "i" is not lowercase "I"
1621 in Turkish.
1622 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
1623 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
1624 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
1625 * m4/.cvsignore: Remove strcase.m4.
1626 * src/getargs.c: Revert 2007-02-07 change, as follows.
1627 Include c-strcase.h.
1628 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
1629
1630 2007-02-11 Bruno Haible <bruno@clisp.org>
1631
1632 Enable the Java related testsuite tests when the only Java compiler
1633 found is a gcj < 4.3. Discussed at
1634 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
1635 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
1636
1637 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
1638
1639 * data/Makefile.am: Update copyright date.
1640 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
1641 yypstate_new returns NULL.
1642 (yypstate_new): Return NULL if malloc does.
1643 * src/reader.c (packgram): Move translation of rule actions from the
1644 beginning of packgram to...
1645 (check_and_convert_grammar): ... here right before packgram is invoked
1646 so it's easier to write more complete comments, and remove redundant
1647 code.
1648
1649 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
1650
1651 As in semantic actions, make @$ in %initial-action, %destructor, and
1652 %printer imply %locations.
1653 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
1654 scanning @$.
1655 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
1656 (@$ in %initial-action implies %locations,
1657 @$ in %destructor implies %locations,
1658 @$ in %printer implies %locations): ... these new test cases.
1659
1660 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
1661
1662 Undo most of the 2007-02-03 change, switching to the strcase module
1663 now that gnulib strcase has been fixed.
1664 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
1665 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
1666 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
1667 * m4/.cvsignore: Add strcase.m4.
1668 * src/getargs.c: Revert 2007-02-03 change, as follows.
1669 Don't include c-strcase.h.
1670 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
1671 strcasecmp has "unspecified behavior" outside the POSIX locale,
1672 but it works fine in practice if at least one argument is ASCII,
1673 as is the case in Bison.
1674
1675 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
1676
1677 * tests/java.at: Skip tests if only one of javac/java is present.
1678 Reported by Joel E. Denny.
1679 * tests/atlocal.in: Adjust copyright years.
1680
1681 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1682
1683 * data/lalr1.java (Stack): Work around old verifiers that disallow
1684 access to the private fields of an inner class, from the outer class.
1685 We can make Stack's fields public because user code doesn't have access
1686 to the instance of Stack used by parse(). Reported by Paul Eggert.
1687
1688 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
1689
1690 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
1691 the right spot for these files?
1692 * bootstrap.conf (gnulib_modules): Add c-strcase.
1693 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
1694 c-strncasecmp.c.
1695 * src/getargs.c: Include c-strcase.h.
1696 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
1697 to avoid unspecified behavior.
1698
1699 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
1700
1701 * doc/bison.texinfo (Decl Summary): Correct typo.
1702
1703 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
1704
1705 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
1706 Complain if the value does not match empty, "true" or "false".
1707 * data/c++.m4: Adjust default definitions of %define variables.
1708 * data/java.m4: Adjust default definitions of %define variables.
1709 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
1710 to above behavior.
1711 * tests/input.at (Boolean %define variables): Test new behavior.
1712
1713 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
1714
1715 * NEWS: Mention java.
1716 * TODO: Remove things that are done.
1717 * bootstrap.conf: Add javacomp-script and javaexec-script.
1718 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
1719
1720 * data/Makefile.am: Add new files.
1721 * data/java-skel.m4: New.
1722 * data/java.m4: New.
1723 * data/lalr1.java: New.
1724
1725 * doc/bison.texinfo: Put "A Complete C++ Example" under
1726 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
1727 under Other Languages.
1728
1729 * src/getargs.c (valid_languages): Add Java.
1730 * src/getargs.h (struct bison_language): Update size of string fields.
1731
1732 * tests/Makefile.am: Add java.at.
1733 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
1734 * tests/java.at: New.
1735 * tests/testsuite.at: Include it.
1736
1737 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
1738
1739 Clean up.
1740 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
1741 at_directive_argv arguments so these no longer have to be global
1742 variables. Also, update the implementation for the following changes.
1743 (fail_for_at_directive_too_many_args,
1744 fail_for_at_directive_too_few_args): Add at_directive_name argument.
1745 (at_directive_name): Remove as at_directive_argv[0] will be used for
1746 this now.
1747 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
1748 for the directive name.
1749 (at_directive_argc, at_directive_argv): Make these local within
1750 skel_lex instead of global.
1751 (INITIAL): Update directive start action for above changes.
1752 (SC_AT_DIRECTIVE_ARG): Rename to...
1753 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
1754 (SC_AT_DIRECTIVE_SKIP_WS): Update.
1755 (scan_skel): Move yylex_destroy to...
1756 (skel_scanner_free): ... here.
1757 * tests/skeletons.at (installed skeleton file name): Rename to...
1758 (installed skeleton file names): ... this.
1759
1760 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
1761
1762 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1763 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
1764 Summary" not "Directives".
1765 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
1766 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
1767 since the former is now the more complete one.
1768 (Prologue Alternatives): Likewise and do the same for %defines.
1769 (Table of Symbols): Add summary of %code, add summary of %define, and
1770 move full %code documentation to...
1771 (Decl Summary): ... here for consistency with other entries in these
1772 sections.
1773 Move %define entry in order to keep this list alphabetized.
1774 Reword %define entry a little to put less emphasis on the skeleton
1775 concept, which most users shouldn't have to think about.
1776
1777 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
1778
1779 Adjust to recent gnulib changes.
1780 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
1781 Add string.h, string_.h, unistd_.h, wchar_.h.
1782 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
1783 * src/system.h: Don't include <stpcpy.h>; this is now done by
1784 <string.h>.
1785
1786 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
1787
1788 Simplify implementation of unqualified %code, implement macros for
1789 uniform treatment of boolean %define flags. Document %define.
1790 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
1791 b4_percent_code_ifdef): New.
1792 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
1793 * data/c++.m4: Define default value for global_tokens_and_yystype.
1794 * data/glr.cc: Likewise.
1795 * data/location.cc: Use b4_percent_define_flag_if.
1796
1797 * doc/bison.texinfo (Decl Summary): Document %define.
1798
1799 * src/parse-gram.y (Unqualified %code): Change muscle name to
1800 b4_percent_code().
1801 (content.opt): Default to empty.
1802
1803 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1804
1805 Implement support for relative and absolute skeleton file names.
1806 Discussed starting at
1807 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
1808 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
1809 (Bison Options): Document in --skeleton entry.
1810 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
1811 full_skeleton can't necessarily hold all of pkgdatadir.
1812 If the specified skeleton file name contains a `/', don't prepend
1813 pkgdatadir.
1814 * src/parse-gram.y (prologue_declaration): If the specified skeleton
1815 file name contains a `/', prepend the grammar file directory.
1816 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
1817 * skeletons.at: New file.
1818 (relative skeleton file names): New test case.
1819 (installed skeleton file names): New test case.
1820 * tests/testsuite.at: Include skeletons.at.
1821
1822 * bootstrap: Update copyright to 2007.
1823
1824 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
1825
1826 * bootstrap: Remove occurrences of .#bootmp from the files.
1827
1828 2007-01-17 Akim Demaille <akim@epita.fr>
1829
1830 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1831 nonterminals.
1832 Use per-type %printer.
1833
1834 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1835
1836 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1837 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1838 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1839 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1840 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1841 tests/glr-regression.at, tests/input.at, tests/local.at,
1842 tests/output.at, tests/torture.at: Update copyright to 2007.
1843
1844 2007-01-16 Akim Demaille <akim@epita.fr>
1845
1846 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1847 error code.
1848 (Calc++ Scanner): Exit with failure if we can't open the input
1849 file.
1850 Accept "-" standing for stdin.
1851 (Calc++ Top Level): Print the result only if the parsing was
1852 successful.
1853
1854 2007-01-16 Akim Demaille <akim@epita.fr>
1855
1856 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1857
1858 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
1859 and Joel E. Denny <jdenny@ces.clemson.edu>
1860
1861 Clean up %define and %code implementation in M4 some. Most
1862 importantly, rename all related macros to be in the b4_percent_define
1863 and b4_percent_code namespaces. Also, complete support for `.' in
1864 %define variable names and %code qualifiers.
1865 * data/bison.m4 (b4_check_user_names): Check for special
1866 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1867 m4_foreach loops.
1868 (b4_get_percent_define, b4_get_percent_code): Rename to...
1869 (b4_percent_define_get, b4_percent_code_get): ... these.
1870 Extend documentation with examples.
1871 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1872 b4_percent_define_skeleton_variables and
1873 b4_percent_code_skeleton_qualifiers.
1874 Expect any value for the %define variable `foo' to be stored in the
1875 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1876 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1877 expect any unqualified %code blocks to be stored in a macro named
1878 `b4_percent_code_unqualified'.
1879 Use m4_indir so that %define variable names and %code qualifiers can
1880 contain `.', which is allowed by the grammar parser.
1881 (b4_percent_define_default): New macro to set a default value for a
1882 %define variable.
1883 (m4_wrap): Update wrapped code, and fix some underquoting.
1884 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1885 Expect grammar uses of %define variables and %code qualifiers to be
1886 defined in b4_percent_define_user_variables and
1887 b4_percent_code_user_qualifiers.
1888 * data/c++.m4: Use b4_percent_define_default rather than
1889 m4_define_default. Fix some underquoting. Skeleton usage of %define
1890 variable define_location_comparison now implies skeleton usage of
1891 %define variable filename_type.
1892 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1893 data/push.c, data/yacc.c: Update macro names.
1894 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1895 muscle names.
1896
1897 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1898
1899 DJGPP specific issues.
1900
1901 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1902 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1903
1904 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1905
1906 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1907 run parsers in all tests so that Valgrind is invoked during
1908 maintainer-check-valgrind.
1909 (Duplicate representation of merged trees): Free all semantic values.
1910 (Duplicated user destructor for lookahead): Likewise.
1911
1912 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1913
1914 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1915 command-line prefix.
1916 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1917 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1918 miss Valgrind messages.
1919 (Exploding the Stack Size with Malloc): Likewise.
1920
1921 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1922
1923 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1924 locals. Reported by Juan Manuel Guerrero at
1925 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1926 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1927 Fix some indentation also.
1928 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1929 explaining this issue.
1930
1931 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
1932 and Joel E. Denny <jdenny@ces.clemson.edu>
1933
1934 Simplify union and prologue handling, and escape union and lex/parse
1935 params with digraphs.
1936 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1937 values to the empty string since these are no longer guaranteed
1938 initialized by the front-end.
1939 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1940 braces around b4_user_stype since this is no longer done by the
1941 front-end.
1942 * src/files.c, src/files.h (pre_prologue_obstack,
1943 post_prologue_obstack): Remove.
1944 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1945 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1946 with digraphs. This fixes lex params and parse params.
1947 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1948 * src/output.c (prepare): Remove muscle insertion of the prologues.
1949 (output): Remove freeing of pre_prologue_obstack and
1950 post_prologue_obstack.
1951 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1952 than prologue_augment for prologue parsing so you don't need prologue
1953 obstacks.
1954 (grammar_declaration): For %union RHS, use `braceless' instead of
1955 "{...}" so that braces are already stripped and code is escaped with
1956 digraphs.
1957 * src/reader.c (prologue_augment): Remove.
1958 (reader): Remove initialization of pre_prologue_obstack and
1959 post_prologue_obstack.
1960 * src/reader.h (prologue_augment): Remove.
1961
1962 * data/c.m4: Remove stray parenthesis.
1963
1964 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1965
1966 Remove quotes from variables names in %define directives and from
1967 qualifiers in %code directives, and restrict the characters that are
1968 allowed in them to M4-friendly ones. For %define, continue to support
1969 the quoted form as a deprecated feature. Discussed starting at
1970 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1971 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1972 %code.
1973 * doc/bison.texinfo (Prologue Alternatives): Update.
1974 (Decl Summary): In %defines entry, update mention of `%code requires'
1975 and `%code provides'.
1976 (C++ Location Values): Update %define uses.
1977 (Calc++ Parser Interface): Likewise.
1978 (Calc++ Parser): Likewise, and update `%code requires' uses.
1979 (Table of Symbols): Update %code documentation.
1980 * src/parse-gram.y (prologue_declaration): For %define variables, use
1981 `variable' instead of `STRING'.
1982 (grammar_declaration): For %code qualifiers, use `ID' instead of
1983 `STRING'.
1984 (variable): New nonterminal that takes an `ID' or a `STRING'.
1985 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1986 and %define uses.
1987 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1988 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1989 (%define errors): Update %define uses.
1990
1991 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1992
1993 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1994 instead of muscle_insert for %define values so that M4-special
1995 characters are replaced with digraphs.
1996 * tests/input.at (%define errors): Extend to check weird values.
1997
1998 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1999
2000 Instead of having skeletons declare all valid %define variables and
2001 %code qualifiers, provide macros that retrieve the associated values
2002 and build these lists automatically. Thus Bison will now warn when a
2003 variable or qualifier is not used by the skeleton in the current
2004 invocation regardless of whether it might sometimes be used by that
2005 skeleton in other invocations. Also, move all %define value macros to
2006 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
2007 form, which is replaced by %code.
2008 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
2009 (b4_check_user_names): ... this, and change the series of valid name
2010 arguments to a single list argument for names used in the skeleton
2011 similar to the existing list argument for names used in the grammar.
2012 Warn instead of complaining.
2013 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
2014 values and %code code, to format %code code properly, and to build
2015 lists of all %define variables and %code qualifiers used in the
2016 skeleton: b4_skeleton_percent_define_variables and
2017 b4_skeleton_percent_code_qualifiers.
2018 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
2019 Remove, and...
2020 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
2021 the skeleton names lists can finish building first. In place of
2022 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
2023 expect the lists b4_user_percent_define_variables and
2024 b4_user_percent_code_qualifiers.
2025 * data/c++.m4: Where setting default values for b4_parser_class_name,
2026 b4_location_type, b4_filename_type, b4_namespace, and
2027 b4_define_location_comparison, update their names to the
2028 b4_percent_define_ namespace.
2029 * data/glr.c: Don't use b4_check_percent_define_variables and
2030 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
2031 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
2032 (b4_parser_class_name, b4_namespace): Define these using
2033 b4_get_percent_define for parser_class_name and namespace.
2034 * data/location.cc: Use b4_get_percent_define.
2035 * data/push.c: Don't use b4_check_percent_define_variables and
2036 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
2037 * data/yacc.c: Likewise, and don't call m4_exit in
2038 b4_use_push_for_pull_if or m4_wrap code will never execute.
2039 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
2040 Rename to...
2041 (muscle_grow_user_name_list): ... this for consistency with the
2042 terminology used in bison.m4.
2043 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
2044 %define variable names, and rename muscle used_percent_define_variables
2045 to user_percent_define_variables.
2046 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
2047 user_percent_code_qualifiers.
2048 (content): Remove.
2049 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
2050 {CODE} form is no longer accepted.
2051 * tests/input.at (Reject bad %code qualifiers): Rename to...
2052 (Reject unused %code qualifiers): ... this, and update test output.
2053 (%define error): Update test output.
2054
2055 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
2056
2057 Check for unrecognized %define variables similar to checking for
2058 unrecognized %code qualifiers. Check for redefined %define variables.
2059 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
2060 generalizes...
2061 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
2062 (b4_check_percent_define_variables): New, also wraps it.
2063 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
2064 variables using b4_check_percent_define_variables.
2065 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
2066 all those exercised in the test suite and all those listed in the
2067 `Default values' section of c++.m4. Are there others?
2068 * data/push.c, data/yacc.c: Declare no valid %define variables.
2069 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
2070 similar to muscle_find, but it works even when the muscle stores a
2071 const value.
2072 (muscle_grow_used_name_list): New function for constructing the used
2073 name list muscles that b4_check_for_unrecognized_names requires.
2074 * src/parse-gram.y (prologue_declaration): Warn if a variable is
2075 %define'd more than once. Define the b4_used_percent_define_variables
2076 muscle with muscle_grow_used_name_list.
2077 (grammar_declaration): Abbreviate %code code with
2078 muscle_grow_used_name_list.
2079 * tests/input.at (%define errors): New.
2080
2081 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2082
2083 Provide warn_at, complain_at, and fatal_at function callbacks to the
2084 skeletons, and use this for %code qualifier complaints.
2085 * data/bison.m4 (b4_error_at): New, invoked by...
2086 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
2087 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
2088 @fatal_at(...@) directives.
2089 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
2090 qualifiers in b4_used_percent_code_qualifiers and to use
2091 b4_complain_at.
2092 * src/location.c, src/location.h (boundary_set_from_string): New global
2093 function.
2094 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
2095 function.
2096 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
2097 to b4_used_percent_code_qualifiers.
2098 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
2099 function.
2100 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
2101 (lineno): Rename to...
2102 (out_lineno): ... this so I don't misunderstand it again.
2103 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
2104 here; these newlines are in the input but not the output file.
2105 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
2106 (at_directive_perform): ... this new static function, and add handling
2107 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
2108 directives.
2109 * tests/input.at (Reject bad %code qualifiers): Update test output with
2110 locations and extend.
2111
2112 * tests/output.at (Output file name: [, Output file name: ]): Remove
2113 bogus comment about these tests failing.
2114
2115 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2116
2117 Clean up b4_check_percent_code_qualifiers a little.
2118 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
2119 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
2120 documentation and add examples.
2121 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
2122 qualifiers here.
2123
2124 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2125
2126 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
2127 unreliable -- especially when they're hidden inside another macro.
2128 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
2129 data/c.m4: Remove m4_divert(-1).
2130 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2131 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
2132 m4_divert_push(0) and m4_divert_pop(0).
2133 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
2134 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
2135 pushed and popped by m4sugar, should be first on the stack.
2136
2137 Provide warn, complain, and fatal function callbacks to the skeletons.
2138 This provides more flexibility than m4_fatal, improves the error
2139 message format, and captures messages for translation. Discussed
2140 starting at
2141 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
2142 * data/bison.m4 (b4_error): New, invoked by...
2143 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
2144 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
2145 directives. Because these M4 macros might be called when the current
2146 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
2147 the previous removal of uses of m4_divert, which caused trouble.
2148 (b4_check_percent_code_qualifiers): Use b4_complain instead of
2149 m4_fatal to report unrecognized %code qualifiers.
2150 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
2151 push parser requests.
2152 * data/glr.c: Use b4_complain instead of m4_fatal to report
2153 non-deterministic push parser requests.
2154 Update @output usage to @output(...@) form.
2155 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
2156 report missing %defines. Update @output usage to @output(...@) form.
2157 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
2158 @output(...@) form.
2159 * src/main.c (main): Invoke skel_scanner_free.
2160 * src/scan-skel.h (skel_scanner_free): Prototype new function.
2161 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
2162 obstack_for_string from flex-scanner.h.
2163 (YY_DECL): Use to declare skel_lex static.
2164 (decode_at_digraphs): Remove; now handled in the new
2165 SC_AT_DIRECTIVE_ARG start condition.
2166 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
2167 functions.
2168 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
2169 at_directive_argv): New static globals.
2170 (INITIAL): Use fail_for_invalid_at.
2171 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
2172 recognize the start of a generalized `@directive(...@)' form and
2173 start...
2174 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
2175 directive args (using the new obstack_for_string), to decode the
2176 contained @ diagraphs, and to perform the directive. It recognizes
2177 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
2178 @output(...@).
2179 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
2180 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
2181 `@,'.
2182 (scan_skel): Initialize obstack_for_string on the first call.
2183 (skel_scanner_free): New function to free obstack_for_string.
2184 * tests/input.at (Reject bad %code qualifiers): Update test output.
2185
2186 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
2187
2188 Consolidate the 4 prologue alternative directives (%code, %requires,
2189 %provides, and %code-top) into a single %code directive with an
2190 optional qualifier field. Discussed at
2191 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
2192 * NEWS (2.3a+): Rewrite the existing entry for the prologue
2193 alternatives.
2194 * doc/bison.texinfo (Prologue Alternatives): Update.
2195 (Decl Summary): Update to %code "requires" and %code "provides".
2196 (Calc++ Parser): Update to %code "requires".
2197 (Table of Symbols): Remove entries for %requires, %provides, and
2198 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
2199 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
2200 are replaced by b4_percent_code_provides and b4_percent_code_requires,
2201 which are skeleton-specific.
2202 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
2203 declare what %code qualifiers it supports and to complain if any other
2204 qualifiers were used in the grammar.
2205 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
2206 and b4_user_code([b4_percent_code_provides]) in place of
2207 b4_user_requires and b4_user_provides.
2208 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
2209 Add b4_user_code([b4_percent_code_top]) and
2210 b4_user_code([b4_percent_code]).
2211 Invoke b4_check_percent_code_qualifiers.
2212 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2213 PERCENT_REQUIRES): Remove.
2214 (grammar_declaration): Remove RHS's for %code-top, %provides, and
2215 %requires. Rewrite the %code RHS as the unqualified form defining the
2216 muscle b4_percent_code. Add another RHS for the qualified %code form,
2217 which defines muscles of the form b4_percent_code_QUALIFIER and the
2218 b4_used_percent_code_qualifiers muscle.
2219 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2220 PERCENT_REQUIRES): Remove.
2221 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
2222 %code "requires" and %code "provides".
2223 * tests/input.at (Reject bad %code qualifiers): New.
2224
2225 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2226
2227 Use the new code_props interface for destructors and printers.
2228 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
2229 printer_location members, and change the type of the destructor and
2230 printer members to code_props.
2231 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
2232 symbol_printer_get, semantic_type_destructor_set,
2233 semantic_type_printer_set, default_tagged_destructor_set,
2234 default_tagless_destructor_set, default_tagged_printer_set,
2235 default_tagless_printer_set): Use code_props in arguments and return
2236 types in place of char const * and location.
2237 (symbol_destructor_location_get, symbol_printer_location_get): Remove
2238 since the locations are now contained in the return of
2239 symbol_destructor_get and symbol_printer_get.
2240 * src/output.c (symbol_destructors_output, symbol_printers_output):
2241 Replace with...
2242 (symbol_code_props_output): ... this to eliminate duplicate code.
2243 (output_skeleton): Update to use symbol_code_props_output.
2244 * src/reader.c (symbol_should_be_used): Update use of
2245 symbol_destructor_get.
2246 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2247 Update uses of the various _destructor_set and _printer_set functions.
2248 * src/symtab.c: (default_tagged_destructor_location,
2249 default_tagless_destructor_location, default_tagged_printer_location,
2250 default_tagless_printer_location): Remove since we...
2251 (default_tagged_destructor, default_tagless_destructor,
2252 default_tagged_printer, default_tagless_printer): ... change the type
2253 of these to code_props.
2254 (symbol_new, semantic_type_new, symbol_destructor_set,
2255 semantic_type_destructor_set, symbol_destructor_get,
2256 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
2257 symbol_check_alias_consistency, default_tagged_destructor_set,
2258 default_tagless_destructor_set, default_tagged_printer_set,
2259 default_tagless_printer_set): Update.
2260 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
2261 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
2262 code_props members.
2263 (symbol_print): Use SYMBOL_CODE_PRINT.
2264
2265 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2266
2267 Use the new code_props interface for rule actions.
2268 * src/symlist.h (symbol_list): Replace action, action_location, and
2269 used members with a code_props action_props member.
2270 * src/reader.c (symbol_should_be_used, grammar_rule_check,
2271 grammar_midrule_action, grammar_current_rule_merge_set,
2272 grammar_current_rule_symbol_append, packgram): Update.
2273 * src/scan-code.h (translate_rule_action): Remove, no longer used.
2274 * src/scan-code.l (handle_action_dollar): Update.
2275 (translate_rule_action): Remove, no longer used.
2276 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
2277
2278 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2279
2280 Use the new code_props interface in parse-gram.y.
2281 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
2282 Update all uses of translate_* functions to use the new code_props
2283 interface and to use gram_scanner_last_string_free and
2284 code_scanner_last_string_free where possible.
2285 (grammar_declaration): symbol_list_destructor_set and
2286 symbol_list_printer_set now perform the translation, so don't do it
2287 here. Use gram_scanner_last_string_free where possible.
2288 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
2289 translate_code): Remove, no longer used.
2290 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
2291 symbol_list_printer_set): Perform code translation here rather than
2292 depending on the caller to do so.
2293
2294 * src/symlist.h (struct symbol_list): Correct some documentation typos.
2295 * src/scan-gram.h (gram_last_string): Remove declaration.
2296 * src/scan-gram.l (last_string): Declare it static.
2297
2298 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2299
2300 Encapsulate code properties and related functionality for the various
2301 destructors, printers, and actions into a code_props structure and
2302 interface. This patch merely implements code_props in scan-code.h and
2303 scan-code.l. Future patches will rewrite other modules to use it.
2304 Discussed starting at
2305 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
2306 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
2307 consistently initialize const structs that have an empty location
2308 field.
2309 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
2310 to ensure consistency.
2311 * src/scan-code.h (code_props): New structure.
2312 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
2313 function, macro, and const global variable for initializing a
2314 code_props with no code.
2315 (code_props_plain_init, code_props_symbol_action_init,
2316 code_props_rule_action_init, code_props_translate_code): The rest of
2317 the new code_props functional interface. Among other things, the init
2318 functions set the code_props kind field so that
2319 code_props_translate_code will know whether to behave like
2320 translate_symbol_action, translate_rule_action, or translate_code.
2321 These old translate functions must remain until all other modules are
2322 updated to use the new code_props interface.
2323 (code_scanner_last_string_free): New function similar to
2324 gram_scanner_last_string_free.
2325 (code_scanner_free): Add documentation.
2326 * src/scan-code.l: Implement the new interface.
2327 (code_lex): Make it static, add a code_props* argument, and remove the
2328 rule argument.
2329 (last_string): New static global similar to the one in scan-gram.l.
2330 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
2331 instead of rule.
2332 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
2333 code_props since Bison may one day use this information for destructors
2334 and printers.
2335 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
2336 (handle_action_dollar): Use symbol_list_n_get and set used flag
2337 directly since symbol_list_n_used_set is removed.
2338 (translate_action): Add a code_props* argument and remove the rule,
2339 action, and location arguments. Pass the code_props* on to code_lex.
2340 (translate_rule_action, translate_symbol_action, translate_code):
2341 Rewrite as wrappers around the new code_props interface.
2342 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
2343 it would eventually need to break the encapsulation of code_props.
2344
2345 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2346
2347 * etc/.cvsignore: New.
2348
2349 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2350
2351 Add maintainer-push-check to run maintainer-check using push parsing in
2352 place of pull parsing where available.
2353 * Makefile.am (maintainer-push-check): New.
2354 * data/bison.m4 (b4_use_push_for_pull_if): New.
2355 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
2356 appropriately based on their existing values.
2357 (yypush_parse): Don't print push-parser-specific diagnostics if push
2358 parsing is being used in place of pull parsing.
2359 * data/yacc.c: If push parsing should replace pull parsing, redirect to
2360 push.c.
2361 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
2362 variable, and insert b4_use_push_for_pull_flag into muscles.
2363 * tests/Makefile.am (maintainer-push-check): New.
2364
2365 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2366
2367 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
2368 (whether successful or failed) so that yypush_parse can be invoked
2369 again to start a new parse using the same yypstate.
2370 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
2371 check multiple yypull_parse invocations on the same yypstate. For pull
2372 mode, extend to check multiple yyparse invocations.
2373 (Exploding the Stack Size with Alloca): Extend to try with
2374 %push-pull-parser.
2375 (Exploding the Stack Size with Malloc): Likewise.
2376
2377 * tests/calc.at (Simple LALR Calculator): Don't specify
2378 %skeleton "push.c" since %push-pull-parser implies that now.
2379 * tests/headers.at (export YYLTYPE): Don't check for the push
2380 declarations. Otherwise, this test case can't be used to see if push
2381 mode can truly emulate pull mode.
2382 * tests/input.at (Torturing the Scanner): Likewise.
2383 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
2384 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
2385 AT_YACC_IF, which now includes the case of push mode since %skeleton
2386 need not be used for push mode. This will be more intuitive once
2387 push.c is renamed to yacc.c.
2388
2389 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2390
2391 For push mode, convert yyparse from a macro to a function, invoke yylex
2392 instead of passing a yylexp argument to yypull_parse, and don't
2393 generate yypull_parse or yyparse unless %push-pull-parser is declared.
2394 Discussed starting at
2395 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
2396 * data/bison.m4 (b4_pull_if): New.
2397 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
2398 * data/push.c: Improve M4 quoting a little.
2399 (b4_generate_macro_args, b4_parenthesize): Remove.
2400 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
2401 any time a pull parser is requested.
2402 Don't #define this as a wrapper around yypull_parse. Instead, when
2403 both push and pull are requested, make it a function that does that
2404 same thing.
2405 (yypull_parse): If there's a b4_prefix, #define this to
2406 b4_prefix[pull_parse] when both push and pull are requested.
2407 Don't define this as a function unless both push and pull are
2408 requested.
2409 Remove the yylexp argument and hard-code yylex invocation instead.
2410 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
2411 %push-parser.
2412 * src/getargs.c (pull_parser): New global initialized to true.
2413 * getargs.h (pull_parser): extern it.
2414 * src/output.c (prepare): Insert pull_flag muscle.
2415 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
2416 (prologue_declaration): Set both push_parser and pull_parser = true for
2417 %push-pull-parser. Set push_parser = true and pull_parser = false for
2418 %push-parser.
2419 * src/scan-gram.l: Don't accept %push_parser as an alternative to
2420 %push-parser since there's no backward-compatibility concern here.
2421 Scan %push-pull-parser.
2422 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
2423 instead of %push-parser.
2424 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
2425 prototype it in the module that calls yyparse.
2426 * tests/input.at (Torturing the Scanner): Likewise.
2427 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
2428
2429 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
2430
2431 Update etc/bench.pl. Optimize push mode a little (the yyn change
2432 deserves most of the credit).
2433 * Makefile.am (SUBDIRS): Add etc subdirectory.
2434 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
2435 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
2436 yytoken, yyval, and yyloc declarations to...
2437 (yyparse or yypush_parse): ... here to improve performance. For
2438 yypush_parse invocations after the first, be sure to assign yyn its old
2439 value again.
2440 (yypstate_new): Don't bother initializing the yyresult field since the
2441 initial value isn't used.
2442 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
2443 remove the #define that, in push mode, set it to yyps->NAME.
2444 * etc/Makefile.am: New.
2445 * etc/bench.pl: Remove and build it instead from...
2446 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
2447 "tests/bison" from the build directory by default rather than just
2448 invoking "bison" from $PATH.
2449 (calc_grammar): Update push parser code: don't declare yylval globally,
2450 don't define yyparse_wrapper, and don't #define yyparse.
2451 (bench_grammar): Update to check all working combinations of yacc.c,
2452 push.c, impure, pure, pull, and push.
2453
2454 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2455
2456 For push mode, add pull wrappers around yypush_parse.
2457 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
2458 (yypull_parse): New function wrapping yypush_parse.
2459 (yyparse): New #define wrapping yypull_parse.
2460 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
2461 is declared.
2462 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
2463 prototype yylex in the module that calls yyparse, and don't prototype
2464 yyparse there. Otherwise, the yyparse expansion won't compile.
2465 * tests/input.at (Torturing the Scanner): Likewise.
2466
2467 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2468
2469 Enable push parsers to operate in impure mode. Thus, %push-parser no
2470 longer implies %pure-parser. The point of this change is to move
2471 towards being able to test the push parser code by running the entire
2472 test suite as if %push-parser had been declared.
2473 * data/push.c (yypush_parse): For impure mode, remove the
2474 yypushed_char, yypushed_val, and yypushed_loc arguments.
2475 Instead, declare these as local variables initialized to the global
2476 yychar, yylval, and yylloc.
2477 For the first yypush_parse invocation only, restore the initial values
2478 of these global variables when it's time to read a token since they
2479 have been overwritten.
2480 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
2481 %push-parser.
2482 * tests/calc.at (Simple LALR(1) Calculator): Always declare
2483 %pure-parser along with %push-parser since this test case was designed
2484 for pure push parsers.
2485 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
2486 (AT_YACC_OR_PUSH_IF): New.
2487 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
2488 add a note that it's still wrong for some cases (as it has been for a
2489 while).
2490 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
2491 %push-parser no longer implies %pure-parser.
2492
2493 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2494
2495 Remove some unnecessary differences between the pull parser code and
2496 the push parser code. This patch enables yynerrs in push mode.
2497 * data/push.c: Reformat M4 a little.
2498 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
2499 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
2500 because push mode is on. Instead, if pure mode is on, move yynerrs
2501 to...
2502 (b4_declare_parser_state_variables): ... here.
2503 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
2504 to yyps->NAME so it can be used in yypush_parse.
2505 (yypush_parse): Don't omit uses of yynerrs in push mode.
2506
2507 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2508
2509 Fix bug such that the first pushed token's value and location are
2510 sometimes overwritten (sometimes by %initial-action) before being used.
2511 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
2512 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
2513 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
2514 more closely mimic the pull parser logic.
2515 Don't copy the pushed token to yychar, yylval, and yylloc until it's
2516 time to read a token, which is after any initialization of yylval and
2517 yylloc.
2518 (gottoken): Rename label to...
2519 (yyread_pushed_token): ... for clarity and to avoid infringing on the
2520 user namespace.
2521
2522 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2523
2524 Rearrange initialization of the parser state variables so that the
2525 skeleton doesn't have to have a copy for pull mode and another for push
2526 mode. This patch also fixes at least a bug such that yylloc was not
2527 initialized (with b4_location_initial_line and
2528 b4_location_initial_column) upon calling yypush_parse. However, that
2529 initialization now overwrites the first token's location;
2530 %initial-action assigning @$ already did the same thing, and both bugs
2531 will be fixed in a later patch.
2532 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
2533 (b4_declare_parser_state_variables): Remove initialization of yytoken,
2534 yyss, yyvs, yyls, and yystacksize.
2535 (yypstate_new): Remove initialization of some yypstate fields: yystate,
2536 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
2537 yylsp.
2538 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
2539 yyps->NAME so it can be used in yypush_parse.
2540 (yyparse or yypush_parse): For yypush_parse, don't print the
2541 "Starting parse" diagnostic for invocations after the first.
2542 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
2543 yypush_parse, only do it for the first invocation.
2544 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
2545 initialization to occur in yypush_parse but only on the first
2546 invocation.
2547
2548 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2549
2550 * data/push.c: Add CPP guards around push parser declarations in both
2551 the header and the code file.
2552 In the code file, move the push parser declarations to the same place
2553 they appear in the header file.
2554 Clean up the M4 some, especially the inconsistent underquoting in
2555 some b4_c_function_def and b4_c_function_decl uses.
2556
2557 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2558
2559 Encapsulate the push parser state variables into an M4 macro so the
2560 push skeleton doesn't have to list them again for pull mode's yyparse.
2561 For push mode, remove yypush_parse's local equivalents of these
2562 variables to eliminate unnecessary copying between the two sets at
2563 run-time. This patch also fixes at least a bug related to multiple
2564 %initial-action invocations in push mode.
2565 * data/push.c (b4_declare_parser_variables): Rename to...
2566 (b4_declare_scanner_communication_variables): ... this for clarity and
2567 update both uses.
2568 (b4_declare_yyparse_variables): Remove and move its contents to the one
2569 spot where it was invoked.
2570 (b4_declare_parser_state_variables): New macro containing the parser
2571 state variables required by push mode.
2572 (struct yypstate): Replace all fields but yynew with
2573 b4_declare_parser_state_variables.
2574 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
2575 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
2576 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
2577 (yyparse or yypush_parse): For yyparse in pull mode, replace local
2578 parser state variable declarations with
2579 b4_declare_parser_state_variables.
2580 Don't initialize parser state variables when calling yypush_parse since
2581 yypstate_new already does that.
2582 Invoke the user's initial action only upon the first yypush_parse
2583 invocation.
2584 Remove all code that copies between the local parser state variables
2585 and the yypstate.
2586
2587 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2588
2589 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
2590 prevent a name collision in a future patch where these names will
2591 sometimes be #define'd.
2592 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
2593 since it no longer has the same name as the existing argument.
2594 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
2595
2596 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
2597 and Joel E. Denny <jdenny@ces.clemson.edu>
2598
2599 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2600 that the argument is case-insensitive, and there's no `=' here.
2601 For the %skeleton entry, mention that %language is better.
2602 (Bison Options): Likewise for --language and --skeleton. Move the
2603 --skeleton entry so that the `Tuning the parser' section is sorted
2604 alphabetically on long options.
2605 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
2606 %language directive in detail here; cross-reference the %language
2607 documentation instead.
2608 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
2609 `%require "2.3b"' so that the example is always up-to-date.
2610 (Table of Symbols): Add entries for %language and %skeleton.
2611 * examples/extexi (normalize): Instead of replacing every %require
2612 argument with the current Bison version, just substitute for
2613 `@value{VERSION}'. This guarantees that we're testing what actually
2614 appears in the documentation.
2615 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
2616 rather than `@VERSION@'.
2617
2618 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2619
2620 * NEWS: Reword the %language news a bit, and put it earlier.
2621
2622 * src/getargs.c (skeleton_arg): Last arg is now location const *.
2623 Rewrite to simplify the logic.
2624 (language_argmatch): Likewise.
2625 (program_name): We now own this var.
2626 * src/getargs.h (struct bison_language): Use char[] rather than
2627 const char *.
2628
2629 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
2630 Java is supported.
2631 * src/complain.c (program_name): Remove decl; no longer needed.
2632 * src/main.c (program_name): Remove; now belongs to getargs.
2633
2634 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
2635
2636 * NEWS: Document %language.
2637
2638 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
2639
2640 * data/c-skel.m4, data/c++-skel.m4: New files.
2641 * data/glr.c: Complain on push parsers.
2642
2643 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
2644 over %skeleton.
2645 (Decl Summary): Document %language and %skeleton.
2646 (Command line): Document -L.
2647
2648 * examples/extexi: Rewrite %require directive.
2649 * examples/calc++/Makefile.am: Pass VERSION to extexi.
2650
2651 * src/files.c (compute_exts_from_gc): Look in language structure
2652 for .y extension.
2653 (compute_file_name_parts): Check whether .tab should be added.
2654 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
2655 (language, skeleton_arg, language_argmatch): New.
2656 (long_options): Add --language.
2657 (getargs): Use skeleton_arg, add -L/--language.
2658 * src/getargs.h: Include location.h.
2659 (struct bison_language, language, skeleton_arg, language_argmatch): New.
2660 * src/output.c (prepare): Pick default skeleton from struct language.
2661 Don't dispatch C skeletons here.
2662 * src/parse-gram.y (PERCENT_LANGUAGE): New.
2663 (prologue_declaration): Add "%language" rule, use skeleton_arg.
2664 * src/scan-gram.l ("%language"): New rule.
2665
2666 * tests/calc.at: Test %skeleton and %language.
2667 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
2668 (AT_GLR_IF): Look for %skeleton "glr.cc".
2669 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
2670 (AT_YACC_IF): Reject %language.
2671
2672 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2673
2674 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
2675 since it wasn't used; only the typedef name 'semantic_type' is needed.
2676 Also, omit trailing white space.
2677
2678 * bootstrap: Sync from coreutils.
2679 (gnulib_extra_files): Add build-aux/announce.gen.
2680 (slurp): Adjust .gitignore files like .cvsignore files.
2681 * build-aux/announce-gen: Remove from CVS, since bootstrap
2682 now creates this.
2683
2684 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
2685
2686 Make %push-parser imply %pure-parser. This fixes several bugs; see
2687 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
2688 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
2689 pure_parser = true.
2690 * data/push.c: Don't bother testing b4_push_if when deciding whether
2691 to expand b4_declare_parser_variables globally.
2692 (yypush_parse): Likewise in here.
2693
2694 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
2695 (yy_reduce_print): Reformat M4 for readability.
2696
2697 2006-12-15 Bob Rossi <bob@brasko.net>
2698 and Joel Denny <jdenny@ces.clemson.edu>
2699
2700 * data/push.c (yypstate): Add typedef, and update all uses of
2701 struct yypstate to just yypstate.
2702 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
2703
2704 2006-12-14 Bob Rossi <bob@brasko.net>
2705
2706 * data/push.c (yypush_parse): Declare prototype regardless of
2707 %locations option.
2708
2709 2006-12-14 Bob Rossi <bob@brasko.net>
2710
2711 * data/push.c (yyparse): Remove the prototype and the #define when in
2712 push-parser mode.
2713
2714 2006-12-13 Bob Rossi <bob@brasko.net>
2715
2716 * data/push.c (yypstate_init): Rename to...
2717 (yypstate_new): ... this and use b4_c_function_def.
2718 (yypstate_delete): New.
2719 (yypush_parse): Change parameters yynval and yynlloc to be const.
2720 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
2721 yypstate_delete functions.
2722
2723 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
2724
2725 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
2726 strange test case titles. Reported by Bob Rossi.
2727
2728 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
2729
2730 * TODO: Add pointer to Sylvain Schmitz's work on static detection
2731 of potential ambiguities in GLR grammers.
2732
2733 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
2734
2735 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
2736 `bison ', use m4_index instead of m4_substr since chopping up a string
2737 containing M4-special characters causes problems here.
2738
2739 Fix a couple of bugs related to special characters in user-specified
2740 file names, and make it easier for skeletons to compute output file
2741 names with the same file name prefix as Bison-computed output file
2742 names.
2743 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
2744 b4_parser_file_name and b4_spec_defines_file instead of
2745 @output_parser_name@ and @output_header_name@, which are now redundant.
2746 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
2747 b4_parser_file_name, b4_spec_defines_file, and the new
2748 @basename(FILENAME@) instead of @output_parser_name@ and
2749 @output_header_name@, which inappropriately escaped the file names as
2750 C string literals.
2751 * src/files.c (all_but_ext): Remove static qualifier.
2752 (compute_output_file_names): Move `free (all_but_ext)' to...
2753 (output_file_names_free): ... here since all_but_ext is needed later.
2754 * src/files.h (all_but_ext): Extern.
2755 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
2756 exactly what MUSCLE_INSERT_STRING used to do.
2757 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
2758 characters are escaped properly.
2759 * src/output.c (prepare): Define muscle file_name_all_but_ext as
2760 all_but_ext.
2761 For pkgdatadir muscle, maintain previous functionality by using
2762 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
2763 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
2764 digraphs would never be expanded. Hopefully no one has M4-special
2765 characters in his Bison installation path.
2766 * src/scan-skel.l: Don't parse @output_header_name@ and
2767 @output_parser_name@ anymore since they're now redundant.
2768 In @output, use decode_at_digraphs.
2769 Parse a new @basename command that invokes last_component.
2770 (decode_at_digraphs): New.
2771 (BASE_QPUTS): Remove unused.
2772 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
2773 (Output file name): New tests.
2774
2775 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
2776
2777 Warn about output files that are generated by the skeletons and that
2778 conflict with other output files.
2779 * data/glr.c: Don't generate the header file here when glr.cc does.
2780 * src/files.c (file_names, file_names_count): New static globals.
2781 (compute_output_file_names): Invoke output_file_name_check for files
2782 not generated by the skeletons and remove existing checks.
2783 (output_file_name_check): New function that warns about conflicting
2784 output file names.
2785 (output_file_names_free): Free file_names.
2786 * src/files.h (output_file_name_check): Declare.
2787 * src/scan-skel.l: Invoke output_file_name_check for files generated by
2788 the skeletons.
2789 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
2790 (Conflicting output files): New tests.
2791
2792 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2793
2794 * doc/bison.texinfo: Fix a couple of typos.
2795
2796 2006-12-08 Bob Rossi <bob@brasko.net>
2797
2798 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
2799 Rename to...
2800 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
2801 update all uses.
2802 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
2803 (yypush_parse): Rename yypvars argument to yyps and remove redundant
2804 local pv.
2805 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
2806 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
2807
2808 2006-12-07 Bob Rossi <bob@brasko.net>
2809 and Joel Denny <jdenny@ces.clemson.edu>
2810
2811 * data/push.c (yypvarsinit): Change return type from void* to struct
2812 yypvars*. No longer cast to void* on return.
2813 (struct yypvars): Remove yylen since it need not be remembered between
2814 yypushparse invocations.
2815 (yypushparse): Don't copy between yylen and pv->yylen.
2816
2817 2006-12-05 Bob Rossi <bob@brasko.net>
2818
2819 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
2820 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
2821 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
2822 (struct yypvars): Remove b4_declare_parser_variables.
2823 (yypvarsinit): Remove init code for removed variables.
2824 (global scope): Do not declare b4_declare_parser_variables if
2825 push or pure mode.
2826 (yypushparse): Add b4_declare_parser_variables.
2827 Init new local variables, and remove init code for removed
2828 yypvars variables.
2829 (yyparse): Delete.
2830 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2831 and yyparse for other modes.
2832 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2833 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2834 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2835 (AT_PURE_LEX_IF): True if pure or push parser.
2836
2837 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2838
2839 Document Yacc prologue alternatives and default %destructor's and
2840 %printer's as experimental. Don't mention Java yet. Discussed at
2841 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2842 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2843 (2.3a): Annotate this entry to say the old forms of these features were
2844 also experimental.
2845 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
2846 Table of Symbols): Say they're experimental. Comment out any mention
2847 of Java (we'll want this back eventually).
2848
2849 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2850
2851 Support a file name argument to %defines. Deprecate `=' in
2852 %file-prefix, %name-prefix, and %output. Discussed at
2853 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2854 * NEWS (2.3a+): Mention.
2855 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
2856 form of %defines, and remove `=' from entries for %file-prefix,
2857 %name-prefix, and %output.
2858 * src/parse-gram.y (prologue_declaration): Implement.
2859 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2860 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2861 all but one occurrence of %name-prefix.
2862 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2863 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2864 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2865 occurrence of each of %file-prefix and %output. Add check for %defines
2866 with argument.
2867 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2868 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2869 Remove the `=' from %output.
2870
2871 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2872
2873 Don't escape $ in test case titles since Autoconf 2.61 now does that
2874 correctly.
2875 * tests/actions.at (Default %printer and %destructor are not for error
2876 or $undefined): Here.
2877 (Default %printer and %destructor are not for $accept): Here.
2878 * tests/input.at (Invalid $n and @n): Here.
2879
2880 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2881
2882 Rename <!> to <>. Discussed starting at
2883 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2884 * NEWS (2.3a+): Update.
2885 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
2886 Update.
2887 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2888 * src/scan-gram.l (INITIAL): Implement.
2889 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2890 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2891 comment.
2892 * tests/actions.at (Default tagless %printer and %destructor,
2893 Default tagged and per-type %printer and %destructor,
2894 Default %printer and %destructor are not for error or $undefined,
2895 Default %printer and %destructor are not for $accept,
2896 Default %printer and %destructor for mid-rule values): Update.
2897 * tests/input.at (Default %printer and %destructor redeclared,
2898 Unused values with default %destructor): Update.
2899
2900 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2901
2902 Don't let %prec take a nonterminal.
2903 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2904 token.
2905 * tests/input.at (%prec takes a token): New test checking that %prec
2906 won't take a nonterminal.
2907
2908 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2909
2910 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2911 it was double-quoted.
2912 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2913 grammar is maintained with Bison's highest standards.
2914 * src/getargs.c: Fix some typos in Doxygen comments.
2915
2916 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2917
2918 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2919 later. Reported by Paul Eggert in
2920 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2921 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2922 * src/scan-code.l (translate_action): Don't bother invoking
2923 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2924 (code_scanner_free): Instead of invoking
2925 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2926 which frees more.
2927 * src/scan-gram.l (gram_scanner_free): Likewise.
2928 * src/scan-skel.l (scan_skel): Likewise.
2929
2930 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2931
2932 * src/files.c (tr): Change return type to void.
2933 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2934 has been called previously for the same key.
2935 (muscle_find): Return storage instead of value so that
2936 --enable-gcc-warnings doesn't produce warnings that the return discards
2937 const. aver that the value and storage are the same since storage
2938 could potentially be NULL when value is not.
2939 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2940 same as 0.
2941
2942 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2943
2944 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2945 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2946 us a slightly cleaner distribution, and also works.
2947 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2948 gnulib changes.
2949
2950 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2951 and Paul Eggert <eggert@cs.ucla.edu>
2952
2953 Don't let Bison leak memory except when it complains.
2954 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2955 (spec_defines_file, dir_prefix): Now char *, not const char *,
2956 since they are freed.
2957 * src/files.c: Likewise.
2958 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2959 Likewise.
2960 (tr): Now operates in-place. All uses changed.
2961 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2962 values.
2963 (compute_file_name_parts, compute_output_file_names): Don't store
2964 read-only data in variables that will be freed.
2965 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2966 src_extension, and header_extension.
2967 (output_file_names_free): New public function to free
2968 spec_verbose_file, spec_graph_file, spec_defines_file,
2969 parser_file_name, and dir_prefix.
2970 * src/getargs.c (getargs): Don't store read-only data in variables that
2971 will be freed.
2972 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2973 (which previously existed but was unused), and quotearg_free.
2974 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2975 * src/muscle_tab.c: Likewise.
2976 (muscle_entry): Make the value char const *,
2977 and add a new storage member that is char * and can be freed.
2978 (muscle_entry_free): New private function.
2979 (muscle_init): Use it instead of free.
2980 (muscle_insert, muscle_grow): Update and use new storage member.
2981 (muscle_code_grow): Free the string passed to muscle_grow
2982 since it's not needed anymore.
2983 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2984 add a new `char *code' member.
2985 ("{...}"): Declare semantic type as code.
2986 * src/scan-code.h (translate_rule_action):
2987 (translate_symbol_action, translate_code, translate_action): Return
2988 `char const *' rather than `char *' since external code should not free
2989 these strings.
2990 * src/scan-code.l: Likewise.
2991 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2992 which is "{...}" in the parser.
2993 * tests/Makefile.am (maintainer-check-valgrind): Set
2994 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2995 Valgrind.
2996 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2997 complain.
2998 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2999 expecting a non-zero exit status sets --leak-check=summary and
3000 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
3001 this case, and we don't want to hear about it.
3002
3003 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
3004
3005 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
3006 instead of from the template, to simplify configuration a bit.
3007 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
3008 and m4/wint_t.m4, as they are needed with the latest gnulib.
3009
3010 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3011
3012 Disable unset/unused mid-rule value warnings by default, and recognize
3013 --warnings=midrule-values to enable them. Discussed starting at
3014 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
3015 * NEWS (2.3a+): Mention.
3016 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
3017 warnings): Add entry for midrule-values subargument.
3018 * src/reader.c (symbol_should_be_used): Don't return true just because
3019 the value is a set/used mid-rule value unless
3020 --warnings=midrule-values was specified.
3021 * tests/input.at (Unused values, Unused values before symbol
3022 declarations): Run tests with and without --warnings=midrule-values.
3023
3024 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
3025 than LIST_FREE directly.
3026
3027 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3028
3029 Finish implementing --warnings=error, which should not be implied by
3030 --warnings=all (or by its synonyms -W and --warnings without
3031 subarguments).
3032 * src/complain.c (set_warning_issued): New function to report that
3033 warnings are being treated as errors and to record an error if so.
3034 Invoke...
3035 (warn_at, warn): ... here.
3036 * src/getargs.c (warnings_args, warnings_types): Reorder so that
3037 "error - warnings are errors" does not appear above "all - all of the
3038 above".
3039 (getargs): For -W and --warnings without subarguments, don't let
3040 FLAGS_ARGMATCH set warnings_error in warnings_flag.
3041 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
3042
3043 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3044
3045 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
3046 empty subargument list. For example: `bison --warnings= parser.y'.
3047
3048 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3049
3050 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
3051 the parser header file so that gcc doesn't warn.
3052
3053 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3054
3055 Split the default %destructor/%printer into two kinds: <*> and <!>.
3056 Discussed starting at
3057 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
3058 * NEWS (2.3a+): Mention.
3059 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
3060 previous change today related to mid-rules.
3061 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3062 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
3063 (TYPE_TAG_ANY): Add as <*>.
3064 (TYPE_TAG_NONE): Add as <!>.
3065 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
3066 for <*> and <!>.
3067 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
3068 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
3069 * src/symlist.c (symbol_list_default_new): Split into tagged and
3070 tagless versions.
3071 (symbol_list_destructor_set, symbol_list_printer_set): Split
3072 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
3073 SYMLIST_DEFAULT_TAGLESS.
3074 * src/symlist.h: Update symbol_list_default*_new prototypes.
3075 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
3076 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
3077 * src/symtab.c (default_destructor, default_destructor_location,
3078 default_printer, default_printer_location): Split each into tagged and
3079 tagless versions.
3080 (symbol_destructor_get, symbol_destructor_location_get,
3081 symbol_printer_get, symbol_printer_location_get): Implement tagged
3082 default and tagless default cases.
3083 (default_destructor_set, default_printer_set): Split each into tagged
3084 and tagless versions.
3085 * src/symtab.h: Update prototypes.
3086 * tests/actions.at (Default %printer and %destructor): Rename to...
3087 (Default tagless %printer and %destructor): ... this, and extend.
3088 (Per-type %printer and %destructor): Rename to...
3089 (Default tagged and per-type %printer and %destructor): ... this, and
3090 extend.
3091 (Default %printer and %destructor for user-defined end token): Extend.
3092 (Default %printer and %destructor are not for error or $undefined):
3093 Update.
3094 (Default %printer and %destructor are not for $accept): Update.
3095 (Default %printer and %destructor for mid-rule values): Extend.
3096 * tests/input.at (Default %printer and %destructor redeclared): Extend.
3097 (Unused values with default %destructor): Extend.
3098
3099 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3100
3101 Don't apply the default %destructor/%printer to an unreferenced midrule
3102 value. Mentioned at
3103 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
3104 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
3105 like $@n instead of just @n so that the default %destructor/%printer
3106 logic doesn't see them as user-defined symbols.
3107 (symbol_is_dummy): Check for both forms of the name.
3108 * src/reader.c (packgram): Remove the `$' from each midrule symbol
3109 name for which the midrule value is referenced in any action.
3110 * tests/actions.at (Default %printer and %destructor for mid-rule
3111 values): New test.
3112 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
3113 for change to dummy symbol names.
3114
3115 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
3116
3117 Warn about unset midrule $$ if the corresponding $n is used.
3118 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
3119 $n usage.
3120 (packgram): Before invoking grammar_rule_check on any rule, make sure
3121 all actions have already been scanned in order to set `used' flags.
3122 Otherwise, checking that a midrule's $$ is set will not always work
3123 properly because the midrule check must forward-reference the midrule's
3124 parent rule.
3125 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
3126 warning.
3127
3128 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
3129
3130 More improvements to the documentation of the prologue alternatives:
3131 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
3132 Bison manual.
3133 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
3134 some text to clarify the relative importance of the new directives and
3135 to show how these directives may be viewed as code labels.
3136
3137 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
3138
3139 Similar to the recently removed %before-header, add %code-top as the
3140 alternative to the pre-prologue. Mentioned at
3141 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
3142 Also, let the prologue alternatives appear in the grammar section.
3143 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
3144 (prologue_declaration): Move the existing prologue alternatives to...
3145 (grammar_declaration): ... here and add %code-top.
3146 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
3147
3148 Clean up and extend documentation for the prologue alternatives.
3149 * NEWS (2.3a+): Describe prologue alternatives.
3150 * doc/bison.texinfo (Prologue): Move discussion of prologue
3151 alternatives to...
3152 (Prologue Alternatives): ... this new section, and extend it to discuss
3153 all 4 directives in detail.
3154 (Table of Symbols): Clean up discussion of prologue alternatives and
3155 add %code-top.
3156
3157 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3158
3159 DJGPP specific issues.
3160
3161 * djgpp/config.bat: config.hin has been moved to lib. Adjust
3162 config.bat accordingly.
3163 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
3164 * djgpp/config.site: Likewise.
3165
3166 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
3167
3168 Replace %*-header with %provides, %requires, %code. See discussion at
3169 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
3170
3171 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
3172 (b4_user_start_header): Remove.
3173 * data/glr.c: Use new macros instead of b4_*start_header
3174 and b4_*end_header.
3175 * data/glr.cc: Likewise.
3176 * data/lalr1.cc: Likewise.
3177 * data/push.c: Likewise.
3178 * data/yacc.c: Likewise.
3179
3180 * doc/bison.texinfo: Remove %before-header, rename
3181 %{start,end,after}-header to %requires, %provides, %code.
3182
3183 * src/parse-gram.y: Likewise (also rename token names accordingly).
3184 * src/scan-gram.l: Likewise.
3185 * tests/actions.at: Likewise.
3186
3187 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
3188
3189 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
3190 Problem reported by Joel E. Denny.
3191
3192 2006-10-14 Jim Meyering <jim@meyering.net>
3193
3194 (Sync from coreutils.)
3195 Work also when the working directory (with e.g. coreutils sources)
3196 is version controlled with git, rather than CVS.
3197 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
3198 rather than CVS.
3199 In messages and comments, say e.g., "checked-out sources",
3200 rather than "CVS sources".
3201 (version_controlled_file): New function. Work for git as well as
3202 for CVS. Don't use grep's -q option.
3203 (slurp): Call it here, in place of CVS-specific code.
3204
3205 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
3206
3207 Fix testsuite for ./configure --enable-gcc-warnings:
3208 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
3209 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
3210 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
3211 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
3212 * test/regression.at (Diagnostic that expects two alternatives):
3213 Likewise.
3214
3215 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3216
3217 * bootstrap.conf (gnulib_modules): Add config-h.
3218 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
3219 worry about HAVE_CONFIG_H.
3220 * lib/abitset.c: Likewise.
3221 * lib/bitset.c: Likewise.
3222 * lib/bitset_stats.c: Likewise.
3223 * lib/bitsetv-print.c: Likewise.
3224 * lib/bitsetv.c: Likewise.
3225 * lib/ebitset.c: Likewise.
3226 * lib/get-errno.c: Likewise.
3227 * lib/lbitset.c: Likewise.
3228 * lib/subpipe.c: Likewise.
3229 * lib/timevar.c: Likewise.
3230 * lib/vbitset.c: Likewise.
3231 * lib/bitset.c: Include "bitset.h" first, to test interface.
3232 * lib/bitset_stats.c: Include "bitset_stats.h" first.
3233 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
3234 * lib/bitsetv.c: Include "bitsetv.h" first.
3235 * lib/get-errno.c: Include "get-errno.h" first.
3236 * m4/.cvsignore: Add config-h.m4.
3237 * tests/actions.at (Default %printer and %destructor for ...):
3238 Adjust expected line numbers in output to reflect removal of #if
3239 HAVE_CONFIG_H lines.
3240 * tests/glr-regression.at (Missed %merge type warnings when ...):
3241 Likewise.
3242 * tests/regression.at (Braced code in declaration in rules section):
3243 Likewise.
3244 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
3245 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
3246 Include <config.h> unconditionally.
3247
3248 * bootstrap: Sync from coreutils, as follows:
3249
3250 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3251
3252 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
3253 variable was sometimes used without being initialized. This
3254 messed up the installation of the INSTALL file in some cases.
3255
3256 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3257
3258 * bootstrap (usage, main program, symlink_to_gnulib): Add option
3259 --copy. Inspired by a suggestion from Bruno Haible.
3260
3261 2006-10-03 Jim Meyering <jim@meyering.net>
3262
3263 * bootstrap: Undo last change to this file, since now gnulib-tool
3264 sticks with the automake default in generating dependencies.
3265
3266 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3267
3268 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
3269 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
3270
3271 * doc/bison.1: Add copyright notice.
3272
3273 * data/glr.c: Don't include <stdarg.h>; not used.
3274
3275 * NEWS: The -g and --graph options now output graphs in Graphviz
3276 DOT format, not VCG format.
3277 * doc/bison.1: Likewise.
3278 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
3279 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
3280 of this change in
3281 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
3282 * TODO: Remove Graphviz entry.
3283 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
3284 remove vcg.c, vcg.h, vcg_defaults.h.
3285 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
3286 * src/graphviz.c, src/graphviz.h: New files.
3287 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
3288 * src/files.h: Make comment more generic.
3289 * src/main.c (main): Likewise.
3290 * src/print_graph.h: Likewise.
3291 * src/getargs.c (usage): Make usage description more generic.
3292 * src/print_graph.c: Include graphviz.h rather than vcg.h.
3293 (static_graph, fgraph): Remove. All uses changed to pass
3294 arguments instead of sharing a static var.
3295 (print_core, print_actions, print_state, print_graph):
3296 Output graphviz format rather than VCG format.
3297 * tests/.cvsignore: Remove *.vcg; add *.dot.
3298 * tests/output.at: Expect *.dot files, not *.vcg files.
3299
3300 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
3301 accommodates the 2006-10-08 change.
3302
3303 2006-10-11 Bob Rossi <bob@brasko.net>
3304
3305 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
3306 (b4_yyssa, b4_yyerror_range): New macros.
3307 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
3308 (yypvarsinit): Remove init of removed fields.
3309 (yypushparse): Remove use of removed fields; use new macros instead.
3310
3311 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3312
3313 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
3314 in a push parser. Reindent slightly to match yacc.c better.
3315
3316 2006-10-11 Bob Rossi <bob@brasko.net>
3317
3318 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
3319 yymsg_alloc fields.
3320 (yypvarsinit, yypushparse): Remove init of removed fields.
3321 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
3322
3323 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3324
3325 * THANKS: Add Paolo Bonzini and Bob Rossi.
3326
3327 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
3328
3329 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
3330 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
3331 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
3332 b4_define_user_cde and uses): Remove.
3333 (b4_comment, b4_prefix, b4_sync_start): New.
3334 * data/bison.m4: New file, with most of the content removed from c.m4.
3335 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
3336 * src/output.c (output_skeleton): Pass bison.m4.
3337 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
3338 only if specified.
3339
3340 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
3341
3342 Fix test failure reported by Tom Lane in
3343 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
3344 and try to make such failures easier to catch in the future.
3345 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
3346 that's now the caller's responsibility.
3347 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
3348 Set yychar = YYEOF if it's negative.
3349 * tests/actions.at (yylex): Abort if asked to read past EOF.
3350 * tests/conflicts.at (yylex): Likewise.
3351 * tests/cxx-type.at (yylex): Likewise.
3352 * tests/glr-regression.at (yylex): Likewise.
3353 * tests/input.at (yylex): Likewise.
3354 * tests/regression.at (yylex): Likewise.
3355 * tests/torture.at (yylex): Likewise.
3356
3357 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
3358
3359 Fix problems with translating English-language diagnostics.
3360 * bootstrap: Fix bug introduced in recent bootstrap changes, with
3361 respect to bison-runtime pot generation. The YY_ stuff
3362 wasn't being captured.
3363 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
3364 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
3365 * runtime-po/POTFILES.in: Add data/push.c.
3366
3367 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
3368
3369 Merge bootstrap changes from coreutils.
3370
3371 2006-09-28 Jim Meyering <jim@meyering.net>
3372
3373 Automatically generated dependencies are important even
3374 when all of the sources in a directory come from gnulib.
3375 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
3376 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
3377
3378 2006-09-23 Jim Meyering <jim@meyering.net>
3379
3380 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
3381
3382 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3383
3384 * bootstrap: Add support for --force.
3385 (usage): New function. Describe usage less tersely.
3386 (CVS_only_file): New var.
3387
3388 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
3389
3390 * data/push.c (YYPUSH_MORE): Make it an enum instead.
3391 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
3392 Adjust white space and comments to match GNU style better.
3393
3394 2006-09-20 Bob Rossi <bob@brasko.net>
3395
3396 * data/push.c (yyresult_get): Remove function.
3397 (YYPUSH_MORE): Add #define.
3398 (yypushparse): Modify return value.
3399
3400 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3401
3402 * stamp-h.in: Remove; no longer needed.
3403 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
3404 Remove config.h, config.hin, intl (no longer created).
3405 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
3406 stamp-h1.
3407
3408 Sync bootstrap from coreutils, as follows:
3409
3410 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
3411
3412 * bootstrap (symlink_to_gnulib): New function.
3413 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
3414 to copies-of-gnulib.
3415 (cp_mark_as_generated, slurp, gnulib_files):
3416 Avoid making a copy if it's the same as the old version.
3417 (gnulib_files): Add support for this variable (used by Bison).
3418
3419 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3420
3421 * src/getargs.c (usage): Rework to use conventions similar to
3422 coreutils, to make translation a bit easier and the code a bit
3423 smaller. Problem reported by Tim Van Holder.
3424
3425 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
3426
3427 Use some of gnulib's new modules, taken from coreutils.
3428
3429 * bootstrap: Sync from coreutils, except add support for gnulib_files.
3430 * bootstrap.conf: New file.
3431 (gnulib_modules): Add configmake, inttypes, unistd.
3432 (XGETTEXT_OPTIONS): Add complain, complain_at,
3433 fatal, fatal_at, warn, warn_at, unexpected_end.
3434 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
3435 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
3436 (gl_EARLY): Add.
3437 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
3438 (gl_INIT): Add
3439 (GNULIB_AUTOCONF_SNIPPET): Remove.
3440 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
3441 the pickiest.
3442 * lib/.cvsignore: Add inttypes_.h.
3443 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
3444 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
3445 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
3446 no-longer-necessary initializations.
3447 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
3448 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
3449 use the unistd module.
3450 * src/system.h: Likewise.
3451 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
3452 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
3453 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
3454 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
3455 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
3456 * src/system.h: Include inttypes.h unconditionally, now that we
3457 use the inttypes module. Don't bother to include stdint.h, since
3458 inttypes.h now does that for us.
3459 (LOCALEDIR): Remove, now that we use the configmake module.
3460 * src/getargs.c: Include configmake.h.
3461 * src/main.c: Likewise.
3462 * src/output.c: Likewise.
3463 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
3464 not from $abs_top_builddir, since config.h moved.
3465
3466
3467 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
3468 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
3469
3470 * src/parse-gram.y (symbol_declaration): Don't put statements
3471 before declarations; it's not portable to C89.
3472 * src/scan-code.l (handle_action_at): Likewise.
3473
3474 * src/scan-code.l: Always initialize braces_level; the old code
3475 left it uninitialized and therefore had undefined behavior.
3476
3477 Don't attempt to redefine 'assert', since it runs afoul of
3478 systems where standard headers (mistakenly) include <assert.h>.
3479 Instead, define and use our own alternative, called 'aver'.
3480 * src/reader.c: Don't include assert.h, since we no longer
3481 use assert.
3482 * src/scan-code.l: Likewise.
3483 * src/system.h (assert): Remove, replacing with....
3484 (aver): New function, taking a bool arg. All uses changed.
3485 * src/tables.c (pack_vector): Ensure that aver arg is bool,
3486 not merely an integer.
3487
3488 2006-09-15 Bob Rossi <bob@brasko.net>
3489
3490 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
3491 * data/c.m4 (YYPUSH): New.
3492 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
3493 * src/getargs.c (push_parser): New var.
3494 * src/getargs.h (push_parser): New declaration.
3495 * src/output.c (prepare): Add macro insertion of `push_flag'.
3496 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
3497 (prologue_declaration): Parse %push-parser.
3498 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
3499 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
3500 list of removed lines from the traces observed.
3501 (AT_CHECK_CALC_LALR): Added push parser tests.
3502
3503 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
3504
3505 * NEWS: Version 2.3a.
3506 * configure.ac (AC_INIT): Likewise.
3507
3508 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
3509 "#define YYSTYPE int" that caused "make maintainer-check" to fail
3510 due to header ordering dependencies. I don't know why the #define
3511 was there.
3512
3513 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
3514 runtime cost when YYDEBUG is not defined, and so that some tests
3515 that used to fail now work. Problem and initial suggestion by
3516 Paolo Bonzini.
3517 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
3518 * data/glr.cc (b4_parser_class_name):
3519 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
3520 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
3521 (yydebug_) [YYDEBUG]: New member.
3522 (yycdebug_): Now defined only if YYDEBUG.
3523 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
3524 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
3525 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
3526 if YYYDEBUG.
3527 (debug_stream, set_debug_stream, debug_level, set_debug_level):
3528 Define only if YYDEBUG.
3529 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
3530 set_debug_level.
3531 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
3532 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
3533 AT_CHECK_CALC_GLR_CC that are working now.
3534
3535 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
3536
3537 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
3538 We don't need them in glr.cc, and glr.c defines them.
3539 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
3540 assumes that defining it to anything is the same as defining
3541 it to 1. Problem reported by Paolo Bonzini.
3542
3543 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
3544
3545 * data/c.m4 (b4_null, b4_case): Define.
3546 * src/output.c (prepare_symbols): Use b4_null.
3547 (user_actions_output): Use b4_case.
3548
3549 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
3550
3551 * data/glr.c (b4_shared_declarations): Put start-header first,
3552 before any #includes that we generate, so that feature-test
3553 macros work. Problem reported by Michael Deutschmann in
3554 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
3555 * data/lalr1.cc: Likewise.
3556 * doc/bison.texinfo (Prologue): Document that feature-test macros
3557 should be defined before any Bison declarations.
3558 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
3559 that depend on location.hh after, not before, Bison decls, since
3560 we now include location.hh after the first user prologue.
3561
3562 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
3563 Sander Brandenburg in
3564 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
3565 Also, fix minor white space and comment issues.
3566 (Prologue): Mention that it's better to define feature-test macros
3567 before Bison declarations. Problem reported by Michael Deutschmann.
3568
3569 * README-cvs: Fix typo: "&" should be "&&". Problem reported
3570 by Jim Meyering.
3571 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
3572 This adjusts to recent gnulib changes.
3573
3574 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3575
3576 Finish implementation of per-type %destructor/%printer. Discussed
3577 starting at
3578 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
3579 and
3580 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
3581 * NEWS (2.3+): Add a description of this feature to the default
3582 %destructor/%printer description.
3583 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
3584 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3585 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
3586 list node contains a semantic type.
3587 * src/symtab.c, src/symtab.h: Extend with a table that associates
3588 semantic types with their %destructor's and %printer's.
3589 (semantic_type_from_uniqstr, semantic_type_get,
3590 semantic_type_destructor_set, semantic_type_printer_set): New functions
3591 composing the public interface of that table.
3592 (symbol_destructor_get, symbol_destructor_location_get,
3593 symbol_printer_get, symbol_printer_location_get): If there's no
3594 per-symbol %destructor/%printer, look up the per-type before trying
3595 the default.
3596 * tests/actions.at (Per-type %printer and %destructor): New test case.
3597 * tests/input.at (Default %printer and %destructor redeclared):
3598 Extend to check that multiple occurrences of %symbol-default in a
3599 single %destructor/%printer declaration is an error.
3600 (Per-type %printer and %destructor redeclared, Unused values with
3601 per-type %destructor): New test cases.
3602
3603 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3604
3605 Require default %destructor/%printer to be declared using
3606 %symbol-default instead of an empty symbol list, and start working on
3607 new per-type %destructor/%printer. Discussed at
3608 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
3609 * NEWS (2.3+): Add %symbol-default to example.
3610 * bison.texinfo (Freeing Discarded Symbols): Likewise.
3611 (Table of Symbols): Add entry for %symbol-default.
3612 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
3613 (generic_symlist, generic_symlist_item): New nonterminals for creating
3614 a list in which each item is a symbol, semantic type, or
3615 %symbol-default.
3616 (grammar_declaration): Use generic_symlist in %destructor and %printer
3617 declarations instead of symbols.1 or an empty list.
3618 (symbol_declaration, precedence_declaration, symbols.1): Update actions
3619 for changes to symbol_list.
3620 * src/reader.c: Update for changes to symbol_list.
3621 * src/scan-code.l: Likewise.
3622 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
3623 * src/symlist.c, src/symlist.h: Extend such that a list node may
3624 represent a semantic type or a %symbol-default in addition to just an
3625 ordinary symbol. Add switched functions for setting %destructor's and
3626 %printer's.
3627 * tests/actions.at, tests/input.at: Add %symbol-default to all default
3628 %destructor/%printer declarations.
3629
3630 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
3631
3632 Whether the default %destructor/%printer applies to a particular symbol
3633 isn't a question of whether the user *declares* that symbol (in %token,
3634 for example). It's a question of whether the user by any means
3635 *defines* the symbol at all (by simply using a char token, for
3636 example). $end is defined by Bison whereas any other token with token
3637 number 0 is defined by the user. The error token is always defined by
3638 Bison regardless of whether the user declares it with %token, but we
3639 may one day let the user define error as a nonterminal instead.
3640 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
3641 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
3642 the meaning of "user-defined".
3643 * tests/actions.at (Default %printer and %destructor for user-declared
3644 end token): Rename to...
3645 (Default %printer and %destructor for user-defined end token): ...
3646 this.
3647
3648 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
3649 computation of whether to apply the default, don't maintain a list of
3650 every Bison-defined symbol. Instead, just check for a first character
3651 of '$', which a user symbol cannot have, and check for the error token.
3652
3653 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
3654
3655 Don't apply the default %destructor or %printer to the error token,
3656 $undefined, or $accept. This change fits the general rule that the
3657 default %destructor and %printer are only for user-declared symbols,
3658 and it solves several difficulties that are described in the new test
3659 cases listed below.
3660 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
3661 * tests/actions.at (Default %printer and %destructor are not for error
3662 or $undefined, Default %printer and %destructor are not for $accept):
3663 New test cases.
3664
3665 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
3666
3667 Allow %start after the first rule.
3668 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
3669 when parsing the first rule.
3670 (check_and_convert_grammar): Search for it here after all grammar
3671 declarations have been parsed. Skip midrules, which have dummy LHS
3672 nonterminals.
3673 * src/symtab.c (symbol_is_dummy): New function.
3674 * src/symtab.h (symbol_is_dummy): Declare it.
3675 * tests/input.at (%start after first rule): New test.
3676
3677 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3678
3679 Redo some of the previous commit: add back the ability to use
3680 non-aliased/undeclared string literals since it might be useful to
3681 those declaring %token-table.
3682 * src/reader.c (check_and_convert_grammar): Undo changes in previous
3683 commit: don't worry about complaints from symbols_pack.
3684 * src/symtab.c (symbol_new, symbol_class_set,
3685 symbol_check_alias_consistency): Undo changes in previous commit: count
3686 each string literal as a new symbol and token, assign it a symbol
3687 number, and don't complain about non-aliased string literals.
3688 (symbols_pack): Since symbol_make_alias still does not decrement symbol
3689 and token counts but does still set aliased tokens to the same number,
3690 symbol_pack_processor now leaves empty slots in the symbols array.
3691 Remove those slots.
3692 * tests/regression.at (Undeclared string literal): Remove test case
3693 added in previous commit since non-aliased string literals are allowed
3694 again.
3695 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
3696 remove unnecessary string literal declarations.
3697 * tests/sets.at (Firsts): Likewise.
3698
3699 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3700
3701 Don't allow an undeclared string literal, but allow a string literal to
3702 be used before its declaration.
3703 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
3704 symbols_pack complained.
3705 * src/symtab.c (symbol_new): Don't count a string literal as a new
3706 symbol.
3707 (symbol_class_set): Don't count a string literal as a new token, and
3708 don't assign it a symbol number since symbol_make_alias does that.
3709 (symbol_make_alias): It's not necessary to decrement the symbol and
3710 token counts anymore. Don't assume that an alias declaration occurs
3711 before any uses of the identifier or string, and thus don't assert that
3712 one of them has the highest symbol number so far.
3713 (symbol_check_alias_consistency): Complain if there's a string literal
3714 that wasn't declared as an alias.
3715 (symbols_pack): Bail if symbol_check_alias_consistency failed since
3716 symbol_pack asserts that every token has been assigned a symbol number
3717 although undeclared string literals have not.
3718 * tests/regression.at (String alias declared after use, Undeclared
3719 string literal): New test cases.
3720 (Characters Escapes, Web2c Actions): Declare string literals as
3721 aliases.
3722 * tests/sets.at (Firsts): Likewise.
3723
3724 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
3725
3726 In the grammar scanner, STRING_FINISH unclosed constructs and return
3727 them to the parser in order to improve error messages.
3728 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
3729 SC_BRACED_CODE, SC_PROLOGUE): Implement.
3730 * tests/input.at (Unclosed constructs): New test case.
3731 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
3732 seen.
3733
3734 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
3735 unused global.
3736
3737 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
3738
3739 Handle string aliases for character tokens correctly.
3740 * src/symtab.c (symbol_user_token_number_set): If the token has an
3741 alias, check and set its alias's user token number instead of its own,
3742 which is set to indicate the alias. Previously, every occurrence of
3743 the character token in the grammar overwrote that alias indicator with
3744 the character code.
3745 * tests/input.at (String aliases for character tokens): New test.
3746
3747 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
3748
3749 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
3750
3751 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
3752
3753 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
3754 to prevent failures when building on older platforms.
3755 Check for autopoint failure.
3756 Set XGETTEXT_OPTIONS to values that check for C format strings,
3757 so that translators are warned about them (this also helps
3758 prevent core dumps).
3759
3760 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
3761 function, since it simplifies our code a bit.
3762
3763 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
3764 rather than -W, so we don't get bogus warnings about sign comparisons.
3765 Add -Wpointer-arith, since that warning is useful (it reports code
3766 that does not conform to C89 and that some compilers reject).
3767 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
3768 since it's no longer needed.
3769
3770 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
3771
3772 Clean up scanners a bit.
3773 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
3774 definitions so gcc won't warn when obstack_for_string is unused.
3775 * src/scan-code.l: config.h and system.h are already #include'd by
3776 scan-code-c.c, so get rid of them here.
3777 * src/scan-gram.l: Likewise.
3778 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
3779 definitions rather than duplicating the rest of it.
3780 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
3781
3782 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
3783
3784 Suppress signed/unsigned comparison warnings for yycheck.
3785 * data/c.m4 (b4_safest_int_type): New macro.
3786 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
3787 a signed int type, cast it to b4_safest_int_type first.
3788 * data/yacc.c: Likewise.
3789 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
3790 also overwritten.
3791
3792 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3793
3794 * doc/bison.texinfo: Fix some typos.
3795
3796 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
3797
3798 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
3799 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
3800
3801 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
3802 the latest gnulib does this a different way.
3803 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
3804 translation was patched, so stop omitting it.
3805
3806 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3807
3808 Enable declaration of default %printer/%destructor. Make the parser
3809 use these for all user-declared grammar symbols for which the user does
3810 not declare a specific %printer/%destructor. Thus, the parser uses it
3811 for token 0 if the user declares it but not if Bison generates it as
3812 $end. Discussed starting at
3813 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
3814 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
3815 and
3816 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
3817 * NEWS (2.3+): Mention.
3818 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
3819 declare a %destructor for a mid-rule's semantic value. It's just
3820 impossible to declare one specific to it.
3821 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
3822 code. Describe default %destructor form.
3823 * src/parse-gram.y (grammar_declaration): Parse default
3824 %printer/%destructor declarations.
3825 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
3826 and symbol_destructor_location_get rather than accessing the destructor
3827 and destructor_location members of struct symbol.
3828 (symbol_printers_output): Likewise but for %printer's.
3829 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3830 again.
3831 * src/symtab.c (default_destructor, default_destructor_location,
3832 default_printer, default_printer_location): New static global
3833 variables to record the default %destructor and %printer.
3834 (symbol_destructor_get, symbol_destructor_location_get,
3835 symbol_printer_get, symbol_printer_location_get): New functions to
3836 compute the appropriate %destructor and %printer for a symbol.
3837 (default_destructor_set, default_printer_set): New functions to set the
3838 default %destructor and %printer.
3839 * src/symtab.h: Prototype all those new functions.
3840 * tests/actions.at (Default %printer and %destructor): New test to
3841 check that the right %printer and %destructor are called, that they're
3842 not called for $end, and that $$ and @$ work correctly.
3843 (Default %printer and %destructor for user-declared end token): New
3844 test to check that the default %printer and %destructor are called for
3845 a user-declared end token.
3846 * tests/input.at (Default %printer and %destructor redeclared, Unused
3847 values with default %destructor): New tests to check related grammar
3848 warnings and errors.
3849
3850 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3851
3852 Clean up handling of %destructor for the end token (token 0).
3853 Discussed starting at
3854 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3855 and
3856 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3857
3858 Make the skeletons consistent in how they pop the end token and invoke
3859 its %destructor.
3860 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3861 state, which has token number 0, since this would invoke the
3862 %destructor for the end token.
3863 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3864 until after shifting the end token, or else it won't be popped.
3865 * data/yacc.c (yyparse): Likewise.
3866
3867 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3868 it's the end token. Upon termination, destroy an unshifted lookahead
3869 even when it's the end token.
3870 * data/lalr1.cc (yy::parser::parse): Likewise.
3871 * data/yacc.c (yyparse): Likewise.
3872
3873 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3874 value warnings for the end token when the user gives the end token a
3875 %destructor.
3876
3877 * tests/actions.at (Printers and Destructors): Test all the above.
3878
3879 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3880
3881 Update to latest gnulib and gettext versions.
3882 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3883 Add fopen-safer.
3884 (gnulib_files): Add m4/warning.m4. Don't worry about files
3885 overwritten by autopoint.
3886 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3887 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3888 rejects them.
3889 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3890 so that we can remove the intl files at a better time.
3891 (intl_files_to_remove): Remove aclocal.m4, since it gets
3892 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3893 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3894 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3895 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3896 Remove datarootdir hack; no longer needed.
3897 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3898 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3899 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3900 strdup.h.
3901 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3902 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3903
3904 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3905
3906 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3907 it with --assume-autoconf='latest-stable'.
3908
3909 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3910
3911 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3912 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3913 YYSTYPE' and `{'.
3914 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3915 those from muscle_tab.c since the old ones are misleading.
3916
3917 2006-07-13 Akim Demaille <akim@epita.fr>
3918
3919 Support %define "KEY" {VALUE}.
3920 * src/scan-code.h, src/scan-code.l (translate_action)
3921 (translate_rule_action, translate_symbol_action, translate_code):
3922 Return char *, not const char *.
3923 * src/parse-gram.y (declaration): Rename as...
3924 (prologue_declaration): this.
3925 (string_content): Remove this nonterminal, use STRING.
3926 (braceless, content, content.opt): New nonterminal.
3927 Use them.
3928 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3929 as value.
3930 * src/scan-gram.l (getargs.h): Don't include it.
3931
3932 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3933
3934 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3935 rather than a for-loop that declares a local bool variable. This
3936 should work around a compatibility problem with a Cray x1e C++
3937 compiler reported by Hung Nguyen in
3938 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3939 The for-loop was introduced in the 2004-11-17 change but I don't
3940 know why it was needed.
3941
3942 2006-07-12 Akim Demaille <akim@epita.fr>
3943
3944 * data/c.m4: Comment changes.
3945
3946 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
3947
3948 * src/complain.c (error_message, ERROR_MESSAGE): New.
3949 To factor...
3950 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3951 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3952
3953 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3954
3955 * NEWS: Instead of %union, you can define and use your own union type
3956 YYSTYPE if your grammar contains at least one <type> tag.
3957 Your YYSTYPE need not be a macro; it can be a typedef.
3958 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3959 (Union Decl, Decl Summary): Document this.
3960 * data/glr.c (YYSTYPE): Implement this.
3961 * data/glr.cc (YYSTYPE): Likewise.
3962 * data/lalr1.cc (YYSTYPE): Likewise.
3963 * data/yacc.c (YYSTYPE): Likewise.
3964 * src/output.c (prepare): Output tag_seen_flag.
3965 * src/parse-gram.y (declaration, grammar_declaration):
3966 Use 'union_seen' rather than 'typed' to determine whether
3967 %union has been seen, since grammars can now be typed without
3968 %union.
3969 (symbol_declaration, type.opt, symbol_def):
3970 Keep track of whether a tag has been seen.
3971 * src/reader.c (union_seen, tag_seen): New vars.
3972 (typed): remove.
3973 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3974 * src/scan-code.l (untyped_var_seen): New variable.
3975 (handle_action_dollar): Adjust to above changes.
3976 (handle_action_dollar, handle_action_at):
3977 Improve overflow checking for outlandish numbers.
3978 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3979 avoid new diagnostics generated by above changes.
3980 * tests/regression.at (YYSTYPE typedef): Add test to check
3981 for type tags without %union.
3982
3983 * src/symlist.c (symbol_list_length): Return int, not unsigned
3984 int, since callers expect int. This may need to get revisited
3985 once we have proper integer overflow checking.
3986
3987 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3988 object is now static.
3989
3990 * src/getargs.c (flags_argmatch): Return void, not int,
3991 to pacify ./configure --enable-gcc-warnings.
3992
3993 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3994 since last_string is already defined to FLEX_PREFIX (last_string).
3995
3996 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
3997
3998 Implement --warnings/-W.
3999 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
4000 replaced by...
4001 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
4002 Adjust callers.
4003 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
4004 (warnings_args, warnings_types): New.
4005 (getargs, short_options, long_options): Accept -W/--warnings.
4006 Sort the options by alphabetical order, upper case letter right
4007 before its lower case.
4008
4009 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4010
4011 Change %merge result type clash warnings to errors. Discussed at
4012 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
4013 * src/reader.c (record_merge_function_type): Use complain_at.
4014 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4015 declared later): Update test case results.
4016
4017 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
4018
4019 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
4020 to be in alphabetical order.
4021 (trace_args): Spelling fixes.
4022
4023 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
4024
4025 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
4026 so they don't collide with user-defined macros.
4027 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
4028 this was never guaranteed, and now that we're using gnulib stdint,
4029 which defines int_fast16_t to long int, the problem is exposed.
4030
4031 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
4032
4033 * data/c.m4 (b4_basename): Simplify a bit, since we don't
4034 need the full POSIX semantics (and weren't implementing them
4035 anyway).
4036
4037 Adjust to Autoconf 2.60 and today's gnulib.
4038 * bootstrap (gnulib_modules): Add stdint.
4039 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
4040 no longer copies it.
4041 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
4042 since stdint needs the former and wcwidth (which is now required
4043 by mbswidth) needs the latter.
4044 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
4045 work around a compatibility glitch between gettext 0.14.6 and
4046 Autoconf 2.60.
4047 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
4048 Do not check for uintptr_t, since new stdint module does the right
4049 thing.
4050 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
4051 Add stdint.h, stdint_.h, wcwidth.h.
4052 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
4053 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
4054 stdint.m4, wchar_t.m4, wcwidth.m4.
4055 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
4056 usual order for ../lib/*.h files.
4057 (file_name_split): Use last_component, not base_name, to adjust
4058 to gnulib changes.
4059 * src/parse-gram.h: Include <strverscmp.h> in the usual order
4060 for ../lib/*.h files.
4061 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
4062 Define unconditionally, since we now assume the stdint module.
4063 * src/scan-skel.l: Include <dirname.h>.
4064 (BASE_QPUTS): Use last_component, not base_name.
4065 * src/system.h: Include <unlocked-io.h> in the usual order
4066 for ../lib/*.h files. Include <stdint.h> unconditionally,
4067 since we now use the stdint module.
4068 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
4069 HAVE_UINTPTR_T, since we now use the stdint module.
4070 (base_name): Remove decl, since files now include <dirname.h>
4071 to get the decl.
4072
4073 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
4074
4075 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
4076 New, default to 1.
4077 * data/yacc.c, data/glr.c, data/location.cc: Use them.
4078 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
4079 default.
4080 * tests/calc.at: Adjust.
4081
4082 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
4083
4084 * data/c.m4 (b4_basename): New.
4085 (b4_syncline): Also output the location of its invocation (from
4086 the skeleton).
4087 (b4_user_action, b4_define_user_action, b4_user_actions)
4088 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
4089 (b4_user_stype): New.
4090 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
4091
4092 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
4093
4094 In the grammar file, the first column is 1 not 0 on the first line as
4095 on every other line.
4096 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
4097 * tests/input.at (Torturing the Scanner): Update output.
4098
4099 * src/scan-gram.l (scanner_cursor): Declare it static.
4100
4101 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
4102
4103 In warnings, say "previous declaration" rather than "first
4104 declaration".
4105 * src/symtab.c (redeclaration): Do that here.
4106 * src/reader.c (record_merge_function_type): In the case of a result
4107 type clash, report the previous declaration rather than the very first
4108 one in the grammar file.
4109 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4110 declared later): Add a third declaration to check this behavior.
4111 * tests/input.at (Incompatible Aliases): Update output.
4112
4113 2006-06-27 Akim Demaille <akim@epita.fr>
4114
4115 * doc/Doxyfile.in: New.
4116 * doc/Makefile.am: Use it.
4117 * src/lalr.h, src/symtab.h: Initial doxygenation.
4118
4119 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4120
4121 Don't miss %merge result type warnings just because the LHS types are
4122 declared after the %merge. This continues the effort of the previous
4123 patch.
4124 * src/reader.c (get_merge_function): Don't set the merger type yet.
4125 (record_merge_function_type): New function for setting the merger type
4126 and checking for clashes.
4127 (grammar_current_rule_merge_set): Set the location of the %merge for
4128 the current rule.
4129 (packgram): Invoke record_merge_function_type for each rule now that
4130 all symbol type declarations have been parsed.
4131 * src/reader.h (merger_list.type_declaration_location): New member
4132 storing the location of the first %merge from which the type for this
4133 merging function was derived.
4134 * src/symlist.h (symbol_list.merger_declaration_location): New member
4135 storing the location of a rule's %merge, if any.
4136 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4137 declared later): New test to catch the error fixed by the above patch.
4138
4139 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4140
4141 Get action warnings (grammar_rule_check) right even when symbol
4142 declarations appear after the rules. Discussed at
4143 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
4144 and
4145 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
4146 Don't mistake the type of $$ in a midrule to be that of its parent
4147 rule's $$.
4148 * src/reader.c (grammar_current_rule_end): Don't invoke
4149 grammar_rule_check yet since not all symbol declarations may have been
4150 parsed yet.
4151 (grammar_midrule_action): Likewise.
4152 Don't record whether the midrule's $$ has been used yet since actions
4153 haven't been translated yet.
4154 Record the midrule's parent rule and its RHS index within the parent
4155 rule.
4156 (grammar_current_rule_action_append): Don't translate the action yet
4157 since not all symbol declarations may have been parsed yet and, thus,
4158 warnings about types for $$, $n, @$, and @n can't be reported yet.
4159 (packgram): Translate the action and invoke grammar_rule_check now that
4160 all symbol declarations have been parsed.
4161 * src/scan-code.l (handle_action_dollar): Now that this is invoked
4162 after parsing the entire grammar file, the symbol list here in the case
4163 of a midrule is actually the midrule's empty RHS, so reference its
4164 parent rule's RHS where necessary.
4165 On the other hand, now that you can already know it's a midrule, you
4166 aren't forced to think $$ has the same type as its parent rule's $$.
4167 (handle_action_at): In the case of a midrule, reference the parent rule
4168 where necessary.
4169 * src/symlist.c (symbol_list_new): Initialize new midrule-related
4170 members.
4171 (symbol_list_length): Now that this is invoked after all rules have
4172 been parsed, a NULL symbol (rather than a NULL symbol list node)
4173 terminates a rule. symbol_list_print already does this correctly.
4174 * src/symlist.h (symbol_list.midrule_parent_rule,
4175 symbol_list.midrule_parent_rhs_index): New members so that midrules can
4176 remember their relationships with their parents.
4177 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
4178 fixed by the above patch.
4179 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
4180 implementing...
4181 (Unused values): ... this old test case and...
4182 (Unused values before symbol declarations): ... this new test case.
4183 This one is the same as `Unused values' except that all symbol
4184 declarations appear after the rules in order to catch the rest of the
4185 errors fixed by the above patch.
4186
4187 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4188
4189 More cleanup.
4190 * src/reader.c (current_rule): Declare it static since it's no longer
4191 used outside this file.
4192 (grammar_current_rule_action_append): Remove redundant arguments from
4193 translate_rule_action invocation.
4194 * src/reader.h (current_rule): Remove this unused extern.
4195 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
4196 * src/scan-code.l (translate_rule_action): Likewise.
4197
4198 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
4199
4200 Clean up yesterday's patch.
4201 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
4202 to...
4203 * src/reader.c (grammar_current_rule_action_append): ... here for
4204 consistency with grammar_current_rule_symbol_append.
4205 * tests/regression.at (Braced code in declaration in rules section):
4206 Make yyerror and yylex static as usual.
4207
4208 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
4209
4210 Fix bug that mistakes braced code in a declaration in the rules section
4211 to be a rule action. Mentioned at
4212 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
4213 * src/scan-gram.l: Move midrule action detection from the start of the
4214 scanning of any braced code to...
4215 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
4216 action. For readability, use $2 and @2 rather than the equivalent
4217 global variables.
4218 * tests/regression.at (Braced code in declaration in rules section):
4219 New test to catch the error fixed by the above patch.
4220
4221 Work on code readability some.
4222 * src/scan-code.l (current_rule): Get rid of this misleading and
4223 redundant declaration: it's actually extern'ed in reader.h.
4224 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
4225 translate_action): Add a rule argument and use it instead of the global
4226 current_rule.
4227 (translate_rule_action): This already receives current_rule through an
4228 argument, so pass it on to translate_action instead of assigning
4229 current_rule to current_rule.
4230 (translate_symbol_action, translate_code): Pass rule = NULL to
4231 translate_action.
4232
4233 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
4234
4235 Rename %before-definitions to %start-header and %after-definitions to
4236 %end-header. Don't use these declarations to separate pre-prologue
4237 blocks from post-prologue blocks. Add new order-independent
4238 declarations %before-header and %after-header as alternatives to the
4239 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
4240 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
4241 * NEWS (2.3+): Update for these changes.
4242 * data/glr.c (b4_before_definitions): Update to...
4243 (b4_start_header): ... this.
4244 (b4_after_definitions): Update to...
4245 (b4_end_header): ... this.
4246 * data/glr.cc: Likewise.
4247 * data/lalr1.cc: Likewise.
4248 * data/yacc.c: Likewise.
4249 * doc/bison.texinfo (The prologue): Update names, and replace remaining
4250 prologue blocks with %*-header declarations.
4251 (Calc++ Parser): Likewise.
4252 (Decl Summary): Update names.
4253 (Table of Symbols): Update description.
4254 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
4255 (PERCENT_END_HEADER): ... this.
4256 (PERCENT_BEFORE_DEFINITIONS): Update to...
4257 (PERCENT_START_HEADER): ... this.
4258 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4259 (declaration): Update token names and m4 macro names.
4260 When parsing %end-header and %start-header, invoke translate_code
4261 before muscle_code_grow, and no longer set global booleans to remember
4262 whether these declarations have been seen.
4263 Parse new %after-header and %before-header.
4264 * src/reader.c (before_definitions, after_definitions): Remove.
4265 (prologue_augment): Accept a new bool argument to specify whether to
4266 augment the pre-prologue or post-prologue.
4267 * src/reader.h (before_definitions, after_definitions): Remove these
4268 extern's.
4269 (prologue_augment): Add new bool argument.
4270 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
4271 (PERCENT_END_HEADER): ... this.
4272 (PERCENT_BEFORE_DEFINITIONS): Update to...
4273 (PERCENT_START_HEADER): ... this.
4274 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4275 * tests/actions.at (Printers and Destructors): Update names.
4276
4277 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
4278
4279 Add comparison operators for C++ location classes. Discussed at
4280 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
4281 * data/c++.m4 (b4_define_location_comparison): New boolean %define
4282 declaration indicating whether filename_type has an operator==. If
4283 filename_type is `std::string', it defaults to `1', `0' otherwise.
4284 * data/location.cc: Iff b4_define_location_comparison is `1', add
4285 operator== and operator!= for class position and for class location.
4286
4287 Some minor fixes.
4288 * src/scan-action.l: Remove unused file.
4289 * src/symtab.c (symbol_printer_set): Use printer_location not
4290 destructor_location.
4291 * src/symtab.h (struct symbol): Replace incorrect source comment for
4292 printer members.
4293 * tests/input.at (Incompatible Aliases): Update output with correct
4294 printer location.
4295
4296 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
4297
4298 Don't put the pre-prologue in the header file. For the yacc.c code
4299 file and the glr.c header and code files, move the pre-prologue before
4300 the token definitions. Add new %before-definitions and
4301 %after-definitions to declare code that will go in both the header file
4302 and code file. Discussed at
4303 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
4304 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
4305 and
4306 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
4307 * NEWS (2.3+): Describe these changes.
4308 * data/glr.c (b4_pre_prologue): Move from within to before...
4309 (b4_shared_declarations): ... this.
4310 Add new b4_before_definitions before b4_token_enums.
4311 Add new b4_after_definitions at the end.
4312 * data/glr.cc (b4_pre_prologue): Replace with...
4313 (b4_before_definitions): ... this in the header file.
4314 (b4_after_definitions): New near the end of the header file.
4315 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
4316 code file right before including the header file.
4317 (b4_before_definitions): New in the previous position of
4318 b4_pre_prologue in the header file.
4319 (b4_after_definitions): New near the end of the header file.
4320 * data/yacc.c: Clean up some m4 quoting especially in the header file.
4321 (b4_token_enums_defines): In the code file, move to right before
4322 YYSTYPE for consistency with the header file.
4323 (b4_before_definitions): New right before b4_token_enums_defines in
4324 both the header and code file.
4325 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
4326 header and code file.
4327 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
4328 of prologues for %union dependencies.
4329 (Decl Summary): In %defines description, mention the effect of
4330 %before-definitions and %after-definitions on the header file.
4331 (Calc++ Parser): Forward declare driver in a %before-definitions rather
4332 than in the pre-prologue so that make check succeeds.
4333 (Table of Symbols): Add entries for %before-definitions and
4334 %after-definitions.
4335 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
4336 %before-definitions.
4337 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
4338 (declaration): Parse those declarations and append to
4339 b4_before_definitions and b4_after_definitions, respectively.
4340 * src/reader.c (before_definitions, after_definitions): New bools to
4341 track whether those declarations have been seen.
4342 (prologue_augment): Add to the post-prologue if %union,
4343 %before-definitions, or %after-definitions has been seen.
4344 * src/reader.h (before_definitions, after_definitions): New extern's.
4345 * src/scan-gram.l: Scan the new declarations.
4346 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
4347 prologue block in a %before-definitions or a %after-definitions based
4348 on whether the %union is declared.
4349 * tests/regression.at (Early token definitions with --yacc, Early token
4350 definitions without --yacc): Move tests for token definitions into the
4351 post-prologue since token names are no longer defined in the
4352 pre-prologue.
4353
4354 2006-06-20 Akim Demaille <akim@epita.fr>
4355
4356 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
4357 (symbol_get): Use it.
4358 * src/parse-gram.y: Use it.
4359
4360 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
4361
4362 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
4363 build succeeds when configured with --enable-gcc-warnings.
4364
4365 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
4366
4367 * src/parse-gram.y (char_name): New function.
4368 (CHAR, STRING, string_content): For %printer, properly escape.
4369 (ID): Prefer fputs to fprintf.
4370 (id): Reindent to be consistent with other rules.
4371 Properly quote char.
4372
4373 The Translation Project changed its way of publishing translations
4374 to maintainers. I haven't received any responses to my request
4375 for supporting the old way, or for documenting the new way. I
4376 have modified 'bootstrap' to use screen scraping
4377 (in this case, HTML scraping). This is unreliable and inelegant,
4378 but I don't see any better way. Yuck.
4379 * bootstrap (TP_URL, WGET_COMMAND): New vars.
4380 (get_translations): New function, which uses HTML scraping to
4381 deduce locations of latest translations.
4382 Use this function to grab both bison and bison-runtime .po files.
4383 Don't bother priming the pump for the runtime-po domain any more,
4384 as it's now translated better than bison is.
4385
4386 2006-06-19 Akim Demaille <akim@epita.fr>
4387
4388 * src/scan-gram.l: No longer "parse" things after `%union' until
4389 `{'. Rather, return a single "%union" token.
4390 No longer make symbols: return strings, and leave the conversion
4391 to symbols to the parser.
4392 (SC_PRE_CODE, token_type): Remove.
4393 * src/parse-gram.y (%union): New field `character'.
4394 Sort tokens.
4395 (CHAR): New token.
4396 (ID, ID_COLON): Now that the scanner no longer makes them
4397 identifiers, adjust all uses to invoke symbol_get.
4398 (id_colon): New, wraps the conversion from string to symbol.
4399 (%union): Accept a possible union_name.
4400 (symbol): Now can be a char.
4401 * data/c.m4 (b4_union_name): Leave a default value.
4402 * data/glr.c, data/yacc.c: Use it.
4403
4404 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
4405
4406 For associating token numbers with token names for "yacc.c", don't use
4407 #define statements unless `--yacc' is specified; always use enum
4408 yytokentype. Most important discussions start at:
4409 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
4410 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
4411 and
4412 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
4413 * NEWS (2.3+): Mention.
4414 * data/c.m4 (b4_yacc_if): New.
4415 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
4416 token #define's.
4417 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
4418 on token name definitions.
4419 * src/getargs.c (usage): Capitalize `Yacc' in English.
4420 * src/output.c (prepare): Define b4_yacc_flag.
4421 * tests/regression.at (Early token definitions): Test that tokens names
4422 are defined before the pre-prologue not just before the post-prologue.
4423 Remove this test case and copy to...
4424 (Early token definitions with --yacc): ... this to test #define's.
4425 (Early token definitions without --yacc): ... and this to test enums.
4426
4427 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
4428
4429 * NEWS: Reword the post-2.3 change to not be so optimistic about
4430 removing the old "look-ahead" spelling.
4431 Update previous look-ahead/lookahead change reports.
4432 * REFERENCES: look-ahead -> lookahead (since that's
4433 what he actually wrote).
4434 * doc/refcard.tex: look ahead -> lookahead,
4435 look-ahead -> lookahead
4436
4437 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
4438
4439 For consistency, use `lookahead' instead of `look-ahead' or
4440 `look_ahead'. Discussed starting at
4441 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
4442 and then at
4443 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
4444 * NEWS: For the next release, note the change to `--report'.
4445 * TODO, doc/bison.1: Update English.
4446 * doc/bison.texinfo: Update English.
4447 (Understanding Your Parser, Bison Options): Document as
4448 `--report=lookahead' rather than `--report=look-ahead'.
4449 * src/conflicts.c: Update English in comments.
4450 (lookahead_set): Rename from look_ahead_set.
4451 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
4452 (resolve_sr_conflict): Rename local look_ahead_tokens to
4453 lookahead_tokens, and update other uses.
4454 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
4455 count_rr_conflicts, conflicts_free): Update uses.
4456 * src/getargs.c (report_args): Move "lookahead" before alternate
4457 spellings.
4458 (report_types): Update uses.
4459 (usage): For `--report' usage description, state `lookahead' spelling
4460 rather than `look-ahead'.
4461 * src/getargs.h (report.report_lookahead_tokens): Rename from
4462 report_look_ahead_tokens.
4463 * src/lalr.c: Update English in comments.
4464 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
4465 (state_lookahead_tokens_count): Rename from
4466 state_look_ahead_tokens_count.
4467 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4468 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
4469 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4470 Update other uses.
4471 Update English in output.
4472 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
4473 * src/print.c: Update English in comments.
4474 (lookahead_set): Rename from look_ahead_set.
4475 (print_reduction): Rename argument lookahead_token from
4476 look_ahead_token.
4477 (print_core, state_default_rule, print_reductions, print_results):
4478 Update uses.
4479 * src/print_graph.c: Update English in comments.
4480 (print_core): Update uses.
4481 * src/state.c: Update English in comments.
4482 (reductions_new): Update uses.
4483 (state_rule_lookahead_tokens_print): Rename from
4484 state_rule_look_ahead_tokens_print, and update other uses.
4485 * src/state.h: Update English in comments.
4486 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
4487 (state_rule_lookahead_tokens_print): Rename from
4488 state_rule_look_ahead_tokens_print.
4489 * src/tables.c: Update English in comments.
4490 (conflict_row, action_row): Update uses.
4491 * tests/glr-regression.at
4492 (Incorrect lookahead during deterministic GLR,
4493 Incorrect lookahead during nondeterministic GLR): Rename
4494 print_look_ahead to print_lookahead.
4495 * tests/torture.at: Update English in comments.
4496 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
4497 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
4498 (Many lookahead tokens): Update uses.
4499 * data/glr.c: Update English in comments.
4500 * lalr1.cc: Likewise.
4501 * yacc.c: Likewise.
4502 * src/conflicts.h: Likewise.
4503 * src/lalr.h: Likewise.
4504 * src/main.c: Likewise.
4505 * src/output.c: Likewise.
4506 * src/parse-gram.c: Likewise.
4507 * src/tables.h: Likewise.
4508 * tests/calc.at: Likewise.
4509
4510 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
4511
4512 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
4513
4514 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
4515
4516 * TODO: Add request from Nelson H. F. Beebe to be able to install
4517 Bison without installing the yacc script.
4518
4519 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4520
4521 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
4522 and yytext if they're already #define'd.
4523 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
4524 * src/scan-code-c.c: ... here.
4525 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
4526 <config.h>.
4527
4528 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4529
4530 Get Bison to build again when configured with --enable-gcc-warnings.
4531 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
4532 missing #include's.
4533 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
4534 loc argument as it shadows a global.
4535 * src/scan-gram.l: Remove stray comma that prevents boundary_set
4536 invocation.
4537
4538 * src/.cvsignore: Add scan-code.c.
4539
4540 2006-06-07 Akim Demaille <akim@epita.fr>
4541
4542 * src/scan-gram.l: Move the "add a trailing ; to actions" code
4543 to...
4544 * src/scan-code.l: here.
4545 * tests/input.at (Torturing the Scanner): Fix another location
4546 error.
4547
4548 2006-06-07 Akim Demaille <akim@epita.fr>
4549
4550 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
4551
4552 2006-06-06 Akim Demaille <akim@epita.fr>
4553
4554 Extract the parsing of user actions from the grammar scanner.
4555 As a consequence, the relation between the grammar scanner and
4556 parser is much simpler. We can also split "composite tokens" back
4557 into simple tokens.
4558 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
4559 * src/scan-gram.l (add_column_width, adjust_location): Move to and
4560 rename as...
4561 * src/location.h, src/location.c (add_column_width)
4562 (location_compute): these.
4563 Fix the column count: the initial column is 0.
4564 (location_print): Be robust to ending column being 0.
4565 * src/location.h (boundary_set): New.
4566 * src/main.c: Adjust to scanner_free being renamed as
4567 gram_scanner_free.
4568 * src/output.c: Include scan-code.h.
4569 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
4570 Use boundary_set.
4571 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
4572 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
4573 which is now, again, a separate token.
4574 Adjust all dependencies.
4575 Whereever actions with $ and @ are used, use translate_code.
4576 (action): Remove this nonterminal which is now useless.
4577 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
4578 (grammar_current_rule_action_append): Use translate_code.
4579 (packgram): Bound check ruleno, itemno, and rule_length.
4580 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
4581 (last_string, last_braced_code_loc, max_left_semantic_context)
4582 (scanner_initialize, scanner_free, scanner_last_string_free)
4583 (gram_out, gram_lineno, YY_DECL_): Move to...
4584 * src/scan-gram.h: this new file.
4585 (YY_DECL): Rename as...
4586 (GRAM_DECL): this.
4587 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
4588 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4589 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4590 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4591 Move these declarations, and...
4592 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
4593 these to...
4594 * src/flex-scanner.h: this new file.
4595 * src/scan-gram.l (rule_length, rule_length_overflow)
4596 (increment_rule_length): Remove.
4597 (last_braced_code_loc): Rename as...
4598 (gram_last_braced_code_loc): this.
4599 Adjust to the changes of the parser.
4600 Move all the handling of $ and @ into...
4601 * src/scan-code.l: here.
4602 * src/scan-gram.l (handle_dollar, handle_at): Remove.
4603 (handle_action_dollar, handle_action_at): Move to...
4604 * src/scan-code.l: here.
4605 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
4606 scan-code.h, scan-code-c.c, scan-gram.h.
4607 (EXTRA_bison_SOURCES): Add scan-code.l.
4608 (BUILT_SOURCES): Add scan-code.c.
4609 (yacc): Be robust to white spaces.
4610
4611 * tests/conflicts.at, tests/input.at, tests/reduce.at,
4612 * tests/regression.at: Adjust the column numbers.
4613 * tests/regression.at: Adjust the error message.
4614
4615 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4616
4617 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4618 Use Akim's wording from
4619 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
4620
4621 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4622
4623 Between Bison releases, manually append `+' to the previous Bison
4624 release number, and use that as a signal to automatically print the
4625 ChangeLog's CVS Id keyword from --version. Discussed starting at
4626 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
4627 * ChangeLog: Add Id header.
4628 * configure.ac (AC_INIT): Append `+' to `2.3'.
4629 * src/.cvsignore: Add revision.c.
4630 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
4631 (BUILT_SOURCES): Add revision.c.
4632 (revision.c): New target rule. This file defines a new global variable
4633 named revision. It initializes it with either the Id from ChangeLog
4634 or, if VERSION doesn't contain `+', with the empty string.
4635 * src/getargs.c (version): Print the value of revision.
4636 * src/revision.h: Extern revision.
4637
4638 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
4639
4640 * NEWS: Version 2.3.
4641 * configure.ac (AC_INIT): Likewise.
4642
4643 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
4644
4645 * data/glr.c (YYRECOVERING): Define to be a function-like macro
4646 with no arguments, not as an object-like macro. This is for
4647 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
4648 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
4649 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
4650 Document this.
4651
4652 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
4653
4654 * src/getargs.c (usage): Back out yesterday's modification of the
4655 --help output so that we don't have to wait for translation before
4656 releasing 2.3.
4657
4658 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
4659
4660 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
4661 Problem reported by Akim Demaille.
4662
4663 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4664
4665 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4666
4667 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
4668
4669 * data/yacc.c (yy_reduce_print): Omit trailing white space in
4670 generated source code. Problem reported by Frans Englich in
4671 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
4672
4673 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
4674
4675 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
4676 shell, not within 'make', so that 'make' by an ordinary builder
4677 (using GNU make) does not worry about configuring gzip. This also
4678 works around a bug reported independently by Keith Thompson and by
4679 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
4680 stderr rather than stdout, messing up the build logs.
4681
4682 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4683
4684 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
4685 to make sure that YYID will never be unused. This fixes a 'make
4686 maintainer-check' failure caused by the recent changes to the 'Trivial
4687 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
4688 not used.
4689 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
4690
4691 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4692
4693 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
4694 state before an empty RHS is always resolved here. Only the location
4695 of that state is guaranteed to be resolved, and that's enough. This
4696 fixes the remaining bug reported by Derek M. Jones in
4697 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4698 * tests/glr-regression.at (Uninitialized location when reporting
4699 ambiguity): Test the above case.
4700 Also, the embedded comments in this test case claim it checks the case
4701 of an empty RHS that has inherited the initial location. However, the
4702 corresponding LHS was already resolved, so yyresolveLocations didn't
4703 actually have reason to modify it. Fix this by forcing
4704 nondeterministic operation at the beginning of the parse.
4705
4706 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
4707
4708 * data/c.m4 (b4_yy_symbol_print_generate):
4709 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
4710 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
4711 of the bugs reported today by Derek M Jones in
4712 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4713 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
4714 defined to be a type name without parens or brackets.
4715 (Location Type): Similarly for YYLTYPE.
4716 * tests/regression.at (Trivial grammars): Put in a test for this
4717 bug that will be caught by 'make maintainer-check' (though not,
4718 alas, by 'make check' unless your compiler is picky).
4719
4720 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
4721
4722 * NEWS: Version 2.2.
4723 * configure.ac (AC_INIT): Likewise.
4724
4725 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
4726
4727 * data/glr.c (yyreportTree): Make room in yystates for the state
4728 preceding the RHS. This fixes the segmentation fault reported by Derek
4729 M. Jones in
4730 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
4731 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
4732 to the user. Reported for yyreportTree by Derek M. Jones later in the
4733 same thread.
4734 * THANKS: Add Derek M. Jones.
4735 Update my email address.
4736 Fix typo in Steve Murphy's name.
4737
4738 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
4739
4740 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
4741 checking against YYLAST that caused the parser to miss a potential
4742 alternative in its diagnostic.
4743 Problem reported by Maria Jose Moron Fernandez in
4744 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
4745 * data/lalr1.cc (yysyntax_error_): Likewise.
4746 * data/yacc.c (yysyntax_error): Likewise.
4747 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
4748 tokens, in case we run into an older C compiler.
4749 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
4750 Use them to check for the off-by-one error fixed above.
4751
4752 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
4753 YYSIZE_T, not size_t.
4754 * tests/regression.at (Trivial grammars): New test, to catch
4755 the error fixed by the above patch.
4756
4757 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4758
4759 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
4760 scheme.
4761 Reported by Steve Murphy.
4762
4763 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4764
4765 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
4766 * data/glr.cc: b4_location_flag is now b4_locations_flag.
4767
4768 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4769
4770 Implement --trace=m4.
4771 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
4772 * src/output.c (output_skeleton): When set, pass -dV to m4.
4773
4774 Factor the handling of flags in m4.
4775 * src/output.c (prepare): Rename the muscle names debug, defines,
4776 error_verbose to debug_flag, defines_flag, error_verbose_flag.
4777 * data/c.m4: Adjust.
4778 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
4779 Use b4_define_flag_if to define other b4_FLAG_if macros.
4780 (b4_location_if): As a consequence, rename as...
4781 (b4_locations_if): this, for consistency.
4782 Adjust all the skeletons.
4783
4784 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4785
4786 * etc/bench.pm: Shorten bench names.
4787
4788 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4789
4790 * src/output.h, src/output.c (error_verbose): Move to...
4791 * src/getargs.h, src/getargs.c: here.
4792 Sort the flags.
4793 Adjust dependencies.
4794
4795 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
4796
4797 * data/c.m4 (b4_copyright): Put the special exception for Bison
4798 skeletons here, so we don't have to put it in each skeleton. All
4799 uses changed. Suggested by Akim Demaille. Also, wrap the
4800 copyright notice, in case it is longer than 80 columns. Replace
4801 comma by newline after title.
4802
4803 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
4804
4805 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
4806 incompatibility, not a bug. Mention that it wasn't fixed as of
4807 flex 2.5.33.
4808
4809 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
4810
4811 * examples/extexi: Enforce the precedence of concatenation over
4812 >>.
4813 Reported by Tommy Nordgren.
4814
4815 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
4816
4817 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
4818 with the member "token".
4819 Reported by Martin Nylin.
4820
4821 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
4822
4823 * data/glr.c: Switch to Bison 2.2 special-exception language in
4824 the copyright notice. Use more-regular format for titles and
4825 copyright notices.
4826 * data/glr.cc: Likewise.
4827 * data/location.cc: Likewise.
4828 * data/yacc.cc: Likewise.
4829 * doc/bison.texinfo (Conditions): Document this.
4830 * NEWS: likewise. Upgrade version to 2.2.
4831
4832 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
4833
4834 * data/glr.cc: Remove dead code.
4835
4836 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4837
4838 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4839 that variable and the line breaks the bootstrap. Problem reported
4840 by Juan M. Guerrero.
4841
4842 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
4843
4844 * doc/bison.texinfo (Multiple start-symbols): New.
4845
4846 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
4847
4848 * etc/README, etc/bench.pl: New.
4849
4850 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
4851
4852 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4853 rule.
4854 Reported by Mickael Labau.
4855 * tests/input.at (Torturing the Scanner): Test it.
4856
4857 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4858
4859 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4860 Problem reported by Bob Rossi.
4861
4862 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4863
4864 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4865 and didn't really work.
4866 For the index, use @ifnotinfo, not @iftex.
4867 Minor cleanups of spacing and terminology.
4868
4869 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
4870
4871 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4872 of AT_NAME_PREFIX when %name-prefix is not used.
4873
4874 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
4875
4876 Apply --prefix to C++ skeletons too: they change the namespace.
4877 The test suite already exercize these cases.
4878 * data/c++.m4 (b4_namespace): New.
4879 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4880 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4881 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4882 * doc/bison.texinfo: Document it.
4883 (Option Cross Key): Use @multitable in all formats. It looks
4884 nicer, even in TeX outputs.
4885 (Rules): Use the same code whatever the output type is.
4886 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4887 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4888 * tests/calc.at: Use it, instead of hard coding `yy'.
4889
4890 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4891
4892 * TODO: Remove dead items.
4893
4894 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4895
4896 * doc/FAQ: Remove, merged into...
4897 * doc/bison.texinfo (FAQ): this.
4898 * doc/Makefile.am (EXTRA_DIST): Adjust.
4899
4900 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4901
4902 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4903 even if empty.
4904 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4905 * doc/bison.texinfo (Calc++ Scanner): Use it.
4906
4907 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4908
4909 Fix two nits reported by twlevo, plus one more that I discovered.
4910
4911 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4912 this is the usual Bison style.
4913 * src/location.h (location_print): Likewise.
4914
4915 * src/reader.h (token_name): Likewise.
4916
4917 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4918
4919 Fix some nits reported by twlevo.
4920 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4921 and "POSIX". Use more-modern syntax for URLs. Mention C++
4922 and ask for Java. Don't hardwire OS version numbers. Add
4923 copyright notice.
4924 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4925 * src/conflicts.c (solved_conflicts_obstack): Now static.
4926
4927 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4928
4929 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4930 page. Say "you can use it" not "you may use it" as on the web page;
4931 we're describing capabilities not granting permission.
4932
4933 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4934
4935 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4936 shadowing warnings. Use usual patter for iterating through RHS.
4937 * tests/glr-regression.at
4938 (Uninitialized location when reporting ambiguity):
4939 Modify yylex so that it uses its argument, rather than trying
4940 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4941 const char -> char const.
4942
4943 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4944 Don't use tabs inside commands; it messes up 'ps'.
4945 Problem reported by twlevo.
4946
4947 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4948
4949 * tests/glr-regression.at (Uninitialized location when reporting
4950 ambiguity): New test case.
4951 * data/glr.c (yyresolveLocations): New function, which uses
4952 YYLLOC_DEFAULT.
4953 (yyresolveValue): Invoke yyresolveLocations before reporting an
4954 ambiguity.
4955 * doc/bison.texinfo (Default Action for Locations): Note
4956 YYLLOC_DEFAULT's usage for ambiguity locations.
4957 (GLR Semantic Actions): Cross-reference those notes.
4958
4959 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4960
4961 * tests/glr-regression.at (Leaked semantic values when reporting
4962 ambiguity): Remove unnecessary union and type declarations.
4963 (Leaked lookahead after nondeterministic parse syntax error): New test
4964 case.
4965 * data/glr.c (yyparse): Check for zero stacks remaining before
4966 attempting to shift the lookahead so that you don't lose it.
4967
4968 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4969
4970 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4971 * tests/glr-regression.at (Leaked semantic values when reporting
4972 ambiguity): New test case.
4973 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4974 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4975 now unnecessary yystackp parameter.
4976 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4977 destructors can be called.
4978
4979 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4980 in existing testcases.
4981
4982 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4983
4984 Don't leak semantic values for parent RHS when a user action cuts the
4985 parser, and clean up related code a bit.
4986 * tests/glr-regression.at (Leaked merged semantic value if user action
4987 cuts parse): Rename to...
4988 (Leaked semantic values if user action cuts parse): ... this. Add check
4989 for leaked parent RHS values.
4990 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4991 between an unresolved state (non-empty chain of semantic options) and
4992 an incomplete one (signaled by an empty chain).
4993 (yyresolveStates): Document the interface. Move all manipulation of a
4994 successfully or unsuccessfully resolved yyGLRState to...
4995 (yyresolveValue): ... here so that yyresolveValue always leaves a
4996 yyGLRState with consistent data and thus is easier to understand.
4997 Remove the yyvalp and yylocp parameters since they are always just
4998 taken from the yys parameter. When reporting a discarded merged value
4999 in debugging output, note that it is incompletely merged. Document the
5000 interface.
5001 (yyresolveAction): If resolving any of the RHS states fails, destroy
5002 them all rather than leaking them. Thus, as long as user actions are
5003 written to clean up the RHS correctly, yyresolveAction always cleans up
5004 the RHS of a semantic option. Document the interface.
5005
5006 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
5007
5008 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
5009 led to a segmentation fault in GNU Pascal. Problem reported
5010 by Waldek Hebisch.
5011
5012 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
5013
5014 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
5015 mid-rule action inside a nonterminal symbol in order to declare a
5016 destructor for its semantic value.
5017
5018 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
5019
5020 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
5021 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
5022 __cplusplus && ! defined _STDLIB_H && !
5023 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
5024 defined free))]: Include <stdlib.h> rather than rolling our own
5025 declarations of malloc and free, to avoid problems with
5026 incompatible declarations (using 'throw') C++'s stdlib.h. This
5027 should fix Debian bug 340012
5028 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
5029 reported by Guillaume Melquiond.
5030
5031 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
5032
5033 * NEWS: Clarify symbols versus types in unused-value warnings.
5034
5035 * configure.ac (AC_INIT): Bump version number.
5036
5037 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
5038
5039 * NEWS: Version 2.1a.
5040 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
5041 since C99 requires this.
5042
5043 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
5044
5045 * m4/c-working.m4: New file.
5046 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
5047
5048 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
5049
5050 * Makefile.maint: Merge from coreutils.
5051
5052 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
5053
5054 More portability fixes for problems summarized by Nelson H. F. Beebe.
5055
5056 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
5057 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
5058 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
5059 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
5060 messes up because C++ code is compiled in 32-bit mode but linked
5061 in 64-bit mode.
5062
5063 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
5064
5065 More portability fixes for problems summarized by Nelson H. F. Beebe.
5066
5067 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
5068 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
5069
5070 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
5071 nodist_PROGRAMS, since we don't need to actually compile the
5072 example if we're just doing a plain 'make'. This avoids bothering
5073 the installer unnecessarily about problems due to weird C++
5074 compilers.
5075
5076 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
5077
5078 More portability fixes for problems summarized by Nelson H. F. Beebe.
5079
5080 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
5081 than #include "...", and compile with -I'.'. The old method was
5082 not portable, according to Posix and the C standard, and it does
5083 not work with Sun C 5.7, where previous #line directives affect
5084 the working directory used in later #include "..." directives.
5085
5086 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5087
5088 Various DJGGP specific issues in /djgpp
5089
5090 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
5091
5092 More portability fixes for problems summarized by Nelson H. F. Beebe.
5093
5094 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
5095 '#include <map>' works and that you can apply ++ to iterators.
5096
5097 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
5098
5099 Work around portability problems summarized by Nelson H. F. Beebe in
5100 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
5101
5102 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5103 that '#include <string>' works.
5104
5105 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
5106 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
5107 "warning: sorry: semantics of inline function static data `const
5108 unsigned char translate_table[262]' are wrong (you'll wind up with
5109 multiple copies)".
5110
5111 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
5112 or, xor to not_, and_, or_, and xor_, respectively. This works
5113 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
5114 random system header somewhere that includes the equivalent of
5115 <iso646.h>.
5116
5117 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
5118 -E" works; it apparently doesn't work with PathScale EKO Compiler
5119 Suite Version 2.0.
5120
5121 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
5122
5123 During deterministic GLR operation, user actions should be able to
5124 influence the parse by changing yychar. To make this easier to fix and
5125 to make glr.c easier to evolve in general, don't maintain yytoken in
5126 parallel with yychar; just compute yytoken when needed.
5127 * tests/glr-regression.at (Incorrect lookahead during deterministic
5128 GLR): Check that setting yychar in a user action has the intended
5129 effect.
5130 * data/glr.c (yyGLRStack): Remove yytokenp member.
5131 (yyclearin): Don't set *yytokenp.
5132 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
5133 yychar rather than *yytokenp to determine the current lookahead.
5134 Compute yytoken locally when needed.
5135 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
5136 point to.
5137
5138 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
5139 after `--report' documentation.
5140
5141 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
5142
5143 * src/parse-gram.y (grammar_declaration): Location of printer
5144 symbol is @1, not list->location. Bug reported by twlevo.
5145 * tests/input.at (Incompatible Aliases): Adjust to above change.
5146
5147 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
5148
5149 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
5150 all the test at once. This makes the output easier to read in the
5151 normal case.
5152
5153 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
5154 got from <http://bro-ids.org/download.html>. The bug is that
5155 when two actions appeared in succession, the second one was
5156 scanned before the first one was added to the grammar rule
5157 as a midrule action. Bison then output the incorrect warning
5158 "parse.y:905.17-906.36: warning: unused value: $3".
5159 * src/parse-gram.y (BRACED_CODE, action): These are no longer
5160 associated with a value.
5161 (rhs): Don't invoke grammar_current_rule_action_append.
5162 (action): Invoke it here instead.
5163 * src/reader.c (grammar_midrule_action): Now extern.
5164 (grammar_current_rule_action_append): Don't invoke
5165 grammar_midrule_action; that is now the scanner's job.
5166 * src/reader.h (last_string, last_braced_code_loc):
5167 (grammar_midrule_action): New decls.
5168 * src/scan-gram.l (last_string): Now extern, sigh.
5169 (last_braced_code_loc): New extern variable.
5170 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
5171 rule already has an action.
5172 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
5173 * tests/input.at (AT_CHECK_UNUSED_VALUES):
5174 Add some tests to check that the above changes fixed the bug.
5175
5176 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
5177
5178 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
5179 All used changed. Check whether the symbol has a destructor,
5180 not whether it is typed.
5181 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
5182 that the values are still reported as unused. All line numbers
5183 adjusted.
5184
5185 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
5186
5187 Work around a bug in bro 0.8, which underparenthesizes its
5188 definition of YYLLOC_DEFAULT.
5189 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
5190 their arguments.
5191 * data/lalr1.cc: Likewise.
5192 * data/yacc.cc: Likewise.
5193
5194 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
5195
5196 Work around a bug in Pike 7.0, and give the Pike folks a
5197 better way to override the usual int widths.
5198 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
5199 user can override the types.
5200 (short): #undef, to work around a bug in Pike 7.0.
5201 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
5202 (union yyalloc.yyss): Use yytype_int16 rather than short.
5203 All uses changed.
5204 (yysigned_char): Remove.
5205 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
5206 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
5207 * tests/regression.at (Web2c Actions): Adjust to above changes.
5208
5209 * src/reader.c (check_and_convert_grammar): New function.
5210 (reader): Close the input file even if something went wrong during
5211 parsing. Minor file descriptor leak reported by twlevo.
5212
5213 * src/assoc.c (assoc_to_string): Use a default: abort (); case
5214 to pacify gcc -Wswitch-default.
5215 * src/scan-gram.l (adjust_location): Use a default: break; case
5216 to pacify gcc -Wswitch-default.
5217 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
5218 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5219 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5220 Move these decls to scan-skel.l, since they don't need to be
5221 visible elsewhere.
5222 * src/scan-skel.l: Accept the above decls.
5223 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
5224 is used.
5225
5226 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
5227
5228 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
5229 since we don't want to insist on a version number at the start
5230 of the changelog every time.
5231 * Makefile.maint: Sync from coreutils a bit better.
5232 (sc_trailing_blank): Renamed from sc_trailing_space.
5233 All uses changed.
5234 (sc_no_if_have_config_h, sc_require_config_h):
5235 (sc_prohibit_assert_without_use): New rules.
5236 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
5237 (sc_dd_max_sym_length): Fix leading spaces in rule.
5238 (sc_system_h_headers): Prefix with @.
5239 (sc_useless_cpp_parens, m4-check): Output line numbers.
5240 (changelog-check): Allow version only in head.
5241 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
5242 satisfy new Makefile.maint rule.
5243 * data/glr.c: Likewise.
5244 * data/glr.cc: Likewise.
5245 * data/lalr1.cc: Likewise.
5246 * data/yacc.c: Likewise.
5247 * lib/ebitsetv.c: Likewise.
5248 * lib/lbitset.c: Likewise.
5249 * lib/subpipe.c: Likewise.
5250 * lib/timevar.c: Likewise.
5251 * src/system.h: Likewise.
5252 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
5253 * djgpp/Makefile.maint: Add copyright notice.
5254 * djgpp/README.in: Likewise.
5255 * djgpp/config.bat: Likewise.
5256 * djgpp/config.site: Likewise.
5257 * djgpp/config_h.sed: Likewise.
5258 * djgpp/djunpack.bat: Likewise.
5259 * djgpp/config.sed: Fix copyright notice to match standard format.
5260 * djgpp/subpipe.h: Likewise.
5261 * lib/bitsetv-print.c: Likewise.
5262 * lib/bitsetv.c: Likewise.
5263 * lib/subpipe.h: Likewise.
5264 * lib/timevar.c: Likewise.
5265 * lib/timevar.h: Likewise.
5266 * djgpp/subpipe.c: Use standard recipe for config.h.
5267 * lib/abitset.c: Likewise.
5268 * lib/bitset.c: Likewise.
5269 * lib/bitset_stats.c: Likewise.
5270 * lib/bitsetv-print.c: Likewise.
5271 * lib/bitsetv.c: Likewise.
5272 * lib/ebitsetv.c: Likewise.
5273 * lib/get-errno.c: Likewise.
5274 * lib/lbitset.c: Likewise.
5275 * lib/subpipe.c: Likewise.
5276 * lib/timevar.c: Likewise.
5277 * lib/vbitset.c: Likewise.
5278 * tests/local.at: Likewise.
5279 * src/scan-gram.l: Don't include verify.h, since system.h does
5280 that for us.
5281 * .x-sc_require_config_h: New file.
5282 * .x-sc_unmarked_diagnostics: New file.
5283
5284 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
5285
5286 Be a bit more systematic about using 'abort'.
5287 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
5288 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
5289 Put 'default: abort ();' before some other case, to satisfy older
5290 pedantic compilers.
5291 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5292 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
5293 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
5294 * src/conflicts.c (resolve_sr_conflict): Likewise.
5295 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
5296 (get_decision_str, get_orientation_str, get_node_alignment_str):
5297 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
5298 (get_linestyle_str, get_arrowstyle_str): Likewise.
5299 * src/conflicts.c (resolve_sr_conflict):
5300 Use a default case rather than one for the one remaining enum
5301 value, to catch invalid enum values as well.
5302 * src/lalr.c (set_goto_map, map_goto):
5303 Prefer "assert (FOO);" to "if (!FOO) abort ();".
5304 * src/nullable.c (nullable_compute, token_definitions_output):
5305 Likewise.
5306 * src/reader.c (packgram, reader): Likewise.
5307 * src/state.c (transitions_to, state_new, state_reduction_find):
5308 Likewise.
5309 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
5310 (symbol_pack): Likewise.
5311 * src/tables.c (conflict_row, pack_vector): Likewise.
5312 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
5313 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
5314 * src/system.h: Don't include <assert.h>.
5315 (assert): New macro.
5316
5317 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
5318 (Destructor Decl, Parser Function, Pure Calling):
5319 Describe rules for braces inside C code more carefully.
5320
5321 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
5322
5323 Fix some porting glitches found by Nelson H. F. Beebe.
5324 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
5325 compilers that don't understand that abort () does not return.
5326 * src/state.c (transitions_to): Likewise.
5327 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5328 that '#include <cstdlib>' works.
5329 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
5330 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
5331 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
5332 for the benefit of some pre-C99 compilers.
5333
5334 * bootstrap: Undo changes to gnulib files that autoreconf made.
5335
5336 Minor fixups to get 'make maintainer-check' to work.
5337 * configure.ac: Don't use -Wnested-externs, as it's incompatible
5338 with the new verify.h implementation.
5339 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
5340 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
5341 * data/yacc.c (YYUSE): Likewise.
5342 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
5343 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
5344 * src/parse-gram.y (declaration): Don't pass a string constant
5345 to a function that expects char *, since GCC might complain
5346 about the constant value.
5347 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
5348 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
5349 before #defining them.
5350 * tests/glr-regression.at
5351 (Incorrectly initialized location for empty right-hand side in GLR):
5352 In yyerror, use the msg arg.
5353 (Corrupted semantic options if user action cuts parse):
5354 (Incorrect lookahead during deterministic GLR):
5355 (Incorrect lookahead during nondeterministic GLR):
5356 Don't name a local var 'index'; it shadows string.h's 'index'.
5357
5358 2006-01-19 Akim Demaille <akim@epita.fr>
5359
5360 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
5361 location, not just parts of it.
5362
5363 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
5364
5365 * NEWS: Document the fact that multiple %unions are now allowed.
5366 * doc/bison.texinfo (Union Decl): Likewise.
5367 * TODO: This feature is now implemented, so remove it from
5368 the wishlist.
5369
5370 * Makefile.maint: Merge with coreutils Makefile.maint.
5371 (CVS_LIST): Use build-aux version if available.
5372 (VERSION_REGEXP): New macro.
5373 (syntax-check-rules): Add sc_no_if_have_config_h,
5374 sc_prohibit_assert_without_use, sc_require_config_h,
5375 sc_useless_cpp_parens.
5376 (sc_obsolete_symbols): Check for O_NDELAY.
5377 (sc_dd_max_sym_length): Track coreutils.
5378 (sc_unmarked_diagnostics): Look in all files, not just *.c.
5379 (sc_useless_cpp_parens): New rule.
5380 (news-date-check): Look for version or today's date.
5381 (changelog-check): Don't require version number near head.
5382 (copyright-check): Use current year instead of hardwiring 2005.
5383 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
5384 (announcement): Add --gpg-key-ID.
5385
5386 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
5387 with "file system".
5388
5389 Avoid undefined behavior that addressed just before the start of an
5390 array. Problem reported by twlevo.
5391 * src/reader.c (packgram): Prepend a new sentinel before ritem.
5392 * src/lalr.c (build_relations): Rely on new sentinel.
5393 * src/gram.c (gram_free): Adjust to new sentinel.
5394
5395 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
5396
5397 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
5398 yylookaheadNeeds. All uses updated.
5399 (yysplitStack): Rename local yynewLookaheadStatuses to
5400 yynewLookaheadNeeds.
5401 * data/glr-regression.at (Incorrect lookahead during nondeterministic
5402 GLR): In comments, change `lookahead status' to `lookahead need'.
5403
5404 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5405
5406 * data/glr.c (yysplitStack): A little stylistic rewrite.
5407
5408 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5409
5410 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
5411
5412 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
5413
5414 * doc/bison.texinfo: Fix some typos.
5415 (GLR Semantic Actions): New subsection discussing special
5416 considerations because GLR semantic actions might be deferred.
5417 (Actions): Mention look-ahead usage of yylval.
5418 (Actions and Locations): Mention look-ahead usage of yylloc.
5419 (Special Features for Use in Actions): Add YYEOF entry and mention it
5420 in the yychar entry.
5421 In the yychar entry, remove mention of the local yychar case (pure
5422 parser) since this is irrelevant information when writing semantic
5423 actions and since it's already discussed in `Table of Symbols' where
5424 yychar is otherwise described as an external variable.
5425 In the yychar entry, don't call it the `current' look-ahead since it
5426 isn't when semantic actions are deferred.
5427 In the yychar and yyclearin entries, add note about deferred semantic
5428 actions.
5429 Add yylloc and yylval entries discussing look-ahead usage.
5430 (Look-Ahead Tokens): When discussing yychar, don't call it the
5431 `current' look-ahead, and do mention yylval and yylloc.
5432 (Error Recovery): Cross-reference `Action Features' when mentioning
5433 yyclearin.
5434 (Table of Symbols): In the yychar entry, don't call it the `current'
5435 look-ahead.
5436 In the yylloc and yylval entries, mention look-ahead usage.
5437
5438 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5439
5440 * tests/glr-regression.at: Update copyright year to 2006.
5441
5442 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5443
5444 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
5445 use during nondeterministic operation to track which stacks have
5446 actually needed the current lookahead.
5447 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
5448 Allocate, deallocate, resize, and otherwise shuffle space for
5449 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
5450 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
5451 appropriately during nondeterministic operation.
5452 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
5453 members to store the current lookahead to be used by the deferred
5454 user action.
5455 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
5456 from which the RHS is taken. Set the lookahead members of the new
5457 yySemanticOption according to the lookahead status for stack yyk.
5458 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
5459 yyaddDeferredAction.
5460 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
5461 members of yySemanticOption before invoking yyuserAction, and then set
5462 them back to their current values afterward.
5463 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
5464 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
5465 * tests/glr-regression.at: Remove `.' from the ends of recent test case
5466 titles for consistency.
5467 (Leaked merged semantic value if user action cuts parse): In order to
5468 suppress lint warnings, use arguments in merge function, and assign
5469 char value < 128 in main.
5470 (Incorrect lookahead during deterministic GLR): New test case.
5471 (Incorrect lookahead during nondeterministic GLR): New test case.
5472
5473 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5474
5475 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
5476 !yyvaluep as signal that no semantic value is available to print.
5477 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
5478 to print a semantic value.
5479
5480 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5481
5482 * tests/glr-regression.at: For consistency with my newer test cases,
5483 don't thank myself.
5484
5485 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5486
5487 * data/glr.c (yyresolveValue): When merging semantic options, if at
5488 least one user action succeeds but a later one cuts the parse, then
5489 destroy the semantic value before returning rather than leaking it.
5490 (yyresolveStates): If a user action cuts the parse and thus
5491 yyresolveValue fails, ignore the (unset) semantic value rather than
5492 corrupting the yyGLRState, and empty the semantic options list since
5493 the user actions should have called all necessary destructors.
5494 Simplify code with YYCHK.
5495 * tests/glr-regression.at (Corrupted semantic options if user action
5496 cuts parse): New test case.
5497 (Undesirable destructors if user action cuts parse): New test case.
5498 Before applying any of this patch, this test case never actually failed
5499 for me... but only because the corrupted semantic options usually
5500 masked this bug.
5501 (Leaked merged semantic value if user action cuts parse): New test
5502 case.
5503
5504 2006-01-05 Akim Demaille <akim@epita.fr>
5505
5506 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
5507
5508 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
5509
5510 * data/c.m4 (b4_c_modern): New macro, with a new provision for
5511 _MSC_VER. Problem reported by Cenzato Marco.
5512 (b4_c_function_def): Use it.
5513 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
5514 b4_c_modern.
5515 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
5516 than rolling our own.
5517
5518 2006-01-04 Akim Demaille <akim@epita.fr>
5519
5520 Also warn about non-used mid-rule values.
5521 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
5522 member.
5523 (symbol_list_new): Adjust.
5524 * src/reader.c (symbol_typed_p): New.
5525 (grammar_rule_check): Use it.
5526 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
5527 Check its rule.
5528 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
5529 Use it.
5530 * tests/actions.at (Exotic Dollars): Adjust.
5531
5532 2006-01-04 Akim Demaille <akim@epita.fr>
5533
5534 * src/reader.c (grammar_midrule_action): If $$ is set in a
5535 mid-rule, move the `used' bit to its lhs.
5536 * tests/input.at (Unused values): New.
5537 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
5538
5539 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
5540
5541 * doc/bison.texinfo (Bison Options): Say more accurately what
5542 --yacc does.
5543 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
5544 about declarations in the grammar when in Yacc mode, as POSIX does
5545 not require a diagnostic when the grammar uses extensions.
5546
5547 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
5548
5549 Warn about dubious constructions like "%token T T".
5550 Reported by twlevo.
5551 * src/symtab.h (struct symbol.declared): New member.
5552 * src/symtab.c (symbol_new): Initialize it to false.
5553 (symbol_class_set): New arg DECLARING, specifying whether
5554 this is a declaration that we want to warn about, if there
5555 is more than one of them. All uses changed.
5556
5557 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
5558 Allow multiple %union directives, whose contents concatenate.
5559 * src/parse-gram.y (grammar_declaration): Likewise.
5560 Use muscle_code_grow, so that we don't need stype_line any more.
5561 All uses changed.
5562
5563 * src/muscle_tab.c (muscle_grow): Fix comment.
5564
5565 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
5566 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
5567 Update copyright year to 2006.
5568
5569 2006-01-03 Akim Demaille <akim@epita.fr>
5570
5571 Have glr.cc pass (some of) the calc.at tests.
5572 * data/glr.cc (b4_parse_param_orig): New.
5573 (b4_parse_param): Improve its definition, and bound it more
5574 clearly in the skeleton.
5575 (b4_epilogue): Append, instead of prepending, in order to keep
5576 #line consistency.
5577 Simplify the generation of auxiliary functions: locations and
5578 purity are mandated.
5579 (b4_global_tokens_and_yystype): Honor it.
5580 * data/location.cc (c++.m4): Don't include it.
5581 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
5582 and AT_SKEL_CC_IF.
5583 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
5584 AT_LALR1_CC_IF.
5585 Be sure to initialize the first position's filename.
5586 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
5587 mandated anyway.
5588 (AT_CHECK_CALC_GLR_CC): New.
5589 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
5590
5591 2006-01-02 Akim Demaille <akim@epita.fr>
5592
5593 * src/output.c (output_skeleton): Don't hard wire the inclusion of
5594 c.m4.
5595 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
5596 * data/glr.cc: Do not include stack.hh.
5597
5598 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5599
5600 * data/glr.c: Reformat whitespace with tabs.
5601 (b4_lpure_formals): Remove this unused m4 macro.
5602 * tests/cxx-type.at: Reformat whitespace with tabs.
5603 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
5604 since it's a member. Rename type to isNterm for clarity.
5605
5606 2005-12-29 Akim <akim@sulaco.local>
5607
5608 Let glr.cc catch up with symbol_value_print.
5609 * data/glr.cc (b4_yysymprint_generate): Replace by...
5610 (b4_yy_symbol_print_generate): this.
5611 (yy_symbol_print, yy_symbol_value_print): Declare them.
5612
5613 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
5614
5615 * src/location.h (boundary): Note that a line or column equal
5616 to INT_MAX indicates an overflow.
5617 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
5618 (rule_length_overflow, increment_rule_length, add_column_width):
5619 New functions.
5620 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
5621 (<SC_BRACED_CODE>"}"):
5622 Use increment_rule_length rather than incrementing it by hand.
5623 (adjust_location, handle_syncline): Diagnose overflow.
5624 (handle_action_dollar, handle_action_at):
5625 Fix bug with monstrosities like $-2147483648.
5626 Remove now-unnecessary checks.
5627 (scan_integer): Verify assumptions and remove now-unnecessary checks.
5628 (convert_ucn_to_byte): Verify assumptions.
5629 (handle_syncline): New arg LOC. All callers changed.
5630 Don't store through a value derived from char const * pointer.
5631
5632 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
5633 GCC warnings.
5634
5635 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
5636
5637 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
5638 Remove unnecessary forward static decls.
5639
5640 2005-12-27 Akim Demaille <akim@epita.fr>
5641
5642 * src/reader.c (grammar_current_rule_check): Also check that $$
5643 is used.
5644 Take the rule to check as argument, hence rename as...
5645 (grammar_rule_check): this.
5646 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
5647 Rename as...
5648 (grammar_rule_begin, grammar_rule_end): these, for consistency.
5649 (grammar_midrule_action, grammar_symbol_append): Now static.
5650 * tests/torture.at (input): Don't rely on the default action
5651 being always performed.
5652 * tests/calc.at: "Set" $$ even when the action is "cut" with
5653 YYERROR or other.
5654 * tests/actions.at (Exotic Dollars): Instead of using unused
5655 values, check that the warning is issued.
5656
5657 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
5658
5659 * NEWS: Improve wording for unused-value warnings.
5660
5661 2005-12-22 Akim Demaille <akim@epita.fr>
5662
5663 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
5664 (b4_yysymprint_generate): Rename as...
5665 (b4_yy_symbol_print_generate): this.
5666 Generate yy_symbol_print instead of yysymprint.
5667 Generate also yy_symbol_value_print, and use it.
5668
5669 2005-12-22 Akim Demaille <akim@epita.fr>
5670
5671 * NEWS: Warn about unused values.
5672 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
5673 a `used' member.
5674 (symbol_list_n_get, symbol_list_n_used_set): New.
5675 (symbol_list_n_type_name_get): Use symbol_list_n_get.
5676 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
5677 * src/reader.c (grammar_current_rule_check): Check that values are
5678 used.
5679 * src/symtab.c (symbol_print): Accept 0.
5680 * tests/existing.at: Remove the type information.
5681 Empty the actions.
5682 Remove useless actions (beware of mid-rule actions: perl -000
5683 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
5684 * tests/actions.at (Exotic Dollars): Use unused values.
5685 * tests/calc.at: Likewise.
5686 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5687 Likewise.
5688
5689 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
5690 rule_useful_p.
5691
5692 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
5693
5694 Undo 2005-12-01 tentative license wording change. The wording is
5695 still being reviewed by the lawyers, and we don't want to wait for
5696 them before publishing a test release. For now, revert to the
5697 previous wording.
5698 * NEWS: Undo 2005-12-01 change.
5699 * data/glr.c: Revert to previous license wording.
5700 * data/glr.cc: Likewise.
5701 * data/lalr1.cc: Likewise.
5702 * data/location.cc: Likewise.
5703 * data/yacc.c: Likewise.
5704
5705 * NEWS: Reword %destructor vs YYABORT etc.
5706 * data/glr.c: Use American spacing, for consistency.
5707 * data/glr.cc: Likewise.
5708 * data/lalr1.cc: Likewise.
5709 * data/yacc.c: Likewise.
5710 * data/yacc.c: Reformat comments slightly.
5711 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
5712 for consistency. Fix some spelling errors and reword recently-included
5713 text slightly.
5714 * tests/cxx-type.at: Cast results of malloc, for C++.
5715
5716 2005-12-21 Joel E. Denny <address@hidden>
5717
5718 * tests/cxx-type.at: Construct a tree, count the parents of shared
5719 nodes, and free each node once and only once. Previously, the memory
5720 for semantic values was leaked instead.
5721
5722 2005-12-21 Joel E. Denny <address@hidden>
5723
5724 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
5725 (yylval, yylloc): If pure, #define to yystackp->yyval and
5726 yystackp->yyloc similar to yychar and yynerrs.
5727 (yyparse): If pure, remove local yylval and yylloc. Add local
5728 yystackp to accommodate pure definitions of yylval and yylloc.
5729 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
5730 yylvalp and yyllocp to &yylval and &yylloc.
5731 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
5732 namespace. Previously, nerrs and char were missing, but lval and lloc
5733 weren't necessary.
5734 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
5735 yylvalp and yyllocp parameters since, if pure, these are now always
5736 accessible through yystackp. If not pure, they are still accessible
5737 globally.
5738 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
5739 `if (YYID (N))' to pacify lint.
5740
5741 2005-12-21 Akim Demaille <akim@epita.fr>
5742
5743 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
5744 destroy the RHS symbols of a rule.
5745 * data/yacc.c (yylen): Initialize to 0.
5746 Keep its value to the number of items to possibly shift.
5747 In particular, a regular successful parse that ends on YYFINAL by
5748 a (internal) YYACCEPT must not have yylen != 0.
5749 (yyerrorlab, yyreturn): Pop the RHS.
5750 Reorder a bit to emphasize the `shifting' bits of code.
5751 (YYPOPSTACK): Now accept a number of items to pop.
5752 * data/lalr1.cc: Likewise.
5753 * data/glr.c: Formatting changes.
5754 Use goto instead of fall through.
5755 * doc/bison.texinfo (Destructor Decl): Complete.
5756
5757 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5758
5759 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5760 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
5761 * djgpp/config.bat: Replace every occurence of the file name
5762 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5763 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5764 * djgpp/config.sed: Replace every occurence of the file name
5765 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5766 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5767 * djgpp/djunpack.bat: DJGPP specific file.
5768 * djgpp/fnchange.lst: DJGPP specific file.
5769 * djgpp/README.in: Add new information about how to unpack the bison
5770 source on MSDOS and other systems which have 8.3 file name restrictions
5771 using djunpack.bat and fnchange.lst.
5772
5773 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
5774
5775 * bootstrap (build_cvs_prefix): Remove; unused.
5776 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
5777 when getting gnulib.
5778
5779 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
5780
5781 * data/glr.c: Reorder typedef declarations for structs to match order
5782 of struct declarations.
5783 Rename yystack everywhere to yystackp except in yyparse where it's not
5784 a pointer.
5785 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
5786 consistency.
5787 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
5788 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
5789 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
5790 lint.
5791
5792 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
5793
5794 * tests/sets.at (Accept): Fix typos in regular expression used to
5795 sed out the final state number.
5796
5797 Work around portability problem on Solaris 10: flex-generated
5798 files include <stdio.h> before <config.h>, which messes up
5799 because the latter defines __EXTENSIONS__. Address the problem
5800 by creating two new little files that include <config.h> first,
5801 then include the flex-generated files. Rewrite everyone else
5802 to include <config.h> first, as well.
5803 * lib/timevar.c: Always include "config.h".
5804 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
5805 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
5806 (EXTRA_bison_SOURCES): New macro.
5807 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
5808 * src/system.h: Don't include config.h.
5809 * src/LR0.c: Include <config.h> first.
5810 * src/assoc.c: Likewise.
5811 * src/closure.c: Likewise.
5812 * src/complain.c: Likewise.
5813 * src/conflicts.c: Likewise.
5814 * src/derives.c: Likewise.
5815 * src/files.c: Likewise.
5816 * src/getargs.c: Likewise.
5817 * src/gram.c: Likewise.
5818 * src/lalr.c: Likewise.
5819 * src/location.c: Likewise.
5820 * src/main.c: Likewise.
5821 * src/muscle_tab.c: Likewise.
5822 * src/nullable.c: Likewise.
5823 * src/output.c: Likewise.
5824 * src/parse-gram.y: Likewise.
5825 * src/print.c: Likewise.
5826 * src/print_graph.c: Likewise.
5827 * src/reader.c: Likewise.
5828 * src/reduce.c: Likewise.
5829 * src/relation.c: Likewise.
5830 * src/state.c: Likewise.
5831 * src/symlist.c: Likewise.
5832 * src/symtab.c: Likewise.
5833 * src/tables.c: Likewise.
5834 * src/uniqstr.c: Likewise.
5835 * src/vcg.c: Likewise.
5836
5837 * src/parse-gram.y: Fix minor problems uncovered by lint.
5838 (current_lhs, current_lhs_location): Now static.
5839 (current_assoc): Remove unused variable.
5840
5841 Cleanups so that Bison-generated parsers have less lint.
5842 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5843 Prepend /*ARGSUSED*/, for lint's sake.
5844 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5845 definition if 'lint' is defined.
5846 (YYID): New macro (or function, if lint).
5847 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5848 * data/yacc.c: Likewise.
5849 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5850 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5851 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5852 is C++ only.
5853 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5854 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5855 Use YYID(0) rather than 0, for lint.
5856 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5857 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5858
5859 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5860
5861 * tests/glr-regression.at
5862 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5863 Close memory leak reported by twlevo.
5864
5865 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5866
5867 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5868 all stacks.
5869 (yyparse): Iterate another stack in order to call user destructors.
5870 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5871 New test case.
5872 (Duplicated user destructor for lookahead): This test now is expected
5873 to succeed.
5874
5875 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5876
5877 * NEWS: Document the following change.
5878 * data/yacc.c: Say "parser skeleton" rather than "file", since
5879 it's no longer just a file.
5880 * data/glr.c: Grant a special exception for C GLR parsers, that
5881 reads like the already-existing exception for C LALR(1) parsers.
5882 * data/glr.cc: Likewise.
5883 * data/lalr1.cc: Likewise.
5884 * data/location.cc: Likewise.
5885 * data/yacc.c: Reword the "written by" statement to clarify that
5886 it was the parser skeleton, not the entire output file.
5887 * data/glr.c: Written by Paul Hilfinger.
5888 * data/glr.cc: Written by Akim Demaille.
5889 * data/lalr1.cc: Likewise.
5890
5891 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5892
5893 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5894 Fix typos in previous change that broke 'make check'.
5895 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5896 supported in C.
5897 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5898 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5899 We can revert this once things settle down.
5900
5901 * src/conflicts.c (conflicts_print): Don't print file name twice
5902 when %expect fails because there were no conflicts.
5903 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5904 change.
5905 * tests/conflicts.at (%expect not enough, %expect too much):
5906 (%expect with reduce conflicts): Adjust to new behavior.
5907
5908 2005-11-18 Akim Demaille <akim@epita.fr>
5909
5910 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5911 errors.
5912 * NEWS: Document this.
5913 * doc/bison.texinfo (Expect Decl): Likewise.
5914
5915 2005-11-16 Akim Demaille <akim@epita.fr>
5916
5917 Generalize the display of semantic values and locations in traces.
5918 * data/glr.c (yy_reduce_print): Fix indices (again).
5919 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5920 literal integers.
5921 * data/lalr1.cc (yyreduce_print): Rename as...
5922 (yy_reduce_print): this.
5923 Display values and locations.
5924 * data/yacc.c (yy_reduce_print): Likewise.
5925 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5926 (yysymprint): Move higher to be visible from yy_reduce_print).
5927 (yyparse): Adjust.
5928 * tests/calc.at: Adjust the expected length of the traces.
5929
5930 2005-11-14 Akim Demaille <akim@epita.fr>
5931
5932 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5933 from 1 to N, while values and location start at 0.
5934 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5935
5936 2005-11-14 Akim Demaille <akim@epita.fr>
5937
5938 * data/glr.c (yy_reduce_print): Fix the $ number.
5939
5940 2005-11-14 Akim Demaille <akim@epita.fr>
5941
5942 "Use" parse parameters.
5943 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5944 * data/glr.c, data/glr.cc: Use them.
5945 * data/glr.c (YYUSE): Have a C++ definition that supports
5946 non-pointer types.
5947
5948 2005-11-14 Akim Demaille <akim@epita.fr>
5949
5950 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5951
5952 2005-11-14 Akim Demaille <akim@epita.fr>
5953
5954 * data/glr.cc: New.
5955 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5956
5957 2005-11-12 Akim Demaille <akim@epita.fr>
5958
5959 Let position and location be PODs.
5960 * data/location.cc (position::initialize, location::initialize): New.
5961 (position::position, location::location): Define only if
5962 b4_location_constructors is defined.
5963 * data/lalr1.cc (b4_location_constructors): Define it for backward
5964 compatibility.
5965 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5966
5967 2005-11-12 Akim Demaille <akim@epita.fr>
5968
5969 * data/lalr1.cc: Move the body of the ctor and dtor into the
5970 parser file (instead of the header).
5971 Wrap the implementations in a "namespace yy".
5972
5973 2005-11-12 Akim Demaille <akim@epita.fr>
5974
5975 Have glr.c include its header file when created.
5976 * data/glr.c (b4_shared_declarations): New.
5977 Output them verbatim in the parser if !%defines, otherwise
5978 output then in the header file, and include it instead.
5979
5980 2005-11-11 Akim Demaille <akim@epita.fr>
5981
5982 * data/glr.c: Comment changes.
5983
5984 2005-11-11 Akim Demaille <akim@epita.fr>
5985
5986 When yydebug, report semantic and location values for reductions.
5987 * data/glr.c (yy_reduce_print): Report the semantic values and the
5988 locations.
5989 (YY_REDUCE_PRINT): Adjust.
5990 (yyglrReduce): Use them.
5991 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5992 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5993 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5994 traces.
5995
5996 2005-11-10 Akim Demaille <akim@epita.fr>
5997
5998 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5999 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
6000 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
6001
6002 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
6003
6004 * m4/cxx.m4, examples/Makefile.am: Don't build
6005 examples/calc++ if no C++ compiler is available. (trivial change)
6006
6007 2005-11-09 Akim Demaille <akim@epita.fr>
6008
6009 * src/scan-skel.l: Use a couple of asserts.
6010
6011 2005-11-03 Akim Demaille <akim@epita.fr>
6012
6013 In some (weird) cases, the final state number is incorrect.
6014 Reported by Alexandre Duret-Lutz.
6015 * src/LR0.c (state_list_append): Remove the computation of
6016 final_state.
6017 (save_reductions): Do it here.
6018 (get_state): Alpha conversion.
6019 (generate_states): Use a for loop.
6020 * src/gram.h (item_number_is_rule_number)
6021 (item_number_is_symbol_number): New.
6022 * src/state.c: Use assert.
6023 * src/system.h: Include assert.h.
6024 * tests/sets.at (Accept): New.
6025
6026 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6027
6028 * data/glr.c (yyfill): Adjust comment.
6029 (yyresolveAction): Initialize default location properly
6030 for empty right-hand sides.
6031 (yydoAction): Ditto.
6032 Add comment explaining apparently dead code.
6033 * tests/glr-regression.at
6034 (Incorrectly initialized location for empty right-hand side in GLR):
6035 New test.
6036
6037 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
6038
6039 * bootstrap (cleanup_gnulib): New function. Use it to clean up
6040 gnulib when interrupted. This fixes some race conditions and
6041 works around some portability problems (one noted by Paul
6042 Hilfinger).
6043
6044 2005-10-22 Akim <akim@epita.fr>
6045
6046 * Makefile.cfg: Adjust to config -> build-aux.
6047 Reported by twledo.
6048
6049 2005-10-21 Akim Demaille <akim@epita.fr>
6050
6051 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
6052 the %parse-params.
6053 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
6054 * data/yacc.c (b4_Pure_if): Rename as...
6055 (b4_yacc_pure_if): this.
6056 (YY_SYMBOL_PRINT, yyparse): Adjust.
6057 * doc/bison.texinfo: Formatting changes.
6058
6059 2005-10-21 Akim Demaille <akim@epita.fr>
6060
6061 Finish the transition config -> build-aux.
6062 * configure.ac, Makefile.am: Use build-aux.
6063 * config/prev-version, config/announce-gen, config/Makefile.am:
6064 Move to...
6065 * build-aux/prev-version, build-aux/announce-gen,
6066 * build-aux/Makefile.am: here.
6067
6068 2005-10-14 Akim Demaille <akim@epita.fr>
6069
6070 * examples/calc++/test: Use set -x only when VERBOSE.
6071
6072 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
6073
6074 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
6075 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
6076
6077 2005-10-13 Akim Demaille <akim@epita.fr>
6078
6079 * src/scan-skel.l: Output the base name parts of the parser and
6080 header file names.
6081 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
6082 additional checks.
6083 Use this to exercise C++ outputs in subdirs.
6084 Reported by Oleg Smolsky.
6085
6086 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
6087
6088 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
6089 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
6090 Problem reported by John P. Hartmann.
6091 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
6092 already defined it.
6093
6094 2005-10-12 Akim Demaille <akim@epita.fr>
6095
6096 * src/parse-gram.y (version_check): Exit 63 to please missing
6097 (stands for "version mismatch).
6098 * tests/input.at, doc/bison.texinfo: Adjust.
6099
6100 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
6101
6102 Work around portability problems with Visual Age C compiler
6103 (xlc and xlC_r) reported by John P. Hartmann.
6104 * data/location.cc (initial_column, initial_line): Remove.
6105 All uses replaced by 0 and 1.
6106 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
6107 that xlc complains about.
6108 * src/scan-skel.l (skel_wrap): Likewise.
6109 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
6110 as __STDC__.
6111 * data/yacc.c (YYMODERN_C): New macro, which also looks at
6112 __STDC_VERSION__. Use it everywhere instead of looking at
6113 __STDC__ and __cplusplus.
6114
6115 2005-10-10 Akim Demaille <akim@epita.fr>
6116
6117 * examples/calc++/test: Be quiet unless VERBOSE.
6118
6119 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
6120
6121 * data/c.m4 (yydestruct, yysymprint):
6122 Use YYUSE instead of casting to void.
6123 * data/glr.c (YYUSE): New macro.
6124 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6125 Use it instead of rolling our own.
6126 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
6127 (YYCHK1):
6128 Use /*CONSTCOND*/ to suppress lint warnings.
6129 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
6130 (YY_STACK_PRINT): Use 'false' not '0'.
6131 (YYUSE): New macro.
6132 (yysymprint_, yydestruct_): Use it instead of rolling our own.
6133 * data/yacc.c (YYUSE): New macro.
6134 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
6135 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
6136 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
6137
6138
6139 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
6140 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
6141
6142 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
6143
6144 Undo the parts of the unlocked-I/O change that substituted
6145 putc or puts for printf. This might hurt performance a bit,
6146 but some people prefer the printf style.
6147 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
6148 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
6149 All uses replaced by YYFPRINTF and YYDPRINTF.
6150 * data/yacc.c: Likewise.
6151 * lib/bitset.c (bitset_print): Likewise.
6152 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
6153 putc and puts.
6154 * lib/lbitset.c (debug_lbitset): Likewise.
6155 * src/closure.c (print_firsts, print_fderives): Likewise.
6156 * src/gram.c (grammar_dump): Likewise.
6157 * src/lalr.c (look_ahead_tokens_print): Likewise.
6158 * src/output.c (escaped_output): Likewise.
6159 (user_actions_output): Break apart two printfs.
6160 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
6161 * src/reduce.c (reduce_print): Likewise.
6162 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
6163 * src/system.h: Include unlocked-io.h rathe than stdio.h.
6164
6165 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6166 Use assignments rather than casts-to-void to suppress
6167 unused-variable warnings. This pacifies 'lint'.
6168 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
6169 unused-variable warnings.
6170
6171 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6172
6173 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
6174
6175 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
6176
6177 Use unlocked I/O for a minor performance improvement on hosts like
6178 GNU/Linux and Solaris that support unlocked I/O. The basic idea
6179 is to use the gnlib unlocked-io module, and to prefer putc and
6180 puts to printf when either will work (since the latter doesn't
6181 come in an unlocked flavor).
6182 * bootstrap (gnulib_modules): Add unlocked-io.
6183 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
6184 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
6185 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
6186 and similarly for puts and putc and printf.
6187 * data/yacc.c: Likewise.
6188 * lib/bitset.c (bitset_print): Likewise.
6189 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
6190 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
6191 to printf.
6192 * lib/lbitset.c (debug_lbitset): Likewise.
6193 * src/closure.c (print_firsts, print_fderives): Likewise.
6194 * src/gram.c (grammar_dump): Likewise.
6195 * src/lalr.c (look_ahead_tokens_print): Likewise.
6196 * src/output.c (escaped_output): Likewise.
6197 (user_actions_output): Coalesce two printfs.
6198 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
6199 * src/reduce.c (reduce_print): Likewise.
6200 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
6201 * src/system.h: Include unlocked-io.h rather than stdio.h.
6202
6203 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
6204 this confuses xgettext.
6205
6206 2005-10-02 Akim Demaille <akim@epita.fr>
6207
6208 * bootstrap (gnulib_modules): Add strverscmp.
6209 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
6210 * m4/.cvsignore: Add strverscmp.m4.
6211 * src/parse-gram.y (%require): New token, new rule.
6212 (version_check): New.
6213 * src/scan-gram.l (%require): Adjust.
6214 * tests/input.at (AT_REQUIRE): New.
6215 Use it.
6216 * doc/bison.texinfo (Require Decl): New.
6217 (Calc++ Parser): Use %require.
6218
6219 2005-10-02 Akim Demaille <akim@epita.fr>
6220
6221 * data/location.cc: New.
6222
6223 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
6224 Akim Demaille <akim@epita.fr>
6225
6226 Make sure -odir/foo.cc creates dir/location.hh etc.
6227 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
6228 (spec_file_prefix, spec_verbose_file, spec_graph_file)
6229 (spec_defines_file): Now const.
6230 (dir_prefix): New.
6231 (short_base_name): Remove.
6232 * src/files.c: Adjust.
6233 (dirname.h): Include.
6234 (base_name): Don't prototype it.
6235 (finput): Remove, duplicates gram_in.
6236 (full_base_name, short_base_name): Replace by...
6237 (all_but_ext, all_but_tab_ext): these.
6238 (compute_base_names): Rename as...
6239 (compute_file_name_parts): this.
6240 Update to compute the new variables, including dir_prefix.
6241 Adjust dependencies.
6242 * src/output.c (prepare): Output them.
6243 * src/reader.c: Adjust to use gram_in, not finput.
6244 * src/scan-skel.l (@dir_prefix@): New.
6245
6246 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6247
6248 * lib/subpipe.c: New function end_of_output_subpipe() added
6249 to allow support for non-posix systems. This is a no-op function
6250 for posix systems.
6251
6252 * lib/subpipe.h: New function end_of_output_subpipe() added
6253 to allow support for non-posix systems. This is a no-op function
6254 for posix systems.
6255
6256 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
6257 handle the lack of pipe/fork functionality on non-posix systems.
6258
6259 * djgpp/Makefile.maint: DJGPP specific file.
6260
6261 * djgpp/README.in: DJGPP specific file.
6262
6263 * djgpp/config.bat: DJGPP specific configuration file.
6264
6265 * djgpp/config.sed: DJGPP specific configuration file.
6266
6267 * djgpp/config.site: DJGPP specific configuration file.
6268
6269 * djgpp/config_h.sed: DJGPP specific configuration file.
6270
6271 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
6272
6273 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
6274
6275 2005-10-02 Akim Demaille <akim@epita.fr>
6276
6277 * data/location.cc: New, extract from...
6278 * data/lalr1.cc: here.
6279 (location.hh): Include it after the user prologue, in case the
6280 filename type is defined by the user.
6281 Forward declation location and position before the pre-prologue.
6282 (yyresult_): Rename as...
6283 (yyresult): this, it's a local variable, not an attribute.
6284 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
6285
6286 2005-10-01 Akim Demaille <akim@epita.fr>
6287
6288 * examples/extexi: Restore the #line generation.
6289
6290 2005-09-30 Akim Demaille <akim@epita.fr>,
6291 Alexandre Duret-Lutz <adl@gnu.org>
6292
6293 Move the token type and YYSTYPE in the parser class.
6294 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
6295 (parser::token): New, from the moved free definition of tokens.
6296 (parser::semantic_value): Now a full definition instead of an
6297 indirection to YYSTYPE.
6298 (b4_post_prologue): No longer included in the header file, but
6299 in the implementation file.
6300 * doc/bison.texi (C+ Language Interface): Update.
6301 * src/parse-gram.y: Support unary %define.
6302 * tests/actions.at: Define global_tokens_and_yystype for backward
6303 compatibility until we update the tests.
6304 * tests/calc.at: Idem.
6305 (first_line, first_column, last_line, last_column): Define for lalr1.cc
6306 to simplify the code.
6307
6308 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
6309
6310 Port to SunOS 4.1.4, which lacks strtoul and strerror.
6311 Ah, the good old days! Problem reported by Peter Klein.
6312 * bootstrap (gnulib_modules): Add strerror, strtoul.
6313 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
6314 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
6315
6316 2005-09-29 Akim Demaille <akim@epita.fr>
6317
6318 * data/c.m4 (b4_error_verbose_if): New.
6319 * data/lalr1.cc: Use it.
6320 (YYERROR_VERBOSE_IF): Remove.
6321 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
6322 parser members, replaced by...
6323 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
6324 local variables.
6325 (yysyntax_error_): Takes the state number as argument.
6326 (yyreduce_print_): Use the argument yyrule, not the former
6327 attribute yyn_.
6328
6329 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
6330
6331 * bootstrap (gnulib_modules): Add verify.
6332 * lib/.cvsignore: Add verify.h.
6333 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
6334 * src/system.h (verify): Remove.
6335 Include verify.h instead.
6336 * src/tables.c (tables_generate): Use new API for 'verify'.
6337
6338 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
6339
6340 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
6341 local variables whose names begin with 'yy'.
6342 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
6343 Trivial changes from Joel E. Denny.
6344
6345 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
6346 it itself.
6347 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
6348 don't use alloca any more.
6349
6350 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
6351 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
6352 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
6353 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
6354 to match yacc.c, to test more hosts.
6355
6356 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
6357
6358 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
6359 doesn't affect behavior.
6360 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
6361 Solaris, AIX, MSC.
6362 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
6363 This works a bit better with glibc, if user code has already included
6364 stdlib.h.
6365 * doc/bison.texinfo (Bison Parser): Document that users can't
6366 arbitrarily use malloc and free for other purposes. Document
6367 that <alloca.h> and <malloc.h> might be included.
6368 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
6369 user must declare alloca.
6370
6371 * HACKING (release): Forwarn the Translation Project about
6372 stable releses.
6373
6374 2005-09-20 Akim Demaille <akim@epita.fr>
6375
6376 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
6377
6378 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
6379
6380 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
6381 (YYSTACK_ALLOC_MAXIMUM): Use it.
6382 (yysyntax_error): New function.
6383 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
6384 multiple syntax errors are reported, and alloca is being used.
6385 Instead, reallocate buffers twice as big each time, so that
6386 we waste at most half the allocated memory. Start with a small
6387 (128-byte) buffer that will suffice in most cases anyway.
6388 Use yysyntax_error to do most of the work.
6389
6390 * doc/bison.texinfo (Error Reporting, Table of Symbols):
6391 yynerrs is the number of errors reported, not the number of
6392 errors encountered.
6393
6394 * tests/glr-regression.at (Duplicated user destructor for lookahead):
6395 Mark it as expected to fail.
6396 Cast result of malloc; problem reported by twlevo@xs4all.nl.
6397 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
6398 Don't start user-code symbols with "yy", to avoid name space problems.
6399
6400 2005-09-19 Akim Demaille <akim@epita.fr>
6401
6402 Remove the traits, failed experiment.
6403 It never proved useful, and anyway because of the current
6404 definition, it was not possible to have several specialization of
6405 this traits, making it useless.
6406 * data/lalr1.cc (yy:traits): Remove.
6407 Inline its definitions in the parser class.
6408
6409 2005-09-19 Akim Demaille <akim@epita.fr>
6410
6411 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
6412 least Mac OSX with a /usr/local install of gettext.
6413
6414 2005-09-19 Akim Demaille <akim@epita.fr>
6415
6416 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
6417 and yytoken for similarity with the other skeletons.
6418
6419 2005-09-19 Akim Demaille <akim@epita.fr>
6420
6421 * NEWS, configure.ac: update version number to 2.1a.
6422
6423 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
6424
6425 * NEWS: Version 2.1.
6426
6427 * NEWS: Remove notice of yytname change, since it was never in an
6428 official release.
6429 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
6430 diagnostic.
6431 * src/output.c (prepare): Likewise.
6432 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
6433 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
6434 is not defined. This is an awful hack, but it's enough for now.
6435 All callers changed.
6436 * tests/glr-regression-at (make_value): Args are const pointers now,
6437 to avoid GCC warning.
6438 (Duplicated user destructor for lookahead): New test. Currently
6439 skipped. It fails on my host but I'm not sure it'll always fail.
6440
6441 2005-09-16 Akim Demaille <akim@epita.fr>
6442
6443 * src/symtab.h (struct symbol): Declare the printer and destructor
6444 as const, to avoid accidental calls to free.
6445 (symbol_destructor_set, symbol_printer_set): Adjust.
6446 * src/symtab.c: Adjust.
6447
6448 2005-09-16 Akim Demaille <akim@epita.fr>
6449
6450 * data/c.m4 (b4_token_enums): New.
6451 (b4_token_defines): Rename as...
6452 (b4_token_enums_defines): this.
6453 (b4_token_defines): New, output only the #defines.
6454 * data/yacc.c, data/glr.c: Adjust.
6455 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
6456 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
6457 as default values.
6458
6459 2005-09-16 Akim Demaille <akim@epita.fr>
6460
6461 * data/lalr1.cc (yylex_): Remove, inline its code.
6462 (yyreport_syntax_error_): Remove, replaced by...
6463 (yysyntax_error_): this which returns a string and leaves to the
6464 caller the call to the users' error function.
6465 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
6466 Move from members of the parser object...
6467 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
6468 to local variables of the parse function.
6469
6470 2005-09-16 Akim Demaille <akim@epita.fr>
6471
6472 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
6473 since it's in Bison's name space.
6474
6475 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
6476
6477 * data/glr.c (yyresolveValue): Add default case to pacify
6478 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
6479
6480 * NEWS: Document when yyparse started to return 2.
6481 * doc/bison.texinfo (Parser Function): Document when yyparse
6482 returns 2.
6483
6484 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
6485 (b4_filename_type): Renamed back from b4_file_name_type. All uses
6486 changed.
6487 (class position): file_name -> filename (reverting). All uses changed.
6488
6489 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
6490
6491 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
6492 do anything if $@ exists. This reverts part of the 2005-07-07
6493 patch.
6494
6495 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
6496
6497 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
6498 contains obsolete information and isn't worth distributing as a
6499 separate file anyway.
6500 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
6501 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
6502 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
6503 (yyparse): Abort if user code uses longjmp to throw an unexpected
6504 value.
6505
6506 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
6507
6508 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
6509 Suggested by twlevo@xs4all.nl.
6510
6511 * data/glr.c (YYCHK1): Do not assume YYE is in range.
6512 This avoids a diagnostic from gcc -Wswitch-enum.
6513 Problem reported by twlevo@xs4all.nl.
6514
6515 * doc/bison.texinfo: Don't use "filename", as per GNU coding
6516 standards. Use "file name" or "file" or "name", depending on
6517 the context.
6518 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
6519 not to hack/foo.tab.c.
6520 (Calc++ Top Level): 2nd arg of main is not const.
6521 * data/glr.c: b4_filename -> b4_file_name.
6522 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
6523 All uses changed.
6524 (class position): filename -> file_name. All uses changed.
6525 * data/yacc.c: b4_filename -> b4_file_name.
6526 * lib/bitset.h: filename -> file_name in local vars.
6527 * lib/bitset_stats.c: Likewise.
6528 * src/files.c: Likewise.
6529 * src/scan-skel.l ("@output ".*\n): Likewise.
6530 * src/files.c (file_name_split): Renamed from filename_split.
6531 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
6532
6533 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
6534
6535 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
6536 to accommodate latest gnulib.
6537
6538 * tests/glr-regression.at (Duplicate representation of merged trees):
6539 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
6540
6541 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
6542 needed.
6543
6544 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
6545
6546 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
6547 All uses changed. Invoke user destructor after an error during a
6548 split parse (trivial change from Joel E. Denny).
6549
6550 * tests/glr-regression.at
6551 (User destructor after an error during a split parse): New test case.
6552 Problem reported by Joel E. Denny in:
6553 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
6554
6555 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
6556
6557 * README-cvs: Give URLs for recommended tools.
6558 Mention Gzip version problem, and bootstrapping issues.
6559 Remove troubleshooting section, as it's somewhat obsolete.
6560
6561 * bootstrap (no_cache): New var, to accommodate different wget
6562 variants. Use it instead of '-C off'. Problem reported by
6563 twlevo@xs4all.nl.
6564
6565 * data/glr.c (yydestroyStackItem): New function.
6566 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
6567 debugging information. Problem reported by Joel E. Denny.
6568
6569 2005-08-25 Akim Demaille <akim@epita.fr>
6570
6571 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
6572
6573 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
6574
6575 * data/glr.c (yyrecoverSyntaxError, yyreturn):
6576 Don't invoke destructor on unresolved entries.
6577 * tests/glr-regression.at
6578 (User destructor for unresolved GLR semantic value): New test case.
6579 Problem reported by Joel E. Denny in:
6580 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
6581
6582 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
6583
6584 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
6585 Add strnlen.c.
6586 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
6587 lib-prefix.m4, po.m4.
6588
6589 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
6590 in yydestruct diagnostic, since it might not be an error.
6591 Problem reported by Joel Denny near end of
6592 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6593 * data/lalr1.cc (yyerturn): Likewise.
6594 * data/yacc.c (yyreturn): Likewise.
6595 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
6596
6597 * src/files.c: Remove obsolete FIXME comment.
6598
6599 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
6600 with the other templates, and to fix bogus run-on messages such
6601 as the one reported at the end of
6602 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6603 All callers changed to avoid the newline.
6604 (yyprocessOneStack): Output two lines rather than one, to accommodate
6605 the above change. This changes the debug output format slightly.
6606
6607 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
6608 reported by Joel E. Denny in
6609 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
6610 (trivial change).
6611 * tests/glr-regression.at (Duplicate representation of merged trees):
6612 New test, from Joel E. Denny in:
6613 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
6614 * THANKS: Add Joel E. Denny.
6615
6616 * configure.ac (AC_INIT): Bump to 2.0c.
6617
6618 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
6619
6620 * NEWS: Version 2.0b.
6621
6622 * Makefile.am (SUBDIRS): Put examples before tests, so that
6623 "make check" doesn't finish with "All 1 tests passed".
6624
6625 * tests/regression.at (Token definitions): Don't rely on
6626 AT_PARSER_CHECK for data that contains backslashes. It currently
6627 uses 'echo', and 'echo' isn't portable if its argument contains
6628 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
6629 that the byte '\0xff' is not printable in the C locale; it is,
6630 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
6631 not printable, so use '\0x81' to test.
6632
6633 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
6634 version of GCC, since the macro is used with non-GCC compilers.
6635
6636 Fix core dump reported by Pablo De Napoli in
6637 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
6638 * tests/regression.at (Invalid inputs with {}): New test.
6639 * src/parse-gram.y (token_name): Translate type before using
6640 it as an index.
6641
6642 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
6643 the user's name space. All uses changed to __attribute__
6644 ((__unused__)).
6645 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
6646 Add __attribute__ ((__noreturn__)).
6647
6648 * etc/clcommit: Remove. We weren't using it, and it failed
6649 "make maintainer-distcheck".
6650 * Makefile.maint: Merge from coreutils.
6651 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
6652 (syntax-check-rules): Change list of rules as described below.
6653 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
6654 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
6655 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
6656 (sc_trailing_space): New rules.
6657 (sc_xalloc_h_in_src): Remove.
6658 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
6659 (sc_space_tab, sc_error_exit_success, sc_changelog):
6660 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
6661 (makefile-check, po-check, author_mark_check):
6662 (makefile_path_separator_check, copyright-check):
6663 Use grep -n, to make it easier to find violations.
6664 Use CVS_LIST and CVS_LIST_EXCEPT.
6665 (header_regexp, h_re): Remove.
6666 (dd_c): New macro.
6667 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
6668 (my-distcheck): Use more-modern GCC flags.
6669 (signatures, %.asc): Remove.
6670 (rel-files, announcement): Remove signatures.
6671 Restore old updating code, even though we don't use it, so
6672 that we're the same as coreutils.
6673 (alpha, beta, major): Depend on news-date-check.
6674 Make the upload commands.
6675
6676 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
6677 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
6678 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
6679 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
6680 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
6681 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
6682 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
6683 * tests/sets.at: Likewise.
6684
6685 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
6686 we comment out the Autoconf version number.
6687 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
6688 it's error-prone and "make maintainer-distcheck" rejects it.
6689
6690 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
6691 Indent calls to "error" to pacify "make maintainer-distcheck",
6692 when the calls are not intended to be translated.
6693 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
6694
6695 * src/Makefile.am (DEFS): Use +=, to pacify
6696 "make maintainer-distcheck".
6697 (bison_SOURCES): Add scan-skel.h.
6698 (sc_tight_scope): New rule, from coreutils.
6699
6700 * src/files.c (src_extension, header_extension):
6701 Now static, not extern.
6702 * src/getargs.c (short_options): Likewise.
6703 * src/muscle_tab.c (muscle_table): Likewise.
6704 * src/parse-gram.y (current_class, current_type, current_prec):
6705 Likewise.
6706 * src/reader.c (grammar_end, previous_rule_end): Likewise.
6707 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
6708 * src/main.c (main): Cast bindtextdomain and textdomain calls to
6709 void, to avoid warning when NLS is disabled.
6710 * src/output.c: Include scan-skel.h.
6711 (scan_skel): Remove decl, since scan-skel.h does this.
6712 (output_skeleton):
6713 Indent calls to "error" to pacify "make maintainer-distcheck".
6714 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
6715 * src/reader.h (gram_end, gram_lineno): New decls to pacify
6716 "make maintainer-distcheck".
6717 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
6718 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
6719 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
6720 (skel_lex_destroy, scan_skel): Move these decls to...
6721 * src/scan-skel.h: New file.
6722 * src/uniqstr.c (uniqstr_assert):
6723 Indent calls to "error" to pacify "make maintainer-distcheck".
6724
6725 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
6726 not @VAR@.
6727
6728 * tests/torture.at: Revamp to avoid misuse of atoi that
6729 "make maintainer-distcheck" complained about.
6730
6731 * examples/extexi (message): Don't print a message more than once,
6732 and omit line-number decoration that makes Emacs compile think
6733 that informative messages are worth worrying about.
6734
6735 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
6736
6737 * configure.ac: Update version number.
6738
6739 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
6740 accidentally.
6741 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
6742 autogenerated by the maintainer.
6743 * examples/calc++/.cvsignore: Add *.yy.
6744
6745 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
6746 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6747 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6748
6749 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
6750
6751 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
6752 from maintainer-distcheck about casting the argument of 'free'.
6753
6754 * NEWS: Mention recent yytname changes.
6755 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
6756
6757 * bootstrap: For translations that have not yet been upgraded to
6758 the new runtime-po domain, prime the pump by extracting the
6759 relevant strings from the obsolete translations. This code can be
6760 removed once the bison-runtime domain has been translated by each
6761 team.
6762
6763 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
6764 now that token names are already quoted.
6765
6766 Fix problem reported by Anthony Heading.
6767 * data/glr.c (YYTOKEN_TABLE): New macro.
6768 (yytname): Define if YYTOKEN_TABLE.
6769 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
6770 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
6771 (YYERROR_VERBOSE): Define the same way the other skeletons do.
6772 * src/output.c (prepare_symbols): Output token_table_flag.
6773
6774 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
6775
6776 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
6777 again if the first call fails.
6778
6779 * data/glr.c (yytnamerr): New function.
6780 (yyreportSyntaxError): Use it to dequote most string literals.
6781 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
6782 with other skeletons. All uses changed.
6783 (yytnameerr_): New function.
6784 (yyreport_syntax_error): Use it to dequote most string literals.
6785 * data/yacc.c (yytnamerr): New function.
6786 (yyerrlab): Use it to decode most string literals.
6787 * doc/bison.texinfo (Decl Summary, Calling Convention):
6788 Clarify quoting convention of yytname.
6789 * src/output.c (prepare_symbols): Quote all names. This undoes
6790 the 2005-04-17 change, which is now accomplished (mostly) via
6791 changes in the parsers as described above.
6792 * tests/regression.at (Token definitions, Web2c Actions):
6793 Undo most 2005-04-17 change here, too.
6794
6795 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
6796
6797 Fix more problems reported by twlevo@xs4all.nl.
6798 * tests/cxx-type.at: Don't pipe output of ./types through sed to
6799 remove trailing spaces. This loses the exit status of ./types,
6800 and isn't needed since ./types shouldn't be emitting trailing
6801 spaces.
6802 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
6803 as the stack isn't valid in that case.
6804
6805 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6806 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6807 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6808 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
6809 is used.
6810 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
6811 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6812 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6813 Likewise.
6814
6815 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
6816 overly-picky compilers that reject 'char *foo = "bar";'.
6817
6818 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
6819 to FILE * parameter, not to stderr. This fixes a typo introduced
6820 in the 2005-07-12 change.
6821
6822 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
6823 warnings from GCC 4.
6824
6825 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
6826 (yyglrShiftDefer, yysplitStack):
6827 Remove unused parameters b4_pure_formals. All uses changed.
6828 (yyglrShift): Remove unused parameters b4_user_formals.
6829 All uses changed.
6830 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6831
6832 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6833
6834 Destructor cleanups and regularization among the three skeletons.
6835 * NEWS: Document the behavior changes.
6836 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6837 stack before failing, as the cleanup code will do it for us now.
6838 * data/lalr1.cc (yyerrlab): Likewise.
6839 * data/glr.c (yyparse): Pop everything off the stack before
6840 freeing it, so that destructors get called properly.
6841 * data/lalr1.cc (yyreturn): Likewise.
6842 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6843 This is more consistent.
6844 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6845 why destructors might be called. 1.875 -> 2.1.
6846 (Destructor Decl, Decl Summary, Table of Symbols):
6847 Some English-language cleanups for %destructor.
6848 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6849 Add output line for destructor of start symbol.
6850 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6851 because of that same extra output line.
6852
6853 * NEWS: Document minor wording changes in diagnostics of
6854 Bison-generated parsers.
6855 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6856 Remove unused formals. All uses changed.
6857 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6858 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6859 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6860 Rename yyoverflowab to yyexhaustedlab.
6861 When memory exhaustion occurs during syntax-error reporting,
6862 report it separately rather than in a single diagnostic; this
6863 eases translation.
6864 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6865 (Memory Exhausted): Renamed from Parser Stack Overflow.
6866 Revamp wording slightly to prefer "memory exhaustion".
6867 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6868
6869 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6870
6871 Add i18n support to the GLR skeleton. Partially fix the C++
6872 skeleton; a C++ expert needs to finish this. Remove debugging
6873 msgids; there's little point to having them translated, since they
6874 can be understood only by someone who can read the
6875 (English-language) source code.
6876
6877 Generate runtime-po/bison-runtime.pot automatically, so that we
6878 don't have to worry about garbage getting in that file. We'll
6879 make sure after the next official release that old msgids don't
6880 get lost. See
6881 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6882
6883 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6884 Now auto-generated.
6885 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6886 Fix typos in explanations of the runtime file.
6887 * bootstrap: Change gettext keyword from YYI18N to YY_.
6888 Use standard Makefile.in.in in runtime-po, since we'll arrange
6889 for backward-compatible bison-runtime.po files in a different way.
6890 * data/glr.c (YY_): New macro, from yacc.c.
6891 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6892 Translate messages intended for users.
6893 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6894 the wording in the other skeletons. We don't know that the memory
6895 is virtual.
6896 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6897 Use same method that yacc.c uses.
6898 Don't translate debugging messages.
6899 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6900 it doesn't work (yet), and requires C++ expertise to fix.
6901 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6902 Move defn to a more logical place, to be consistent with other
6903 skeletons.
6904 Don't translate debugging messages.
6905 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6906 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6907 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6908 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6909
6910 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6911 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6912 void, not int.
6913 * tests/glr-regression.at (Badly Collapsed GLR States):
6914 Likewise.
6915 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6916 yylex should return 0 at EOF rather than aborting.
6917
6918 Improve tests for stack overflow in GLR parser.
6919 Problem reported by twlevo@xs4all.nl.
6920 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6921 All uses removed.
6922 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6923 can handle the problem.
6924 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6925 (yyparse): New local variable yyresult to record the result.
6926 Use result of setjmp to set it, rather than storing itinto
6927 struct.
6928 (yyDone): Remove label.
6929 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6930 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6931 if YYABORT is used).
6932 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6933 yyparse status; put status > 1 into diagnostic.
6934 Check that status==2 works.
6935 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6936 Use exit status 3 for failure to open (which shouldn't happen).
6937
6938 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6939
6940 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6941 1 on syntax error; just let yyparse do its thing.
6942 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6943 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6944 (Exploding the Stack Size with Alloca):
6945 (Exploding the Stack Size with Malloc):
6946 Expect exit status 2, not 1, since the parser is supposed to blow
6947 its stack. Problem reported by twlevo@xs4all.nl.
6948
6949 * data/glr.c (yyparse): Don't assume that the initial calls
6950 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6951 Print a stack-overflow message and fail instead.
6952 Initialize the line-number information before creating the stack,
6953 so that the stack-overflow message can report line zero safely.
6954
6955 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6956
6957 Fix problems reported by twlevo@xs4all.nl.
6958 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6959 (yyuserMerge): Provide a default case if b4_mergers is empty.
6960 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6961 * tests/glr-regression.at
6962 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6963 Add casts to pacify C++ compilers.
6964 * tests/glr-regression.at (Improper merging of GLR delayed action
6965 sets): Declare yylex before using it.
6966 * tests/Makefile.am (maintainer-check-g++): Fix a stray
6967 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6968 test for valgrind; valgrind is independent of g++.
6969 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6970 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6971 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6972 Use a destructor, so that we can expand the stack. Change
6973 YYSTYPE to char * so that we can free it. Cast result of malloc.
6974
6975 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6976
6977 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6978 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6979
6980 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6981
6982 * PACKAGING: New file, suggested by Bruno Haible and taken from
6983 similar wording in gettext's PACKAGING file.
6984 * NEWS: Mention PACKAGING.
6985 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6986
6987 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6988
6989 * NEWS: Document recent i18n improvements.
6990 * bootstrap: Get runtime translations into runtime-po.
6991 Create runtime-po files automatically, if possible.
6992 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6993 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6994 does not infringe on the user's name space.
6995 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6996 * doc/bison.texinfo (Internationalization): Revamp the English
6997 and Texinfo syntax a bit, to try to make it clearer.
6998 (Bison Options, Option Cross Key): Mention --print-localedir.
6999 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
7000 YYENABLE_NLS. Quote a bit more.
7001 * runtime-po/.cvsignore: New file.
7002 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
7003 * runtime-po/Rules-quot: Remove; now created by bootstrap.
7004 * runtime-po/quot.sed: Likewise.
7005 * runtime-po/boldquot.sed: Likewise.
7006 * runtime-po/en@quot.header: Likewise.
7007 * runtime-po/en@boldquot.header: Likewise.
7008 * runtime-po/insert-header.sin: Likewise.
7009 * runtime-po/remove-potcdate.sin: Likewise.
7010 * runtime-po/Makevars: Likewise.
7011 * runtime-po/LINGUAS: Likewise.
7012 * runtime-po/de.po: Likewise; we will rely on the translation project
7013 to maintain this, so "bootstrap" should get it.
7014 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
7015 its value.
7016 * src/main.c (main): Bind the bison-runtime domain, too.
7017
7018 2005-07-12 Bruno Haible <bruno@clisp.org>
7019
7020 * data/yacc.c: Include <libintl.h> when NLS is enabled.
7021 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
7022 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
7023 * runtime-po: New directory.
7024 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
7025 $(DOMAIN).pot-update rule, so that old messages are never dropped.
7026 * runtime-po/Rules-quot: New file, copied from po/.
7027 * runtime-po/quot.sed: Likewise.
7028 * runtime-po/boldquot.sed: Likewise.
7029 * runtime-po/en@quot.header: Likewise.
7030 * runtime-po/en@boldquot.header: Likewise.
7031 * runtime-po/insert-header.sin: Likewise.
7032 * runtime-po/remove-potcdate.sin: Likewise.
7033 * runtime-po/Makevars: New file.
7034 * runtime-po/POTFILES.in: New file.
7035 * runtime-po/LINGUAS: New file.
7036 * runtime-po/bison-runtime.pot: New file.
7037 * runtime-po/de.po: New file.
7038 * m4/bison.m4: New file.
7039 * Makefile.am (SUBDIRS): Add runtime-po.
7040 (aclocaldir, aclocal_DATA): New variables.
7041 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
7042 Define aclocaldir.
7043 * src/getargs.c (usage): Document --print-localedir option.
7044 (PRINT_LOCALEDIR_OPTION): New enum item.
7045 (long_options): Add --print-localedir option.
7046 (getargs): Handle --print-localedir option.
7047 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
7048 (Internationalization): New section.
7049
7050 2005-07-12 Akim Demaille <akim@epita.fr>
7051
7052 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
7053 for consistency with the rest of the code.
7054 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
7055 Add separators.
7056
7057 2005-07-12 Akim Demaille <akim@epita.fr>
7058
7059 * src/parse-gram.y: Use %printer instead of YYPRINT.
7060
7061 2005-07-12 Akim Demaille <akim@epita.fr>
7062
7063 * src/symtab.h, src/symtab.c (symbol_print): New.
7064 * src/symlist.h, src/symlist.c (symbol_list_print): New.
7065 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
7066
7067 2005-07-12 Akim Demaille <akim@epita.fr>
7068
7069 * data/glr.c (b4_syncline): Fix (swap) the definitions of
7070 b4_at_dollar and b4_dollar_dollar.
7071
7072 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
7073
7074 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
7075 and Pennello's paper.
7076
7077 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
7078
7079 * data/yacc.c (yyparse): Undo previous patch. Instead,
7080 set yylsp[0] and yyvsp[0] only if the initial action
7081 sets yylloc and yylval, respectively.
7082
7083 * data/yacc.c (yyparse): In the initial action, set
7084 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
7085 This avoids the use of undefined variables if the initial
7086 action does not set yylloc and/or yylval.
7087
7088 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
7089
7090 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
7091 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
7092 Remove from CVS. These files are automatically generated.
7093 * examples/extexi: Clarify that this file is now part of Bison,
7094 not GNU M4, and that it works with any POSIX-compatible Awk.
7095 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
7096 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
7097 so that we also get calc++-parser.yy. Geneate it.
7098 Use $(AWK), not gawk, since any conforming Awk will do.
7099 Put comment before action, since older 'make' can't handle comment
7100 in action.
7101 $(BUILT_SOURCES): List all built sources, not just some of them.
7102 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
7103 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
7104 $($(calc_sources_generated)): Remove unnecessary test for existence
7105 of target. (This had a shell syntax error anyway; a stray "x".)
7106 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
7107 calc++-parser.yy.
7108 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
7109
7110 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
7111 implied by the other modules.
7112
7113 2005-07-06 Akim Demaille <akim@epita.fr>
7114
7115 Bind examples/calc++ to the package.
7116 * examples/calc++/Makefile: Remove, replaced by...
7117 * examples/calc++/Makefile.am: ... this new file.
7118 * examples/calc++/test: Remove input.
7119 * examples/calc++/compile: Remove.
7120 * examples/Makefile.am: New.
7121 * configure.ac, Makefile.am: Adjust.
7122 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
7123
7124 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
7125
7126 * data/glr.c (yyFail): Drastically simplify; since the format argument
7127 never had any % directives, we can simply pass it to yyerror.
7128 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
7129 be modified later, as that is the usual style in glr.c.
7130 Problems reported by Paul Hilfinger.
7131
7132 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
7133 and size overflow errors.
7134 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
7135 in case the user prolog sets feature-test macros like _GNU_SOURCE.
7136 (YYSIZEMAX): New macro.
7137 (yystpcpy): New function, taken from yacc.c.
7138 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
7139 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
7140 so that we don't have to maintain their signatures.
7141 (yyFail): Check for buffer overflow, by using vsnprintf rather
7142 than vsprintf. Allocate a bigger buffer if possible.
7143 Report an error if buffer allocation fails.
7144 (yyStackOverflow): New function.
7145 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
7146 the initialization was successful. It might fail if storage was
7147 exhausted.
7148 (yyexpandGLRStack): Add more checks for storage allocation failure.
7149 Use yyStackOverflow to report failures.
7150 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
7151 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
7152 Don't assume stack number fits in int.
7153 (yysplitStack): Check for storage allocation failure.
7154 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
7155 can print diagnostics on storage allocation failure. All callers
7156 changed.
7157 (yyresolveValue): Use yybool for boolean.
7158 (yyreportSyntaxError): Check for size-calculation overflow.
7159 This code is taken from yacc.c.
7160 (yyparse): Check for storage allocation errors when allocating
7161 the initial stack.
7162
7163 2005-07-05 Akim Demaille <akim@epita.fr>
7164
7165 Extract calc++ from the documentation.
7166 * doc/bison.texinfo (Calc++): Add the extraction marks.
7167 * examples/extexi: New, from the aborted GNU Programming 2E.
7168 Separate the different paragraph of a file with empty lines.
7169 * examples/Makefile: Use it to extract the whole calc++ example.
7170
7171 2005-06-24 Akim Demaille <akim@epita.fr>
7172
7173 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
7174 class typedefs.
7175
7176 2005-06-22 Akim Demaille <akim@epita.fr>
7177
7178 * doc/bison.texinfo (C++ Language Interface): First stab.
7179 (C++ Parsers): Remove.
7180
7181 2005-06-22 Akim Demaille <akim@epita.fr>
7182
7183 * data/lalr1.cc (yylex_): Honor %lex-param.
7184
7185 2005-06-22 Akim Demaille <akim@epita.fr>
7186
7187 Start a set of simple examples.
7188 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
7189 * examples/calc++/calc++-driver.hh,
7190 * examples/calc++/calc++-parser.yy,
7191 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
7192 * examples/calc++/compile, examples/calc++/test: New.
7193
7194 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
7195
7196 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
7197 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
7198 which stems from the 2005-05-27 patch.
7199
7200 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7201
7202 * data/glr.c: Modify treatment of unused parameters to permit use
7203 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
7204
7205 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
7206
7207 Fix infringement on user name space reported by Janos Zoltan Szabo.
7208 * data/yacc.c (yyparse): strlen -> yystrlen.
7209
7210 2005-05-30 Akim Demaille <akim@epita.fr>
7211
7212 * data/lalr1.cc (_): New.
7213 Translate the various messages.
7214
7215 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
7216
7217 Fix infringement on user name space reported by Bruno Haible.
7218 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
7219 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
7220 the user's name space.
7221 (alloca): Include <stdlib.h> to get it, if it's not built in.
7222 (YYMALLOC, YYFREE): Define only if needed.
7223 (malloc, free): Declare, but only if needed, as this infringes on
7224 the user name space.
7225
7226 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
7227
7228 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
7229 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
7230 with %d format.
7231 * lib/ebitset.c (min, max): Undef before defining.
7232 * lib/vbitset.c (min, max): Likewise.
7233 * lib/subpipe.c (create_subpipe): Save local variables in case
7234 vfork clobbers them.
7235
7236 2005-05-24 Bruno Haible <bruno@clisp.org>
7237
7238 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
7239 error message syntax used by gcc-4.0.
7240
7241 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
7242
7243 * README: Mention m4 1.4.3. Remove obsolete advice about
7244 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
7245
7246 * bootstrap: Remove workaround for problem I encountered with
7247 gettext 0.14.1; it seems to be fixed now.
7248
7249 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
7250
7251 * NEWS: Version 2.0a.
7252
7253 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
7254 the previous change.
7255
7256 Various maintainer cleanups.
7257 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
7258 conftest*, for benefit of CVS commands run at the same time as
7259 "configure". Add build-aux, since "bootstrap" now creates it and
7260 its subfiles.
7261 * Makefile.cfg (move_if_change): Remove.
7262 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
7263 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
7264 (po_repo, do-po-update, po-update, wget_files, get-targets):
7265 (config.guess-url_prefix, config.sub-url_prefix):
7266 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
7267 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
7268 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
7269 Remove.
7270 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
7271 this is now the recommended name.
7272 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
7273 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
7274 ylwrap. These files now go into build-aux.
7275 * config/move-if-change: Remove.
7276 * config/prev-version.txt: Bump from 1.75 to 2.0.
7277
7278 * bootstrap: Add stdio-safer, unistd-safer modules.
7279 Remove m4/glibc2.m4 (introduced by latest gnulib, but
7280 we don't need it).
7281 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
7282 fopen-safer.c, stdio-safer.h, unistd-safer.h.
7283 * lib/subpipe.c: Include "unistd-safer.h".
7284 (create_subpipe): Make sure all the newly-created
7285 file descriptors are > 2, so that diagnostics don't
7286 get sent down them (which might cause Bison to hang, in theory).
7287 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
7288 * src/files.c (xfopen): Use fopen_safer, not fopen.
7289
7290 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
7291 yesterday's yacc.c fix.
7292
7293 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
7294
7295 * data/glr.c, data/lalr1.cc: Update copyright date.
7296
7297 Fix a destructor bug reported by Wolfgang Spraul in
7298 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
7299 * data/yacc.c (yyabortlab): Don't call destructor, and
7300 don't set yychar to EMPTY.
7301 (yyoverflowlab): Don't call destructor.
7302 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
7303 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
7304 since we no longer output the message "discarding lookahead token
7305 end of input ()".
7306
7307 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7308
7309 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
7310 fix a small glitch in debugging output.
7311 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
7312 after YY_SYMBOL_PRINT where needed.
7313
7314 (struct yyGLRState): Add some comments.
7315 (struct yySemanticOption): Add some comments.
7316 (union yyGLRStackItem): Add comment.
7317
7318 (yymergeOptionSets): Correct this to properly perform the union,
7319 avoiding infinite reported by Michael Rosien.
7320 Update comment.
7321
7322 * tests/glr-regression.at: Add test for GLR merging error reported
7323 by M. Rosien.
7324
7325 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
7326
7327 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
7328 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
7329 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
7330 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
7331 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
7332 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
7333 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
7334 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
7335 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
7336 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
7337 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
7338 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
7339 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
7340 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
7341 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
7342 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
7343 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
7344 src/derives.h, src/files.c, src/files.h, src/getargs.c,
7345 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
7346 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
7347 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
7348 src/output.h, src/parse-gram.c, src/parse-gram.h,
7349 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
7350 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
7351 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
7352 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
7353 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
7354 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
7355 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
7356 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
7357 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
7358 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
7359 tests/reduce.at, tests/regression.at, tests/sets.at,
7360 tests/synclines.at, tests/testsuite.at, tests/torture.at:
7361 Update FSF postal mail address.
7362
7363 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
7364
7365 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
7366 Problem reported by Ralf Menzel.
7367
7368 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
7369
7370 * tests/actions.at: Test that stack overflow invokes destructors.
7371 From Marcus Holland-Moritz.
7372 * data/yacc.c (yyerrlab): Move the code that destroys the stack
7373 from here....
7374 (yyreturn): to here. That way, destructors are called properly
7375 even if the stack overflows, or the user calls YYACCEPT or
7376 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
7377 (yyoverflowlab): Destroy the lookahead.
7378
7379 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
7380
7381 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
7382
7383 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
7384
7385 * NEWS: Bison-generated C parsers no longer quote literal strings
7386 associated with tokens.
7387 * src/output.c (prepare_symbols): Don't escape strings,
7388 since users don't want to see C escapes.
7389 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
7390 in diagnostics.
7391 * tests/input.at (Torturing the Scanner): Likewise.
7392 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
7393
7394 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
7395
7396 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
7397 the data size is known to be too small and we can't increase it.
7398 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
7399
7400 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
7401
7402 * src/parse-gram.y: Include quotearg.h.
7403 (string_as_id): Quote $1 before using it as a key, since the
7404 lexer no longer quotes it for us.
7405 (string_content): Don't strip quotes, since lexer no longer
7406 quotes it for us.
7407 * src/scan-gram.l: Include quotearg.h.
7408 ("\""): Omit quote.
7409 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
7410 a key, since the rest of the lexer doesn't quote it.
7411 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
7412 * tests/regression.at (Token definitions): Check for backslashes
7413 in token strings.
7414
7415 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
7416 (YYSIZE_T): Define to unsigned long int when using an older compiler.
7417 (yyparse): Revamp code to generate long syntax error message, to
7418 make it easier to translate, and to avoid problems with arithmetic
7419 overflow. Change "virtual memory" to "memory" in diagnostic, since
7420 we don't know whether the memory is virtual.
7421
7422 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
7423
7424 * NEWS: Bison-generated C parsers now use the _ macro to
7425 translate strings.
7426 * data/yacc.c (_) [!defined _]: New macro.
7427 All English strings wrapped inside this macro.
7428 * doc/bison.texinfo (Bison Parser): Document _.
7429 * po/POTFILES.in: Include src/parse-gram.c, since it now
7430 includes translateable strings that parse-gram.y doesn't.
7431
7432 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
7433
7434 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
7435 reverting the 2004-10-11 change to this function.
7436 (symbol_check_alias_consistency): Don't call symbol_type_set
7437 if the type name is already correct.
7438 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
7439
7440 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
7441
7442 * tests/regression.at (Token definitions): Don't use a token named
7443 c, as that generates a "#define c ..." that runs afoul of buggy
7444 stdlib.h that uses the identifier c as a member of struct
7445 drand48_data. Problem reported by Horst Wente.
7446
7447 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
7448
7449 * bootstrap: Change translation URL from
7450 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
7451 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
7452 redirection glitches. Problem reported by twlevo@xs4all.nl.
7453
7454 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
7455
7456 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
7457 after operands; POSIX says this isn't portable for the c99 command.
7458
7459 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
7460
7461 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
7462 immediately if a data overrun has occurred; this may help us track
7463 down what may be a spurious failure on MacOS.
7464
7465 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
7466
7467 Respond to problems reported by twlevo@xs4all.nl.
7468
7469 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
7470
7471 * src/vcg.h: Comment fix.
7472 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
7473 (G_CMAX): Change to -1 instead of INT_MAX.
7474
7475 * data/yacc.c (yyparse): Omit spaces before #line.
7476
7477 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
7478
7479 * src/tables.c (state_number_to_vector_number): Put it inside an
7480 "#if 0", since it's not currently used. Problem reported by
7481 Roland McGrath.
7482
7483 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
7484
7485 * src/output.c (escaped_output): Renamed from
7486 escaped_file_name_output, since we now use it for symbol tags as
7487 well. All uses changed.
7488 (symbol_destructors_output, symbol_printers_output):
7489 Escape symbol tags too.
7490 Problem reported by Matyas Forstner in
7491 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
7492
7493 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
7494 not needed.
7495 * src/output.c (user_actions_output, token_definitions_output,
7496 symbol_destructors_output, symbol_printers_output): Likewise.
7497 * src/reader.c (prologue_augment): Likewise.
7498 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
7499
7500 * src/vcg.c (output_edge): Don't quote linestyle arg.
7501 Problem reported by twlevo@xs4all.nl.
7502
7503 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
7504
7505 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
7506 example, reported by Derek M Jones. Also, make the example even
7507 more outrageous, to better illustrate how bad the problem is.
7508
7509 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
7510
7511 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
7512 putsym. Typo reported by Sebastian Piping.
7513
7514 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
7515
7516 * doc/bison.texinfo (Language and Grammar): some -> same
7517 (Epilogue): int he -> in the
7518 Typos reported by Sebastian Piping via Justin Pence.
7519
7520 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
7521
7522 * tests/glr-regression.at (Improper handling of embedded actions
7523 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
7524 embedded actions and $-N in GLR parsers", work around an Autoconf bug
7525 with dollar signs in test names.
7526 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
7527 for a similar reason.
7528
7529 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
7530
7531 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
7532 wants to redefine G_VIEW.
7533
7534 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
7535
7536 * src/vcg.c (get_view_str): Remove case for normal_view.
7537 Problem reported by twlevo@xs4all.nl.
7538
7539 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
7540
7541 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
7542 Problem reported by twlevo@xs4all.nl.
7543
7544 * doc/bison.texinfo: Change @dircategory from "GNU programming
7545 tools" to "Software development". Requested by Richard Stallman
7546 via Karl Berry.
7547
7548 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
7549
7550 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
7551 Problem reported by twlevo@xs4all.nl.
7552
7553 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
7554
7555 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
7556 keyword; it's not needed with modern compilers, and it doesn't
7557 affect correctness with older compilers. Suggested by
7558 twlevo@xs4all.nl.
7559
7560 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
7561
7562 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
7563 gcc -Wswitch-default.
7564 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7565 * data/yacc.c (yyparse): Likewise.
7566
7567 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
7568
7569 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
7570 already. Let config.h define any nonstandard values.
7571
7572 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
7573
7574 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
7575 for the benefit of slower hosts. Problem reported by
7576 Nelson H. F. Beebe.
7577
7578 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
7579
7580 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
7581 being defined and not used.
7582 * data/lalr1.cc (yyparse): Likewise.
7583 Use "if (false)" rather than "if (0)".
7584
7585 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
7586
7587 * TODO: Mention that we should allow NUL bytes in tokens.
7588
7589 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
7590
7591 * src/scan-skel.l (<<EOF>>): Don't close standard output.
7592 Problem reported by Hans Aberg.
7593
7594 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
7595
7596 * src/getargs.c (version): Happy new year; update overall
7597 program copyright date from 2004 to 2005.
7598
7599 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
7600 Problem reported by Hans Aberg.
7601 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
7602 (Output file names.): Add a test for the case when standard output
7603 is closed.
7604
7605 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
7606
7607 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
7608 to fix an oversight in the Bison 2.0 manual.
7609
7610 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
7611
7612 * NEWS: Version 2.0. Reformat the existing news items since
7613 1.875, so that related items are grouped together.
7614 * configure.ac (AC_INIT): Bump version to 2.0.
7615 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
7616
7617 * tests/torture.at (Exploding the Stack Size with Alloca): Set
7618 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
7619 otherwise, we're not testing alloca. Unfortunately there's no
7620 simple way to consult HAVE_ALLOCA here.
7621
7622 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
7623 for yymsg, too.
7624
7625 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
7626 hand. This avoids a warning about comparing int to size_t when
7627 GCC warnings are enabled.
7628
7629 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
7630
7631 * NEWS: Bison-generated parsers no longer default to using the
7632 alloca function (when available) to extend the parser stack, due
7633 to widespread problems in unchecked stack-overflow detection.
7634 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
7635 responsibility to set it to a positive value. This lets the user
7636 specify a value that is not a preprocessor constant.
7637 * data/yacc.c (YYMAXDEPTH): Likewise.
7638 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
7639 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
7640 to be a compile-time constant. However, explain the constraints on it.
7641 Also, explain the constraints on YYINITDEPTH.
7642 (Table of Symbols): Explain that alloca is no longer the default.
7643 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
7644 to 1.
7645
7646 * doc/bison.texinfo (Location Default Action): Mention that n must
7647 be zero when k is zero. Suggested by Frank Heckenbach.
7648
7649 2004-12-22 Akim Demaille <akim@epita.fr>
7650
7651 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
7652 (parser::state_type, parser::semantic_type, parser::location_type):
7653 Private, not public.
7654 (parser::parse): Return ints, not bool.
7655 Returning a bool introduces a problem: 0 corresponds to false, and
7656 it seems weird to return false on success. Returning true changes
7657 the conventions for yyparse.
7658 Alternatively we could return void and send an exception.
7659 There is no clear consensus (yet?).
7660 (state_stack, semantic_stack, location_stack): Rename as...
7661 (state_stack_type, semantic_stack_type, location_stack_type): these.
7662 Private, not public.
7663 * tests/c++.at: New.
7664 * tests/testsuite.at, tests/Makefile.am: Adjust.
7665
7666 2004-12-21 Akim Demaille <akim@epita.fr>
7667
7668 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
7669
7670 2004-12-21 Akim Demaille <akim@epita.fr>
7671
7672 Don't impose std::string for filenames.
7673
7674 * data/lalr1.cc (b4_filename_type): New.
7675 (position::filename): Use it.
7676 (parser.hh): Move the inclusion of stack.hh and location.hh below
7677 the user code, so that needed headers for the filename type can be
7678 included first.
7679 Forward declare them before the user code.
7680 * tests/Makefile.am (check-local, installcheck-local): Pass
7681 TESTSUITEFLAGS to the TESTSUITE.
7682
7683 2004-12-20 Akim Demaille <akim@epita.fr>
7684
7685 Use more STL like names: my_class instead of MyClass.
7686
7687 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
7688 (SemanticStack, SemanticType, StateStack, StateType)
7689 (TokenNumberType, Stack, Slice, Traits, Parser::location)
7690 (Parser::value): Rename as...
7691 (location_stack, location_type, rhs_number_type, semantic_stack)
7692 (semantic_type, state_stack, state_type, token_number_type, stack)
7693 (slice, traits, parser::yylloc, parser::yylval): these.
7694
7695 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
7696
7697 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
7698
7699 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
7700 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7701
7702 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
7703
7704 Remove uses of 'short int' and 'unsigned short int'. This raises
7705 some arbitrary limits. It uses more memory but nowadays that's
7706 not much of an issue.
7707
7708 This change does not affect the generated parsers; that's a different
7709 task, as some users will want to conserve memory there.
7710
7711 Ideally we should use size_t to represent all object counts, and
7712 something like ptrdiff_t to represent signed differences of object
7713 counts; but that will require more code-cleanup than I have the
7714 time to do right now.
7715
7716 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
7717 Use size_t, not int or short int, to count objects.
7718 * src/closure.c (nritemset, closure): Likewise.
7719 * src/closure.h (nritemset, closure): Likewise.
7720 * src/nullable.c (nullable_compute): Likewise.
7721 * src/print.c (print_core): Likewise.
7722 * src/print_graph.c (print_core): Likewise.
7723 * src/state.c (state_compare, state_hash): Likewise.
7724 * src/state.h (struct state): Likewise.
7725 * src/tables.c (default_goto, goto_actions): Likewise.
7726
7727 * src/gram.h (rule_number, rule): Use int, not short int.
7728 * src/output.c (prepare_rules): Likewise.
7729 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
7730 errs, reductions): Likewise.
7731 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
7732 Likewise.
7733 * src/tables.c (vector_number, tally, action_number,
7734 ACTION_NUMBER_MINIMUM): Likewise.
7735 * src/output.c (muscle_insert_short_int_table): Remove.
7736
7737 2004-12-17 Akim Demaille <akim@epita.fr>
7738
7739 * data/lalr1.cc: Extensive Doxygenation.
7740 (error_): Rename as...
7741 (error): this, since it is visible to the user.
7742 Adjust callers.
7743 (Parser::message): Now an automatic variable from...
7744 (Parser::yyreport_syntax_error_): here.
7745 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
7746 Parser::error.
7747 * tests/input.at: Escape $.
7748
7749 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
7750
7751 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
7752 Parenthesize rhs to avoid obscure problems with mistakes like
7753 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
7754 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7755 b4_rhs_location): Likewise.
7756 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7757 b4_rhs_location): Likewise.
7758
7759 2004-12-16 Akim Demaille <akim@epita.fr>
7760
7761 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
7762 yacc.c: be sure to stay within yycheck_.
7763 * tests/actions.at: Re-enable C++ tests.
7764
7765 2004-12-16 Akim Demaille <akim@epita.fr>
7766
7767 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
7768 real.
7769
7770 2004-12-16 Akim Demaille <akim@epita.fr>
7771
7772 Use #define to handle the %name-prefix.
7773
7774 * data/glr.c, data/yacc.c: Comment changes.
7775 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
7776 so that one can refer to yylex in the parser file, and have it
7777 renamed, as is the case with other skeletons.
7778
7779 2004-12-16 Akim Demaille <akim@epita.fr>
7780
7781 Move lalr1.cc internals into yy*.
7782
7783 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
7784 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
7785 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
7786 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
7787 (empty_, final_, terror_, errcode_, ntokens_)
7788 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
7789 (looka_, ilooka_, error_range_, nerrs_):
7790 Rename as...
7791 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
7792 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
7793 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
7794 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
7795 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
7796 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
7797 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
7798 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
7799 these.
7800
7801 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
7802
7803 Fix some problems reported by twlevo at xs4all.
7804 * src/symtab.c (symbol_new): Report an error if the input grammar
7805 contains too many symbols. This is better than calling abort() later.
7806 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
7807 (struct node, struct graph):
7808 Rename member expand to stretch. All uses changed.
7809 (struct graph): Remove member layoutalgorithm. All uses removed.
7810 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
7811 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
7812 All uses changed.
7813 (N_STRETCH): Rename from N_EXPAND. All uses changed.
7814
7815 2004-12-15 Akim Demaille <akim@epita.fr>
7816
7817 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
7818 Add more Doxygen comments.
7819 (symprint_, stack_print_, reduce_print_, destruct_, pop)
7820 (report_syntax_error_, translate_): Rename as...
7821 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
7822 (yypop_, yyreport_syntax_error_, yytranslate_): this.
7823
7824 2004-12-15 Akim Demaille <akim@epita.fr>
7825
7826 * data/lalr1.cc (lex_): Rename as...
7827 (yylex_): this.
7828 Move the trace here.
7829 Take the %name-prefix into account.
7830 Reported by Alexandre Duret-Lutz.
7831
7832 2004-12-15 Akim Demaille <akim@epita.fr>
7833
7834 Simplify the C++ parser constructor.
7835
7836 * data/lalr1.cc (debug_): Rename as...
7837 (yydebug_): so that the parser's internals are always in the yy*
7838 pseudo namespace.
7839 Adjust uses.
7840 (b4_parse_param_decl): Remove the leading comma as it is now only
7841 called as unique argument list.
7842 (Parser::Parser): Remove the constructor accepting a location and
7843 an initial debugging level.
7844 Remove from the other ctor the argument for the debugging level.
7845 (debug_level_type, debug_level, set_debug_level): New.
7846
7847 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7848 constructor calls.
7849
7850 2004-12-15 Akim Demaille <akim@epita.fr>
7851
7852 Remove b4_root related material: failure experiment
7853 (which goal was to allow to derive from a class).
7854
7855 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7856 definitions and uses.
7857
7858 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7859
7860 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7861 not 2, since it's not portable to subtract 1 from the start of an
7862 array. The new item 0 is never set or used. All uses changed.
7863
7864 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7865 the default definition of YYLLOC_DEFAULT. Problem reported
7866 by Frank Heckenbach.
7867
7868 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7869
7870 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7871 the normal case and one for the error case. Just use the
7872 first one uniformly. Problem reported by Frank Heckenbach.
7873 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7874 use exactly the same macro in both places.
7875 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7876 so that the normal-case YYRHSLOC works for the error case too.
7877 All uses changed.
7878 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7879 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7880 * doc/bison.texinfo (Location Default Action): Don't claim that
7881 we have an array of locations. Use the same macro for both glr
7882 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7883 the index is 0.
7884
7885 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7886
7887 * HACKING: Update email addresses to send announcements to.
7888
7889 * configure.ac (AC_INIT): Bump version to 1.875f.
7890
7891 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7892
7893 * NEWS: Version 1.875e.
7894 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7895
7896 * src/scan-skel.l: Include "complain.h", for "fatal".
7897
7898 * src/relation.h (relation_print, relation_digraph):
7899 Relation sizes are of type relation_node, not size_t (this is
7900 merely a doc fix, since the two types are equivalent).
7901 (relation_transpose): Relation sizes are of type relation_node,
7902 not int.
7903 * src/relation.c: Likewise.
7904 (top, infinity): Now of type relation_node, not int.
7905 (traverse, relation_transpose): Use relation_node, not int.
7906
7907 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7908 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7909 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7910
7911 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
7912 specifying whether the test should be skipped. Use it tp
7913 specify that the [%defines %skeleton "lalr1.cc"] tests currently
7914 fail on some hosts, and should be skipped.
7915
7916 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7917
7918 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7919 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7920 unless otherwise specified below.
7921
7922 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7923 to allocate kernel_base, kernel_items, kernel_size, since
7924 they needn't be initialized to 0.
7925 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7926 * src/closure.c (new_closure): Likewise, for itemset.
7927 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7928 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7929 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7930 (build_relations): Likewise for edge, states1, includes.
7931 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7932 * src/reader.c (packgram): Likewise, for ritem, rules.
7933 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7934 * src/relation.c (relation_digraph): Likewise for VERTICES.
7935 (relation_transpose): Likewise for new_R, end_R.
7936 * src/symtab.c (symbols_token_translations_init): Likewise for
7937 token_translations.
7938 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7939 (token_actions): Likewise for yydefact, actrow, conflrow,
7940 conflict_list.
7941 (save_column): Likewise for froms[symno], tos[symno].
7942 (goto_actions): Likewise for state_count.
7943 (pack_table): Likewise for base, pos, check.
7944 (tables_generate): Likewise for width.
7945
7946 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7947 for initial core. Just have a separate core, so we needn't worry
7948 about whether kernel_size and kernel_base are initialized.
7949
7950 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7951 kernel_size, kernel_items): Remove unnecessary initialization.
7952 * src/conflicts.c (conflicts): Likewise.
7953 * src/derives.c (derives): Likewise.
7954 * src/muscle_tablc (muscle_insert): Likewise.
7955 * src/relation.c (relation_digraph): Likewise.
7956 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7957 conflrow, conflict_table, conflict_list, table, check):
7958 Likewise.
7959
7960 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7961 This is because all callers pass unsigned int.
7962 * src/closure.h (new_closure): Likewise.
7963
7964 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7965 (build_relations): Initialize includes[i] in all cases.
7966 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7967 and rules[ruleno].precsym. Initialize members in order.
7968 * src/relation.c (relation_transpose): Always initialize new_R[i]
7969 and end_R[i].
7970 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7971
7972 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7973 conflict_list[0] was always 0, but now it isn't initialized.
7974
7975 * src/table.c (table_grow): When conflict_table grew, the grown
7976 area wasn't cleared. Fix this.
7977
7978 * lib/.cvsignore: Add strdup.c, strdup.h.
7979 * m4/.cvsignore: Add strdup.m4.
7980
7981 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7982
7983 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7984 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7985 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7986 ngotos + 1 without checking for overflow.
7987 (build_relations): Use END_NODE, not -1, to denote end of edges.
7988 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7989 build_relations): Use goto_number, not int, for goto numbers.
7990 * src/tables.c (save_column, default_goto): Likewise.
7991
7992 2004-11-23 Akim Demaille <akim@epita.fr>
7993
7994 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7995 of #defining from yystype.
7996 Don't typedef yystype, C++ does not need it.
7997 This lets it possible to forward declare it as union.
7998
7999 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
8000
8001 * bootstrap (gnulib_modules): Add extensions.
8002 Problem reported by Jim Meyering.
8003
8004 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
8005
8006 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
8007 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
8008 src/system.h, src/tables.c: XFREE -> free, to accommodate
8009 recent change to gnulib xalloc.h.
8010 Problem reported by Jim Meyering.
8011
8012 2004-11-17 Akim Demaille <akim@epita.fr>
8013
8014 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
8015
8016 2004-11-17 Akim Demaille <akim@epita.fr>,
8017 Alexandre Duret-Lutz <adl@gnu.org>
8018
8019 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
8020 changes.
8021 (YYCDEBUG): Adjust.
8022 Use it instead of cdebug_.
8023 (Parser::debug_stream, Parser::set_debug_stream): New.
8024 (Parser::symprint_): Define cdebug_ for temporary backward
8025 compatibility.
8026 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
8027 debug_stream ().
8028
8029 2004-11-17 Akim Demaille <akim@epita.fr>
8030
8031 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
8032 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
8033 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
8034 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8035
8036 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
8037
8038 * data/glr.c (yyloc_default): Remove; not used.
8039 Problem reported by Frank Heckenbach.
8040
8041 2004-10-25 Akim Demaille <akim@epita.fr>
8042
8043 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
8044 Introduce another definition to address simple location arrays.
8045 (yyGLRStack): New member: yyerror_range.
8046 (yyrecoverSyntaxError, yyparse): Update it.
8047 (yyrecoverSyntaxError): Use it when shifting the error token to
8048 have an accurate range, equivalent to the one computed by both
8049 yacc.c and lalr1.cc.
8050 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
8051 that column numbers start at column 0, as per GNU Coding
8052 Standards, the others tests, and the doc.
8053 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
8054 Adjust to the above change (first column is 0).
8055 And adjust the location of the "<error>", now covering the whole
8056 line.
8057
8058 2004-10-22 Akim Demaille <akim@epita.fr>
8059 and Paul Eggert <eggert@cs.ucla.edu>
8060
8061 Remove some arbitrary limits on goto numbers and relations.
8062 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
8063 initial values, since they're never used.
8064 (set_goto_map): ngotos is now unsigned, so test for overflow
8065 by seeing whether it wraps around to zero.
8066 * src/lalr.h (goto_number): Now size_t, not short int.
8067 (GOTO_NUMBER_MAXIMUM): Remove.
8068 * src/relation.c (relation_print, traverse, relation_transpose):
8069 Check for END_NODE rather than looking at sign.
8070 * src/relation.h (END_NODE): New macro.
8071 (relation_node): Now size_t, not short int.
8072
8073 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
8074
8075 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
8076 keyword, not an identifier. Problem reported by Baron Schwartz in
8077 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
8078
8079 2004-10-11 Akim Demaille <akim@epita.fr>
8080
8081 * src/symtab.c (symbol_check_alias_consistency): Also check
8082 type names, destructors, and printers.
8083 Reported by Alexandre Duret-Lutz.
8084 Recode the handling of associativity and precedence in terms
8085 of symbol_precedence_set.
8086 Accept no redeclaration at all, not even equal to the previous
8087 value.
8088 (redeclaration): New.
8089 Use it to factor redeclaration complaints.
8090 (symbol_make_alias): Don't set the type of the alias, let
8091 symbol_check_alias_consistency do it as for other features.
8092 * src/symtab.h (symbol): Add new member prec_location, and
8093 type_location.
8094 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
8095 * tests/input.at (Incompatible Aliases): New.
8096
8097 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
8098
8099 .cvsignore fixes to accommodate gnulib changes,
8100 and the practice of naming build directories "_build".
8101 * .cvsignore: Add "_*". Sort.
8102 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
8103 * m4/.cvsignore: Add "*_gl.m4".
8104
8105 2004-10-06 Akim Demaille <akim@epita.fr>
8106
8107 * src/parse-gram.y (add_param): Fix the truncation of trailing
8108 spaces.
8109
8110 2004-10-05 Akim Demaille <akim@epita.fr>
8111
8112 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
8113 whether the reducion was empty or not. This leaves room to
8114 improve the use of YYLLOC_DEFAULT in such a case.
8115 lalr1.cc is still experimental, so changing this is acceptable.
8116 And finally, there are probably not many users who changed the
8117 handling of locations in GLR, so changing is admissible too.
8118
8119 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
8120 empty reduction, set @$ to an empty location ending the previously
8121 stacked symbol.
8122 Adjust uses to make sure the code is triggered on empty
8123 reductions.
8124 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
8125 expected output: empty reductions have empty locations.
8126
8127 2004-09-29 Akim Demaille <akim@epita.fr>
8128
8129 * data/lalr1.cc: Move towards a more standard C++ coding style
8130 for templates: Class < T > -> Class<T>.
8131
8132 2004-09-29 Akim Demaille <akim@epita.fr>
8133
8134 * data/lalr1.cc: Reinstall the former ctor, for sake of
8135 compatibility, but warn it will be removed.
8136 Move towards a more standard C++ coding style (i.e., type *var ->
8137 type* var).
8138
8139 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
8140
8141 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
8142 since it's less likely to work if NULs are involved in the future.
8143
8144 2004-09-27 Akim Demaille <akim@epita.fr>
8145
8146 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
8147
8148 2004-09-27 Akim Demaille <akim@epita.fr>
8149
8150 * data/lalr1.cc (b4_parse_param_decl_1): New.
8151 (b4_parse_param_decl): Use it to have different names between attribute
8152 and argument names.
8153 (b4_cc_constructor_call): Likewise.
8154
8155 2004-09-24 Akim Demaille <akim@epita.fr>
8156
8157 * src/parse-gram.y (add_param): Strip the leading and trailing
8158 blanks from a formal argument declaration.
8159 (YY_LOCATION_PRINT): New.
8160
8161 2004-09-24 Akim Demaille <akim@epita.fr>
8162
8163 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
8164 after the location.
8165
8166 2004-09-24 Akim Demaille <akim@epita.fr>
8167
8168 * doc/bison.texinfo (Table of Symbols): Sort.
8169
8170 2004-09-21 Akim Demaille <akim@epita.fr>
8171
8172 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
8173 the useless parentheses.
8174 Suggested by Paul Eggert.
8175
8176 2004-09-20 Akim Demaille <akim@epita.fr>
8177
8178 Let the initial-action act on the look-ahead, and use it for the
8179 "initial push" (corresponding to an hypothetical beginning-of-file).
8180 And let lalr1.cc honor %initial-action.
8181
8182 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
8183 example.
8184 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
8185 (Parser::Parser): Remove the ctor that used to initialize it.
8186 (Parser::parse): Like in the other skeletons, issue the "starting
8187 parse" message before any action.
8188 Honor %initial-action.
8189 Initialize the stacks with the lookahead.
8190 * data/yacc.c: Let $$ and @$ in %initial-action designate the
8191 look-ahead.
8192 Push them in the stacks.
8193 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
8194
8195 2004-09-20 Akim Demaille <akim@epita.fr>
8196
8197 * doc/bison.texinfo (Initial Action Decl): New.
8198
8199 2004-09-20 Akim Demaille <akim@epita.fr>
8200
8201 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
8202 clearer criterion to define it.
8203 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
8204 When reducing on an empty RHS, use the latest stacked location as
8205 location.
8206 yylloc is not always available.
8207 * data/glr.c: Likewise.
8208 Also, honor initial-actions.
8209
8210 2004-09-20 Akim Demaille <akim@epita.fr>
8211
8212 * data/yacc.c (YY_LOCATION_PRINT): New.
8213 Define when we know YYLTYPE's structure, i.e., when the default
8214 YYLLOC_DEFAULT is used.
8215 * data/c.m4 (b4_yysymprint_generate): Use it.
8216 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
8217 value of the result.
8218 (error_start_): Replace with...
8219 (error_range_): this location array.
8220 This allows to replace code relying on the implementation of
8221 locations by portable code.
8222 * data/yacc.c (yylerrsp): Replace with...
8223 (yyerror_range): this.
8224 Every time a token is popped, update yyerror_range[0], to have an
8225 accurate location for the error token.
8226 * data/glr.c (YY_LOCATION_PRINT): New.
8227 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
8228 deference a pointer.
8229 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
8230 report the location in %printers.
8231
8232 * src/scan-skel.l: Instead of abort, report error messages to ease
8233 understanding skeleton scanning failures.
8234
8235 2004-09-16 Akim Demaille <akim@epita.fr>
8236
8237 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
8238 (iterator, const_iterator): these, to be more in the C++ spirit.
8239 Also, return reverse iterators so that when displaying the stack
8240 we display its bottom first.
8241 (Parser::stack_print_, Parser::reduce_print_): Match the messages
8242 from yacc.c.
8243 We should probably use vector here though.
8244
8245 2004-09-16 Akim Demaille <akim@epita.fr>
8246
8247 Have more complete shift traces.
8248
8249 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
8250 to report Shifts instead of ad hoc YYDPRINTF invocations,
8251 including for the error token.
8252 * data/lalr1.cc (symprint_): Output the location.
8253 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
8254 output the location within the %printer.
8255 Activate GLR tests, at least to make sure they compile properly.
8256 They still don't pass though.
8257 * tests/calc.at: Adjust expect verbose output, since now "Entering
8258 state..." is on a different line than the "Shifting" message.
8259
8260 2004-09-08 Akim Demaille <akim@epita.fr>
8261
8262 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
8263 Bison directive from the Bison file to the invocation of this
8264 macro, so that these directives are passed to
8265 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
8266 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
8267 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
8268 the extra Bison directives instead of the whole series.
8269 Change the grammar so that there are recoverable errors, and
8270 unrecoverable errors. Now we can have the parser give up before
8271 consuming the whole input. As a result we now can observe that
8272 the lookahead is freed when needed.
8273 Change the parser source to parse argv[1] instead of a hard coded
8274 string.
8275 Simplify yylex, and give a value and location to EOF.
8276 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
8277 passed directives already coded in the file.
8278 Add some tests to check the location of "error".
8279 For some tests, the C++ parser is correct, and not yacc.c.
8280 For other tests, they provide different, but unsatisfying, values,
8281 so keep the C++ value so that at least one parser is "correct"
8282 according to the test suite.
8283 (Actions after errors): Remove, this is subsumed by the
8284 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
8285
8286 2004-09-06 Akim Demaille <akim@epita.fr>
8287
8288 * data/lalr1.cc: Adjust the indentation of the labels.
8289 (Parser::pop): New.
8290 Use it.
8291
8292 2004-09-06 Akim Demaille <akim@epita.fr>
8293
8294 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
8295 argument, an informative message.
8296 Call YY_SYMBOL_PRINT.
8297 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
8298 * data/lalr1.cc (destruct_): Likewise.
8299 In addition, no longer depend on b4_yysymprint_generate and
8300 b4_yydestruct_generate to generate these functions, do it "by
8301 hand".
8302
8303 2004-09-03 Akim Demaille <akim@epita.fr>
8304
8305 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
8306 invoked, yydestruct the lookahead.
8307 * tests/calc.at (Calculator $1): Update the expected lengths of
8308 traces: there is an added line for the discarded lookahead.
8309 * doc/bison.texinfo (Destructor Decl): Some rewording.
8310 Define "discarded" symbols.
8311
8312 2004-09-02 Akim Demaille <akim@epita.fr>
8313
8314 * data/lalr1.cc (translate_, destruct_): No reason to be static.
8315
8316 2004-09-02 Akim Demaille <akim@epita.fr>
8317
8318 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
8319 (YYDSYMPRINTF): Rename as...
8320 (YY_SYMBOL_PRINT): this.
8321 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
8322 two.
8323 Use it instead of direct symprint_ calls.
8324 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
8325 one.
8326
8327 2004-09-02 Akim Demaille <akim@epita.fr>
8328
8329 * data/lalr1.cc (b4_yysymprint_generate): New.
8330 (symprint_): New member function, defined when YYDEBUG.
8331 Use it consistently instead of token/nterm debugging output by
8332 hand.
8333 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
8334 %printer calls to use cdebug_ when using lalr1.cc.
8335
8336 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
8337
8338 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
8339 with #ifdef YYDEBUG.
8340
8341 2004-08-26 Akim Demaille <akim@epita.fr>
8342
8343 * doc/bison.texinfo (Implementing Loops): Rename as...
8344 (Implementing Gotos/Loops): this.
8345
8346 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
8347
8348 Adjust to latest gnulib.
8349 * bootstrap (gnulib_modules): Add xalloc-die.
8350 Set LC_ALL=C so that file names sort consistently.
8351 Prefer the gnulib copies of gettext.m4, glibc21.m4,
8352 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
8353 uintmax_t.m4, ulonglong.m4.
8354 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
8355 po.m4 since we are now using _gl.m4 instead.
8356
8357 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
8358
8359 * src/scan-action.l: Remove. Scanning of semantic actions is
8360 handled in scan-gram.l.
8361
8362 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
8363
8364 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
8365
8366 * src/location.h (struct): The file member is a uniqstr.
8367 (equal_boundaries): Use UNIQSTR_EQ for comparison.
8368
8369 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
8370
8371 Fix bug with non-%union parsers that have printers or destructors,
8372 which led to a Bison core dump. Reported by Peter Fales in
8373 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
8374
8375 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
8376 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
8377 not to our own type.
8378 * src/output.c (symbol_destructors_output, symbol_printers_output):
8379 Don't assume %union.
8380 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
8381 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
8382 UNION-FLAG. All callers changed.
8383 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
8384 Use type char, not unsigned int, when declaring an array of char;
8385 this lets us remove a cast.
8386 (Printers and Destructors): Add non-%union test cases.
8387
8388 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8389
8390 * doc/bison.texinfo: Minor editorial changes, mostly to the new
8391 GLR writeups. E.g., avoid frenchspacing and the future tense,
8392 change "lookahead" to "look-ahead", and change "wrt" to "with
8393 respect to".
8394
8395 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8396
8397 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
8398 New sections, split off from the GLR Parsers section. Put the new
8399 Simple GLR Parser near the start of the GLR section, for clarity.
8400 Rewrite connective text.
8401
8402 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
8403
8404 * doc/bison.texinfo (Simple GLR Parsers): New section.
8405
8406 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8407
8408 * NEWS, TODO, doc/bison.texinfo:
8409 Use "look-ahead" instead of "lookahead", to be consistent.
8410 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
8411 while we're fixing "look-ahead".
8412 * src/conflicts.c (shift_set): Renamed from shiftset.
8413 (look_ahead_set): Renamed from lookaheadset.
8414 * src/print.c: Likewise.
8415 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
8416 name for "lookahead".
8417 (report_types, usage): Likewise.
8418 * src/getargs.h (report_look_ahead_tokens): Renamed from
8419 report_lookaheads.
8420 * src/lalr.c (compute_look_ahead_tokens): Renamed from
8421 compute_lookaheads.
8422 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
8423 (look_ahead_tokens_print): Renamed from lookaheads_print.
8424 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
8425 state_rule_lookaheads_print.
8426 * src/state.h: Likewise.
8427 (reductions.look_ahead_tokens): Renamed from lookaheads.
8428 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
8429 AT_DATA_LOOKAHEADS_GRAMMAR.
8430
8431 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
8432
8433 * README: Update location of patched M4 distribution.
8434
8435 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
8436
8437 Don't assume the C++ compiler takes the same arguments as the C compiler
8438 (trivial change).
8439 * configure.ac (O0CXXFLAGS): New var.
8440 * tests/atlocal.in (CXXFLAGS): Use it.
8441
8442 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
8443
8444 Fix some "make check" problems with C++ reported by
8445 Albert Chin-A-Young for Tru64 C++ in this thread:
8446 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
8447
8448 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
8449 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8450 Output to a .cc file for C++, not to a .c file.
8451 * tests/calc.at (AT_CHECK_CALC): Likewise.
8452 * tests/regression.at (AT_CHECK_DANCER): Likewise.
8453 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
8454
8455 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
8456
8457 * tests/calc.at, tests/actions.at: Workaround for SGI
8458 C++ compiler. (trivial change)
8459
8460 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
8461
8462 Spent a few hours checking out which prerequisite versions the
8463 current sources actually require. I went all the way back to
8464 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
8465 a seemingly endless set of combinations of versions more recent
8466 than that. The bottom line is that the current sources require
8467 fairly recent versions of the build tools, and it'll be some work
8468 to change this.
8469 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
8470 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
8471 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
8472 Add comments explaining why those particular versions are
8473 currently needed.
8474
8475 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
8476 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
8477 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
8478
8479 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
8480 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
8481
8482 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
8483
8484 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
8485 0.11.5. Suggested by Bruno Haible.
8486 * bootstrap: Remove gettext version checking.
8487
8488 * doc/bison.texinfo (Decl Summary): Also mention that %union
8489 can depend on prerequisite types. Problem reported by Tim
8490 Van Holder.
8491
8492 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
8493
8494 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
8495 * README-alpha: Don't tell people not to package this.
8496
8497 * bootstrap: Don't assume $(...) works; use `...` instead.
8498 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
8499 gettext better.
8500
8501 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
8502 put into the -d output file, and mention what to do if YYSTYPE is
8503 defined as a macro.
8504
8505 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
8506
8507 Undo change made earlier today: it caused autopoint to not bring
8508 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
8509 autopoint's.
8510
8511 * bootstrap: Check that gettext version matches what's in
8512 configure.ac. Warn users to ignore robots.txt ERROR 404.
8513 * bootstrap: Undo today's earlier change (logged below).
8514 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
8515
8516 The gettext version checking is causing more trouble than it's
8517 curing; remove it. Problem reported by Paul Hilfinger.
8518
8519 * bootstrap: Issue a warning that one can expect a message
8520 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
8521 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
8522
8523 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
8524
8525 Ensure that the C++ compiler used for testing actually works on a
8526 simple test program; if not, skip the C++-related tests. Problem
8527 reported by Vin Shelton in:
8528 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
8529
8530 * m4/cxx.m4: New file.
8531 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
8532 * tests/atlocal.in (BISON_CXX_WORKS): Add.
8533 * tests/local.at (AT_COMPILE_CXX): Use it.
8534
8535 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8536
8537 * data/glr.c (yylloc): Output this macro even if locations are not
8538 being generated, as the GLR parser needs it even in that case.
8539 Problem reported by Troy A. Johnson
8540 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
8541
8542 * configure.ac (AC_INIT): Update to 1.875e.
8543
8544 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8545
8546 * NEWS: Version 1.875d.
8547 * configure.ac (AC_INIT): Likewise.
8548 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
8549
8550 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
8551 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
8552 lalr1.cc runs afoul of the first, and the last two are no longer
8553 supported by GCC 3.4.0.
8554 * README: Mention GNU m4 1.4 or later; mention m4 patches.
8555 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
8556
8557 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
8558
8559 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
8560 unsigned int, for compatibility with latest gnulib hash module.
8561 * src/state.c (state_hash, state_hasher): Likewise.
8562 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
8563 * src/uniqstr.c (hash_uniqstr): Likewise.
8564
8565 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
8566
8567 * NEWS: Unescaped newlines are no longer allowed in char & strings.
8568
8569 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
8570 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
8571 character and string literals.
8572 (unexpected_end): New function.
8573 (unexpected_eof): Use it.
8574 (unexpected_newline): New function.
8575 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
8576 actions.
8577
8578 * NEWS: Document %expect-rr.
8579
8580 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
8581 Fix typo by replacing $1 with $option.
8582 Remove more 'intl'-related files.
8583 Don't DEFUN AM_INTL_SUBDIR twice.
8584
8585 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
8586 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
8587 strtoul.c.
8588 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
8589 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
8590 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
8591 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
8592 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
8593 * src/.cvsignore: Add *.output.
8594
8595 * src/parse-gram.y: Put copyright notice inside %{ %} so it
8596 gets copied to the output file.
8597
8598 2004-04-28 Paul Eggert <eggert@twinsun.com>
8599
8600 Get files from the gnulib and po repositories, instead of relying
8601 on them being in our CVS. Upgrade to latest versions of gnulib
8602 and Automake.
8603
8604 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
8605 * bootstrap: Bootstrap from gnulib and po repositories.
8606 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
8607 * README-cvs: Document these changes. Remove version numbers from
8608 mentions of build tools, since they change so often. Mention Flex.
8609
8610 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
8611 (gl_USE_SYSTEM_EXTENSIONS): Add.
8612 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
8613 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
8614 does this for us.
8615 (AC_ISC_POSIX): Remove; we no longer support this
8616 ancient OS, as it gets in the way of latest Autoconf & gnulib.
8617 (AC_HEADER_STDC): Remove: we now assume C89 or better.
8618 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
8619 Do not check for C89 headers, except for locale.h which is used
8620 by the Yacc library and must port to K&R hosts.
8621 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
8622 Do not check for C89 functions, except for setlocale which is
8623 used by the Yacc library.
8624 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
8625 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
8626 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
8627 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
8628 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
8629 AM_GNU_GETTEXT): Remove; now done by:
8630 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
8631 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
8632 for us.
8633
8634 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
8635 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
8636 Define to empty, as gnulib.mk will do the rest for us.
8637 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
8638 for us.
8639 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
8640 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
8641
8642 * src/files.c: Include gnulib's xstrndup.h.
8643
8644 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
8645 (REALLOC): Use xnrealloc, for likewise.
8646 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
8647 (strnlen, memrchr): Remove decls; functions no longer used.
8648 Include <stpcpy.h>.
8649
8650 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
8651 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
8652 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
8653 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
8654 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
8655 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
8656 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
8657 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
8658 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
8659 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
8660 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
8661 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8662 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
8663 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
8664 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
8665 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
8666 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
8667 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
8668 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
8669 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
8670 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
8671 Remove, as these files are now generated automatically
8672 by bootstrap or automake.
8673
8674 * po/ChangeLog: Remove: all but one entry was a duplicate
8675 of this file, and I moved that 2000-11-02 entry here.
8676
8677 * config/.cvsignore: Add Makefile, depcomp, install-sh.
8678 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
8679 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
8680 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
8681 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
8682 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
8683 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
8684 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
8685 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
8686 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
8687 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
8688 xstrndup.h.
8689 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
8690 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
8691 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
8692 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
8693 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
8694 * src/.cvsignore: Remove *_.c.
8695
8696
8697 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
8698 support it. (The latest stable gzip doesn't.)
8699
8700 2004-04-27 Paul Eggert <eggert@twinsun.com>
8701
8702 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
8703 case, as stos_ is now used by destructors due to the 2004-02-09
8704 change.
8705
8706 Remove more K&R C support.
8707 * lib/libiberty.y (PARAMS): Remove. All uses removed.
8708 * lib/subpipe.c (errno): Remove decl.
8709 Include <stdlib.h> unconditionally.
8710 (EXIT_FAILURE): Remove macro.
8711 * src/complain.c (vfprintf, strerror): Remove.
8712 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
8713 unconditionally.
8714 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
8715 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
8716 (strchr, strspn, memchr): Remove decls.
8717 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
8718 unconditionally. Do not declare perror.
8719 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
8720 unconditionally.
8721
8722 * src/complain.c (_): Remove useless defn, as system.h defines this.
8723
8724 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
8725 with latest obstack.h.
8726 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
8727 to procedure types, as obstack.h now does that for us.
8728 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
8729
8730 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
8731 so that this include file can stand alone.
8732 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
8733 does this now. Include subpipe.h first after config.h, to
8734 test whether it can stand alone.
8735
8736 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
8737 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
8738 unused declaration.
8739
8740 * tests/synclines.at (%union synch line): Put a dummy member in
8741 the union, because empty unions aren't allowed in C. Caught
8742 by GCC 3.4.0.
8743
8744 2004-04-13 Jim Meyering <jim@meyering.net>
8745
8746 * src/conflicts.c (conflicts_print): Correct format string typo:
8747 use `%%' to produce literal `%'. (trivial change)
8748
8749 2004-03-30 Paul Eggert <eggert@twinsun.com>
8750
8751 * src/getargs.c (version): Update copyright year to 2004.
8752
8753 * data/c.m4 (b4_int_type): Use 'short int' rather than
8754 'short', and similarly for 'long', 'unsigned', etc.
8755 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
8756 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
8757 yy_yypstack, yydumpstack): Likewise.
8758 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
8759 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
8760 Likewise.
8761 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
8762 yy_stack_print, yyparse): Likewise.
8763 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
8764 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
8765 * lib/bitset.c (bitset_print): Likewise.
8766 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
8767 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8768 * lib/bitsetv.c (bitsetv_dump): Likewise.
8769 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
8770 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
8771 Likewise.
8772 * src/LR0.c (allocate_itemsets): Likewise.
8773 * src/gram.h (rule_number, rule): Likewise.
8774 * src/lalr.h (goto_number): Likewise.
8775 * src/nullable.c (nullable_compute): Likewise.
8776 * src/output.c (prepare_rules): Likewise.
8777 * src/relation.c (relation_print, relation_digraph): Likewise.
8778 * src/relation.h (relation_node): Likewise.
8779 * src/state.h (state_number, transitions, errs, reductions,
8780 struct state): Likewise.
8781 * src/symtab.h (symbol_number, struct symbol): Likewise.
8782 * src/tables.c (vector_number, tally, action_number,
8783 default_goto, goto_actions): Likewise.
8784 * tests/existing.at (GNU Cim Grammar): Likewise.
8785 * tests/regression.at (Web2c Actions): Likewise.
8786
8787 * src/output.c (muscle_insert_short_int_table): Renamed from
8788 muscle_insert_short_table. All uses changed.
8789
8790 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8791
8792 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
8793 (declaration): Replace expected_conflicts with expected_sr_conflicts.
8794 Add %expect-rr rule.
8795
8796 * src/scan-gram.l: Recognize %expect-rr.
8797
8798 * src/conflicts.h (expected_sr_conflicts): Rename from
8799 expected_conflicts.
8800 (expected_rr_conflicts): Declare.
8801
8802 * src/conflicts.c (expected_sr_conflicts): Rename from
8803 expected_conflicts.
8804 (expected_rr_conflicts): Define.
8805 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
8806 for GLR parsers.
8807 Use expected_sr_conflicts in place of expected_conflicts.
8808 Warn if expected_rr_conflicts used in non-GLR parser.
8809
8810 * doc/bison.texinfo: Add documentation for %expect-rr.
8811
8812 2004-03-08 Paul Eggert <eggert@gnu.org>
8813
8814 Add support for hex token numbers. Suggested by Odd Arild Olsen in
8815 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
8816
8817 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
8818 in lalr1.cc.
8819 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
8820 * src/scan-gram.l (scan_integer): New function.
8821 ({int}): Use it.
8822 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
8823 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
8824 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
8825 Say "long int", not "long", for uniformity with GNU style.
8826
8827 2004-02-25 Paul Eggert <eggert@twinsun.com>
8828
8829 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8830 compilers. This fixes a problem with Intel's C++ compiler being
8831 chatty, reported by Guido Trentalancia in
8832 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
8833
8834 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8835
8836 Support %destructor and merge error locations in lalr1.cc.
8837
8838 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8839 (Parser::stos_): Define unconditionally.
8840 (Parser::destruct_): New method. Generate its body with
8841 b4_yydestruct_generate.
8842 (Parser::error_start_): New attribute.
8843 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8844 token which are discarded.
8845 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8846 error_start_ when erroneous token are discarded.
8847 (Parser::parse) <yyerrlab1>: Compute the location of the error
8848 token so that it covers all the discarded tokens.
8849 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8850 it can be called with `%skeleton "lalr1.cc"', and do that.
8851
8852 2004-02-02 Paul Eggert <eggert@twinsun.com>
8853
8854 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8855 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8856 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8857 There's no need to mention top_builddir since Automake does that
8858 for us.
8859 (INCLUDES): Remove, as Automake says it's obsolescent.
8860 Contents migrated into AM_CPPFLAGS as described above.
8861 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8862
8863 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8864
8865 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8866 (yyreportSyntaxError): Handle case where lookahead token is
8867 YYEMPTY.
8868
8869 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8870
8871 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8872 resulting parsers are compilable with C++.
8873
8874 2003-12-23 Paul Eggert <eggert@twinsun.com>
8875
8876 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8877 * src/output.c (output_skeleton): Rename local var.
8878 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8879 Bison tokens, as this runs afoul of the 2003-10-07 change that
8880 disallowed NUL bytes in character constants or string literals.
8881
8882 * tests/local.at: Require Autoconf 2.59's Autotest.
8883 * tests/testsuite.at: Don't include local.at, since we now assume
8884 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8885 including it.
8886 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8887 multiple inclusion warnings.
8888
8889 2003-12-02 Akim Demaille <akim@epita.fr>
8890
8891 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8892 conditions.
8893 From Bruno Haible.
8894
8895 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8896
8897 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8898
8899 2003-10-07 Paul Eggert <eggert@twinsun.com>
8900
8901 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8902 if testsuite doesn't exist.
8903
8904 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8905 literals, unfortunately.
8906 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8907 Complain about NUL bytes in character constants or string literals.
8908
8909 2003-10-05 Paul Eggert <eggert@twinsun.com>
8910
8911 * NEWS: Don't document %no-default-prec, as it's still
8912 too experimental.
8913 * doc/bison.texinfo: Document %no-default-prec only if
8914 the defaultprec flag is set. Normally it's not.
8915
8916 2003-10-04 Paul Eggert <eggert@twinsun.com>
8917
8918 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8919 non-modifiable lvalue, instead of a modifiable one.
8920 * doc/bison.texinfo (Actions): Document that $$ can
8921 be assigned to. Do not claim that $$ and $N are
8922 array element references: user code should not rely on this.
8923
8924 2003-10-01 Paul Eggert <eggert@twinsun.com>
8925
8926 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8927 (grammar_declaration): Use it.
8928 * src/scan-gram.l: New token %no-default-prec.
8929 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8930 * NEWS, doc/bison.texinfo: Document the above.
8931
8932 2003-10-01 Akim Demaille <akim@epita.fr>
8933
8934 VCG no longer supports long_straight_phase.
8935
8936 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8937 * src/print_graph.c (print_graph): Adjust.
8938
8939 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
8940 and Paul Eggert <eggert@twinsun.com>
8941
8942 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8943 Table of Symbols): Document %default-prec.
8944 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8945 (grammar_declaration): Set default_prec on %default-prec.
8946 * src/scan-gram.l (%default-prec): New token.
8947 * src/reader.h (default_prec): New flag.
8948 * src/reader.c: Likewise.
8949 (packgram): Handle it.
8950 * tests/conflicts.at (%default-prec without %prec,
8951 %default-prec with %prec, %default-prec 1): New tests.
8952
8953 2003-09-30 Paul Eggert <eggert@twinsun.com>
8954
8955 * tests/testsuite.at: Include local.at, not input.at, fixing
8956 a typo in the 2003-08-25 patch.
8957
8958 2003-08-27 Akim Demaille <akim@epita.fr>
8959
8960 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8961 GCC warnings.
8962
8963 2003-08-26 Akim Demaille <akim@epita.fr>
8964
8965 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8966 "<\#" to avoid magic from Gnus when posting parts of this script.
8967
8968 2003-08-26 Akim Demaille <akim@epita.fr>
8969
8970 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8971 (Parser::parse): here.
8972 Adjust: nerrs and errstatus is now replaced by...
8973 (Parser::nerrs_, Parser::errstatus_): New.
8974
8975 2003-08-25 Akim Demaille <akim@epita.fr>
8976
8977 * config/announce-gen, Makefile.cfg: New.
8978 * Makefile.am: Adjust.
8979 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8980 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8981
8982 2003-08-25 Akim Demaille <akim@epita.fr>
8983
8984 When reducing initial empty rules, Bison parser read an initial
8985 location that is not defined. This results in garbage, and that
8986 affects Bison's own parser. Therefore we need (i) to extend Bison
8987 to support a means to initialize this location, and (ii) to use
8988 this CVS Bison to fix CVS Bison's parser.
8989
8990 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8991 with...
8992 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8993 * src/parse-gram.y: Adjust.
8994 (%initial-action): New.
8995 (%error-verbose): Since we require CVS Bison, there is no reason
8996 not to use it.
8997 * src/scan-gram.l: Adjust.
8998 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8999 * data/yacc.c (yyparse): Use b4_initial_action.
9000
9001 2003-08-25 Akim Demaille <akim@epita.fr>
9002
9003 * doc/bison.texinfo: Don't promote stdout for error messages.
9004
9005 2003-08-25 Akim Demaille <akim@epita.fr>
9006
9007 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
9008 From Alexandre Duret-Lutz.
9009
9010 2003-08-25 Akim Demaille <akim@epita.fr>
9011
9012 Version 1.875c.
9013
9014 2003-08-25 Akim Demaille <akim@epita.fr>
9015
9016 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
9017 Use them.
9018
9019 2003-08-25 Akim Demaille <akim@epita.fr>
9020
9021 * data/lalr1.cc (Parser::reduce_print_): New.
9022 Use it.
9023
9024 2003-08-25 Akim Demaille <akim@epita.fr>
9025
9026 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
9027 error recovery loops. This patch is based on
9028 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
9029 Also, augment the similarity between lalr1.cc and yacc.c.
9030 Note: the locations of error recovery rules are not correct yet.
9031
9032 * data/lalr1.cc: Comment changes to augment the similarity between
9033 lalr1.cc and yacc.c.
9034 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
9035 (yyerrlab1): Remove, but where it used to be (now the bottom part of
9036 yyerrlab), when hitting EOF, pop the whole stack here instead of
9037 merely falling thru the default error handling mechanism.
9038 (yyerrorlab): New label, with the old contents of YYERROR,
9039 plus the following change: pop the stack of rhs corresponding
9040 to the production that invoked YYERROR. That is how Yacc
9041 behaves (required by POSIX).
9042 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
9043 fail.
9044
9045 2003-08-25 Akim Demaille <akim@epita.fr>
9046
9047 Tune local.at so that people can "autom4te -l autotest calc.at -o
9048 calc" for instance, to extract a sub test suite.
9049
9050 * tests/testsuite.at: Move the initialization, Autotest version
9051 requirement, and AT_TESTED invocation into...
9052 * tests/local.at: here.
9053 * tests/testsuite.at: Include it for compatibility with Autoconf
9054 2.57.
9055 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
9056 be ignore.
9057
9058 2003-08-04 Paul Eggert <eggert@twinsun.com>
9059
9060 Rework code slightly to avoid gcc -Wtraditional warnings.
9061 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
9062 The returned value is now stored in *YY0. All callers changed.
9063 * src/output.c (merge_output): Adjust to the above change.
9064
9065 2003-07-26 Paul Eggert <eggert@twinsun.com>
9066
9067 * data/glr.c (YYASSERT): New macro.
9068 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
9069 yyresolveStates, yyprocessOneStack):
9070 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
9071 Derived from a suggestion by Frank Heckenbach.
9072
9073 2003-07-25 Paul Eggert <eggert@twinsun.com>
9074
9075 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
9076 for portability to K&R C (after ansi2knr, presumably). See
9077 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
9078 by Frank Heckenbach, though I have omitted the structure-initialization
9079 part of his glr-knr.diff patch since I recall that the Portable
9080 C Compiler didn't require that change.
9081
9082 Let the user specify how to allocate and free memory.
9083 Derived from a suggestion by Frank Heckenbach in
9084 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
9085 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
9086 All uses of free, malloc, realloc changed to use these macros,
9087 and unnecessary casts removed.
9088 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
9089
9090 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
9091
9092 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
9093 use s.empty() rather than s == "" to test for empty string; see
9094 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
9095 (trivial change)
9096
9097 2003-06-25 Akim Demaille <akim@epita.fr>
9098
9099 * config/depcomp, config/install-sh: Update from masters.
9100
9101 2003-06-20 Paul Eggert <eggert@twinsun.com>
9102
9103 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
9104 and return properly parenthesized result.
9105 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
9106 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9107 Remove unnecessary parentheses from uses.
9108 * doc/bison.texinfo (Location Default Action): Describe the
9109 conventions for parentheses.
9110
9111 2003-06-19 Paul Eggert <eggert@twinsun.com>
9112
9113 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
9114 yyreportTree): Do not assume that size_t is the same width as int,
9115 when printing sizes. Print sizes using an unsigned format.
9116 Problem reported by Frank Heckenbach in
9117 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
9118
9119 Port to Forte Developer 7 C compiler.
9120 * data/glr.c (struct YYLTYPE): If locations are not being used,
9121 declare a single dummy member, as empty structs do not conform
9122 to the C standard.
9123 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
9124 the Forte Developer 7 C compiler complains that end-of-loop
9125 code is not reached.
9126
9127 2003-06-17 Paul Eggert <eggert@twinsun.com>
9128
9129 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
9130 avoid warnings from picky compilers about redefinition of PARAMS.
9131
9132 2003-06-17 Paul Eggert <eggert@twinsun.com>
9133
9134 Version 1.875b.
9135
9136 * NEWS: Document 1.875b.
9137
9138 * lib/bbitset.h: Do not include config.h; that's the includer's job.
9139 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
9140 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
9141 Don't use 'index' in comments, as it's a builtin fn on some hosts.
9142 * lib/bitset_stats.c: Include gettext.h unconditionally, as
9143 per recent gettext manual's suggestion.
9144 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
9145 Use prototypes, not old-style definitions.
9146 * lib/lbitset.c (lbitset_unused_clear): Likewise.
9147 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
9148 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
9149 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
9150 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
9151 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
9152 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
9153 vbitset_or_and_cmp, vbitset_copy): Likewise.
9154
9155 * lib/libiberty.h: Do not include config.h; that's the includer's job.
9156 Do not include <stdlib.h>.
9157 (PARAMS): Define unconditionally for C89.
9158 (ATTRIBUTE_NORETURN): Remove.
9159 (ATTRIBUTE_UNUSED): Define unconditionally.
9160
9161 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
9162 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
9163 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
9164 * lib/vbitset.c, lib/vbitset.h: New files.
9165 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9166 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
9167 from libbitset.
9168
9169 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
9170 `How Can I Reset @code{yyparse}', since texinfo does not allow
9171 arbitrary @ in node names.
9172
9173 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
9174 shouldn't be needed according to the gettext 0.12.1 documentation
9175 but which seem to be needed anyway: codeset.m4 glibc21.m4
9176 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
9177 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
9178 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
9179
9180 * lib/.cvsignore: Add stdbool.h.
9181 * m4/.cvsignore: Add nls.m4, po.m4.
9182
9183 Upgrade to CVS gnulib.
9184 * stdbool_.h: File renamed from stdbool.h.in.
9185 * configure.ac (AM_STDBOOL_H): Invoke this instead of
9186 AC_HEADER_STDBOOL.
9187 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
9188 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
9189 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
9190 (MOSTLYCLEANFILES): New var.
9191 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
9192 (stdbool.h): New rule.
9193 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
9194 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
9195 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
9196 m4/quote.m4: Upgrade to today's gnulib.
9197
9198 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
9199 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
9200 the tests right now.
9201 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
9202 yyerror are declared before use; C99 requires this.
9203
9204 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9205
9206 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
9207 first.
9208 (yyrecoverSyntaxError): Correct the logic for setting and testing
9209 yyerrState.
9210 Correct comment on handling EOF.
9211 Allow states with only a default reduction, rather than failing
9212 (I can't quite reconstruct why these were not allowed before).
9213
9214 Fixes to avoid problem that $-N rules in GLR parsers can cause
9215 buffer overruns, corrupting state.
9216
9217 * src/output.c (prepare_rules): Output max_left_semantic_context
9218 definition.
9219 * src/reader.h (max_left_semantic_context): New variable declaration.
9220 * src/scan-gram.l (max_left_semantic_context): Define.
9221 (handle_action_dollar): Update max_left_semantic_context.
9222 * data/glr.c (YYMAXLEFT): New definition.
9223 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
9224 (yyresolveAction): Ditto.
9225
9226 Fixes to problems with location handling in GLR parsers reported by
9227 Frank Heckenbach (2003/06/05).
9228
9229 * data/glr.c (YYLTYPE): Make trivial if locations not used.
9230 (YYRHSLOC): Add parentheses, and define only if locations used.
9231 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
9232 locations not used.
9233 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
9234 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
9235
9236 * tests/cxx-type.at: Exercise location information; update tests
9237 to differentiate output with and without locations.
9238 Remove forward declarations of yylex and yyerror---caused errors
9239 because default YYLTYPE not yet defined.
9240 Change semantic actions to compute strings, rather than printing
9241 them directly (to test proper passing of semantics values). Change
9242 output to prefix notation and update test data and expected results.
9243 (yylex): Track locations.
9244 (stmtMerge): Return value rather than printing, and include arguments
9245 in value.
9246
9247 2003-06-03 Paul Eggert <eggert@twinsun.com>
9248
9249 Avoid warnings generated by GCC 2.95.4 when Bison is
9250 configured with --enable-gcc-warnings.
9251 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
9252 yy::]b4_parser_class_name[::translate_,
9253 yy::Stack::operator[] (unsigned),
9254 yy::Stack::operator[] (unsigned) const,
9255 yy::Slice::operator[] (unsigned),
9256 yy::Slice::operator[] (unsigned) const):
9257 Rename local vars to avoid warnings.
9258 * tests/glr-regression.at (Improper handling of embedded actions
9259 and $-N in GLR parsers): Remove unused local variable from yylex.
9260 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
9261 (void) as arg when not pure, since we now assume C89 when building
9262 Bison. Pacify GCC by using parameter.
9263
9264 2003-06-02 Paul Eggert <eggert@twinsun.com>
9265
9266 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
9267 yy::Location::lines, yy::Location::columns): Rename arguments
9268 to avoid shadowing; this removes a warning generated by GCC 3.3.
9269
9270 2003-06-01 Paul Eggert <eggert@twinsun.com>
9271
9272 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
9273 to g++, as GCC 3.3 complains if you do it.
9274 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
9275 everything that WARNING_CFLAGS has, except omit warnings
9276 not suitable for C++.
9277 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
9278 * tests/atlocal.in (CXXFLAGS): New var.
9279 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
9280
9281 Fix a GLR parser bug I reported in February; see
9282 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
9283 The problem was that GLR parsers did not conform to the C standard,
9284 because actions like { $1 = $2 + $3; } expanded to expressions
9285 that invoked YYFILL in separate subexpressions, and YYFILL assigned
9286 to a local variable. The C standard says that expressions
9287 like (var = f ()) + (var = f ()) have undefined behavior.
9288 Another problem was that GCC sometimes issues warnings that
9289 yyfill and its parameters are unused.
9290
9291 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
9292 as possibly unused.
9293 (yyfill): New function.
9294 (YYFILL): Use it.
9295 (yyuserAction): Change type of yynormal to bool, so that it matches
9296 the new yyfill signature. Mark it as possibly unused.
9297
9298
9299 Follow up on a bug I reported in February, where a Bison-generated
9300 parser can loop. Provide a test case and a fix for yacc.c. I
9301 don't have a fix for lalr1.cc or for glr.c, unfortunately.
9302 The original bug report is in:
9303 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
9304
9305 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
9306 macro's size was becoming unwieldy.
9307 (yyerrlab): Do not discard an empty lookahead symbol, as this
9308 might destroy garbage.
9309 (yyerrorlab): New label, with the old contents of YYERROR,
9310 plus the following change: pop the stack of rhs corresponding
9311 to the production that invoked YYERROR. That is how Yacc
9312 behaves, and POSIX requires this behavior.
9313 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
9314 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
9315 Define 'alarm' to do nothing if unistd.h is not available.
9316 Add a new rule "exp: '-' error;" to test the above change to
9317 data/yacc.c. Use 'alarm' to abort any test taking longer than
9318 10 seconds, as it's probably looping.
9319 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
9320 Also, the new yacc.c generates two fewer diagnostics for an
9321 existing test.
9322
9323 2003-05-24 Paul Eggert <eggert@twinsun.com>
9324
9325 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
9326 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
9327 This fixes a problem reported by John Bowman when the Compaq/HP
9328 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
9329 -ansi -Wall -gall).
9330 * data/yacc.c (union yyalloc): Likewise.
9331 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
9332
9333 Switch from 'int' to 'bool' where that makes sense.
9334
9335 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
9336 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
9337 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
9338 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
9339 Return or accept bool, not int. All callers changed.
9340 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
9341 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
9342 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
9343 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
9344 bitset_or_and_cmp_): Likewise.
9345 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
9346 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
9347 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
9348 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
9349 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
9350 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
9351 bitset_stats_or_and_cmp): Likewise.
9352 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
9353 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
9354 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
9355 ebitset_xor_cmp): Likewise.
9356 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
9357 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
9358 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
9359 lbitset_xor_cmp): Likewise.
9360 * lib/bbitset.h: Include <stdbool.h>.
9361 (struct bitset_vtable): The following members now return bool, not
9362 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
9363 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
9364 or_and_cmp).
9365 * src/conflicts.c (count_rr_conflicts): Likewise.
9366 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
9367 All uses changed.
9368 * lib/ebitset.c (ebitset_obstack_init): Likewise.
9369 * lib/lbitset.c (lbitset_obstack_init): Likewise.
9370 * src/getargs.c (debug_flag, defines_flag, locations_flag,
9371 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9372 graph_flag): Likewise.
9373 * src/getargs.h (debug_flag, defines_flag, locations_flag,
9374 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9375 graph_flag): Likewise.
9376 * src/output.c (error_verbose): Likewise.
9377 * src/output.h (error_verbose): Likewise.
9378 * src/reader.c (start_flag, typed): Likewise.
9379 * src/reader.h (typed): Likewise.
9380 * src/getargs.c (LOCATIONS_OPTION): New constant.
9381 (long_options, getargs): Use it.
9382 * src/lalr.c (build_relations): Use bool, not int.
9383 * src/nullable.c (nullable_compute): Likewise.
9384 * src/print.c (print_reductions): Likewise.
9385 * src/tables.c (action_row, pack_vector): Likewise.
9386 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
9387 * src/output.c (prepare): Use it.
9388 * src/output.c (token_definitions_output,
9389 symbol_destructors_output, symbol_destructors_output): Use string,
9390 not boolean integer, to keep track of whether to output separator.
9391 * src/print_graph.c (print_core): Likewise.
9392 * src/state.c (state_rule_lookaheads_print): Likewise.
9393
9394 * config/install-sh: Sync from automake 1.7.5.
9395
9396 2003-05-14 Paul Eggert <eggert@twinsun.com>
9397
9398 * src/parse-gram.y (rules_or_grammar_declaration): Require a
9399 semicolon after a grammar declaration, in the interest of possible
9400 future changes to the Bison input language.
9401 Do not allow a stray semicolon at the start of the grammar.
9402 (rhses.1): Allow one or more semicolons after any rule, including
9403 just before "|" as required by POSIX.
9404 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
9405 grammar.
9406
9407 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
9408
9409 %parse-param support for lalr1.cc.
9410
9411 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
9412 b4_cc_constructor_calls, b4_cc_constructor_call,
9413 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
9414 definitions.
9415 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
9416 parse-param arguments.
9417 (yy::b4_parser_class_name): Declare instance variables to
9418 hold parse-param arguments.
9419 * tests/calc.at: s/value/semantic_value/ because value clashes
9420 with a member of yy::b4_parser_class_name. Adjust C++ code
9421 to handle %parse-param. Enable %parse-param test in C++.
9422
9423 2003-05-12 Paul Eggert <eggert@twinsun.com>
9424
9425 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
9426 English a bit. Fix fclose typo. Change "const char" to "char
9427 const", and use ANSI C rather than K&R for "main". Suggest
9428 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
9429 and suggest yy_switch_to_buffer.
9430
9431 2003-05-05 Paul Eggert <eggert@twinsun.com>
9432
9433 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
9434 C89. This avoids a diagnostic on compilers that define __STDC__
9435 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
9436 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
9437
9438 2003-05-03 Paul Eggert <eggert@twinsun.com>
9439
9440 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
9441 Do not overrun array bounds.
9442 This should fix a bug reported today by Olatunji Oluwabukunmi in
9443 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
9444
9445 2003-04-29 Akim Demaille <akim@epita.fr>
9446
9447 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
9448 * src/getargs.c, src/getargs.h: here, as bool, not int.
9449 (nondeterministic_parser): New.
9450 * src/parse-gram.y, src/scan-gram.l: Support
9451 %nondeterministic-parser.
9452 * src/output.c (prepare): Use nondeterministic_parser instead
9453 of glr_parser where appropriate.
9454 * src/tables.c (conflict_row, action_row, save_row)
9455 (token_actions, token_actions, pack_vector): Ditto.
9456
9457 2003-04-29 Akim Demaille <akim@epita.fr>
9458
9459 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
9460
9461 2003-04-29 Akim Demaille <akim@epita.fr>
9462
9463 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
9464 with %pure-parser and %locations to exercise the patch from Yakov
9465 Markovitch below.
9466
9467 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
9468
9469 * data/yacc.c: (b4_lex_param): Corrected for the case where
9470 %lex-param is provided and %pure-parser isn't.
9471
9472 2003-04-27 Paul Eggert <eggert@twinsun.com>
9473
9474 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
9475 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
9476 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
9477 if it is not defined.
9478 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
9479
9480 2003-04-26 Paul Eggert <eggert@twinsun.com>
9481
9482 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
9483 Declare to be of type suitable for the ninf value itself, not of
9484 type suitable for the corresponding table, since the latter might
9485 be unsigned but the ninf value might be negative. This fixes a
9486 bug reported by Alexandre Duret-Lutz in
9487 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
9488
9489 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
9490 invokes it. We shouldn't invoke it twice because it will attempt
9491 to put error.o in the archive twice. This fixes a glitch reported
9492 by Martin Mokrejs in
9493 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
9494
9495 2003-04-21 Paul Eggert <eggert@twinsun.com>
9496
9497 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
9498 to gnulib.
9499
9500 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
9501
9502 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
9503 Fix obvious typo that results in uncompilable GLR parsers
9504 when both %pure-parser and %locations are used. (trivial change)
9505
9506 2003-04-17 Paul Eggert <eggert@twinsun.com>
9507
9508 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
9509 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
9510 Do not insert the expected token via unput, as this runs afoul
9511 of a POSIX-compatibility bug in flex 2.5.31.
9512 All uses changed to BEGIN the parent state,
9513 since we no longer insert the expected token via unput.
9514 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
9515 that is no longer emitted after the above change.
9516
9517 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
9518 the first one. This change is from Paul Hilfinger, and it fixes
9519 regression reported by Werner Lemberg in
9520 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
9521
9522 (resolve_sr_conflict): Don't invoke state_errs_set
9523 unless one or more tokens have been explicitly made errors.
9524 Otherwise, the above change causes Bison to abort.
9525
9526 * tests/existing.at (GNU pic Grammar): New test case, taken from
9527 Lemberg's email.
9528
9529 2003-03-31 Akim Demaille <akim@epita.fr>
9530
9531 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
9532
9533 2003-03-31 Akim Demaille <akim@epita.fr>
9534
9535 * src/output.c (prepare_symbols): Avoid trailing spaces in the
9536 output.
9537
9538 2003-03-31 Akim Demaille <akim@epita.fr>
9539
9540 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
9541 From Paul Hilfinger.
9542
9543 2003-03-29 Akim Demaille <akim@epita.fr>
9544
9545 * m4/error.m4: Do not put under dynamic conditions some code which
9546 expansion is under static control.
9547
9548 2003-03-29 Akim Demaille <akim@epita.fr>
9549
9550 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
9551
9552 2003-03-29 Akim Demaille <akim@epita.fr>
9553
9554 * doc/bison.texinfo (Strings are Destroyed): New.
9555
9556 2003-03-13 Paul Eggert <eggert@twinsun.com>
9557
9558 * .cvsignore: Add configure.lineno.
9559 * src/.cvsignore: Add yacc.
9560 * tests/.cvsignore: Add testsuite.log.
9561 * doc/fdl.texi: Sync with latest FSF version.
9562
9563 2003-03-12 Paul Eggert <eggert@twinsun.com>
9564
9565 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
9566 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
9567 cursor, instead of leaving it undefined. This fixes a bug
9568 reported by Tim Van Holder in
9569 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
9570 * tests/input.at (Torturing the Scanner): Test the scanner on
9571 an empty input file, which was Tim Van Holder's test case.
9572
9573 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
9574 <sys/resource.h> can be included, include sys/time.h and
9575 sys/times.h first, if available. This works around the SunOS
9576 4.1.4 porting bug reported by Bruce Becker in
9577 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
9578
9579 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
9580 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
9581 AC_HEADER_SYS_WAIT.
9582
9583 Merge changes from gnulib. This was prompted because the CVS
9584 snapshot didn't build on Solaris 7 due to strnlen problems.
9585
9586 These changes need to be merged back into gnulib:
9587 * lib/hash.c: Include <stdbool.h> unconditionally.
9588 * m4/onceonly.m4 (m4_quote): New macro.
9589 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
9590 Quote AC_FOREACH variable-expansions properly.
9591 The 2003-01-03 obstack.h change also needs merging.
9592 {end of changes requiring merging}
9593
9594 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9595 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
9596 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
9597 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
9598 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
9599 New files, imported from gnulib.
9600 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
9601 above.
9602
9603 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
9604 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
9605 gnulib sources.
9606
9607 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
9608 Add.
9609 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
9610 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
9611 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
9612 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
9613 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
9614 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
9615 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
9616 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
9617 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
9618 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
9619 (jm_PREREQ_ARGMATCH): Remove.
9620 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
9621 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
9622
9623 * src/system.h: Include <stdbool.h> unconditionally.
9624
9625 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
9626 assuming at least C89 in the bitset code for some time now.
9627
9628 2003-03-03 Akim Demaille <akim@epita.fr>
9629
9630 * ro.po: New.
9631
9632 2003-03-02 Akim Demaille <akim@epita.fr>
9633
9634 * doc/bison.texinfo (Table of Symbols): Reactivate the
9635 documentation for %lex-param, and %parse-param.
9636
9637 2003-03-02 Akim Demaille <akim@epita.fr>
9638
9639 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
9640 generate verbose error messages.
9641 Use the number of tokens as an upper bound in yytname, as it
9642 cannot be a non terminal.
9643
9644 2003-03-02 Akim Demaille <akim@epita.fr>
9645
9646 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
9647 message.
9648
9649 2003-03-02 Akim Demaille <akim@epita.fr>
9650
9651 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
9652 Use them to exercise yycheck overrun.
9653 Based on Andrew Suffield's grammar.
9654
9655 2003-03-02 Akim Demaille <akim@epita.fr>
9656
9657 Create tests/local.at for Bison generic testing macros.
9658
9659 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
9660 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
9661 This new file.
9662 * tests/calc.at (AT_CHECK_CALC): Adjust.
9663 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
9664 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
9665 * tests/local.at: here.
9666 (AT_COMPILE_CXX): Tags the tests using it as c++.
9667 Ignore the test if CXX is not functional.
9668
9669 2003-03-01 Paul Eggert <eggert@twinsun.com>
9670
9671 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
9672 not loc->end, since loc->end might contain garbage and this leads
9673 to undefined behavior on some platforms.
9674 (id_loc, token_start): Use (IF_LINTed) initial values that do not
9675 depend on *loc, so that the reader doesn't give the the false
9676 impression that *loc is initialized.
9677 (<INITIAL>"%%"): Do not bother setting code_start, since its value
9678 does not survive the return.
9679
9680 2003-03-01 Akim Demaille <akim@epita.fr>
9681
9682 * src/scan-gram.l (code_start): Always initialize it when entering
9683 into yylex, as SC_EPILOGUE is activated *before* the corresponding
9684 yylex invocation. An alternative would be making it static, but
9685 then it starts with the second %%'s beginning, instead of its end.
9686
9687 2003-02-28 Paul Eggert <eggert@twinsun.com>
9688
9689 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
9690 around a UnixWare 7.1.1 porting bug reported by John Hughes in
9691 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
9692
9693 2003-02-26 Paul Eggert <eggert@twinsun.com>
9694
9695 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
9696 Remove Sequent/Pyramid discussion (nobody uses them any more).
9697 Merge VMS and MS-DOS discussion; these ports may well be dead
9698 but let's keep mentioning them for now. Put <> around email
9699 addresses. Add copyright notice.
9700
9701 2003-02-24 Paul Eggert <eggert@twinsun.com>
9702
9703 * data/glr.c (yy_reduce_print): yylineno -> yylno,
9704 to avoid collision with flex use of yylineno.
9705 Problem reported by Bruce Lilly in
9706 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
9707 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9708 * data/yacc.c (yy_reduce_print): Likewise.
9709
9710 * config/depcomp: Sync with Automake 1.7.3.
9711
9712 2003-02-21 Akim Demaille <akim@epita.fr>
9713
9714 * data/lalr1.cc: Use temporary variables instead of casts to
9715 change integer types.
9716 Suggested by Paul Eggert.
9717
9718 2003-02-21 Akim Demaille <akim@epita.fr>
9719
9720 * doc/bison.texinfo: Use "location" consistently to refer to @n,
9721 to avoid confusions with lalr1.cc's notion of Position.
9722 Suggested by Paul Eggert.
9723
9724 2003-02-20 Akim Demaille <akim@epita.fr>
9725
9726 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
9727 before initial_columns.
9728 (location.hh): Use consistent variable names when defining the
9729 operator<<.
9730 Use "last" so that we subtract from Positions, not from unsigned.
9731
9732 2003-02-20 Akim Demaille <akim@epita.fr>
9733
9734 * data/lalr1.cc (position.hh): New subfile, including the extended
9735 and Doxygen'ed documentation of class Position.
9736 (location.hh): Use it.
9737 Document a` la Doxygen.
9738 With the help of Benoit Perrot.
9739
9740 2003-02-20 Akim Demaille <akim@epita.fr>
9741
9742 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
9743 AT_YACC_IF.
9744 Redefine AT_YYERROR_SEES_LOC_IF using it.
9745 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
9746 not defined.
9747 Don't use the location in yy::Parser::error_ and
9748 yy::Parser::print_ when not %locations.
9749 Activate more lalr1.cc tests.
9750
9751 2003-02-19 Akim Demaille <akim@epita.fr>
9752
9753 * data/lalr1.cc: When displaying a line number, be sure to make it
9754 an int.
9755
9756 2003-02-19 Akim Demaille <akim@epita.fr>
9757
9758 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
9759 Remove, useless.
9760 (YYABORT, YYACCEPT, YYERROR): New.
9761 * tests/calc.at: Renable the lalr1.cc test.
9762
9763 2003-02-19 Akim Demaille <akim@epita.fr>
9764
9765 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
9766 error recovery, mixing with/without pops and discarding of the
9767 lookahead.
9768 Exercise YYERROR.
9769 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
9770
9771 2003-02-17 Paul Eggert <eggert@twinsun.com>
9772
9773 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
9774 * tests/testsuite.at (AT_COMPILE): Use them.
9775 This fixes the testsuite problem reported by Robert Lentz in
9776 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
9777
9778 2003-02-12 Paul Eggert <eggert@twinsun.com>
9779
9780 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
9781 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
9782 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
9783 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
9784 Check for malloc failure, for consistency with yacc.c.
9785 (yytname_size): Remove, for consistency with yacc.c.
9786
9787 The bug still remains in data/lalr1.cc, as I didn't have time
9788 to fix it there.
9789
9790 2003-02-06 Akim Demaille <akim@epita.fr>
9791
9792 * configure.ac (GXX): Rename as...
9793 (CXX): this, to keep the original Autoconf semantics.
9794 Require 2.57.
9795 * data/lalr1.cc: Fix b4_copyright invocations.
9796 If YYDEBUG is not defined, don't depend upon name_ being defined.
9797 (location.hh): Include string and iostream.
9798 (Position::filename): New member.
9799 (Position::Position ()): New.
9800 (operator<< (Position)): New.
9801 (operator- (Position, int)): New.
9802 (Location::first, Location::last): Rename as...
9803 (Location::begin, Location::end): these, to mock the conventional
9804 iterator names.
9805 (operator<< (Location)): New.
9806 * tests/atlocal.in (CXX): New.
9807 * tests/testsuite.at (AT_COMPILE_CXX): New.
9808 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
9809 locations in a more synthetic way.
9810 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
9811 lalr1.cc is used.
9812 Adjust the C locations to match those from Emacs: first column is
9813 column 0.
9814 Change all the expected results.
9815 Conform to the GCS: simplify the locations when applicable.
9816 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
9817 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
9818 these CPP macros with the m4 macros new defined by...
9819 (AT_CHECK_PUSHDEFS): this, i.e.:
9820 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
9821 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
9822 New macros.
9823 (AT_CHECK_POPDEFS): Undefine them.
9824 (AT_CHECK_CALC_LALR1_CC): New.
9825 Use it for the first lalr1.cc test.
9826
9827 2003-02-04 Akim Demaille <akim@epita.fr>
9828
9829 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9830 Location as is defined.
9831
9832 2003-02-04 Akim Demaille <akim@epita.fr>
9833
9834 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9835 name_ being defined.
9836
9837 2003-02-03 Paul Eggert <eggert@twinsun.com>
9838
9839 * src/gram.h (start_symbol): Remove unused decl.
9840
9841 Use more-consistent naming conventions for local vars.
9842
9843 * src/derives.c (derives_compute): Change type of local var from
9844 int to rule_number.
9845 * src/gram.c (grammar_rules_partial_print): Likewise.
9846 * src/print.c (print_core): Likewise.
9847 * src/reduce.c (reduce_grammar_tables): Likewise.
9848
9849 * src/gram.c (grammar_dump): Change name of item_number *
9850 local var from r to rp.
9851 * src/nullable.c (nullable_compute): Likewise.
9852
9853 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9854
9855 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9856 for symbol or symbol_number var.
9857 * src/reader.c (grammar_start_symbol_set): Likewise.
9858 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9859 Likewise.
9860 * src/state.c (transitions_to): Likewise.
9861 * src/state.h: Likewise.
9862 * src/tables.c (symbol_number_to_vector_number): Likewise.
9863
9864 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9865 char * var.
9866
9867 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9868 var.
9869
9870 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9871 var.
9872
9873 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9874 Use str, not s, for char * var. Use ch, not c, for character var.
9875 Use size for size var.
9876
9877 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9878 char * var.
9879 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9880 uniqstr var.
9881 * src/uniqstr.h: Likewise.
9882
9883 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9884 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9885 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9886 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9887 param to have same name as that of enum, so that we don't use
9888 "s" to stand for a non-state.
9889
9890 2003-02-02 Akim Demaille <akim@epita.fr>
9891
9892 * src/scan-skel.l: Scan more than one inert character per yylex
9893 invocation.
9894
9895 2003-02-01 Paul Eggert <eggert@twinsun.com>
9896
9897 Version 1.875a.
9898
9899 * po/LINGUAS: Add ms.
9900
9901 2003-01-30 Akim Demaille <akim@epita.fr>
9902
9903 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9904
9905 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9906
9907 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9908 of $1.
9909
9910 Changes in response to error report by S. Eken: GLR mode does not
9911 handle negative $ indices or $ indices in embedded rules correctly.
9912 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
9913
9914 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9915 (b4_rhs_location): Ditto.
9916 (yyfill): New function to copy from stack tree into array
9917 incrementally.
9918 (yyuserAction): Modify to allow incremental move of semantic values
9919 to rhs array when in GLR mode.
9920 Define YYFILL to use in user-defined actions to fill semantic array
9921 as needed.
9922 Remove dummy use of yystack, as there is now a guaranteed use.
9923 (yydoAction): Modify to allow incremental move of semantic values
9924 to rhs array when in GLR mode.
9925 (yyresolveAction): Ditto.
9926 (yyglrShiftDefer): Update comment.
9927 (yyresolveStates): Use X == NULL for pointers, not !X.
9928 (yyglrReduce): Ditto.
9929 (yydoAction): Ditto
9930
9931 * tests/glr-regr1.at: Rename to ...
9932 * tests/glr-regression.at: Add new regression test for the problems
9933 described above (adapted from S. Eken).
9934 Update copyright notice.
9935 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9936 * tests/Makefile.am: Ditto.
9937
9938 2003-01-28 Paul Eggert <eggert@twinsun.com>
9939
9940 * data/lalr1.cc: Do not use @output_header_name@ unless
9941 b4_defines_flag is set. This fixes two bugs reported by
9942 Tim Van Holder in
9943 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9944 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
9945
9946 2003-01-21 Paul Eggert <eggert@twinsun.com>
9947
9948 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9949 we don't need to worry about yyerrlab1 being reported as an
9950 "unused label" by non-GCC C compilers. The downside is that if
9951 locations are used then a couple of statements are duplicated each
9952 time YYERROR is invoked, but the upside is that the warnings
9953 should vanish.
9954 (yyerrlab1): Move code to YERROR.
9955 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9956 This reverts some of the 2002-12-27 change.
9957
9958 2003-01-17 Paul Eggert <eggert@twinsun.com>
9959
9960 * src/output.c (symbol_printers_output): Fix typo that led
9961 to core dump. Problem reported by Antonio Rus in
9962 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
9963
9964 2003-01-13 Akim Demaille <akim@epita.fr>,
9965 Quoc Peyrot <chojin@lrde.epita.fr>,
9966 Robert Anisko <anisko_r@lrde.epita.fr>
9967
9968 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9969 when the stacks contain one element, as the loop would otherwise
9970 free the last state, and then use the top state (the one we just
9971 popped). This means that the initial elements will not be freed
9972 explicitly, as is the case in yacc.c; it is not a problem, as
9973 these elements have fake values.
9974
9975 2003-01-11 Paul Eggert <eggert@twinsun.com>
9976
9977 * NEWS: %expect-violations are now just warnings, reverting
9978 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9979 bootstrapping problem reported by Matthias Klose; see
9980 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
9981 * src/conflicts.c (conflicts_print): Likewise.
9982 * tests/conflicts.at (%expect not enough, %expect too much,
9983 %expect with reduce conflicts): Likewise.
9984 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9985 that the warning is enabled if the number of conflicts changes
9986 (not necessarily increases).
9987
9988 * src/getargs.c (version): Update copyright year.
9989
9990 2003-01-09 Akim Demaille <akim@epita.fr>
9991
9992 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9993
9994 2003-01-08 Paul Eggert <eggert@twinsun.com>
9995
9996 * Makefile.maint (WGETFLAGS):
9997 New macro, containing "-C off" to disable proxy caches.
9998 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9999 (rel-check): Use $(WGET) instead of wget.
10000
10001 2003-01-06 Paul Eggert <eggert@twinsun.com>
10002
10003 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
10004 the GLR paper of Scott, Johnstone and Hussain.
10005
10006 2003-01-04 Paul Eggert <eggert@twinsun.com>
10007
10008 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
10009 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
10010 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
10011 (EXTRA_LIBRARIES): New var, for liby.a.
10012 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
10013 (EXTRA_SCRIPTS): New var, for yacc.
10014
10015 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
10016 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
10017 Problem reported by Nelson H. F. Beebe.
10018
10019 2003-01-03 Paul Eggert <eggert@twinsun.com>
10020
10021 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
10022 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
10023 when compiling Bison 1.875's `bitset bset = obstack_alloc
10024 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
10025
10026 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
10027 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
10028 grow to a huge size with typical invocation.
10029
10030 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
10031 Use the pattern recommended by Autoconf 2.57, except also protect
10032 against double-definition.
10033 * src/system.h: Likewise.
10034 Portability issues reported by Nelson H. F. Beebe.
10035
10036 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
10037 All uses changed. Provide a definition in both C and C++.
10038 (yytrue, yyfalse): Define even if defined (__cplusplus).
10039
10040 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
10041 Reported by Nelson H. F. Beebe.
10042
10043 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
10044
10045 2003-01-02 Paul Eggert <eggert@twinsun.com>
10046
10047 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
10048 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
10049 Bug reported by Nelson H. F. Beebe.
10050
10051 2003-01-01 Paul Eggert <eggert@twinsun.com>
10052
10053 * Version 1.875.
10054
10055 2002-12-30 Paul Eggert <eggert@twinsun.com>
10056
10057 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
10058 Moved here from...
10059 (<INITIAL>","): Here. This causes stray "," to be treated
10060 more uniformly.
10061
10062 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
10063 last brace in braced code when not in Yacc mode, for compatibility
10064 with Bison 1.35. This resurrects the 2001-12-15 patch to
10065 src/reader.c.
10066
10067 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
10068 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
10069
10070 2002-12-28 Paul Eggert <eggert@twinsun.com>
10071
10072 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
10073 that of SYM's type. This fixes Debian bug 168069, reported by
10074 Thomas Olsson.
10075
10076 2002-12-28 Paul Eggert <eggert@twinsun.com>
10077
10078 Version 1.75f.
10079
10080 Switch back to the Yacc style of conflict reports, undoing some
10081 of the 2002-07-30 change.
10082 * doc/bison.texinfo (Understanding): Use Yacc style for
10083 conflict reports. Also, use new way of locating rules.
10084 * src/conflicts.c (conflict_report):
10085 Renamed from conflict_report_yacc, removing the old
10086 'conflict_report'. Translate the entire conflict report at once,
10087 so that we don't assume that "," has the same interpretation in
10088 all languages.
10089 (conflicts_output): Use Yacc-style conflict report for each state,
10090 instead of our more-complicated style.
10091 (conflicts_print): Use Yacc-style conflict report, except print
10092 the input file name when not emulating Yacc.
10093 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
10094 Conflicted Reduction, %expect not enough, %expect too much,
10095 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
10096 * tests/existing.at (GNU Cim Grammar): Likewise.
10097 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
10098
10099 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
10100 fatal): Don't invoke fflush; it's not needed and it might even be
10101 harmful for stdout, as stdout might not be open.
10102 * src/reduce.c (reduce_print): Likewise.
10103
10104 2002-12-27 Paul Eggert <eggert@twinsun.com>
10105
10106 Fix a bug where error locations were not being recorded correctly.
10107 This problem was originally reported by Paul Hilfinger in
10108 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
10109
10110 * data/yacc.c (yyparse): New local var yylerrsp, to record the
10111 top of the location stack's error locations.
10112 (yyerrlab): Set it. When discarding a token, push its location
10113 onto yylerrsp so that we don't lose track of the error's end.
10114 (yyerrlab1): Now is only the target of YYERROR, so that we can
10115 properly record the location of the action that failed. For GCC
10116 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
10117 GCC warning about yyerrlab1 being unused if YYERROR is unused.
10118 (yyerrlab2): New label, which yyerrlab now falls through to.
10119 Compute the error's location by applying YYLLOC_DEFAULT to
10120 the locations of all the symbols that went into the error.
10121 * doc/bison.texinfo (Location Default Action): Mention that
10122 YYLLOC_DEFAULT is also invoked for syntax errors.
10123 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10124 Error locations include the locations of all the tokens that were
10125 discarded, not just the last token.
10126
10127 2002-12-26 Paul Eggert <eggert@twinsun.com>
10128
10129 * src/files.c: Include quote.h.
10130 (compute_output_file_names): Warn if we detect conflicting
10131 outputs to the same file. This should catch the misunderstanding
10132 exemplified by Debian Bug 165349, reported by Bruce Stephens..
10133
10134 * src/conflicts.c (conflicts_print): If the user specifies
10135 "%expect N", report an error if there are any reduce/reduce
10136 conflicts. This is what the manual says should happen.
10137 This fixes Debian bug 130890, reported by Anthony DeRobertis.
10138 * tests/conflicts.at (%expect with reduce conflicts): New test.
10139
10140 Don't use m4_include on relative file names, as it doesn't work as
10141 desired if there happens to be a file with that name under ".".
10142
10143 * m4sugar/version.m4: Remove; it was included but it wasn't used.
10144 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
10145 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
10146 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
10147 * src/output.c (output_skeleton): Use full path names when
10148 specifying a file to include; don't rely on include path, as
10149 it's unreliable when the working file contains a file with
10150 that name.
10151
10152 2002-12-25 Paul Eggert <eggert@twinsun.com>
10153
10154 Remove obsolete references to bison.simple and bison.hairy.
10155 Problem mentioned by Aubin Mahe in
10156 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
10157 * data/glr.c: Comment fix.
10158 * doc/bison.1: Remove references. Also, mention "yacc".
10159
10160 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
10161 with -g option.
10162
10163 * src/parse-gram.y (declaration): Use enum "report_states" rather
10164 than its numeric value 1.
10165
10166 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
10167 opening a new one. This fixes Debian bug 165349, reported by
10168 Bruce Stephens.
10169
10170 2002-12-24 Paul Eggert <eggert@twinsun.com>
10171
10172 Version 1.75e.
10173
10174 * Makefile.maint (cvs-update): Don't assume that the shell
10175 supports $(...), as Solaris sh doesn't.
10176
10177 * src/parse-gram.y (lloc_default): Remove test for empty
10178 nonterminals at the end, since it didn't change the result.
10179
10180 2002-12-24 Paul Eggert <eggert@twinsun.com>
10181
10182 If the user does not define YYSTYPE as a macro, Bison now declares it
10183 using typedef instead of defining it as a macro. POSIX requires this.
10184 For consistency, YYLTYPE is also declared instead of defined.
10185
10186 %union directives can now have a tag before the `{', e.g., the
10187 directive `%union foo {...}' now generates the C code
10188 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
10189 The default union tag is `YYSTYPE', for compatibility with Solaris 9
10190 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
10191 instead of `yyltype'.
10192
10193 `yystype' and `yyltype' are now obsolescent macros instead of being
10194 typedefs or tags; they are no longer documented and will be
10195 withdrawn in a future release.
10196
10197 * data/glr.c (b4_location_type): Remove.
10198 (YYSTYPE): Renamed from yystype.
10199 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
10200 (struct YYLTYPE): Renamed from struct yyltype.
10201 (YYLTYPE): Renamed from yyltype.
10202 (yyltype, yystype): New (and obsolescent) macros,
10203 for backward compatibility.
10204 * data/yacc.c: Likewise.
10205
10206 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
10207 does not specify a union tag. This is for compatibility with
10208 Solaris 9 yacc.
10209
10210 * src/parse-gram.y (add_param): 2nd arg is now char * not char
10211 const *, since it is now modified by stripping surrounding { }.
10212 (current_braced_code): Remove.
10213 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
10214 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
10215 trailing " {...}". Now of type <chars>.
10216 (grammar_declaration): Adjust to bundled tokens.
10217 (code_content): Remove; stripping is now done by add_param.
10218 (print_token_value): Print contents of bundled tokens.
10219 (token_name): New function.
10220
10221 * src/reader.h (braced_code, current_braced_code): Remove.
10222 (token_name): New decl.
10223
10224 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
10225 token_type, not braced_code code_kind. All uses changed.
10226 (SC_PRE_CODE): New state, for scanning after a keyword that
10227 has (or usually has) an immediately-following braced code.
10228 (token_type): New local var, to keep track of which token type
10229 to return when scanning braced code.
10230 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
10231 <INITIAL>"%parse-param", <INITIAL>"%printer",
10232 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
10233 instead of returning a token type immediately.
10234 (<INITIAL>"{"): Set token type.
10235 (<SC_BRACED_CODE>"}"): Use it.
10236 (handle_action_dollar, handle_action_at): Now returns bool
10237 indicating success. Fail if ! current_rule; this prevents a core dump.
10238 (handle_symbol_code_dollar, handle_symbol_code_at):
10239 Remove; merge body into caller.
10240 (handle_dollar, handle_at): Complain in invalid contexts.
10241
10242 * NEWS, doc/bison.texinfo: Document the above.
10243 * NEWS: Fix years and program names in copyright notice.
10244
10245 2002-12-17 Paul Eggert <eggert@twinsun.com>
10246
10247 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
10248 Reporting, Table of Symbols): Omit mentions of %lex-param and
10249 %parse-param from the documentation for now.
10250
10251 2002-12-15 Paul Eggert <eggert@twinsun.com>
10252
10253 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
10254 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
10255 lookahead symbol, and which sets yychar in parser actions) and it
10256 disagreed with the Bison documentation. Bug
10257 reported by Andrew Walrond.
10258
10259 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
10260 as the caller now does that.
10261 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
10262 (YYEMPTY): Parenthesize right hand side, since others use it.
10263 (yyparse): Don't assume that our generated code is the only code
10264 that sets yychar.
10265
10266 2002-12-13 Paul Eggert <eggert@twinsun.com>
10267
10268 Version 1.75d.
10269
10270 POSIX requires a "yacc" command.
10271 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
10272 (MOSTLYCLEANFILES): Add yacc.
10273 (yacc): New rule.
10274 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
10275 as an alias for bison y.
10276
10277 * po/LINGUAS: Add da.
10278
10279 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
10280 problem with latest <getopt.h>.
10281 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
10282
10283 * doc/fdl.texi: Upgrade to 1.2.
10284 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
10285 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
10286 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
10287 gnulib.
10288 * config/install-sh: Sync with autotools.
10289
10290 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
10291 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
10292 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
10293 locations are requested.
10294 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
10295 locations are requested.
10296
10297 2002-12-12 Paul Eggert <eggert@twinsun.com>
10298
10299 Remove unportable casts and storage allocation tricks.
10300 While we're at it, remove almost all casts, since they
10301 usually aren't needed and are a sign of trouble.
10302
10303 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
10304
10305 * src/derives.c (derives_compute): Do not subtract NTOKENS from
10306 the pointer DSET returned by malloc; this isn't portable.
10307 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
10308 Similarly for DERIVES.
10309 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
10310 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
10311 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
10312
10313 * src/derives.c (derives_compute): Do not bother invoking
10314 int_of_rule_number, since rule numbers are integers.
10315
10316 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
10317 rather than XMALLOC (char, N).
10318
10319 * src/files.c (filename_split): Rewrite to avoid cast.
10320
10321 * src/gram.h (symbol_number_as_item_number,
10322 item_number_as_symbol_number, rule_number_as_item_number,
10323 item_number_as_rule_number):
10324 Now inline functions rather than macros, to avoid casts.
10325 * src/state.h (state_number_as_int): Likewise.
10326 * src/tables.c (state_number_to_vector_number,
10327 symbol_number_to_vector_number): Likewise.
10328
10329 * src/gram.h (int_of_rule_number): Remove; no longer used.
10330
10331 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
10332 since the resulting storage is always stored into.
10333
10334 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
10335 where it's needed.
10336
10337 * src/muscle_tab.c (muscle_m4_output):
10338 Now inline. Return bool, not int.
10339 * src/state.c (state_compare): Likewise.
10340 * src/symtab.c (symbol_check_defined,
10341 symbol_check_alias_consistency, symbol_pack, symbol_translation,
10342 hash_compare_symbol, hash_symbol):
10343 Likewise.
10344 * src/uniqstr.c (uniqstr_print): Likewise.
10345 * src/muscle_tab.c (muscle_m4_output_processor):
10346 New function, to avoid casts.
10347 * src/state.c (state_comparator, stage_hasher): Likewise.
10348 * src/symtab.c (symbol_check_defined_processor,
10349 symbol_check_alias_consistency_processor, symbol_pack_processor,
10350 symbol_translation_processor, hash_symbol_comparator,
10351 hash_symbol_hasher): Likewise.
10352 * src/uniqstr.c (uniqstr_print_processor): Likewise.
10353 * src/muscle_tab.c (muscles_m4_output):
10354 Use new functions instead of casting old functions unportably.
10355 * src/state.c (state_hash_new): Likewise.
10356 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
10357 symbols_token_translations_init):
10358 Likewise.
10359 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
10360
10361 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
10362 var instead of casting to long, to avoid casts.
10363 (prepare_states): Use MALLOC rather than alloca, so that we don't
10364 have to worry about alloca.
10365 * src/state.c (state_hash_lookup): Likewise.
10366
10367 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
10368 local var instead of casting to unsigned char, to avoid casts.
10369
10370 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
10371 STATE_ALLOC): Remove.
10372 (transitions_new, errs_new, reductions_new, state_new): Use malloc
10373 rather than calloc, and use offsetof to avoid allocating slightly
10374 too much storage.
10375 (state_new): Initialize all members.
10376
10377 * src/state.c (state_hash): Use unsigned accumulator, not signed.
10378
10379 * src/symtab.c (symbol_free): Remove; unused.
10380 (symbol_get): Remove cast in lhs of assignment.
10381 (symbols_do): Now static. Accept generic arguments, not
10382 hashing-related ones.
10383
10384 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
10385 (symbol_processor): Remove.
10386 (symbols_do): Remove decl; now static.
10387
10388 * src/system.h (alloca): Remove; decl no longer needed.
10389 (<stddef.h>): Include, for offsetof.
10390 (<inttypes.>, <stdint.h>): Include if available.
10391 (uintptr_t): New type, if system lacks it.
10392 (CALLOC, MALLOC, REALLOC): New macros.
10393 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
10394 new macros.
10395
10396 * src/tables.c (table_size): Now int, to pacify GCC.
10397 (table_grow, table_ninf_remap): Use signed table size.
10398 (save_row): Don't bother initializing locals when not needed.
10399 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
10400 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
10401
10402 * src/vcg.h: Correct misspellings.
10403
10404 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
10405
10406
10407 * src/getargs.c (getargs): Don't assume EOF == -1.
10408
10409 2002-12-09 Paul Eggert <eggert@twinsun.com>
10410
10411 Change identifier spellings to avoid collisions with names
10412 that are reserved by POSIX.
10413
10414 Don't use names ending in _t, since POSIX reserves them.
10415 For consistency, remove _e and _s endings -- they're weren't
10416 needed to remove ambiguity. All uses changed.
10417 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
10418 turn was just renamed from struniq_t.
10419 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
10420 which in turn was just renamed from struniq_processor_t.
10421 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
10422 in turn was renamed from hash_compare_struniq_t.
10423 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
10424 (state_list): Renamed from state_list_t.
10425 * src/assoc.h (assoc): Renamed from assoc_t.
10426 * src/conflicts.c (enum conflict_resolution): Renamed from
10427 enum conflict_resolution_e.
10428 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
10429 (rule_list): Renamed from rule_list_t.
10430 * src/getargs.h (enum trace): Renamed from enum trace_e.
10431 (enum report): Renamed from enum report_e.
10432 * src/gram.h (item_number): Renamed from item_number_t.
10433 (rule_number): Renamed from rule_number_t.
10434 (struct rule_s): Remove the "rule_s" part; not used.
10435 (rule): Renamed from rule_t.
10436 (rule_filter): Renamed from rule_filter_t.
10437 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
10438 (goto_list): Renamed from goto_list_t.
10439 * src/lalr.h (goto_number): Renamed from goto_number_t.
10440 * src/location.h (location): Renamed from location_t.
10441 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
10442 and moved here from:
10443 * src/muscle_tab.h (muscle_entry_t): here.
10444 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
10445 (rule_list): Renamed from rule_list_t.
10446 * src/print_graph.c (static_graph): Renamed from graph.
10447 * src/reader.h (braced_code): Renamed from braced_code_t.
10448 Remove brace_code_e tag.
10449 * src/relation.h (relation_node): Renamed from relation_node_t.
10450 (relation_nodes): Renamed from relation_nodes_t.
10451 (relation): Renamed from relation_t.
10452 * src/state.h (state_number): Renamed from state_number_t.
10453 (struct state): Renamed from struct state_s.
10454 (state): Renamed from state_t.
10455 (transitions): Renamed from transitions_t. Unused (and
10456 misspelled) transtion_s tag removed.
10457 (errs): Renamed from errs_t. Unused errs_s tag removed.
10458 (reductions): Renamed from reductions_t. Unused tag
10459 reductions_s removed.
10460 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
10461 (struct symbol_list): Renamed from struct symbol_list_s.
10462 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
10463 (struct symbol): Renamed from struct symbol_s.
10464 (symbol): Renamed from symbol_t.
10465 * src/tables.c (vector_number): Renamed from vector_number_t.
10466 (action_number): Renamed from action_t.
10467 * src/tables.h (base_number): Renamed from base_t.
10468 * src/vcg.h (enum color): Renamed from enum color_e.
10469 (enum textmode): Renamed from enum textmode_e.
10470 (enum shape): Renamed from enum shape_e.
10471 (struct colorentry): Renamed from struct colorentry_s.
10472 (struct classname): Renamed from struct classname_s.
10473 (struct infoname): Renamed from struct infoname_s.
10474 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
10475 (enum decision): Renamed from enum decision_e.
10476 (enum orientation): Renamed from enum orientation_e.
10477 (enum alignment): Renamed from enum alignment_e.
10478 (enum arrow_mode): Renamed from enum arrow_mode_e.
10479 (enum crossing_type): Renamed from enum crossing_type_e.
10480 (enum view): Renamed from enum view_e.
10481 (struct node): Renamed from struct node_s.
10482 (node): Renamed from node_t.
10483 (enum linestyle): Renamed from enum linestyle_e.
10484 (enum arrowstyle): Renamed from enum arrowstyle_e.
10485 (struct edge): Renamed from struct edge.
10486 (edge): Renamed from edge_t.
10487 (struct graph): Renamed from struct graph_s.
10488 (graph): Renamed from graph_t.
10489 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
10490 Rename value_t -> value.
10491 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
10492 value_t_as_yystype -> value_as_yystype.
10493
10494 Don't include <errno.h> in the mainstream code, since it
10495 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
10496 * lib/get-errno.c, lib/get-errno.h: New files.
10497 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
10498 get-errno.c.
10499 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
10500 * src/output.c (output_skeleton): Likewise.
10501 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
10502 instead of errno.
10503 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
10504 Likewise.
10505 (handle_action_dollar, handle_action_at): Likewise.
10506 * src/system.h: Do not include <errno.h>.
10507 (TAB_EXT): Renamed from EXT_TAB.
10508 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
10509
10510 Avoid str[a-z]*, since <string.h> reserves that name space.
10511 Change all instances of "struniq" in names to "uniqstr", and
10512 likewise for "STRUNIQ" and "UNIQSTR".
10513 * src/uniqstr.c: Renamed from src/struniq.c.
10514 * src/uniqstr.h: Renamed from src/struniq.h.
10515 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
10516 * src/files.c (strsuffix): Remove; unused.
10517 (concat2): Renamed from stringappend. Now static.
10518 * src/files.h (strsuffix, stringappend): Remove; unused.
10519 * src/parse-gram.y (<chars>): Renamed from <string>.
10520 (<uniqstr>): Renamed from <struniq>.
10521 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
10522 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
10523 (struct graph_s.expand): Renamed from struct graph_s.stretch.
10524 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
10525 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
10526 (N_EXPAND): Renamed from N_STRETCH.
10527
10528 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
10529 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
10530 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
10531 Remove; unused.
10532 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
10533 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
10534 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
10535 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
10536 (BASE_MAXIMUM): Renamed from BASE_MAX.
10537 (BASE_MINIMUM): Renamed from BASE_MIN.
10538 (ACTION_MAX): Remove; unused.
10539 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
10540 Unnecessary casts removed from above defines.
10541
10542
10543 Fix misspelling in names.
10544 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
10545 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
10546 G_NODE_ALIGNEMENT.
10547
10548
10549 * lib/timevar.c (timevar_report): Renamed from time_report,
10550 for consistency with other names.
10551 * lib/timevar.h (timevar_report): New decl.
10552 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
10553
10554
10555 Sort include-file uses.
10556
10557 Reorder all include files under src to be in the order "system.h".
10558 then the ../lib include files in angle brackets (alphabetized),
10559 then the . include files in double-quotes (alphabetized). Fix
10560 dependency breakages encountered in this process, as follows:
10561 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
10562 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
10563 * src/state.h: Include "symtab.h".
10564
10565 2002-12-08 Paul Eggert <eggert@twinsun.com>
10566
10567 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
10568 since this causes problems when __file__ contains character
10569 sequences like "@" that are treated specially by src/scan-skel.l.
10570 Instead, just use the file's basename. This fixes the bug
10571 reported by Martin Mokrejs in
10572 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
10573
10574 2002-12-06 Paul Eggert <eggert@twinsun.com>
10575
10576 Add support for rules that do not have trailing semicolons, as
10577 POSIX requires. Improve the quality of locations in Bison
10578 diagnostics.
10579
10580 * src/location.c: Include <quotearg.h>.
10581 (empty_location): Now const.
10582 (location_print): New function. Follow the recommendation of the
10583 GNU Coding Standards for locations that span file boundaries.
10584 * src/location.h: Do not include <quotearg.h>; no longer needed.
10585 (boundary): New type.
10586 (location_t): Use it. This allows locations to span file boundaries.
10587 All member uses changed: file -> start.file or end.file (as needed),
10588 first_line -> start.line, first_column -> start.column,
10589 last_line -> end.line, last_column -> end.column.
10590 (equal_boundaries): New function.
10591 (LOCATION_RESET, LOCATION_STEP): Remove.
10592 (LOCATION_PRINT): Remove. All callers changed to use location_print.
10593 (empty_location): Now const.
10594 (location_print): New decl.
10595 * src/parse-gram.y (lloc_default): New function, which handles
10596 empty locations more accurately.
10597 (YYLLOC_DEFAULT): Use it.
10598 (%token COLON): Remove.
10599 (%token ID_COLON): New token.
10600 (rules): Use it.
10601 (declarations, rules): Remove trailing semicolon.
10602 (declaration, rules_or_grammar_declaration):
10603 Allow empty (";") declaration.
10604 (symbol_def): Remove empty actions; no longer needed.
10605 (rules_or_grammar_declaration): Remove trailing semicolon.
10606 (semi_colon.opt): Remove.
10607 * src/reader.h: Include location.h.
10608 (scanner_cursor): New decl.
10609 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
10610 rolling our own.
10611 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
10612 of *loc.
10613 (STEP): Remove. No longer needed, now that adjust_location does
10614 the work. All uses removed.
10615 (scanner_cursor): New var.
10616 (adjust_location): Renamed from extend_location. It now sets
10617 *loc and adjusts the scanner cursor. All uses changed.
10618 Don't bother testing for CR.
10619 (handle_syncline): Remove location arg; now updates scanner cursor.
10620 All callers changed.
10621 (unexpected_end_of_file): Now accepts start boundary of token or
10622 comment, not location. All callers changed. Update scanner cursor,
10623 not the location.
10624 (SC_AFTER_IDENTIFIER): New state.
10625 (context_state): Renamed from c_context. All uses changed.
10626 (id_loc, code_start, token_start): New local vars.
10627 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
10628 processing of Yacc white space and equivalents here.
10629 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
10630 instead of returning ID immediately, since we need to search for
10631 a subsequent colon.
10632 (<INITIAL>"'", "\""): Save token_start.
10633 (<INITIAL>"%{", "{", "%%"): Save code_start.
10634 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
10635 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
10636 BEGIN context_state at end, not INITIAL.
10637 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
10638 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
10639 Return correct token start.
10640 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
10641 the start of a character, string or multiline comment is found.
10642 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
10643 Reduction): Adjust reported locations to match the more-precise
10644 results now expected.
10645 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
10646 * tests/reduce.at (Useless Rules, Reduced Automaton,
10647 Underivable Rules): Likewise.
10648 * tests/regression.at (Invalid inputs): No longer `expecting ";"
10649 or "|"' now that so many other tokens are allowed by the new grammar.
10650
10651 * src/complain.h (current_file): Remove duplicate decl;
10652 current_file is now owned by files.h.
10653 * src/complain.c, src/scan-gram.l: Include files.h.
10654
10655 2002-12-06 Paul Eggert <eggert@twinsun.com>
10656
10657 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
10658 promotes to int; it might be unsigned int.
10659 * data/yacc.c (yy_reduce_print): Likewise.
10660
10661 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
10662 be #defined in the prologue, not in the Bison declarations.
10663 This fixes Debian Bug 102878, reported by Shaul Karl.
10664
10665 2002-12-02 Paul Eggert <eggert@twinsun.com>
10666
10667 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
10668 * lib/strtoul.c: New file, from gnulib.
10669 This fixes a porting bug reported by Peter Klein in
10670 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
10671
10672 2002-11-30 Paul Eggert <eggert@twinsun.com>
10673
10674 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
10675 and put only a forward declaration in the prologue. This is for
10676 consistency with the other scanner helper functions.
10677
10678 Type clashes now generate warnings, not errors, since it
10679 appears that POSIX may allow some grammars with type clashes.
10680 * src/reader.c (grammar_current_rule_check): Warn about
10681 type clashes instead of complaining.
10682 * tests/input.at (Type Clashes): Expect warnings, not complaints.
10683
10684 Add Yacc library, since POSIX requires it.
10685 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
10686 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
10687 * lib/main.c, lib/yyerror.c: New files.
10688
10689 gram_error can be static; it need not be extern.
10690 * src/reader.h (gram_error): Remove decl.
10691 * src/parse-gram.y (gram_error): Now static. Add static decl.
10692 (print_token_value): Omit parameter names from forward decl,
10693 for consistency.
10694
10695 2002-11-29 Paul Eggert <eggert@twinsun.com>
10696
10697 * doc/bison.texinfo: Emphasize that yylex and yyerror must
10698 be declared before being used. E.g., one should typically
10699 declare them in the prologue. Use GNU coding style in examples.
10700 Put "const" consistently after the type it modifies. Mention
10701 that C99 supports "inline". Mention that yyerror traditionally
10702 returns "int".
10703
10704 %parse-param and %lex-param now take just one argument, the
10705 declaration; the argument name is deduced from the declaration.
10706
10707 * doc/bison.texinfo (Parser Function, Pure Calling, Error
10708 Reporting, Table of Symbols): Document this.
10709 * src/parse-gram.y (add_param): New function.
10710 (COMMA): Remove.
10711 (declaration): Implement new rule for %parse-param and %lex-param.
10712 * src/scan-gram.l: "," now elicits a warning, rather than being
10713 a token; this is more compatible with byacc.
10714 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
10715
10716 2002-11-27 Paul Eggert <eggert@twinsun.com>
10717
10718 Rename identifiers to avoid real and potential collisions.
10719
10720 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
10721 to avoid collision with lex macro described by Bruce Lilly in
10722 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
10723 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10724 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
10725 * src/parse-gram.y (print_token_value): Renamed from yyprint.
10726 All uses changed.
10727 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
10728 The name "yycontrol" violates the name space rules, and this stuff
10729 wasn't being used anyway.
10730 (input): Remove action; this stuff wasn't being used.
10731 (gram_error): Rename local variable yylloc -> loc.
10732 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
10733 (YY_DECL): Don't use "yy" at start of local variables.
10734 All uses changed, e.g., yylloc -> loc.
10735 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
10736 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
10737 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
10738 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
10739
10740 * src/parse-gram.y (gram_error): loc is now const *.
10741 * src/reader.h (gram_error): Likewise.
10742
10743 2002-11-24 Paul Eggert <eggert@twinsun.com>
10744
10745 Version 1.75c.
10746
10747 * tests/actions.at (Actions after errors): Use an output format
10748 more similar to that of the Printers and Destructors test.
10749 Test the position of the ';' token too.
10750 (Printers and Destructors): Likewise.
10751 (Printers and Destructors: %glr-parser): Remove for now, to avoid
10752 unnecessarily alarming people when the test fails.
10753
10754 * data/yacc.c (yyerrlab1): Move this label down, so that the
10755 parser does not discard the lookahead token if the user code
10756 invokes YYERROR. This change is required for POSIX conformance.
10757
10758 * lib/error.c: Sync with gnulib.
10759
10760 2002-11-22 Paul Eggert <eggert@twinsun.com>
10761
10762 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
10763 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
10764 * lib/xmalloc.c: Likewise.
10765
10766 2002-11-20 Paul Eggert <eggert@twinsun.com>
10767
10768 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
10769
10770 2002-11-20 Paul Eggert <eggert@twinsun.com>
10771
10772 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
10773 should use `if (! x) abort ();' rather than `assert (x);', and
10774 anyway it's one less thing to worry about configuring.
10775
10776 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
10777 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
10778 and replace all instances of assert with abort.
10779 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10780 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
10781
10782 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
10783 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
10784 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
10785 hash_find_entry, hash_rehash, hash_insert): Likewise.
10786 * src/conflicts.c (resolve_sr_conflict): Likewise.
10787 * src/lalr.c (set_goto_map, map_goto): Likewise.
10788 * src/nullable.c (nullable_compute): Likewise.
10789 * src/output.c (prepare_rules, token_definitions_output): Likewise.
10790 * src/reader.c (packgram, reader): Likewise.
10791 * src/state.c (state_new, state_free, state_transitions_set,
10792 state_reduction_find): Likewise.
10793 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
10794 symbol_pack): Likewise.
10795 * src/tables.c (conflict_row, pack_vector): Likewise.
10796 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10797 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10798 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
10799 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
10800
10801 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
10802 (ARGMATCH_CONSTRAINT): New macro.
10803 (ARGMATCH_ASSERT): Use it.
10804
10805 * src/system.h (verify): New macro.
10806 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
10807 rather than assert.
10808 * src/tables.c (tables_generate): Likewise.
10809
10810 * src/struniq.c (struniq_assert): Now returns void, and aborts
10811 if the assertion is false.
10812 (struniq_assert_p): Remove.
10813 * src/struniq.h: Likewise.
10814
10815 2002-11-18 Paul Eggert <eggert@twinsun.com>
10816
10817 * data/glr.c (yygetLRActions): Replace `yyindex' with
10818 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
10819 This fixes the regression with Sun ONE Studio 7 cc that I reported in
10820 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
10821
10822 2002-11-18 Akim Demaille <akim@epita.fr>
10823
10824 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
10825 space.
10826 From Tim Van Holder.
10827
10828 2002-11-17 Paul Eggert <eggert@twinsun.com>
10829
10830 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10831 to "SyntaxError" for consistency with my 2002-11-15 change.
10832
10833 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10834 not define to {}, since this breaks the common use of `YYDPRINTF
10835 ((...));' if a single statement is desired (e.g. before `else').
10836 Work around GCC warnings by surrounding corresponding calls with
10837 {} if needed.
10838 (yyhasResolvedValue): Remove unused function.
10839 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10840 loop body.
10841 (yyreportSyntaxError): Renamed from yyreportParseError.
10842 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10843 All uses changed.
10844 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10845 extern when possible. Remove unused initializations.
10846
10847 2002-11-16 Akim Demaille <akim@epita.fr>
10848
10849 Augment the similarity between GLR and LALR traces.
10850
10851 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10852 (YY_REDUCE_PRINT): New.
10853 (yyparse): Use them.
10854 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10855 YYDPRINT here.
10856 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10857 state reached after the reduction/recovery, since...
10858 (yyparse, yyprocessOneStack): Report the state we are entering in.
10859
10860 2002-11-16 Akim Demaille <akim@epita.fr>
10861
10862 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10863 Add support for --trace=skeleton.
10864 * src/scan-skel.l: %option debug.
10865 Scan strings of non-@ or \n instead of character by character.
10866 (scan_skel): Handle trace_skeleton.
10867 (QPUTS): New.
10868 (@output_parser_name@, @output_header_name@): ``Restore'' their
10869 support (used to be M4 macros).
10870 * data/yacc.c: Quote larger chunks, a la glr.c.
10871 * data/lalr1.cc: Likewise.
10872 The header guards are no longer available, so use some other
10873 string than `YYLSP_NEEDED'.
10874
10875 2002-11-16 Akim Demaille <akim@epita.fr>
10876
10877 Make the ``Printers and Destructors'' test more verbose, taking
10878 `yacc.c''s behavior as (possibly wrong) reference.
10879
10880 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10881 instead of fprint on stdout.
10882 Set and report the last_line of the symbols.
10883 Consistently display values and locations.
10884
10885 2002-11-16 Paul Eggert <eggert@twinsun.com>
10886
10887 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10888
10889 2002-11-15 Paul Eggert <eggert@twinsun.com>
10890
10891 * tests/actions.at (Actions after errors): New test case.
10892
10893 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10894 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10895 tests/action.at, tests/calc.at, tests/conflicts.at,
10896 tests/cxx-type.at, tests/regression.at:
10897 "parse error" -> "syntax error" for POSIX compatibility.
10898 "parsing stack overflow..." -> "parser stack overflow" so
10899 that code matches Bison documentation.
10900
10901 2002-11-15 Akim Demaille <akim@epita.fr>
10902
10903 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10904 take two BRACED_CODE, not two string_content.
10905 Free the scanner's obstack when we are done.
10906 (code_content): New.
10907 * tests/calc.at: Adjust.
10908 * doc/bison.texinfo: Adjust.
10909 Also, make sure to include the `,' for these declarations.
10910
10911 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10912
10913 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10914 definition; avoids potential autoreconf problems.
10915
10916 2002-11-15 Akim Demaille <akim@epita.fr>
10917
10918 Always check the value returned by yyparse.
10919
10920 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10921 returned by yyparse.
10922 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10923 Adjust calls.
10924 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10925 returned by yyparse.
10926
10927 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10928
10929 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10930 on input.at test.
10931
10932 2002-11-14 Paul Eggert <eggert@twinsun.com>
10933
10934 * src/output.c (output_skeleton): Call xfopen instead of
10935 duplicating xfopen's body.
10936
10937 Fix bugs reported by Nelson H. F. Beebe in
10938 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
10939
10940 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10941 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10942 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10943 file twice in the grammar, as an extra check.
10944
10945 * tests/input.at (Torturing the Scanner): Surround the
10946 backslash-newline tests with "#if 0", to make it less likely that
10947 we'll run into compiler bugs. Bring back solitary \ inside
10948 comment, but add a closing comment to work around HP C bug. Don't
10949 test backslash-newline in C character constant.
10950
10951 2002-11-14 Akim Demaille <akim@epita.fr>
10952
10953 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10954 status of the compiler.
10955 Calling `exit 1' is no longer needed.
10956 Reported by Nelson H. F. Beebe.
10957
10958 2002-11-14 Akim Demaille <akim@epita.fr>
10959
10960 * tests/atlocal.in (CPPFLAGS): We have config.h.
10961 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10962 New.
10963 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10964 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10965 * tests/regression.at, tests/torture.at: Use them for all the
10966 grammars that are to be compiled.
10967 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10968 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10969 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10970
10971 2002-11-14 Akim Demaille <akim@epita.fr>
10972
10973 * doc/bison.texinfo: Various formatting changes (alignments in
10974 samples, additional @group/@end group, GCS in samples.
10975 Use @deffn instead of simple @table to define the directives,
10976 macros, variables etc.
10977
10978 2002-11-13 Paul Eggert <eggert@twinsun.com>
10979
10980 Fix some bugs reported by Albert Chin-A-Young in
10981 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
10982
10983 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
10984 -o c"; the HP C compiler chatters during compilation.
10985 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10986 * tests/headers.at (export YYLTYPE): Likewise.
10987
10988 * tests/input.at (Torturing the Scanner): Remove lines containing
10989 solitary backslashes, as they tickle a bug in the HP C compiler.
10990
10991 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10992 comments, since they're not portable. Use GNU coding style.
10993
10994 2002-11-13 Akim Demaille <akim@epita.fr>
10995
10996 * data/yacc.c: Leave bigger chunks of quoted text.
10997 (YYDSYMPRINTF): New.
10998 Use it to report symbol activities.
10999 * data/glr.c (YYDSYMPRINTF): New.
11000 Use it.
11001
11002 2002-11-12 Paul Eggert <eggert@twinsun.com>
11003
11004 Version 1.75b.
11005
11006 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
11007 (yyglrReduce): Return yyok, not 0.
11008 This should avoid the enumerated-type warnings reported
11009 by Nelson H. F. Beebe in
11010 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
11011
11012 * lib/bbitset.h (BITSET_INLINE): Remove.
11013 * lib/bitset.h [! BITSET_INLINE]: Remove.
11014 (bitset_set, bitset_reset, bitset_test): Rename local vars
11015 to avoid shadowing warnings by GCC.
11016
11017 * data/glr.c (inline): Remove #define. It's the user's
11018 responsibility to #define it away, just like 'const'.
11019 This fixes one of the bugs reported by Nelson H. F. Beebe in
11020 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
11021
11022 * Makefile.maint (po-check): Scan .l and .y files instead of the
11023 .c and the .h files that they generate. This fixes the bug
11024 reported by Tim Van Holder in:
11025 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
11026 Look for N_ as well as for _. Try to avoid matching #define for
11027 N_ and _.
11028 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
11029 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
11030 * src/scan-gram.l: Revamp regular expressions so that " and '
11031 do not confuse xgettext.
11032
11033 * src/struniq.h (struniq_new): Do not declare the return type
11034 to be 'const'; this violates the C standard.
11035 * src/struniq.c (struniq_new): Likewise.
11036
11037 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
11038
11039 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
11040 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
11041 linker.
11042
11043 2002-11-12 Akim Demaille <akim@epita.fr>
11044
11045 * Makefile.maint: Sync with Autoconf:
11046 (local_updates): New.
11047
11048 2002-11-12 Akim Demaille <akim@epita.fr>
11049
11050 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
11051
11052 2002-11-12 Akim Demaille <akim@epita.fr>
11053
11054 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
11055 locations.
11056
11057 2002-11-12 Akim Demaille <akim@epita.fr>
11058
11059 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
11060 not yyvalue.
11061
11062 2002-11-12 Akim Demaille <akim@epita.fr>
11063
11064 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
11065 Use it to test the GLR parser.
11066
11067 2002-11-12 Akim Demaille <akim@epita.fr>
11068
11069 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
11070 defines it.
11071 * data/glr.c (yystos): New.
11072 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
11073 (YYDSYMPRINT): New.
11074 (yyval): Don't define it, it is handled via M4.
11075 (yyrecoverParseError): Free verbosely the discarded symbols.
11076 * data/yacc.c (yysymprint): Remove, rather...
11077 (b4_yysymprint_generate): invoke.
11078 * data/c.m4 (b4_yysymprint_generate): New.
11079 Accept pointers as arguments, as opposed to the version from
11080 yacc.c.
11081 (b4_yydestruct_generate): Likewise.
11082 * tests/cations.at (Printers and Destructors): Use Bison directives
11083 instead of CPP macros.
11084 Don't rely on internal details.
11085
11086 2002-11-12 Akim Demaille <akim@epita.fr>
11087
11088 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
11089 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
11090 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
11091 it against YYEMPTY and so forth), work on yytoken (i.e., set
11092 it to YYEMPTY etc.).
11093 (yydestruct): Replace with a b4_yydestruct_generate invocation.
11094 (b4_symbol_actions): Remove.
11095 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
11096 for 0, end-of-input.
11097
11098 2002-11-12 Akim Demaille <akim@epita.fr>
11099
11100 * doc/bison.texinfo (Destructor Decl): New.
11101
11102 2002-11-12 Akim Demaille <akim@epita.fr>
11103
11104 * src/tables.c (tables_generate): Use free for pointers that
11105 cannot be NULL, not XFREE.
11106 (pack_vector): Use assert, not fatal, for bound violations.
11107 * src/state.c (state_new): Likewise.
11108 * src/reader.c (reader): Likewise.
11109 * src/lalr.c (set_goto_map): Likewise.
11110 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
11111 the file name.
11112
11113 2002-11-12 Akim Demaille <akim@epita.fr>
11114
11115 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
11116 Restore.
11117 * src/scan-gram.l (last_string): Is global to the file, not to
11118 yylex.
11119 * src/parse-gram.y (input): Don't append the epilogue here,
11120 (epilogue.opt): do it here, and free the scanner's obstack.
11121 * src/reader.c (epilogue_set): Rename as...
11122 (epilogue_augment): this.
11123 * data/c.m4 (b4_epilogue): Defaults to empty.
11124
11125 2002-11-12 Akim Demaille <akim@epita.fr>
11126
11127 * src/getargs.c (long_options): Remove duplicates.
11128 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
11129 Remove.
11130 * doc/bison.rnh: Remove.
11131 * doc/bison.texinfo (VMS Invocation): Remove.
11132
11133 2002-11-12 Akim Demaille <akim@epita.fr>
11134
11135 * src/struniq.h, src/struniq.c (struniq_t): Is const.
11136 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
11137
11138 Use struniq for symbols.
11139
11140 * src/symtab.h (symbol_t): The tag member is a struniq.
11141 (symbol_type_set): Adjust.
11142 * src/symtab.c (symbol_new): Takes a struniq.
11143 (symbol_free): Don't free the tag member.
11144 (hash_compare_symbol_t, hash_symbol_t): Rename as...
11145 (hash_compare_symbol, hash_symbol): these.
11146 Use the fact that tags as struniqs.
11147 (symbol_get): Use struniq_new.
11148 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
11149 Returns a strniq.
11150 * src/reader.h (merger_list, grammar_currentmerge_set): The name
11151 and type members are struniqs.
11152 * src/reader.c (get_merge_function)
11153 (grammar_current_rule_merge_set): Adjust.
11154 (TYPE, current_type): Are struniq.
11155
11156 Use struniq for file names.
11157
11158 * src/files.h, src/files.c (infile): Split into...
11159 (grammar_file, current_file): these.
11160 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
11161 * src/reduce.c (reduce_print): Likewise.
11162 * src/getargs.c (getargs): Likewise.
11163 * src/complain.h, src/complain.c: Likewise.
11164 * src/main.c (main): Call struniqs_new early enough to use it for
11165 file names.
11166 Don't free the input file name.
11167
11168 2002-11-12 Akim Demaille <akim@epita.fr>
11169
11170 * src/symtab.c (symbol_free): Remove dead deactivated code:
11171 type_name are properly removed.
11172 Don't use XFREE to free items that cannot be NULL.
11173 * src/struniq.h, src/struniq.c: New.
11174 * src/main.c (main): Initialize/free struniqs.
11175 * src/parse-gram.y (%union): Add astruniq member.
11176 (yyprint): Adjust.
11177 * src/scan-gram.l (<{tag}>): Return a struniq.
11178 Free the obstack bit that used to store it.
11179 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
11180
11181 2002-11-11 Paul Eggert <eggert@twinsun.com>
11182
11183 Revamp to fix many (but not all) of the C- and M4-related quoting
11184 problems. Among other things, this fixes the Bison bug reported
11185 by Jan Hubicka when processing the Bash grammar; see:
11186 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
11187
11188 Use new @ escapes consistently. Represent brackets with @{ and @}
11189 rather than @<:@ and @:>@, since this works a bit better with dumb
11190 editors like vi. Represent @ with @@, since @ is now consistently
11191 an escape. Use @oline@ and @ofile@ rather than __oline__ and
11192 __ofile__, to avoid unexpected expansions. Similarly, use @output
11193 rather than #output.
11194
11195 * data/c.m4 (b4_copyright): Omit file name from comment, since
11196 the file name could contain "*/".
11197 (b4_synclines_flag): Don't quote the 2nd argument; it should already
11198 be quoted. All uses changed.
11199
11200 * data/glr.c: Use new @ escapes consistently.
11201 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
11202 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
11203 Remove, since they couldn't handle arbitrary characters in file
11204 names.
11205 * data/lalr1.cc: Likewise.
11206 * data/yacc.c: Likewise.
11207
11208 * src/files.c (output_infix): Remove; all uses removed.
11209 * src/files.h: Likewise.
11210
11211 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
11212 mishandled funny characters in file names, and anyway it isn't
11213 needed any more.
11214 * data/yacc.c: Likewise.
11215 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
11216
11217 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
11218 * data/yacc.c: Likewise.
11219
11220 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
11221 strings now.
11222 (muscle_init): Quote filename as a C string.
11223 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
11224 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
11225 * src/output.c (escaped_file_name_output): New function.
11226 (prepare_symbols): Quote tokens for M4.
11227 (prepare): Don't insert output_infix, output_prefix,
11228 output_parser_name, output_header_name; this is now down by scan-skel.
11229 Insert skeleton as a C string.
11230
11231 * src/output.c (user_actions_output, symbol_destructors_output,
11232 symbol_printers_output): Quote filenames for C and M4.
11233 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11234
11235 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
11236 escapes other than \\ and \'; this simplifies the code.
11237 (<SC_STRING>): Likewise, for \\ and \".
11238 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
11239 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
11240 Use new escapes @{ and @} for [ and ].
11241
11242 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
11243 them with auto vars.
11244 Switch to new escape scheme, where @ is the escape character uniformly.
11245 Abort if a stray escape character is found. Avoid unbounded input
11246 buffer when parsing non-escaped text.
11247
11248 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
11249 __oline__, #output, $@, and @{ do not have unintended meanings.
11250
11251 2002-11-09 Paul Eggert <eggert@twinsun.com>
11252
11253 Fix the test failure due to GCC warnings described in
11254 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
11255 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
11256 evaluate to 0 if it's impossible for NINF to be in the respective
11257 table.
11258 (yygetLRActions, yyrecoverParseError): Use them.
11259
11260 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
11261 counted in the token inserted at end of file. Now takes
11262 location_t *, not location_t, so that the location can be
11263 adjusted. All uses changed.
11264
11265 * tests/regression.at (Invalid inputs): Adjust wording in
11266 diagnostic to match the new behavior.
11267
11268 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
11269 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
11270 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
11271 abort ();'. This reduces the runtime of the "Many lookaheads"
11272 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
11273 GCC 3.2.
11274
11275 2002-11-07 Paul Eggert <eggert@twinsun.com>
11276
11277 * src/parse-gram.y (CHARACTER): Remove unused token.
11278 All uses removed.
11279
11280 * src/scan-gram.l: Remove stack option. We no longer use the
11281 stack, since the stack was never deeper than 1; instead, use the
11282 new auto var c_context to record the stacked value.
11283
11284 Remove nounput option. At an unexpected end of file, we now unput
11285 the minimal input necessary to end cleanly; this simplifies the
11286 code.
11287
11288 Avoid unbounded token sizes where this is easy.
11289
11290 (unexpected_end_of_file): New function.
11291 Use it to systematize the error message on unexpected EOF.
11292 (last-string): Now auto, not static.
11293 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
11294 (scanner_last_string_free): Remove; not used.
11295 (percent_percent_count): Move decl to just before use.
11296 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
11297 not the (never otherwised-used) CHARACTER.
11298
11299 2002-11-07 Akim Demaille <akim@epita.fr>
11300
11301 Let yyerror always receive the msg as last argument, so that
11302 yyerror can be variadic.
11303
11304 * data/yacc.c (b4_yyerror_args): New.
11305 Use it when calling yyerror.
11306 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
11307 Use it when calling yyerror.
11308 * doc/bison.texinfo (Error Reporting): Adjust.
11309 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
11310 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
11311
11312 2002-11-06 Akim Demaille <akim@epita.fr>
11313
11314 #line should have quoted strings.
11315 Ideally, this should be done by m4_quotearg.
11316
11317 * src/scan-skel.l: Include quotearg.h.
11318 Quote __ofile__.
11319 * src/output.c (symbol_printers_output)
11320 (symbol_destructors_output): Quote the file name.
11321
11322 2002-11-06 Akim Demaille <akim@epita.fr>
11323
11324 * tests/regression.at (Invalid inputs): Adjust to the recent
11325 messages.
11326
11327 2002-11-06 Akim Demaille <akim@epita.fr>
11328
11329 Restore --no-lines.
11330 Reported by Jim Kent.
11331
11332 * data/c.m4 (b4_syncline): New.
11333 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
11334 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
11335 * src/output.c (user_actions_output): Likewise.
11336 (prepare): Define 'b4_synclines_flag'.
11337 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
11338
11339 2002-11-06 Akim Demaille <akim@epita.fr>
11340
11341 * src/main.c (main): Free `infile'.
11342 * src/scan-gram.l (handle_syncline): New.
11343 Recognize `#line'.
11344 * src/output.c (user_actions_output, symbol_destructors_output)
11345 (symbol_printers_output): Use the location's file name, not
11346 infile.
11347 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11348
11349 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11350
11351 * src/tables.c (matching_state): Don't allow states to match if
11352 either has GLR conflict entries.
11353
11354 2002-11-05 Paul Eggert <eggert@twinsun.com>
11355
11356 * src/scan-gram.l: Use more accurate diagnostics, e.g.
11357 "integer out of range" rather than "invalid value".
11358 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
11359 accordingly.
11360
11361 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
11362 Also, remove one static variable in the scanner.
11363
11364 * src/scan-gram.l (braces_level): Now auto, not static.
11365 Initialize to zero if the compiler is being picky.
11366 (INITIAL): Clear braces_level instead of incrementing it.
11367 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
11368 as POSIX 1003.1-2001 requires.
11369 * src/system.h (IF_LINT): New macro, taken from coreutils.
11370 * configure.ac: Define "lint" if --enable-gcc-warnings.
11371
11372 2002-11-05 Akim Demaille <akim@epita.fr>
11373
11374 * src/scan-gram.l: When it starts with `%', complain about the
11375 whole directive, not just that `invalid character: %'.
11376
11377 2002-11-04 Akim Demaille <akim@epita.fr>
11378
11379 * Makefile.maint: Update from Autoconf.
11380 (update, cvs-update, po-update, do-po-update): New.
11381
11382 2002-11-04 Akim Demaille <akim@epita.fr>
11383
11384 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
11385 and yyerror.
11386 Have yyerror `use' its arguments.
11387 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
11388 returns true when location & yacc & pure & parse-param.
11389 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
11390
11391 2002-11-04 Akim Demaille <akim@epita.fr>
11392
11393 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
11394 clashes.
11395 * src/scan-gram.l: Use [\'] instead of ['] to pacify
11396 font-lock-mode.
11397 Use complain_at.
11398 Use quote, not quote_n since LOCATION_PRINT no longer uses the
11399 slot 0.
11400
11401 2002-11-03 Paul Eggert <eggert@twinsun.com>
11402
11403 * src/reader.c (get_merge_function, grammar_current_rule_check):
11404 Use consistent diagnostics for reporting type name clashes.
11405 Quote the types with <>, for consistency with Yacc.
11406 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
11407
11408 2002-11-03 Akim Demaille <akim@epita.fr>
11409
11410 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
11411 New.
11412 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
11413 (b4_parse_param): Remove.
11414 Use b4_identification.
11415 Propagate b4_pure_args where needed to pass them to yyerror.
11416 * data/glr.m4 (b4_parse_param): Remove.
11417 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
11418 (b4_lpure_formals): New.
11419 Use b4_identification.
11420 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
11421 b4_user_formals and b4_user_args.
11422 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
11423 (yyreportAmbiguity): When using a pure parser, also need
11424 the location, and the parse-params.
11425 Adjust callers.
11426 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
11427 When using a pure parser, also need the parse-params.
11428 Adjust callers.
11429 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
11430 (%pure-parser + %parse-param) LALR and GLR parsers.
11431 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
11432 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
11433 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
11434 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
11435 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
11436 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
11437 * doc/bison.texinfo: Untabify the whole file.
11438 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
11439 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
11440 (Error Reporting): Adjust to these new directives.
11441 Document %error-verbose, deprecate YYERROR_VERBOSE.
11442
11443 2002-11-03 Akim Demaille <akim@epita.fr>
11444
11445 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
11446 AT_CHECK_CALC_GLR invocations to use % directives, instead of
11447 command line options.
11448 * tests/cxx-type.at: Formatting changes.
11449
11450 2002-11-03 Paul Eggert <eggert@twinsun.com>
11451
11452 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
11453 to count columns correctly, and to check for invalid inputs.
11454
11455 Use mbsnwidth to count columns correctly. Account for tabs, too.
11456 Include mbswidth.h.
11457 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
11458 (extend_location): New function.
11459 (YY_LINES): Remove.
11460
11461 Handle CRLF in C code rather than in Lex code.
11462 (YY_INPUT): New macro.
11463 (no_cr_read): New function.
11464
11465 Scan UCNs, even though we don't fully handle them yet.
11466 (convert_ucn_to_byte): New function.
11467
11468 Handle backslash-newline correctly in C code.
11469 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
11470 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
11471 all uses changed.
11472 (tag, splice): New EREs. Do not allow NUL or newline in tags.
11473 Use {splice} wherever C allows backslash-newline.
11474 YY_STEP after space, newline, vertical-tab.
11475 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
11476
11477 (letter, id): Don't assume ASCII; e.g., spell out a-z.
11478
11479 ({int}, handle_action_dollar, handle_action_at): Check for integer
11480 overflow.
11481
11482 (YY_STEP): Omit trailing semicolon, so that it's more like C.
11483
11484 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
11485 as well as \000. Check for UCHAR_MAX, not 255.
11486 Allow \x with an arbitrary positive number of digits, as in C.
11487 Check for overflow here.
11488 Allow \? and UCNs, for compatibility with C.
11489
11490 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
11491 with quote slot used by complain_at.
11492
11493 * tests/input.at: Add tests for backslash-newline, m4 quotes
11494 in symbols, long literals, and funny escapes in strings.
11495
11496 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
11497 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
11498 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
11499 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
11500 * m4/mbswidth.m4: New file, from GNU coreutils.
11501
11502 * doc/bison.texinfo (Grammar Outline): Document // comments.
11503 (Symbols): Document that trigraphs have no special meaning in Bison,
11504 nor is backslash-newline allowed.
11505 (Actions): Document that trigraphs have no special meaning.
11506
11507 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
11508 no longer used.
11509
11510 2002-11-02 Paul Eggert <eggert@twinsun.com>
11511
11512 * src/reader.c: Don't include quote.h; not needed.
11513 (get_merge_function): Reword warning to be consistent with
11514 type clash diagnostic in grammar_current_rule_check.
11515
11516 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
11517 bug in trigraph handling.
11518
11519 * src/output.c (prepare_symbols): When printing token names,
11520 escape "[" as "@<:@" and likewise for "]".
11521
11522 * src/system.h (errno): Remove declaration, as we are now
11523 assuming C89 or better, and C89 guarantees errno.
11524
11525 2002-10-30 Paul Eggert <eggert@twinsun.com>
11526
11527 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
11528 Check for close failures.
11529 * src/files.h (xfclose): Return void, not int, since it always
11530 returned zero.
11531 * src/files.c (xfclose): Likewise. Report I/O error if ferror
11532 indicates one.
11533 * src/output.c (output_skeleton): Use xfclose rather than fclose
11534 and ferror. xfclose now checks ferror.
11535
11536 * data/glr.c (YYLEFTMOST_STATE): Remove.
11537 (yyreportTree): Use a stack-based leftmost state. This avoids
11538 our continuing battles with bogus warnings about initializers.
11539
11540 2002-10-30 Akim Demaille <akim@epita.fr>
11541
11542 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
11543 #if.
11544
11545 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11546
11547 * tests/glr-regr1.at: New test for reported regressions.
11548 * tests/testsuite.at: Add glr-regr1.at test.
11549 * tests/Makefile.am: Add glr-regr1.at test.
11550
11551 2002-10-24 Paul Eggert <eggert@twinsun.com>
11552
11553 Version 1.75a.
11554
11555 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
11556 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
11557 we use malloc. Don't assume 'A' through 'Z' are contiguous.
11558 Don't assume strdup exists; POSIX says its an XSI extension.
11559 Check for buffer overflow on input.
11560
11561 2002-10-24 Akim Demaille <akim@epita.fr>
11562
11563 * src/output.c (output_skeleton): Don't disable M4sugar comments
11564 too soon: it results in comments being expanded.
11565 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
11566 first output.
11567
11568 2002-10-24 Akim Demaille <akim@epita.fr>
11569
11570 * data/yacc.c (m4_int_type): New.
11571 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
11572 char' as only yacc.c wants K&R portability.
11573 * data/glr.c (yysigned_char): Remove.
11574 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
11575 Reported by Quoc Peyrot.
11576
11577 2002-10-23 Paul Eggert <eggert@twinsun.com>
11578
11579 * src/main.c (main): With --trace=time, report times even if a
11580 non-fatal error occurs. Formerly, the times were reported in some
11581 such cases but not in others.
11582 * src/reader.c (reader): Just return if a complaint has been issued,
11583 instead of exiting, so that 'main' can report times.
11584
11585 2002-10-22 Akim Demaille <akim@epita.fr>
11586
11587 * src/system.h: Include sys/types.
11588 Reported by Bert Deknuydt.
11589
11590 2002-10-23 Paul Eggert <eggert@twinsun.com>
11591
11592 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
11593 Suggested by Art Haas.
11594
11595 2002-10-22 Paul Eggert <eggert@twinsun.com>
11596
11597 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
11598 decl; not needed any more.
11599 * src/main.c (main): Use return to exit, undoing yesterday's change.
11600 The last OS that we could find where this wouldn't work is
11601 SunOS 3.5, and that's too old to worry about now.
11602
11603 * data/glr.c (struct yyltype): Define members even when not
11604 doing locations. This is more consistent with yacc.c, and it
11605 works around the following bug reports:
11606 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
11607 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
11608
11609 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
11610 @acronym consistently. Standardize on "Yacc" instead of "YACC",
11611 "Algol" instead of "ALGOL". Give a bit more history about BNF.
11612
11613 2002-10-22 Akim Demaille <akim@epita.fr>
11614
11615 * data/README: New.
11616
11617 2002-10-21 Paul Eggert <eggert@twinsun.com>
11618
11619 Be consistent about 'bool'; the old code used an enum in one
11620 module and an int in another, and this violates the C standard.
11621 * m4/stdbool.m4: New file, from coreutils 4.5.3.
11622 * configure.ac (AC_HEADER_STDBOOL): Add.
11623 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
11624 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
11625 * src/symtab.c (hash_compare_symbol_t): Likewise.
11626 * src/system.h (bool, false, true): Use a definition consistent
11627 with ../lib/hash.c. All uses changed.
11628
11629 * src/complain.c (warning_issued): Renamed from warn_message_count,
11630 so that we needn't worry about integer overflow (!).
11631 Now of type bool. All uses changed.
11632 (complaint_issued): Renamed from complain_message_count; likewise.
11633
11634 * src/main.c (main): Use exit to exit with failure.
11635
11636 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
11637 rather than 1 and 0.
11638 * src/main.c (main): Likewise.
11639 * src/getargs.c (getargs): Likewise.
11640 * src/reader.c (reader): Likewise.
11641
11642 * src/getarg.c (getargs): Remove duplicate code for
11643 "Try `bison --help'".
11644
11645 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
11646 What was that "2" for?
11647
11648 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
11649 * src/getargs.c (usage): Likewise.
11650
11651 * src/getargs.c (getargs): When there are too few operands, report
11652 the last one. When there are too many, report the first extra
11653 one. This is how diffutils does it.
11654
11655 2002-10-20 Paul Eggert <eggert@twinsun.com>
11656
11657 Remove K&R vestiges.
11658 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
11659 * src/complain.c (VA_START): Remove. Assume prototypes.
11660 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
11661 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
11662 fatal): Assume prototypes.
11663 * src/complain.h: Assume prototypes.
11664 * src/system.h (PARAMS): Remove.
11665 Include <limits.h> unconditionally, since it's guaranteeed even
11666 for a freestanding C89 compiler.
11667 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
11668 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
11669
11670 2002-10-20 Akim Demaille <akim@epita.fr>
11671
11672 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
11673 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
11674 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
11675 (yyresolveStates, yyresolveAction, yyresolveStack)
11676 (yyprocessOneStack): Use them.
11677 (yy_reduce_print): New.
11678 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
11679
11680 2002-10-20 Akim Demaille <akim@epita.fr>
11681
11682 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
11683 arguments and output `void'.
11684 (b4_c_function): Rename as...
11685 (b4_c_function_def): this.
11686 (b4_c_function_decl, b4_c_ansi_function_def)
11687 (b4_c_ansi_function_decl): New.
11688 Change the interpretation of the arguments: before `int, foo', now
11689 `int foo, foo'.
11690 * data/yacc.c (yyparse): Prototype and define thanks to these.
11691 Adjust b4_c_function_def uses.
11692 * data/glr.c (yyparse): Likewise, but ANSI only.
11693
11694 2002-10-20 Akim Demaille <akim@epita.fr>
11695
11696 * src/output.c (prepare): Move the definition of `tokens_number',
11697 `nterms_number', `undef_token_number', `user_token_number_max'
11698 to...
11699 (prepare_tokens): Here.
11700 (prepare_tokens): Rename as...
11701 (prepare_symbols): this.
11702 (prepare): Move the definition of `rules_number' to...
11703 (prepare_rules): here.
11704 (prepare): Move the definition of `last', `final_state_number',
11705 `states_number' to...
11706 (prepare_states): here.
11707 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
11708
11709 2002-10-20 Akim Demaille <akim@epita.fr>
11710
11711 * src/tables.h, src/tables.c, src/output.c: Comment changes.
11712
11713 2002-10-20 Akim Demaille <akim@epita.fr>
11714
11715 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
11716 * data/c.m4: here.
11717
11718 2002-10-20 Akim Demaille <akim@epita.fr>
11719
11720 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
11721 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
11722 `pair'.
11723 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
11724 `name' to...
11725 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
11726 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
11727 These.
11728
11729 2002-10-19 Paul Eggert <eggert@twinsun.com>
11730
11731 Do not create a temporary file, as that involves security and
11732 cleanup headaches. Instead, use a pair of pipes.
11733 Derived from a suggestion by Florian Krohm.
11734 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
11735 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
11736 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
11737 (BISON_PREREQ_SUBPIPE): Add.
11738 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
11739 Add subpipe.h, subpipe.c.
11740 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
11741 * po/POTFILES.in: Add lib/subpipe.c.
11742 * src/output.c: Include "subpipe.h".
11743 (m4_invoke): Remove decl.
11744 (scan_skel): New decl.
11745 (output_skeleton): Use pipe rather than temporary file for m4 input.
11746 Check that m4sugar.m4 is readable, to avoid deadlock.
11747 Check for pipe I/O error.
11748 * src/scan-skel.l (readpipe): Remove decl.
11749 (scan_skel): New function, to be used in place of m4_invoke.
11750 Read from stream rather than file.
11751
11752 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
11753 float, as this generates a warning on Solaris 8 + GCC 3.2 with
11754 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
11755 this generates a more-accurate value anyway.
11756
11757 * lib/timevar.c (timervar_accumulate): Rename locals to
11758 avoid confusion with similarly-named more-global.
11759 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
11760
11761 * src/output.c (prepare): Use xstrdup to convert char const *
11762 to char *, to avoid GCC warning.
11763
11764 2002-10-19 Akim Demaille <akim@epita.fr>
11765
11766 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
11767 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
11768 Use them to have `calc.y' ready for %pure-parser.
11769 * data/yacc.c (YYLEX): Pass a yylex return type to
11770 b4_c_function_call.
11771
11772 2002-10-19 Akim Demaille <akim@epita.fr>
11773
11774 Prototype support of %lex-param and %parse-param.
11775
11776 * src/parse-gram.y: Add the definition of the %lex-param and
11777 %parse-param tokens, plus their rules.
11778 Drop the `_' version of %glr-parser.
11779 Add the "," token.
11780 * src/scan-gram.l (INITIAL): Scan them.
11781 * src/muscle_tab.c: Comment changes.
11782 (muscle_insert, muscle_find): Rename `pair' as `probe'.
11783 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
11784 (muscle_entry_s): The `value' member is no longer const.
11785 Adjust all dependencies.
11786 * src/muscle_tab.c (muscle_init): Adjust: use
11787 MUSCLE_INSERT_STRING.
11788 Initialize the obstack earlier.
11789 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
11790 (muscle_pair_list_grow): New.
11791 * data/c.m4 (b4_c_function_call, b4_c_args): New.
11792 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
11793 * tests/calc.at: Use %locations, not --locations.
11794 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
11795
11796 2002-10-19 Akim Demaille <akim@epita.fr>
11797
11798 * src/getargs.c (usage): Take status as argument and exit
11799 accordingly.
11800 Report the traditional `Try ... --help' message when status != 0.
11801 (usage, version): Don't take a FILE * as arg, it is pointless.
11802 (getargs): When there is an incorrect number of arguments, make it
11803 an error, and report it GNUlically thanks to `usage ()'.
11804
11805 2002-10-18 Paul Eggert <eggert@twinsun.com>
11806
11807 * data/glr.c (yyreportParseError): Don't assume that sprintf
11808 yields the length of the printed string, as this is not true
11809 on SunOS 4.1.4. Reported by Peter Klein.
11810
11811 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
11812 * tests/conflicts.at (%nonassoc and eof): Likewise.
11813 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
11814
11815 2002-10-17 Akim Demaille <akim@epita.fr>
11816
11817 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
11818 * src/getargs.c (trace_types, trace_args): Adjust.
11819 * src/reader.c (grammar_current_rule_prec_set)
11820 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
11821 Standardize error messages.
11822 And s/@prec/%prec/!
11823 (reader): Use trace_flag to enable scanner/parser debugging,
11824 instead of an adhoc scheme.
11825 * src/scan-gram.l: Remove trailing debugging code.
11826
11827 2002-10-16 Paul Eggert <eggert@twinsun.com>
11828
11829 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11830 MUSCLE_TAB_H.
11831
11832 * NEWS: Officially drop support for building Bison with K&R C,
11833 since it didn't work anyway and it's not worth worrying about.
11834 * Makefile.maint (wget_files): Remove ansi2knr.c.
11835 (ansi2knr.c-url_prefix): Remove.
11836 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11837 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11838 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11839
11840 2002-10-15 Paul Eggert <eggert@twinsun.com>
11841
11842 Stop using the "enum_" trick for K&R-style function definitions;
11843 it confused me, and I was the author! Instead, assume that people
11844 who want to use K&R C compilers (when using these modules in GCC,
11845 perhaps?) will run ansi2knr.
11846
11847 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11848 All uses of "enum_" changed to "enum ".
11849 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11850 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11851
11852 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11853 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11854 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11855 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11856 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11857 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11858 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11859 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11860 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11861 Use function prototypes; this removes the need for declaring
11862 static functions simply to provide their prototypes.
11863 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11864 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11865 bitset_count_, bitset_create, bitset_dump, bitset_first,
11866 bitset_free, bitset_init, bitset_last, bitset_next,
11867 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11868 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11869 bitset_print, bitset_release_memory, bitset_toggle_,
11870 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11871 debug_bitset): Likewise.
11872 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11873 * lib/bitset_stats.c (bitset_log_histogram_print,
11874 bitset_percent_histogram_print, bitset_stats_and,
11875 bitset_stats_and_cmp, bitset_stats_and_or,
11876 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11877 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11878 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11879 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11880 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11881 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11882 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11883 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11884 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11885 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11886 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11887 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11888 bitset_stats_zero): Likewise.
11889 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11890 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11891 bitsetv_dump, debug_bitsetv): Likewise.
11892 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11893 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11894 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11895 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11896 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11897 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11898 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11899 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11900 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11901 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11902 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11903 Likewise.
11904 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11905 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11906 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11907 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11908 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11909 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11910 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11911 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11912 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11913 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11914 lbitset_xor_cmp, lbitset_zero): Likewise.
11915
11916 2002-10-14 Akim Demaille <akim@epita.fr>
11917
11918 Version 1.75.
11919
11920 2002-10-14 Akim Demaille <akim@epita.fr>
11921
11922 * tests/Makefile.am (maintainer-check-posix): New.
11923
11924 2002-10-14 Akim Demaille <akim@epita.fr>
11925
11926 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11927 member.
11928
11929 2002-10-14 Akim Demaille <akim@epita.fr>
11930
11931 * src/tables.c (table_ninf_remap): base -> tab.
11932 Reported by Matt Rosing.
11933
11934 2002-10-14 Paul Eggert <eggert@twinsun.com>
11935
11936 * tests/action.at, tests/calc.at, tests/conflicts.at,
11937 tests/cxx-type.at, tests/headers.at, tests/input.at,
11938 tests/regression.at, tests/synclines.at, tests/torture.at:
11939 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11940 so that the tests still work even if POSIXLY_CORRECT is set.
11941 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
11942
11943 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11944 for portability to K&R hosts. Fix typo: signed char is guaranteed
11945 only to 127, not to 128.
11946 * data/glr.c (yysigned_char): New type.
11947 * data/yacc.c (yysigned_char): Likewise.
11948 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11949
11950 2002-10-13 Paul Eggert <eggert@twinsun.com>
11951
11952 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11953 true due to limited range of data type" warning from GCC.
11954
11955 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11956 by wrapping enum yytokentype's definition inside #ifndef
11957 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11958
11959 2002-10-13 Akim Demaille <akim@epita.fr>
11960
11961 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11962 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11963
11964 2002-10-13 Akim Demaille <akim@epita.fr>
11965
11966 * Makefile.maint: Update from Autoconf 2.54.
11967 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11968
11969 2002-10-13 Akim Demaille <akim@epita.fr>
11970
11971 * src/print.c (print_state): Separate the list of solved conflicts
11972 from the other items.
11973 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11974
11975 2002-10-13 Akim Demaille <akim@epita.fr>
11976
11977 Let nondeterministic skeletons be usable with deterministic
11978 tables.
11979
11980 With the patch, GAWK compiled by GCC without -O2 passes its test
11981 suite using a GLR parser driven by LALR tables. It fails with -O2
11982 because `struct stat' gives two different answers on my machine:
11983 88 (definition of an auto var) and later 96 (memset on this var).
11984 Hence the stack is badly corrumpted. The headers inclusion is to
11985 blame: if I move the awk.h inclusion before GLR's system header
11986 inclusion, the two struct stat have the same size.
11987
11988 * src/tables.c (pack_table): Always create conflict_table.
11989 (token_actions): Always create conflict_list.
11990 * data/glr.c (YYFLAG): Remove, unused.
11991
11992 2002-10-13 Akim Demaille <akim@epita.fr>
11993
11994 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11995 (O0FLAGS): New.
11996 (VALGRIND, GXX): New.
11997 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11998 * tests/bison.in: Run $PREBISON a pre-command.
11999 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
12000 (maintainer-check-g++): New.
12001 * Makefile.am (maintainer-check): New.
12002
12003 2002-10-13 Akim Demaille <akim@epita.fr>
12004
12005 * data/glr.c: Formatting changes.
12006 Tweak some trace messages to match yacc.c's.
12007
12008 2002-10-13 Akim Demaille <akim@epita.fr>
12009
12010 GLR parsers sometimes raise parse errors instead of performing the
12011 default reduction.
12012 Reported by Charles-Henry de Boysson.
12013
12014 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
12015 check the length of the traces when %glr.
12016 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
12017 GLR's traces.
12018 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
12019 Test GLR parsers.
12020 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
12021 (yyltype): Remove the yy prefix from the member names.
12022 (yytable): Complete its comment.
12023 (yygetLRActions): Map error action number from YYTABLE from
12024 YYTABLE_NINF to 0.
12025 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
12026 (which was a bug: it should have been YYTABEL_NINF, and yet it was
12027 not satisfying as we could compare an YYACTION computed from
12028 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
12029 only value for error actions.
12030 (yyreportParseError): In verbose parse error messages, don't issue
12031 `error' in the list of expected tokens.
12032 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
12033 next action to perform to match glr.c's decoding.
12034 (yytable): Complete its comment.
12035
12036 2002-10-13 Paul Eggert <eggert@twinsun.com>
12037
12038 Fix problem reported by Henrik Grubbstroem in
12039 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
12040 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
12041 because the Bison parser reads the second action before reducing
12042 the first one.
12043 * src/scan-gram.l (rule_length): New static var.
12044 Use it to keep track of the rule length in the scanner, since
12045 we can't expect the parser to be in lock-step sync with the scanner.
12046 (handle_action_dollar, handle_action_at): Use this var.
12047 * tests/actions.at (Exotic Dollars): Test for the problem.
12048
12049 2002-10-12 Paul Eggert <eggert@twinsun.com>
12050
12051 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
12052 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
12053 Include <sys/time.h> when checking for clock_t and struct tms.
12054 Use same include order as source.
12055 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
12056 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
12057
12058 * lib/timevar.c: Update copyright date and clarify comments.
12059 (get_time) [IN_GCC]: Keep the GCC version for reference.
12060
12061 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
12062 GCC version as of today, then merge Bison's changes.
12063 Change "GCC" to "Bison" in copyright notice. timevar.def's
12064 author is Akim, so change that too.
12065
12066 * src/reader.c (grammar_current_rule_check):
12067 Don't worry about the default action if $$ is untyped.
12068 Prevents bogus warnings reported by Jim Gifford in
12069 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
12070
12071 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
12072 * data/glr.c, data/lalr1.cc, data/yacc.c:
12073 Output token definitions before the first part of user declarations.
12074 Fixes compatibility problem reported by Jim Gifford for kbd in
12075 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
12076
12077 2002-10-11 Paul Eggert <eggert@twinsun.com>
12078
12079 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
12080 (yyparse): here. This undoes some of the 2002-07-25 change.
12081 Compatibility problem reported by Ralf S. Engelschall with
12082 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
12083
12084 2002-10-11 Akim Demaille <akim@epita.fr>
12085
12086 * tests/regression.at Characters Escapes): New.
12087 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
12088 characters.
12089 Reported by Jan Nieuwenhuizen.
12090
12091 2002-10-11 Akim Demaille <akim@epita.fr>
12092
12093 * po/id.po: New.
12094
12095 2002-10-10 Paul Eggert <eggert@twinsun.com>
12096
12097 Portability fixes for bitsets; this also avoids several GCC
12098 warnings.
12099
12100 * lib/abitset.c: Include <stddef.h>, for offsetof.
12101 * lib/lbitset.c: Likewise.
12102
12103 * lib/abitset.c (abitset_bytes): Return a size that is aligned
12104 properly for vectors of objects. Do not assume that adding a
12105 header size to a multiple of a word size yields a value that is
12106 properly aligned for the whole union.
12107 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12108
12109 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
12110 unique names for structures.
12111 * lib/ebitset.c (ebitset_bytes): Likewise.
12112 * lib/lbitset.c (lbitset_bytes): Likewise.
12113
12114 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
12115 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
12116 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
12117 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
12118 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
12119 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
12120 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
12121 to improve the type-checking that GCC can do.
12122 * lib/bitset.c (bitset_op4_cmp): Likewise.
12123 * lib/bitset_stats.c (bitset_stats_count,
12124 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
12125 bitset_stats_copy, bitset_stats_disjoint_p,
12126 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
12127 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
12128 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
12129 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
12130 bitset_stats_and_or_cmp, bitset_stats_andn_or,
12131 bitset_stats_andn_or_cmp, bitset_stats_or_and,
12132 bitset_stats_or_and_cmp): Likewise.
12133 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
12134 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
12135 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
12136 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
12137
12138 * lib/abitset.h: Include bitset.h, not bbitset.h.
12139 * lib/ebitset.h: Likewise.
12140 * lib/lbitset.h: Likewise.
12141
12142 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
12143 All instances of parameters of type enum bitset_opts are now of
12144 type enum_bitset_opts, to conform to the C Standard, and similarly
12145 for enum_bitset_type.
12146 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
12147 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
12148
12149 Do not use "struct bitset_struct" to mean different things in
12150 different modules. Not only is this confusing, it violates
12151 the C Standard, which requires that structure types in different
12152 modules must be compatible if one is to be passed to the other.
12153 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
12154 All instances of "struct bitset_struct *" replaced with "bitset".
12155 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
12156 (union bitset_union, struct abitset_struct, struct ebitset_struct,
12157 struct lbitset_struct, struct bitset_stats_struct): New types.
12158 All uses of struct bitset_struct changed to union bitset_union,
12159 etc.
12160 * lib/abitset.c (struct abitset_struct, abitset,
12161 struct bitset_struct): Remove.
12162 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
12163 struct bitset_struct): Remove.
12164 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
12165 bitset_struct): Remove.
12166 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
12167 Likewise.
12168
12169 Do not call a function of type T using a call that assumes the
12170 function is of a different type U. Standard C requires that a
12171 function must be called with a type that is compatible with its
12172 definition.
12173 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12174 New decls.
12175 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12176 New functions.
12177 * lib/ebitset.c (PFV): Remove.
12178 * lib/lbitset.c (PFV): Likewise.
12179 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
12180 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
12181 decls.
12182 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
12183 (ebitset_vtable): Use them.
12184 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
12185 lbitset_xor): New functions.
12186 (lbitset_vtable): Use them.
12187
12188 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
12189 Declare.
12190
12191 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
12192 GCC warning.
12193 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
12194 Use offsetof, for simplicity.
12195
12196 2002-10-06 Paul Eggert <eggert@twinsun.com>
12197
12198 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
12199 the same width as int. This reapplies a hunk of the 2002-08-12 patch
12200 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
12201 which was inadvertently undone by the 2002-09-30 patch.
12202 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
12203 the same width as int.
12204
12205 2002-10-04 Paul Eggert <eggert@twinsun.com>
12206
12207 Version 1.50.
12208
12209 * configure.ac (AC_INIT), NEWS: Increment version number.
12210
12211 * doc/bison.texinfo: Minor spelling, grammar, and white space
12212 fixes.
12213 (Symbols): Mention that any negative value returned from yylex
12214 signifies end-of-input. Warn about negative chars. Mention
12215 the portable Standard C character set.
12216
12217 The GNU coding standard says CFLAGS and YFLAGS are reserved
12218 for the installer to set.
12219 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
12220 * src/Makefile.am (AM_CFLAGS): Likewise.
12221 (AM_YFLAGS): Renamed from YFLAGS.
12222
12223 Fix some MAX and MIN problems.
12224 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
12225 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
12226 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
12227 * src/reader.c (reader): Use it.
12228
12229 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
12230 POSIX 1003.1-2001 has removed fgrep.
12231
12232 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
12233
12234 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
12235 interpreted as signed.
12236 * lib/ebitset.c (ebitset_list): Fix bug.
12237
12238 2002-10-01 Paul Eggert <eggert@twinsun.com>
12239
12240 More fixes for 64-bit hosts and large bitsets.
12241
12242 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
12243 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
12244 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
12245 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
12246 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
12247 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
12248 bitset_count_): Likewise.
12249 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
12250 bitset_first, bitset_last): Likewise.
12251 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
12252 bitset_stats_list_reverse, bitset_stats_size,
12253 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
12254 Likewise.
12255 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12256 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12257 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12258 bitsetv_reflexive_transitive_closure): Likewise.
12259 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
12260 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
12261 Likewise.
12262 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
12263 Likewise.
12264
12265 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
12266 Use size_t, not unsigned int, to count bytes.
12267 * lib/abitset.h (abitset_bytes): Likewise.
12268 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
12269 Likewise.
12270 * lib/bitset.h (bitset_bytes): Likewise.
12271 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
12272 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
12273 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12274 * lib/ebitset.c (ebitset_bytes): Likewise.
12275 * lib/ebitset.h (ebitset_bytes): Likewise.
12276 * lib/lbitset.c (lbitset_bytes): Likewise.
12277 * lib/lbitset.h (lbitset_bytes): Likewise.
12278
12279 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
12280 abitset_subset_p, abitset_disjoint_p, abitset_and,
12281 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
12282 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
12283 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
12284 abitset_or_and, abitset_or_and_cmp):
12285 Use bitset_windex instead of unsigned int.
12286 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12287 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
12288 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
12289 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
12290 Likewise.
12291 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
12292
12293 * lib/bitset.c (bitset_print):
12294 Use proper printf formats for widths of integer types.
12295 * lib/bitset_stats.c (bitset_percent_histogram_print,
12296 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
12297 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12298 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12299 * lib/lbitset.c (lbitset_bytes): Likewise.
12300
12301 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
12302 BITSET_SIZE_MAX): New macros.
12303 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
12304 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
12305 to BITSET_WINDEX_MAX.
12306
12307 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
12308 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
12309 since we now return the bitset_bindex type (not int).
12310
12311 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
12312 when computing sizes.
12313 * lib/ebitset.c (ebitset_elts_grow): Likewise.
12314
12315 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
12316 and avoid cast to unsigned.
12317
12318 2002-09-30 Akim Demaille <akim@epita.fr>
12319
12320 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12321 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
12322 Updates from Michael Hayes.
12323
12324 2002-09-30 Art Haas <ahaas@neosoft.com>
12325
12326 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
12327 invocations.
12328 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
12329 defined.
12330
12331 2002-09-27 Akim Demaille <akim@epita.fr>
12332
12333 Version 1.49c.
12334
12335 2002-09-27 Akim Demaille <akim@epita.fr>
12336
12337 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
12338 (Because of AC_LIBSOURCE).
12339
12340 2002-09-27 Akim Demaille <akim@epita.fr>
12341
12342 Playing with Autoscan.
12343
12344 * configure.ac: Remove the old LIBOBJ tweaks.
12345 (AC_REPLACE_FUNCS): Add strrchr and strtol.
12346 * lib/strrchr.c: New.
12347 * lib/strtol.c: New, from the Coreutils 4.5.1.
12348
12349 2002-09-27 Akim Demaille <akim@epita.fr>
12350
12351 Playing with Autoscan.
12352
12353 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
12354 * lib/Makefile.am (libbison_a_SOURCES): No longer include
12355 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
12356 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
12357 Coreutils 4.5.1.
12358
12359 2002-09-24 Akim Demaille <akim@epita.fr>
12360
12361 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
12362 (Frequently Asked Questions, Parser Stack Overflow): New.
12363
12364 2002-09-13 Akim Demaille <akim@epita.fr>
12365
12366 Playing with autoscan.
12367
12368 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
12369 * src/files.c (skeleton_find): Remove, unused.
12370 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
12371 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
12372
12373 2002-09-13 Akim Demaille <akim@epita.fr>
12374
12375 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
12376 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
12377
12378 2002-09-13 Akim Demaille <akim@epita.fr>
12379
12380 * configure.ac: Require 2.54.
12381 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
12382 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
12383 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
12384 Remove, provided by Autoconf macros.
12385
12386 2002-09-12 Akim Demaille <akim@epita.fr>
12387
12388 * m4/prereq.m4: Update, from Coreutils 4.5.1.
12389
12390 2002-09-12 Akim Demaille <akim@epita.fr>
12391
12392 * m4/prereq.m4: Update, from Fileutils 4.1.5.
12393 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
12394 Reported by Martin Mokrejs.
12395
12396 2002-09-10 Akim Demaille <akim@epita.fr>
12397
12398 * src/parse-gram.y: Associate a human readable string to each
12399 token type.
12400 * tests/regression.at (Invalid inputs): Adjust.
12401
12402 2002-09-10 Gary V. Vaughan <gary@gnu.org>
12403
12404 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
12405 with an Autoconf-2.5x style configure.ac.
12406
12407 2002-09-06 Paul Eggert <eggert@twinsun.com>
12408
12409 * doc/bison.texinfo (Conditions): Make explicit that the GPL
12410 exception applies only to yacc.c. This is a modification of a
12411 patch originally suggested by Akim Demaille.
12412
12413 2002-09-06 Akim Demaille <akim@epita.fr>
12414
12415 * data/c.m4 (b4_copyright): Move the GPL exception comment from
12416 here to...
12417 * data/yacc.c: here.
12418
12419 * data/lalr1.cc (struct yyltype): Don't define it, since we use
12420 LocationType.
12421 (b4_ltype): Default to yy::Location from location.hh.
12422
12423 2002-09-04 Jim Meyering <jim@meyering.net>
12424
12425 * data/yacc.c: Guard the declaration of yytoknum also with
12426 `#ifdef YYPRINT', so it is declared only when used.
12427
12428 2002-09-04 Akim Demaille <akim@epita.fr>
12429
12430 * configure.in: Rename as...
12431 * configure.ac: this.
12432 Bump to 1.49c.
12433
12434 2002-09-04 Akim Demaille <akim@epita.fr>
12435
12436 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
12437 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
12438 translate maintainer only messages.
12439
12440 2002-08-12 Paul Eggert <eggert@twinsun.com>
12441
12442 Version 1.49b.
12443
12444 * Makefile.am (SUBDIRS): Remove intl.
12445 (DISTCLEANFILES): Remove.
12446 * NEWS: Mention that GNU M4 is now required. Clarify what is
12447 meant by "larger grammars". Mention the pt_BR translation.
12448 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
12449 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
12450 Bump version from 0.11.2 to 0.11.5.
12451 (BISON_PREREQ_STAGE): Remove.
12452 (AM_GNU_GETTEXT): Use external gettext.
12453 (AC_OUTPUT): Remove intl/Makefile.
12454
12455 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
12456
12457 * data/glr.c: Include string.h, for strlen.
12458 (yyreportParseError): Use size_t for yysize.
12459 (yy_yypstack): No longer nested inside yypstates, as nested
12460 functions are not portable. Do not assume size_t is the
12461 same width as int.
12462 (yypstates): Do not assume that ptrdiff_t is the same width
12463 as int, and similarly for yyposn and YYINDEX.
12464
12465 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
12466
12467 * lib/Makefile.am (INCLUDES): Do not include from the intl
12468 directory, which has been removed.
12469 * src/Makefile.am (INCLUDES): Likewise.
12470
12471 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
12472 (bitsets_sources, additional_bitsets_sources, timevars_sources):
12473 New vars.
12474
12475 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
12476 * tests/Makefile.am (EXTRA_DIST): Likewise.
12477
12478 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
12479 Do not assume that bitset_windex is the same width as unsigned.
12480
12481 * lib/abitset.c (abitset_unused_clear): Do not assume that
12482 bitset_word is the same width as int.
12483 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
12484 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
12485 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
12486 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
12487 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
12488
12489 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
12490 portability to one's complement hosts!).
12491 * lib/ebitset.c (ebitset_op1): Likewise.
12492 * lib/lbitset.c (lbitset_op1): Likewise.
12493
12494 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
12495 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12496 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
12497 Sync with fileutils.
12498 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
12499 lib/gettext.h: Sync with diffutils.
12500
12501 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
12502 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
12503
12504 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
12505 PROTOTYPES to check for prototypes, and "defined __STDC__" to
12506 check for void *.
12507
12508 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
12509 size_t; the old version tried to do this but casted improperly.
12510 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
12511 (bitset_test): Now returns int, not unsigned long.
12512
12513 * lib/bitset_stats.c: Include "gettext.h".
12514 (_): New macro.
12515 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
12516 name locals "index", as it generates unnecessary warnings on some
12517 hosts that have an "index" function.
12518
12519 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
12520 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
12521 they need translation.
12522 * src/LR0.c (state_list_append, new_itemsets, get_state,
12523 append_states, generate_states): Likewise.
12524 * src/assoc.c (assoc_to_string): Likewise.
12525 * src/closure.c (print_closure, set_firsts, closure): Likewise.
12526 * src/gram.c (grammar_dump): Likewise.
12527 * src/injections.c (injections_compute): Likewise.
12528 * src/lalr.c (lookaheads_print): Likewise.
12529 * src/relation.c (relation_transpose): Likewise.
12530 * src/scan-gram.l: Likewise.
12531 * src/tables.c (table_grow, pack_vector): Likewise.
12532
12533 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
12534 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
12535 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
12536 * m4/mbstate_t.m4: Sync with fileutils.
12537 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
12538
12539 * po/LINGUAS: Add pt_BR.
12540 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
12541 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
12542 lib/timevar.c.
12543 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
12544 manual recommends.
12545 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
12546
12547 * src/complain.c (strerror_r): Remove decl; not needed.
12548 (strerror): Use same pattern as ../lib/error.c.
12549
12550 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
12551
12552 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
12553
12554 * src/main.c (main): Cast result of bindtextdomain and textdomain
12555 to void, to avoid a GCC warning when --disable-nls is in effect.
12556
12557 * src/scan-gram.l: Use strings rather than escapes when possible,
12558 to minimize the number of warnings from xgettext.
12559 (handle_action_dollar, handle_action_at): Don't use isdigit,
12560 as it mishandles negative chars and it may not work as expected
12561 outside the C locale.
12562
12563 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
12564 this is a GCC extension and is not portable to other compilers.
12565
12566 * src/system.h (alloca): Use same pattern as ../lib/error.c.
12567 Do not include <ctype.h>; no longer needed.
12568 Do not include <malloc.h>; no longer needed (and generates
12569 warnings on OpenBSD 3.0).
12570
12571 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
12572 it's not portable.
12573
12574 * tests/regression.at: Do not use 'cc -c input.c -o input';
12575 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
12576
12577 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
12578 exit status as failure, not just exit status 1. Sun C exits
12579 with status 2 sometimes.
12580
12581 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
12582 Use it for the two large tests.
12583
12584 2002-08-02 Akim Demaille <akim@epita.fr>
12585
12586 * src/conflicts.c (conflicts_output): Don't output rules never
12587 reduced here, since anyway that computation doesn't work.
12588 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
12589 (rule_useless_p, rule_never_reduced_p): New.
12590 (grammar_rules_partial_print): Use a filter instead of a range.
12591 Display the title only if needed.
12592 (grammar_rules_print): Adjust.
12593 (grammar_rules_never_reduced_report): New.
12594 * src/tables.c (action_row): Move the computation of rules never
12595 reduced to...
12596 (token_actions): here.
12597 * src/main.c (main): Make the parser before making the report, so
12598 that rules never reduced are computed.
12599 Call grammar_rules_never_reduced_report.
12600 * src/print.c (print_results): Report rules never reduced.
12601 * tests/conflicts.at, tests/reduce.at: Adjust.
12602
12603 2002-08-01 Akim Demaille <akim@epita.fr>
12604
12605 Instead of attaching lookaheads and duplicating the rules being
12606 reduced by a state, attach the lookaheads to the reductions.
12607
12608 * src/state.h (state_t): Remove the `lookaheads',
12609 `lookaheads_rule' member.
12610 (reductions_t): Add a `lookaheads' member.
12611 Use a regular array for the `rules'.
12612 * src/state.c (reductions_new): Initialize the lookaheads member
12613 to 0.
12614 (state_rule_lookaheads_print): Adjust.
12615 * src/state.h, src/state.c (state_reductions_find): New.
12616 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
12617 (count_rr_conflicts): Adjust.
12618 * src/lalr.c (LArule): Remove.
12619 (add_lookback_edge): Adjust.
12620 (state_lookaheads_count): New.
12621 (states_lookaheads_initialize): Merge into...
12622 (initialize_LA): this.
12623 (lalr_free): Adjust.
12624 * src/main.c (main): Don't free nullable and derives too early: it
12625 is used by --verbose.
12626 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
12627
12628 2002-08-01 Akim Demaille <akim@epita.fr>
12629
12630 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
12631 `rule_number_t**'.
12632 (set_derives, free_derives): Rename as...
12633 (derives_compute, derives_free): this.
12634 Adjust all dependencies.
12635 * src/nullable.c (set_nullable, free_nullable): Rename as...
12636 (nullable_compute, nullable_free): these.
12637 (rule_list_t): Store rule_t *, not rule_number_t.
12638 * src/state.c (state_rule_lookaheads_print): Directly compare rule
12639 pointers, instead of their numbers.
12640 * src/main.c (main): Call nullable_free, and derives_free earlier,
12641 as they were lo longer used.
12642
12643 2002-08-01 Akim Demaille <akim@epita.fr>
12644
12645 * lib/timevar.c (get_time): Include children time.
12646 * src/lalr.h (LA, LArule): Don't export them: used with the
12647 state_t.
12648 * src/lalr.c (LA, LArule): Static.
12649 * src/lalr.h, src/lalr.c (lalr_free): New.
12650 * src/main.c (main): Call it.
12651 * src/tables.c (pack_vector): Check whether loc is >= to the
12652 table_size, not >.
12653 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
12654 (tables_generate): do it, since that's also it which allocates
12655 them.
12656 Don't free LA and LArule, main does.
12657
12658 2002-07-31 Akim Demaille <akim@epita.fr>
12659
12660 Separate parser tables computation and output.
12661
12662 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
12663 (conflict_list, conflict_list_cnt, table, check, table_ninf)
12664 (yydefgoto, yydefact, high): Move to...
12665 * src/tables.h, src/tables.c: here.
12666 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12667 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12668 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
12669 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
12670 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
12671 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
12672 (action_row, save_row, token_actions, save_column, default_goto)
12673 (goto_actions, sort_actions, matching_state, pack_vector)
12674 (table_ninf_remap, pack_table, prepare_actions): Move to...
12675 * src/tables.c: here.
12676 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
12677 * src/output.c (token_actions, output_base, output_conflicts)
12678 (output_check): Merge into...
12679 (prepare_actions): this.
12680 (actions_output): Rename as...
12681 (user_actions_output): this.
12682 * src/main.c (main): Call tables_generate and tables_free.
12683
12684 2002-07-31 Akim Demaille <akim@epita.fr>
12685
12686 Steal GCC's --time-report support.
12687
12688 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
12689 stolen/adjusted from GCC.
12690 * m4/stage.m4: Remove time related checks.
12691 * m4/timevar.m4: New.
12692 * configure.in: Adjust.
12693 * src/system.h: Adjust to using timevar.h.
12694 * src/getargs.h, src/getargs.c: Support trace_time for
12695 --trace=time.
12696 * src/main.c (stage): Remove.
12697 (main): Replace `stage' invocations with timevar calls.
12698 * src/output.c: Insert pertinent timevar calls.
12699
12700 2002-07-31 Akim Demaille <akim@epita.fr>
12701
12702 Let --trace have arguments.
12703
12704 * src/getargs.h (enum trace_e): New.
12705 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
12706 (long_options, short_options): --trace/-T takes an optional
12707 argument.
12708 Change all the uses of trace_flag to reflect the new flags.
12709 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
12710
12711 Strengthen `stage' portability.
12712
12713 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
12714 * configure.in: Use it.
12715 Don't check for malloc.h and sys/times.h.
12716 * src/system.h: Include them when appropriate.
12717 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
12718 times and struct tms are available.
12719
12720 2002-07-30 Akim Demaille <akim@epita.fr>
12721
12722 In verbose parse error message, don't report `error' as an
12723 expected token.
12724 * tests/actions.at (Printers and Destructors): Adjust.
12725 * tests/calc.at (Calculator $1): Adjust.
12726 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
12727 error message, do not report the parser accepts the error token in
12728 that state.
12729
12730 2002-07-30 Akim Demaille <akim@epita.fr>
12731
12732 Normalize conflict related messages.
12733
12734 * src/complain.h, src/complain.c (warn, complain): New.
12735 * src/conflicts.c (conflicts_print): Use them.
12736 (conflict_report_yacc): New, extracted from...
12737 (conflicts_print): here.
12738 * tests/conflicts.at, tests/existing.at: Adjust.
12739
12740 2002-07-30 Akim Demaille <akim@epita.fr>
12741
12742 Report rules which are never reduced by the parser: those hidden
12743 by conflicts.
12744
12745 * src/LR0.c (save_reductions): Don't make the final state too
12746 different: save its reduction (accept) instead of having a state
12747 without any action (no shift or goto, no reduce).
12748 Note: the final state is now a ``regular'' state, i.e., the
12749 parsers now contain `reduce 0' as default reduction.
12750 Nevertheless, since they decide to `accept' when yystate =
12751 final_state, they still will not reduce rule 0.
12752 * src/print.c (print_actions, print_reduction): Adjust.
12753 * src/output.c (action_row): Track reduced rules.
12754 (token_actions): Report rules never reduced.
12755 * tests/conflicts.at, tests/regression.at: Adjust.
12756
12757 2002-07-30 Akim Demaille <akim@epita.fr>
12758
12759 `stage' was accidently included in a previous patch.
12760 Initiate its autoconfiscation.
12761
12762 * configure.in: Look for malloc.h and sys/times.h.
12763 * src/main.c (stage): Adjust.
12764 Report only when trace_flag.
12765
12766 2002-07-29 Akim Demaille <akim@epita.fr>
12767
12768 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
12769 state_number_t.
12770 (errs_t): symbol_t*, not symbol_number_t.
12771 (reductions_t): rule_t*, not rule_number_t.
12772 (FOR_EACH_SHIFT): New.
12773 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
12774 * src/print.c, src/print_graph.c: Adjust.
12775
12776 2002-07-29 Akim Demaille <akim@epita.fr>
12777
12778 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
12779
12780 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
12781 (endtoken, accept): these.
12782 * src/reader.c (reader): Set endtoken's default tag to "$end".
12783 Set undeftoken's tag to "$undefined" instead of "$undefined.".
12784 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
12785 Adjust.
12786
12787 2002-07-29 Akim Demaille <akim@epita.fr>
12788
12789 * src/reduce.c (reduce_grammar): When the language is empty,
12790 complain about the start symbol, not the axiom.
12791 Use its location.
12792 * tests/reduce.at (Empty Language): New.
12793
12794 2002-07-26 Akim Demaille <akim@epita.fr>
12795
12796 * src/reader.h, src/reader.c (gram_error): ... can't get
12797 yycontrol without making too strong assumptions on the parser
12798 itself.
12799 * src/output.c (prepare_tokens): Use the real 0th value of
12800 token_translations instead of `0'.
12801 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
12802 visible here.
12803 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
12804 for the time being: %locations ought to provide it to yyerror.
12805
12806 2002-07-25 Akim Demaille <akim@epita.fr>
12807
12808 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
12809 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
12810 * tests/regression.at (Web2c Actions): Adjust.
12811
12812 2002-07-25 Akim Demaille <akim@epita.fr>
12813
12814 Stop storing rules from 1 to nrules + 1.
12815
12816 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12817 * src/nullable.c, src/output.c, src/print.c, src/reader.c
12818 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
12819 Iterate from 0 to nrules.
12820 Use rule_number_as_item_number and item_number_as_rule_number.
12821 Adjust to `derive' now containing possibly 0.
12822 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12823 Handle the `- 1' part in rule numbers from/to item numbers.
12824 * src/conflicts.c (log_resolution): Fix the message which reversed
12825 shift and reduce.
12826 * src/output.c (action_row): Initialize default_rule to -1.
12827 (token_actions): Adjust.
12828 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
12829 expected output.
12830 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12831
12832 2002-07-25 Akim Demaille <akim@epita.fr>
12833
12834 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12835 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12836 (b4_c_knr_arg_decl): New.
12837 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12838 yyreport_parse_error.
12839
12840 2002-07-25 Akim Demaille <akim@epita.fr>
12841
12842 * data/yacc.c (yyreport_parse_error): New, extracted from...
12843 (yyparse): here.
12844 (yydestruct, yysymprint): Move above yyparse.
12845 Be K&R compliant.
12846
12847 2002-07-25 Akim Demaille <akim@epita.fr>
12848
12849 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12850 replace...
12851 (b4_sint_type, b4_uint_type): these.
12852 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12853 * tests/regression.at (Web2c Actions): Adjust.
12854
12855 2002-07-25 Akim Demaille <akim@epita.fr>
12856
12857 * src/gram.h (TIEM_NUMBER_MAX): New.
12858 (item_number_of_rule_number, rule_number_of_item_number): Rename
12859 as...
12860 (rule_number_as_item_number, item_number_as_rule_number): these.
12861 Adjust dependencies.
12862 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12863 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12864 (symbol_number_to_vector_number): New.
12865 (order): Of vector_number_t* type.
12866 (base_t, BASE_MAX, BASE_MIN): New.
12867 (froms, tos, width, pos, check): Of base_t type.
12868 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12869 (actrow): Of action_number_t type.
12870 (conflrow): Of unsigned int type.
12871 (table_ninf, base_ninf): New.
12872 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12873 (muscle_insert_int_table, muscle_insert_base_table)
12874 (muscle_insert_rule_number_table): New.
12875 (prepare_tokens): Output `toknum' as int_table.
12876 (action_row): Returns a rule_number_t.
12877 Use ACTION_MIN, not SHRT_MIN.
12878 (token_actions): yydefact is rule_number_t*.
12879 (table_ninf_remap): New.
12880 (pack_table): Use it for `base' and `table'.
12881 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12882 replaced with...
12883 (YYPACT_NINF, YYTABLE_NINF): these.
12884 (yypact, yytable): Compute their types instead of hard-coded
12885 `short'.
12886 * tests/regression.at (Web2c Actions): Adjust.
12887
12888 2002-07-19 Akim Demaille <akim@epita.fr>
12889
12890 * src/scan-gram.l (id): Can start with an underscore.
12891
12892 2002-07-16 Akim Demaille <akim@epita.fr>
12893
12894 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12895 Adjust all former `associativity' dependencies.
12896 * src/symtab.c (symbol_new): Default associativity is `undef', not
12897 `right'.
12898 (symbol_check_alias_consistence): Adjust.
12899
12900 2002-07-09 Akim Demaille <akim@epita.fr>
12901
12902 * doc/bison.texinfo: Properly set the ``header'' part.
12903 Use @dircategory ``GNU programming tools'' as per Texinfo's
12904 documentation.
12905 Use @copying.
12906
12907 2002-07-09 Akim Demaille <akim@epita.fr>
12908
12909 * lib/quotearg.h: Protect against multiple inclusions.
12910 * src/location.h (location_t): Add a `file' member.
12911 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12912 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12913 `error_one_per_line' support.
12914
12915 2002-07-09 Akim Demaille <akim@epita.fr>
12916
12917 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12918 * src/reader.c (lineno): Remove.
12919 Adjust all dependencies.
12920 (get_merge_function): Take a location and use complain_at.
12921 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12922 * tests/regression.at (Invalid inputs, Mixing %token styles):
12923 Adjust.
12924
12925 2002-07-09 Akim Demaille <akim@epita.fr>
12926
12927 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12928 recovery rule, and forbid extensions when --yacc.
12929 (gram_error): Use complain_at.
12930 * src/reader.c (reader): Exit if there were parse errors.
12931
12932 2002-07-09 Akim Demaille <akim@epita.fr>
12933
12934 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12935 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12936 Reported by R Blake <blakers@mac.com>.
12937
12938 2002-07-09 Akim Demaille <akim@epita.fr>
12939
12940 * data/yacc.c: Output the copyright notive in the header.
12941
12942 2002-07-03 Akim Demaille <akim@epita.fr>
12943
12944 * src/output.c (froms, tos): Are state_number_t.
12945 (save_column): sp, sp1, and sp2 are state_number_t.
12946 (prepare): Rename `final' as `final_state_number', `nnts' as
12947 `nterms_number', `nrules' as `rules_number', `nstates' as
12948 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12949 unused.
12950 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12951 * data/lalr1.cc (nsym_): Remove, unused.
12952
12953 2002-07-03 Akim Demaille <akim@epita.fr>
12954
12955 * src/lalr.h, src/lalr.c (goto_number_t): New.
12956 * src/lalr.c (goto_list_t): New.
12957 Propagate them.
12958 * src/nullable.c (rule_list_t): New.
12959 Propagate.
12960 * src/types.h: Remove.
12961
12962 2002-07-03 Akim Demaille <akim@epita.fr>
12963
12964 * src/closure.c (print_fderives): Use rule_rhs_print.
12965 * src/derives.c (print_derives): Use rule_rhs_print.
12966 (rule_list_t): New, replaces `shorts'.
12967 (set_derives): Add comments.
12968 * tests/sets.at (Nullable, Firsts): Adjust.
12969
12970 2002-07-03 Akim Demaille <akim@epita.fr>
12971
12972 * src/output.c (prepare_actions): Free `tally' and `width'.
12973 (prepare_actions): Allocate and free `order'.
12974 * src/symtab.c (symbols_free): Free `symbols'.
12975 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12976 * src/output.c (m4_invoke): Move to...
12977 * src/scan-skel.l: here.
12978 (<<EOF>>): Close yyout, and free its name.
12979
12980 2002-07-03 Akim Demaille <akim@epita.fr>
12981
12982 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12983
12984 * src/LR0.c (new_state): Merge into...
12985 (state_list_append): this.
12986 (new_states): Merge into...
12987 (generate_states): here.
12988 (set_states): Don't ensure a proper `errs' state member here, do it...
12989 * src/conflicts.c (conflicts_solve): here.
12990 * src/state.h, src/state.c: Comment changes.
12991 (state_t): Rename member `shifts' as `transitions'.
12992 Adjust all dependencies.
12993 (errs_new): For consistency, also take the values as argument.
12994 (errs_dup): Remove.
12995 (state_errs_set): New.
12996 (state_reductions_set, state_transitions_set): Assert that no
12997 previous value was assigned.
12998 (state_free): New.
12999 (states_free): Use it.
13000 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
13001 temporary storage: use `errs' and `nerrs' as elsewhere.
13002 (set_conflicts): Allocate and free this `errs'.
13003
13004 2002-07-02 Akim Demaille <akim@epita.fr>
13005
13006 * lib/libiberty.h: New.
13007 * lib: Update the bitset implementation from upstream.
13008 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
13009 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
13010 * src/main.c: Adjust bitset stats calls.
13011
13012 2002-07-01 Paul Eggert <eggert@twinsun.com>
13013
13014 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
13015 char, so that negative chars don't collide with $.
13016
13017 2002-06-30 Akim Demaille <akim@epita.fr>
13018
13019 Have the GLR tests be `warning' checked, and fix the warnings.
13020
13021 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
13022 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
13023 (yyremoveDeletes): `yyi' and `yyj' are size_t.
13024 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
13025 (yyaddDeferredAction): static.
13026 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
13027 (yyreportParseError): yyprefix is const.
13028 yytokenp is used only when verbose.
13029 (yy__GNUC__): Replace with __GNUC__.
13030 (yypdumpstack): yyi is size_t.
13031 (yypreference): Un-yy local variables and arguments, to avoid
13032 clashes with `yyr1'. Anyway, we are not in the user name space.
13033 (yytname_size): be an int, as is compared with ints.
13034 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
13035 Use them.
13036 * tests/cxx-gram.at: Use quotation to protect $1.
13037 Use AT_COMPILE to enable warnings hunts.
13038 Prototype yylex and yyerror.
13039 `Use' argc.
13040 Include `string.h', not `strings.h'.
13041 Produce and prototype stmtMerge only when used.
13042 yylex takes a location.
13043
13044 2002-06-30 Akim Demaille <akim@epita.fr>
13045
13046 We spend a lot of time in quotearg, in particular when --verbose.
13047
13048 * src/symtab.c (symbol_get): Store a quoted version of the key.
13049 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
13050 Adjust all callers.
13051
13052 2002-06-30 Akim Demaille <akim@epita.fr>
13053
13054 * src/state.h (reductions_t): Rename member `nreds' as num.
13055 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
13056 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
13057
13058 2002-06-30 Akim Demaille <akim@epita.fr>
13059
13060 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
13061 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
13062 (shifts_to): Rename as...
13063 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
13064 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
13065 (TRANSITION_IS_DISABLED, transitions_to): these.
13066
13067 2002-06-30 Akim Demaille <akim@epita.fr>
13068
13069 * src/print.c (print_shifts, print_gotos): Merge into...
13070 (print_transitions): this.
13071 (print_transitions, print_errs, print_reductions): Align the
13072 lookaheads columns.
13073 (print_core, print_transitions, print_errs, print_state,
13074 print_grammar): Output empty lines separator before, not after.
13075 (state_default_rule_compute): Rename as...
13076 (state_default_rule): this.
13077 * tests/conflicts.at (Defaulted Conflicted Reduction),
13078 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
13079 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
13080
13081 2002-06-30 Akim Demaille <akim@epita.fr>
13082
13083 Display items as we display rules.
13084
13085 * src/gram.h, src/gram.c (rule_lhs_print): New.
13086 * src/gram.c (grammar_rules_partial_print): Use it.
13087 * src/print.c (print_core): Likewise.
13088 * tests/conflicts.at (Defaulted Conflicted Reduction),
13089 (Unresolved SR Conflicts): Adjust.
13090 (Unresolved SR Conflicts): Adjust and rename as...
13091 (Resolved SR Conflicts): this, as was meant.
13092 * tests/regression.at (Web2c Report): Adjust.
13093
13094 2002-06-30 Akim Demaille <akim@epita.fr>
13095
13096 * src/print.c (state_default_rule_compute): New, extracted from...
13097 (print_reductions): here.
13098 Pessimize, but clarify the code.
13099 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
13100
13101 2002-06-30 Akim Demaille <akim@epita.fr>
13102
13103 * src/output.c (action_row): Let default_rule be always a rule
13104 number.
13105
13106 2002-06-30 Akim Demaille <akim@epita.fr>
13107
13108 * src/closure.c (print_firsts, print_fderives, closure):
13109 Use BITSET_EXECUTE.
13110 * src/lalr.c (lookaheads_print): Likewise.
13111 * src/state.c (state_rule_lookaheads_print): Likewise.
13112 * src/print_graph.c (print_core): Likewise.
13113 * src/print.c (print_reductions): Likewise.
13114 * src/output.c (action_row): Likewise.
13115 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
13116
13117 2002-06-30 Akim Demaille <akim@epita.fr>
13118
13119 * src/print_graph.c: Use report_flag.
13120
13121 2002-06-30 Akim Demaille <akim@epita.fr>
13122
13123 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
13124 to...
13125 * src/relation.h, src/relation.c (traverse, relation_digraph)
13126 (relation_print, relation_transpose): New.
13127
13128 2002-06-30 Akim Demaille <akim@epita.fr>
13129
13130 * src/state.h, src/state.c (shifts_to): New.
13131 * src/lalr.c (build_relations): Use it.
13132
13133 2002-06-30 Akim Demaille <akim@epita.fr>
13134
13135 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
13136 (item_number_of_rule_number, rule_number_of_item_number): New.
13137 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
13138 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
13139 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
13140 Propagate their use.
13141 Much remains to be done, in particular wrt `shorts' from types.h.
13142
13143 2002-06-30 Akim Demaille <akim@epita.fr>
13144
13145 * src/symtab.c (symbol_new): Initialize the `printer' member.
13146
13147 2002-06-30 Akim Demaille <akim@epita.fr>
13148
13149 * src/LR0.c (save_reductions): Remove, replaced by...
13150 * src/state.h, src/state.c (state_reductions_set): New.
13151 (reductions, errs): Rename as...
13152 (reductions_t, errs_t): these.
13153 Adjust all dependencies.
13154
13155 2002-06-30 Akim Demaille <akim@epita.fr>
13156
13157 * src/LR0.c (state_list_t, state_list_append): New.
13158 (first_state, last_state): Now symbol_list_t.
13159 (this_state): Remove.
13160 (new_itemsets, append_states, save_reductions): Take a state_t as
13161 argument.
13162 (set_states, generate_states): Adjust.
13163 (save_shifts): Remove, replaced by...
13164 * src/state.h, src/state.c (state_shifts_set): New.
13165 (shifts): Rename as...
13166 (shifts_t): this.
13167 Adjust all dependencies.
13168 * src/state.h (state_t): Remove the `next' member.
13169
13170 2002-06-30 Akim Demaille <akim@epita.fr>
13171
13172 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
13173 escaped in slot 0.
13174
13175 2002-06-30 Akim Demaille <akim@epita.fr>
13176
13177 Use hash.h for the state hash table.
13178
13179 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
13180 (allocate_storage): Use state_hash_new.
13181 (free_storage): Use state_hash_free.
13182 (new_state, get_state): Adjust.
13183 * src/lalr.h, src/lalr.c (states): Move to...
13184 * src/states.h (state_t): Remove the `link' member, no longer
13185 used.
13186 * src/states.h, src/states.c: here.
13187 (state_hash_new, state_hash_free, state_hash_lookup)
13188 (state_hash_insert, states_free): New.
13189 * src/states.c (state_table, state_compare, state_hash): New.
13190 * src/output.c (output_actions): Do not free states now, since we
13191 still need to know the final_state number in `prepare', called
13192 afterwards. Do it...
13193 * src/main.c (main): here: call states_free after `output'.
13194
13195 2002-06-30 Akim Demaille <akim@epita.fr>
13196
13197 * src/state.h, src/state.c (state_new): New, extracted from...
13198 * src/LR0.c (new_state): here.
13199 * src/state.h (STATE_ALLOC): Move to...
13200 * src/state.c: here.
13201 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
13202 * src/state.h, src/state.c: here.
13203
13204 2002-06-30 Akim Demaille <akim@epita.fr>
13205
13206 * src/reader.c (gensym): Rename as...
13207 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
13208 (getsym): Rename as...
13209 (symbol_get): this.
13210
13211 2002-06-30 Akim Demaille <akim@epita.fr>
13212
13213 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
13214 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
13215 * src/output.c, src/print.c, src/print_graph.c: Propagate.
13216 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
13217
13218 2002-06-30 Akim Demaille <akim@epita.fr>
13219
13220 Make the test suite pass with warnings checked.
13221
13222 * tests/actions.at (Printers and Destructors): Improve.
13223 Avoid unsigned vs. signed issues.
13224 * tests/calc.at: Don't exercise the scanner here, do it...
13225 * tests/input.at (Torturing the Scanner): here.
13226
13227 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13228
13229 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
13230 reorganize first lines parallel to yacc.c.
13231
13232 2002-06-28 Akim Demaille <akim@epita.fr>
13233
13234 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
13235 (b4_token_enum, b4_token_defines): New, factored from...
13236 * data/lalr1.cc, data/yacc.c, glr.c: here.
13237
13238 2002-06-28 Akim Demaille <akim@epita.fr>
13239
13240 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
13241 unused variables.
13242 * src/output.c (merger_output): static.
13243
13244 2002-06-28 Akim Demaille <akim@epita.fr>
13245
13246 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
13247 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
13248 pacify GCC.
13249 * src/output.c (save_row): Initialize all the variables to pacify GCC.
13250
13251 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13252
13253 Accumulated changelog for new GLR parsing features.
13254
13255 * src/conflicts.c (count_total_conflicts): Change name to
13256 conflicts_total_count.
13257 * src/conflicts.h: Ditto.
13258 * src/output.c (token_actions): Use the new name.
13259 (output_conflicts): Change conflp => conflict_list_heads, and
13260 confl => conflict_list for better readability.
13261 * data/glr.c: Use the new names.
13262 * NEWS: Add self to GLR announcement.
13263
13264 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
13265
13266 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
13267 Akim Demaille.
13268
13269 * data/bison.glr: Change name to glr.c
13270 * data/glr.c: Renamed from bison.glr.
13271 * data/Makefile.am: Add glr.c
13272
13273 * src/getargs.c:
13274
13275 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
13276 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
13277
13278 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13279
13280 * data/bison.glr: Be sure to restore the
13281 current #line when returning to the skeleton contents after having
13282 exposed the input file's #line.
13283
13284 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13285
13286 * data/bison.glr: Bring up to date with changes to bison.simple.
13287
13288 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13289
13290 * data/bison.glr: Correct definitions that use b4_prefix.
13291 Various reformatting.
13292 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
13293 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
13294 yytokenp argument; now part of stack.
13295 (yychar): Define to behave as documented.
13296 (yyclearin): Ditto.
13297
13298 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13299
13300 * src/reader.h: Add declaration for free_merger_functions.
13301
13302 * src/reader.c (merge_functions): New variable.
13303 (get_merge_function): New function.
13304 (free_merger_functions): New function.
13305 (readgram): Check for %prec that is not followed by a symbol.
13306 Handle %dprec and %merge declarations.
13307 (packgram): Initialize dprec and merger fields in rules array.
13308
13309 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
13310 conflict_list_cnt, conflict_list_free): New variables.
13311 (table_grow): Also grow conflict_table.
13312 (prepare_rules): Output dprec and merger tables.
13313 (conflict_row): New function.
13314 (action_row): Output conflict lists for GLR parser. Don't use
13315 default reduction in conflicted states for GLR parser so that there
13316 are spaces for the conflict lists.
13317 (save_row): Also save conflict information.
13318 (token_actions): Allocate conflict list.
13319 (merger_output): New function.
13320 (pack_vector): Pack conflict table, too.
13321 (output_conflicts): New function to output yyconflp and yyconfl.
13322 (output_check): Allocate conflict_tos.
13323 (output_actions): Output conflict tables, also.
13324 (output_skeleton): Output b4_mergers definition.
13325 (prepare): Output b4_max_rhs_length definition.
13326 Use 'bison.glr' as default skeleton for GLR parsers.
13327
13328 * src/gram.c (glr_parser): New flag.
13329 (grammar_free): Call free_merger_functions.
13330
13331 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
13332 all pairs of conflicting reductions, rather than just all tokens
13333 causing conflicts. Needed to size conflict tables.
13334 (conflicts_output): Modify call to count_rr_conflicts for new
13335 interface.
13336 (conflicts_print): Ditto.
13337 (count_total_conflicts): New function.
13338
13339 * src/reader.h (merger_list): New type.
13340 (merge_functions): New variable.
13341
13342 * src/lex.h (tok_dprec, tok_merge): New token types.
13343
13344 * src/gram.h (rule_s): Add dprec and merger fields.
13345 (glr_parser): New flag.
13346
13347 * src/conflicts.h (count_total_conflicts): New function.
13348
13349 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
13350
13351 * doc/bison.texinfo (Generalized LR Parsing): New section.
13352 (GLR Parsers): New section.
13353 (Language and Grammar): Mention GLR parsing.
13354 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
13355 Correct typo ("tge" -> "the").
13356
13357 * data/bison.glr: New skeleton for GLR parsing.
13358
13359 * tests/cxx-gram.at: New tests for GLR parsing.
13360
13361 * tests/testsuite.at: Include cxx-gram.at.
13362
13363 * tests/Makefile.am: Add cxx-gram.at.
13364
13365 * src/parse-gram.y:
13366
13367 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
13368
13369 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
13370
13371 2002-06-27 Akim Demaille <akim@epita.fr>
13372
13373 * src/options.h, src/options.c: Remove.
13374 * src/getargs.c (short_options, long_options): New.
13375
13376 2002-06-27 Akim Demaille <akim@epita.fr>
13377
13378 * data/bison.simple, data/bison.c++: Rename as...
13379 * data/yacc.c, data/lalr1.cc: these.
13380 * doc/bison.texinfo (Environment Variables): Remove.
13381
13382 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
13383
13384 * src/getargs.c (report_argmatch): Initialize strtok().
13385
13386 2002-06-20 Akim Demaille <akim@epita.fr>
13387
13388 * data/bison.simple (b4_symbol_actions): New, replaces...
13389 (b4_symbol_destructor, b4_symbol_printer): these.
13390 (yysymprint): Be sure to call YYPRINT only for tokens, and using
13391 user token numbers.
13392
13393 2002-06-20 Akim Demaille <akim@epita.fr>
13394
13395 * data/bison.simple (yydestructor): Rename as...
13396 (yydestruct): this.
13397
13398 2002-06-20 Akim Demaille <akim@epita.fr>
13399
13400 * src/symtab.h, src/symtab.c (symbol_type_set)
13401 (symbol_destructor_set, symbol_precedence_set): The location is
13402 the last argument.
13403 Adjust all callers.
13404
13405 2002-06-20 Akim Demaille <akim@epita.fr>
13406
13407 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
13408 internals.
13409 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
13410 Takes a location.
13411 * src/symtab.h, src/symtab.c (symbol_class_set)
13412 (symbol_user_token_number_set): Likewise.
13413 Adjust all callers.
13414 Promote complain_at.
13415 * tests/input.at (Type Clashes): Adjust.
13416
13417 2002-06-20 Akim Demaille <akim@epita.fr>
13418
13419 * data/bison.simple (YYLEX): Fix the declaration when
13420 %pure-parser.
13421
13422 2002-06-20 Akim Demaille <akim@epita.fr>
13423
13424 * data/bison.simple (yysymprint): Don't print the token number,
13425 just its name.
13426 * tests/actions.at (Destructors): Rename as...
13427 (Printers and Destructors): this.
13428 Also exercise %printer.
13429
13430 2002-06-20 Akim Demaille <akim@epita.fr>
13431
13432 * data/bison.simple (YYDSYMPRINT): New.
13433 Use it to remove many of the #if YYDEBUG/if (yydebug).
13434
13435 2002-06-20 Akim Demaille <akim@epita.fr>
13436
13437 * src/symtab.h, src/symtab.c (symbol_t): printer and
13438 printer_location are new members.
13439 (symbol_printer_set): New.
13440 * src/parse-gram.y (PERCENT_PRINTER): New token.
13441 Handle its associated rule.
13442 * src/scan-gram.l: Adjust.
13443 (handle_destructor_at, handle_destructor_dollar): Rename as...
13444 (handle_symbol_code_at, handle_symbol_code_dollar): these.
13445 * src/output.c (symbol_printers_output): New.
13446 (output_skeleton): Call it.
13447 * data/bison.simple (yysymprint): New. Cannot be named yyprint
13448 since there are already many grammar files with a user `yyprint'.
13449 Replace the calls to YYPRINT to calls to yysymprint.
13450 * tests/calc.at: Adjust.
13451 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
13452 taking advantage of parser very internal details (stack size!).
13453
13454 2002-06-20 Akim Demaille <akim@epita.fr>
13455
13456 * src/scan-gram.l: Complete the scanner with the missing patterns
13457 to pacify Flex.
13458 Use `quote' and `symbol_tag_get' where appropriate.
13459
13460 2002-06-19 Akim Demaille <akim@epita.fr>
13461
13462 * tests/actions.at (Destructors): Augment to test locations.
13463 * data/bison.simple (yydestructor): Pass it the current location
13464 if locations are enabled.
13465 Prototype only when __STDC__ or C++.
13466 Change the argument names to move into the yy name space: there is
13467 user code here.
13468
13469 2002-06-19 Akim Demaille <akim@epita.fr>
13470
13471 * data/bison.simple (b4_pure_if): New.
13472 Use it instead of #ifdef YYPURE.
13473
13474 2002-06-19 Akim Demaille <akim@epita.fr>
13475
13476 * data/bison.simple (b4_location_if): New.
13477 Use it instead of #ifdef YYLSP_NEEDED.
13478
13479 2002-06-19 Akim Demaille <akim@epita.fr>
13480
13481 Prepare @$ in %destructor, but currently don't bind it in the
13482 skeleton, as %location use is not cleaned up yet.
13483
13484 * src/scan-gram.l (handle_dollar, handle_destructor_at)
13485 (handle_action_at): New.
13486 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
13487 a braced_code_t and a location as additional arguments.
13488 (handle_destructor_dollar): Instead of requiring `b4_eval', just
13489 unquote one when outputting `b4_dollar_dollar'.
13490 Adjust callers.
13491 * data/bison.simple (b4_eval): Remove.
13492 (b4_symbol_destructor): Adjust.
13493 * tests/input.at (Invalid @n): Adjust.
13494
13495 2002-06-19 Zack Weinberg <zack@codesourcery.com>
13496
13497 * doc/bison.texinfo: Document ability to have multiple
13498 prologue sections.
13499
13500 2002-06-18 Akim Demaille <akim@epita.fr>
13501
13502 * src/files.c (compute_base_names): When computing the output file
13503 names from the input file name, strip the directory part.
13504
13505 2002-06-18 Akim Demaille <akim@epita.fr>
13506
13507 * data/bison.simple.new: Comment changes.
13508 Reported by Andreas Schwab.
13509
13510 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
13511
13512 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
13513 there are no `label `yyoverflowlab' defined but not used' warnings
13514 when yyoverflow is defined.
13515
13516 2002-06-18 Akim Demaille <akim@epita.fr>
13517
13518 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
13519 new member.
13520 (symbol_destructor_set): Adjust.
13521 * src/output.c (symbol_destructors_output): Output the destructor
13522 locations.
13523 Output the symbol name.
13524 * data/bison.simple (b4_symbol_destructor): Adjust.
13525
13526 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
13527 and Akim Demaille <akim@epita.fr>
13528
13529 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
13530 what's left on the stack when the error recovery hits EOF.
13531 * tests/actions.at (Destructors): Complete to exercise this case.
13532
13533 2002-06-17 Akim Demaille <akim@epita.fr>
13534
13535 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
13536 arguments is really empty, not only equal to `[]'.
13537 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
13538 member.
13539 (symbol_destructor_set): New.
13540 * src/output.c (symbol_destructors_output): New.
13541 * src/reader.h (brace_code_t, current_braced_code): New.
13542 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
13543 (handle_dollar): Rename as...
13544 (handle_action_dollar): this.
13545 (handle_destructor_dollar): New.
13546 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
13547 (grammar_declaration): Use it.
13548 * data/bison.simple (yystos): Is always defined.
13549 (yydestructor): New.
13550 * tests/actions.at (Destructors): New.
13551 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
13552
13553 2002-06-17 Akim Demaille <akim@epita.fr>
13554
13555 * src/symlist.h, src/symlist.c (symbol_list_length): New.
13556 * src/scan-gram.l (handle_dollar, handle_at): Compute the
13557 rule_length only when needed.
13558 * src/output.c (actions_output, token_definitions_output): Output
13559 the full M4 block.
13560 * src/symtab.c: Don't access directly to the symbol tag, use
13561 symbol_tag_get.
13562 * src/parse-gram.y: Use symbol_list_free.
13563
13564 2002-06-17 Akim Demaille <akim@epita.fr>
13565
13566 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
13567 (symbol_list_prepend, get_type_name): Move to...
13568 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
13569 (symbol_list_prepend, symbol_list_n_type_name_get): here.
13570 Adjust all callers.
13571 (symbol_list_free): New.
13572 * src/scan-gram.l (handle_dollar): Takes a location.
13573 * tests/input.at (Invalid $n): Adjust.
13574
13575 2002-06-17 Akim Demaille <akim@epita.fr>
13576
13577 * src/reader.h, src/reader.c (symbol_list_new): Export it.
13578 (symbol_list_prepend): New.
13579 * src/parse-gram.y (%union): `list' is a new member.
13580 (symbols.1): New, replaces...
13581 (terms_to_prec.1, nterms_to_type.1): these.
13582 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
13583 Take a location as additional argument.
13584 Adjust all callers.
13585
13586 2002-06-15 Akim Demaille <akim@epita.fr>
13587
13588 * src/parse-gram.y: Move %token in the declaration section so that
13589 we don't depend upon CVS Bison.
13590
13591 2002-06-15 Akim Demaille <akim@epita.fr>
13592
13593 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
13594 * src/print.c (print_core): Use it.
13595
13596 2002-06-15 Akim Demaille <akim@epita.fr>
13597
13598 * src/conflicts.c (log_resolution): Accept the rule involved in
13599 the sr conflicts instead of the lookahead number that points to
13600 that rule.
13601 (flush_reduce): Accept the current lookahead vector as argument,
13602 instead of the index in LA.
13603 (resolve_sr_conflict): Accept the current number of lookahead
13604 bitset to consider for the STATE, instead of the index in LA.
13605 (set_conflicts): Adjust.
13606 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
13607
13608 2002-06-15 Akim Demaille <akim@epita.fr>
13609
13610 * src/state.h (state_t): Replace the `lookaheadsp' member, a
13611 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
13612 Adjust all dependencies.
13613 * src/lalr.c (initialize_lookaheads): Split into...
13614 (states_lookaheads_count, states_lookaheads_initialize): these.
13615 (lalr): Adjust.
13616
13617 2002-06-15 Akim Demaille <akim@epita.fr>
13618
13619 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
13620 out of...
13621 (grammar_rules_print): here.
13622 * src/reduce.c (reduce_output): Use it.
13623 * tests/reduce.at (Useless Rules, Reduced Automaton)
13624 (Underivable Rules): Adjust.
13625
13626 2002-06-15 Akim Demaille <akim@epita.fr>
13627
13628 Copy BYacc's nice way to report the grammar.
13629
13630 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
13631 New.
13632 Don't print the rules' location, it is confusing and useless.
13633 (rule_print): Use grammar_rhs_print.
13634 * src/print.c (print_grammar): Use grammar_rules_print.
13635
13636 2002-06-15 Akim Demaille <akim@epita.fr>
13637
13638 Complete and rationalize `useless thing' warnings.
13639
13640 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
13641 (symbol_tag_print): New.
13642 Use them everywhere in place of accessing directly the tag member.
13643 * src/gram.h, src/gram.c (rule_print): New.
13644 Use it where a rule used to be printed `by hand'.
13645 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
13646 (reduce_grammar_tables): Report the useless rules.
13647 (reduce_print): Useless things are a warning, not an error.
13648 Report it as such.
13649 * tests/reduce.at (Useless Nonterminals, Useless Rules):
13650 (Reduced Automaton, Underivable Rules): Adjust.
13651 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
13652 * tests/conflicts.at (Unresolved SR Conflicts)
13653 (Solved SR Conflicts): Adjust.
13654
13655 2002-06-15 Akim Demaille <akim@epita.fr>
13656
13657 Let symbols have a location.
13658
13659 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
13660 (getsym): Adjust.
13661 Adjust all callers.
13662 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
13663 Use location_t, not int.
13664 * src/symtab.c (symbol_check_defined): Take advantage of the
13665 location.
13666 * tests/regression.at (Invalid inputs): Adjust.
13667
13668 2002-06-15 Akim Demaille <akim@epita.fr>
13669
13670 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
13671 (input): Don't try to initialize yylloc here, do it in the
13672 scanner.
13673 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
13674 * src/gram.h (rule_t): Change line and action_line into location
13675 and action_location, of location_t type.
13676 Adjust all dependencies.
13677 * src/location.h, src/location.c (empty_location): New.
13678 * src/reader.h, src/reader.c (grammar_start_symbol_set)
13679 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
13680 (grammar_current_rule_symbol_append)
13681 (grammar_current_rule_action_append): Expect a location as argument.
13682 * src/reader.c (grammar_midrule_action): Adjust to attach an
13683 action's location as dummy symbol location.
13684 * src/symtab.h, src/symtab.c (startsymbol_location): New.
13685 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
13686 the line numbers.
13687
13688 2002-06-14 Akim Demaille <akim@epita.fr>
13689
13690 Grammar declarations may be found in the grammar section.
13691
13692 * src/parse-gram.y (rules_or_grammar_declaration): New.
13693 (declarations): Each declaration may end with a semicolon, not
13694 just...
13695 (grammar_declaration): `"%union"'.
13696 (grammar): Branch to rules_or_grammar_declaration.
13697
13698 2002-06-14 Akim Demaille <akim@epita.fr>
13699
13700 * src/main.c (main): Invoke scanner_free.
13701
13702 2002-06-14 Akim Demaille <akim@epita.fr>
13703
13704 * src/output.c (m4_invoke): Extracted from...
13705 (output_skeleton): here.
13706 Free tempfile.
13707
13708 2002-06-14 Akim Demaille <akim@epita.fr>
13709
13710 * src/parse-gram.y (directives, directive, gram)
13711 (grammar_directives, precedence_directives, precedence_directive):
13712 Rename as...
13713 (declarations, declaration, grammar, grammar_declaration)
13714 (precedence_declaration, precedence_declarator): these.
13715 (symbol_declaration): New.
13716
13717 2002-06-14 Akim Demaille <akim@epita.fr>
13718
13719 * src/files.c (action_obstack): Remove, unused.
13720 (output_obstack): Remove it, and all its dependencies, as it is no
13721 longer needed.
13722 * src/reader.c (epilogue_set): Build the epilogue in the
13723 muscle_obstack.
13724 * src/output.h, src/output.c (muscle_obstack): Move to...
13725 * src/muscle_tab.h, src/muscle_tab.h: here.
13726 (muscle_init): Initialize muscle_obstack.
13727 (muscle_free): New.
13728 * src/main.c (main): Call it.
13729
13730 2002-06-14 Akim Demaille <akim@epita.fr>
13731
13732 * src/location.h: New, extracted from...
13733 * src/reader.h: here.
13734 * src/Makefile.am (noinst_HEADERS): Merge into
13735 (bison_SOURCES): this.
13736 Add location.h.
13737 * src/parse-gram.y: Use location_t instead of Bison's.
13738 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
13739 Use location_t instead of ints.
13740
13741 2002-06-14 Akim Demaille <akim@epita.fr>
13742
13743 * data/bison.simple, data/bison.c++: Be sure to restore the
13744 current #line when returning to the skeleton contents after having
13745 exposed the input file's #line.
13746
13747 2002-06-12 Akim Demaille <akim@epita.fr>
13748
13749 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
13750 eager.
13751 * tests/actions.at (Exotic Dollars): New.
13752
13753 2002-06-12 Akim Demaille <akim@epita.fr>
13754
13755 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
13756 ['"/] too eagerly.
13757 * tests/input.at (Torturing the Scanner): New.
13758
13759 2002-06-11 Akim Demaille <akim@epita.fr>
13760
13761 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
13762 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
13763 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
13764 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
13765 * src/reader.c (reader): Use it.
13766
13767 2002-06-11 Akim Demaille <akim@epita.fr>
13768
13769 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
13770 Adjust all callers.
13771 (scanner_last_string_free): New.
13772
13773 2002-06-11 Akim Demaille <akim@epita.fr>
13774
13775 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
13776 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
13777 (last_string, YY_OBS_FREE): New.
13778 Use them when returning an ID.
13779
13780 2002-06-11 Akim Demaille <akim@epita.fr>
13781
13782 Have Bison grammars parsed by a Bison grammar.
13783
13784 * src/reader.c, src/reader.h (prologue_augment): New.
13785 * src/reader.c (copy_definition): Remove.
13786
13787 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
13788 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
13789 (grammar_current_rule_prec_set, grammar_current_rule_check)
13790 (grammar_current_rule_symbol_append)
13791 (grammar_current_rule_action_append): Export.
13792 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
13793 (symbol_list_action_append): Remove.
13794 Hook the routines from reader.
13795 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
13796 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
13797
13798 * src/reader.c (read_declarations): Remove, unused.
13799
13800 * src/parse-gram.y: Handle the epilogue.
13801 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
13802 (grammar_start_symbol_set): this.
13803 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
13804 * src/reader.c (readgram): Remove, unused.
13805 (reader): Adjust to insert eoftoken and axiom where appropriate.
13806
13807 * src/reader.c (copy_dollar): Replace with...
13808 * src/scan-gram.h (handle_dollar): this.
13809 * src/parse-gram.y: Remove `%thong'.
13810
13811 * src/reader.c (copy_at): Replace with...
13812 * src/scan-gram.h (handle_at): this.
13813
13814 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
13815 New.
13816
13817 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
13818 time being.
13819
13820 * src/reader.h, src/reader.c (grammar_rule_end): New.
13821
13822 * src/parse.y (current_type, current_class): New.
13823 Implement `%nterm', `%token' support.
13824 Merge `%term' into `%token'.
13825 (string_as_id): New.
13826 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
13827 type name.
13828
13829 * src/parse-gram.y: Be sure to handle properly the beginning of
13830 rules.
13831
13832 * src/parse-gram.y: Handle %type.
13833 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13834
13835 * src/parse-gram.y: More directives support.
13836 * src/options.c: No longer handle source directives.
13837
13838 * src/parse-gram.y: Fix %output.
13839
13840 * src/parse-gram.y: Handle %union.
13841 Use the prologue locations.
13842 * src/reader.c (parse_union_decl): Remove.
13843
13844 * src/reader.h, src/reader.c (epilogue_set): New.
13845 * src/parse-gram.y: Use it.
13846
13847 * data/bison.simple, data/bison.c++: b4_stype is now either not
13848 defined, then default to int, or to the contents of %union,
13849 without `union' itself.
13850 Adjust.
13851 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13852
13853 * src/output.c (actions_output): Don't output braces, as they are
13854 already handled by the scanner.
13855
13856 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13857 characters to themselves.
13858
13859 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13860 that the epilogue has a proper #line.
13861
13862 * src/parse-gram.y: Handle precedence/associativity.
13863
13864 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13865 a terminal.
13866 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13867 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13868 at all to define terminals that cannot be emitted.
13869
13870 * src/scan-gram.l: Escape M4 characters.
13871
13872 * src/scan-gram.l: Working properly with escapes in user
13873 strings/characters.
13874
13875 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13876 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13877 grammar.
13878 Use more modest sizes, as for the time being the parser does not
13879 release memory, and therefore the process swallows a huge amount
13880 of memory.
13881
13882 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13883 stricter %token grammar.
13884
13885 * src/symtab.h (associativity): Add `undef_assoc'.
13886 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13887 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13888
13889 * tests/regression.at (Invalid %directive): Remove, as it is now
13890 meaningless.
13891 (Invalid inputs): Adjust to the new error messages.
13892 (Token definitions): The new grammar doesn't allow too many
13893 eccentricities.
13894
13895 * src/lex.h, src/lex.c: Remove.
13896 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13897 (copy_character, copy_string2, copy_string, copy_identifier)
13898 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13899 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13900 (parse_action): Remove.
13901 * po/POTFILES.in: Adjust.
13902
13903 2002-06-11 Akim Demaille <akim@epita.fr>
13904
13905 * src/reader.c (parse_action): Don't store directly into the
13906 rule's action member: return the action as a string.
13907 Don't require `rule_length' as an argument: compute it.
13908 (grammar_current_rule_symbol_append)
13909 (grammar_current_rule_action_append): New, eved out from
13910 (readgram): here.
13911 Remove `action_flag', `rulelength', unused now.
13912
13913 2002-06-11 Akim Demaille <akim@epita.fr>
13914
13915 * src/reader.c (grammar_current_rule_prec_set).
13916 (grammar_current_rule_check): New, eved out from...
13917 (readgram): here.
13918 Remove `xaction', `first_rhs': useless.
13919 * tests/input.at (Type clashes): New.
13920 * tests/existing.at (GNU Cim Grammar): Adjust.
13921
13922 2002-06-11 Akim Demaille <akim@epita.fr>
13923
13924 * src/reader.c (grammar_midrule_action): New, Eved out from
13925 (readgram): here.
13926
13927 2002-06-11 Akim Demaille <akim@epita.fr>
13928
13929 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13930 New.
13931 (readgram): Use them as replacement of inlined code, crule and
13932 crule1.
13933
13934 2002-06-11 Akim Demaille <akim@epita.fr>
13935
13936 * src/reader.c (grammar_end, grammar_symbol_append): New.
13937 (readgram): Use them.
13938 Make the use of `p' as local as possible.
13939
13940 2002-06-10 Akim Demaille <akim@epita.fr>
13941
13942 GCJ's parser requires the tokens to be defined before the prologue.
13943
13944 * data/bison.simple: Output the token definition before the user's
13945 prologue.
13946 * tests/regression.at (Braces parsing, Duplicate string)
13947 (Mixing %token styles): Check the output from bison.
13948 (Early token definitions): New.
13949
13950 2002-06-10 Akim Demaille <akim@epita.fr>
13951
13952 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13953 assigning twice the same user number to a token, so that we can
13954 use it in...
13955 * src/lex.c (lex): here.
13956 Also use `symbol_class_set' instead of hand written code.
13957 * src/reader.c (parse_assoc_decl): Likewise.
13958
13959 2002-06-10 Akim Demaille <akim@epita.fr>
13960
13961 * src/symtab.c, src/symtab.c (symbol_class_set)
13962 (symbol_user_token_number_set): New.
13963 * src/reader.c (parse_token_decl): Use them.
13964 Use a switch instead of ifs.
13965 Use a single argument.
13966
13967 2002-06-10 Akim Demaille <akim@epita.fr>
13968
13969 Remove `%thong' support as it is undocumented, unused, duplicates
13970 `%token's job, and creates useless e-mail traffic with people who
13971 want to know what it is, why it is undocumented, unused, and
13972 duplicates `%token's job.
13973
13974 * src/reader.c (parse_thong_decl): Remove.
13975 * src/options.c (option_table): Remove "thong".
13976 * src/lex.h (tok_thong): Remove.
13977
13978 2002-06-10 Akim Demaille <akim@epita.fr>
13979
13980 * src/symtab.c, src/symtab.c (symbol_type_set)
13981 (symbol_precedence_set): New.
13982 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13983 (value_components_used): Remove, unused.
13984
13985 2002-06-09 Akim Demaille <akim@epita.fr>
13986
13987 Move symbols handling code out of the reader.
13988
13989 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13990 (axiom): Move to...
13991 * src/symtab.h, src/symtab.c: here.
13992
13993 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13994 * src/reader.c (startval): Rename as...
13995 * src/symtab.h, src/symtab.c (startsymbol): this.
13996 * src/reader.c: Adjust.
13997
13998 * src/reader.c (symbol_check_defined, symbol_make_alias)
13999 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14000 (token_translations_init)
14001 Move to...
14002 * src/symtab.c: here.
14003 * src/reader.c (packsymbols): Move to...
14004 * src/symtab.h, src/symtab.c (symbols_pack): here.
14005 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
14006 argument.
14007
14008 2002-06-03 Akim Demaille <akim@epita.fr>
14009
14010 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
14011 then statements.
14012
14013 2002-06-03 Akim Demaille <akim@epita.fr>
14014
14015 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
14016 structs with non literals.
14017 * src/scan-skel.l: never-interactive.
14018 * src/conflicts.c (enum conflict_resolution_e): No trailing
14019 comma.
14020 * src/getargs.c (usage): Split long literal strings.
14021 Reported by Hans Aberg.
14022
14023 2002-05-28 Akim Demaille <akim@epita.fr>
14024
14025 * data/bison.c++: Use C++ ostreams.
14026 (cdebug_): New member.
14027
14028 2002-05-28 Akim Demaille <akim@epita.fr>
14029
14030 * src/output.c (output_skeleton): Be sure to allocate enough room
14031 for `/' _and_ for `\0' in full_skeleton.
14032
14033 2002-05-28 Akim Demaille <akim@epita.fr>
14034
14035 * data/bison.c++: Catch up with bison.simple:
14036 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14037 and Paul Eggert <eggert@twinsun.com>: `error' handing.
14038 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
14039 and popping traces.
14040
14041 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14042
14043 * src/output.c (output_skeleton): Put an explicit path in front of
14044 the skeleton file name, rather than relying on the -I directory,
14045 to partially alleviate effects of having a skeleton file lying around
14046 in the current directory.
14047
14048 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14049
14050 * src/conflicts.c (log_resolution): Correct typo:
14051 obstack_printf should be obstack_fgrow1.
14052
14053 2002-05-26 Akim Demaille <akim@epita.fr>
14054
14055 * src/state.h (state_t): `solved_conflicts' is a new member.
14056 * src/LR0.c (new_state): Set it to 0.
14057 * src/conflicts.h, src/conflicts.c (print_conflicts)
14058 (free_conflicts, solve_conflicts): Rename as...
14059 (conflicts_print, conflicts_free, conflicts_solve): these.
14060 Adjust callers.
14061 * src/conflicts.c (enum conflict_resolution_e)
14062 (solved_conflicts_obstack): New, used by...
14063 (log_resolution): this.
14064 Adjust to attach the conflict resolution to each state.
14065 Complete the description with the precedence/associativity
14066 information.
14067 (resolve_sr_conflict): Adjust.
14068 * src/print.c (print_state): Output its solved_conflicts.
14069 * tests/conflicts.at (Unresolved SR Conflicts)
14070 (Solved SR Conflicts): Exercise --report=all.
14071
14072 2002-05-26 Akim Demaille <akim@epita.fr>
14073
14074 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14075 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14076 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
14077 (token_number_t, item_number_as_token_number)
14078 (token_number_as_item_number, muscle_insert_token_number_table):
14079 Rename as...
14080 (symbol_number_t, item_number_as_symbol_number)
14081 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
14082 these, since it is more appropriate.
14083
14084 2002-05-26 Akim Demaille <akim@epita.fr>
14085
14086 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
14087 `Error:' lines.
14088 * data/bison.simple (yystos) [YYDEBUG]: New.
14089 (yyparse) [YYDEBUG]: Display the symbols which are popped during
14090 error recovery.
14091 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
14092
14093 2002-05-25 Akim Demaille <akim@epita.fr>
14094
14095 * doc/bison.texinfo (Debugging): Split into...
14096 (Tracing): this new section, its former contents, and...
14097 (Understanding): this new section.
14098 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
14099 by...
14100 (report_flag): this.
14101 Adjust all dependencies.
14102 (report_args, report_types, report_argmatch): New.
14103 (usage, getargs): Report/support -r, --report.
14104 * src/options.h
14105 (struct option_table_struct): Rename as..,
14106 (struct option_table_s): this.
14107 Rename the `set_flag' member to `flag' to match with getopt_long's
14108 struct.
14109 * src/options.c (option_table): Split verbose into an entry for
14110 %verbose, and another for --verbose.
14111 Support --report/-r, so remove -r from the obsolete --raw.
14112 * src/print.c: Attach full item sets and lookaheads reports to
14113 report_flag instead of trace_flag.
14114 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
14115
14116 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14117 and Paul Eggert <eggert@twinsun.com>
14118
14119 * data/bison.simple (yyparse): Correct error handling to conform to
14120 POSIX and yacc. Specifically, after syntax error is discovered,
14121 do not reduce further before shifting the error token.
14122 Clean up the code a bit by removing the labels yyerrdefault,
14123 yyerrhandle, yyerrpop.
14124 * NEWS: Document the above.
14125
14126 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14127
14128 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
14129 type; it isn't always big enough, since it doesn't necessarily
14130 include non-terminals.
14131 (yytranslate): Expand definition of yy_token_number_type, so that
14132 the latter can be removed.
14133 (yy_token_number_type): Remove, only one use.
14134 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
14135 don't use TokenNumberType as element type.
14136
14137 * tests/regression.at: Modify expected output to agree with change
14138 to yyr1 and yytranslate.
14139
14140 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
14141
14142 * src/reader.c (parse_action): Use copy_character instead of
14143 obstack_1grow.
14144
14145 2002-05-13 Akim Demaille <akim@epita.fr>
14146
14147 * tests/regression.at (Token definitions): Prototype yylex and
14148 yyerror.
14149
14150 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14151
14152 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
14153 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
14154 32-bit arithmetic.
14155 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
14156
14157 2002-05-07 Akim Demaille <akim@epita.fr>
14158
14159 * tests/synclines.at: Be sure to prototype yylex and yyerror to
14160 avoid GCC warnings.
14161
14162 2002-05-07 Akim Demaille <akim@epita.fr>
14163
14164 Kill GCC warnings.
14165
14166 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
14167 over the RHS of each rule.
14168 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
14169 * src/state.h (state_t): Member `nitems' is unsigned short.
14170 * src/LR0.c (get_state): Adjust.
14171 * src/reader.c (packgram): Likewise.
14172 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
14173 `Type'.
14174 (muscle_insert_int_table): Remove, unused.
14175 (prepare_rules): Remove `max'.
14176
14177 2002-05-06 Akim Demaille <akim@epita.fr>
14178
14179 * src/closure.c (print_firsts): Display of the symbol tags.
14180 (bitmatrix_print): Move to...
14181 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
14182 here.
14183 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
14184
14185 2002-05-06 Akim Demaille <akim@epita.fr>
14186
14187 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
14188 hash_do_for_each.
14189
14190 2002-05-06 Akim Demaille <akim@epita.fr>
14191
14192 * src/LR0.c (new_state, get_state): Instead of using the global
14193 `kernel_size' and `kernel_base', have two new arguments:
14194 `core_size' and `core'.
14195 Adjust callers.
14196
14197 2002-05-06 Akim Demaille <akim@epita.fr>
14198
14199 * src/reader.c (packgram): No longer end `ritem' with a 0
14200 sentinel: it is not used.
14201
14202 2002-05-05 Akim Demaille <akim@epita.fr>
14203
14204 New experimental feature: display the lookaheads in the report and
14205 graph.
14206
14207 * src/print (print_core): When --trace-flag, display the rules
14208 lookaheads.
14209 * src/print_graph.c (print_core): Likewise.
14210 Swap the arguments.
14211 Adjust caller.
14212
14213 2002-05-05 Akim Demaille <akim@epita.fr>
14214
14215 * tests/torture.at (Many lookaheads): New test.
14216
14217 2002-05-05 Akim Demaille <akim@epita.fr>
14218
14219 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
14220 (GENERATE_MUSCLE_INSERT_TABLE): this.
14221 (output_int_table, output_unsigned_int_table, output_short_table)
14222 (output_token_number_table, output_item_number_table): Replace with...
14223 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
14224 (muscle_insert_short_table, muscle_insert_token_number_table)
14225 (muscle_insert_item_number_table): these.
14226 Adjust all callers.
14227 (prepare_tokens): Don't free `translations', since...
14228 * src/reader.h, src/reader.c (grammar_free): do it.
14229 Move to...
14230 * src/gram.h, src/gram.c (grammar_free): here.
14231 * data/bison.simple, data/bison.c++: b4_token_number_max is now
14232 b4_translate_max.
14233
14234 2002-05-05 Akim Demaille <akim@epita.fr>
14235
14236 * src/output.c (output_unsigned_int_table): New.
14237 (prepare_rules): `i' is unsigned.
14238 `prhs', `rline', `r2' are unsigned int.
14239 Rename muscle `rhs_number_max' as `rhs_max'.
14240 Output muscles `prhs_max', `rline_max', and `r2_max'.
14241 Free rline and r1.
14242 * data/bison.simple, data/bison.c++: Adjust to use these muscles
14243 to compute types instead of constant types.
14244 * tests/regression.at (Web2c Actions): Adjust.
14245
14246 2002-05-04 Akim Demaille <akim@epita.fr>
14247
14248 * src/symtab.h (SALIAS, SUNDEF): Rename as...
14249 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
14250 Adjust dependencies.
14251 * src/output.c (token_definitions_output): Be sure not to output a
14252 `#define 'a'' when fed with `%token 'a' "a"'.
14253 * tests/regression.at (Token definitions): New.
14254
14255 2002-05-03 Paul Eggert <eggert@twinsun.com>
14256
14257 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
14258 for K&R C.
14259
14260 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
14261
14262 * Makefile.am (SUBDIRS): Remove intl.
14263 (EXTRA_DIST): Add config/config.rpath.
14264
14265 2002-05-03 Akim Demaille <akim@epita.fr>
14266
14267 * data/bison.simple (m4_if): Don't output empty enums.
14268 And actually, output valid enum definitions :(.
14269
14270 2002-05-03 Akim Demaille <akim@epita.fr>
14271
14272 * configure.bat: Remove, completely obsolete.
14273 * Makefile.am (EXTRA_DIST): Adjust.
14274 Don't distribute config.rpath...
14275 * config/Makefile.am (EXTRA_DIST): Do it.
14276
14277 2002-05-03 Akim Demaille <akim@epita.fr>
14278
14279 * configure.in (GETTEXT_VERSION): New.
14280 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
14281
14282 2002-05-03 Akim Demaille <akim@epita.fr>
14283
14284 * data/bison.simple (b4_token_enum): New.
14285 (b4_token_defines): Use it to output tokens both as #define and
14286 enums.
14287 Suggested by Paul Eggert.
14288 * src/output.c (token_definitions_output): Don't output spurious
14289 white spaces.
14290
14291 2002-05-03 Akim Demaille <akim@epita.fr>
14292
14293 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14294
14295 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
14296
14297 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
14298 Update the stack class, give a try to deque as the default container.
14299
14300 2002-05-02 Akim Demaille <akim@epita.fr>
14301
14302 * data/bison.simple (yyparse): Do not implement @$ = @1.
14303 (YYLLOC_DEFAULT): Adjust to do it.
14304 * doc/bison.texinfo (Location Default Action): Fix.
14305
14306 2002-05-02 Akim Demaille <akim@epita.fr>
14307
14308 * src/reader.c (parse_braces): Merge into...
14309 (parse_action): this.
14310
14311 2002-05-02 Akim Demaille <akim@epita.fr>
14312
14313 * configure.in (ALL_LINGUAS): Remove.
14314 * po/LINGUAS, hr.po: New.
14315
14316 2002-05-02 Akim Demaille <akim@epita.fr>
14317
14318 Remove the so called hairy (semantic) parsers.
14319
14320 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
14321 * src/gram.h, src/gram.c (semantic_parser): Remove.
14322 (rule_t): Remove the guard and guard_line members.
14323 * src/lex.h (token_t): remove tok_guard.
14324 * src/options.c (option_table): Remove %guard and %semantic_parser
14325 support.
14326 * src/output.c, src/output.h (guards_output): Remove.
14327 (prepare): Adjust.
14328 (token_definitions_output): Don't output the `T'
14329 tokens (???).
14330 (output_skeleton): Don't output the guards.
14331 * src/files.c, src/files.c (attrsfile): Remove.
14332 * src/reader.c (symbol_list): Remove the guard and guard_line
14333 members.
14334 Adjust dependencies.
14335 (parse_guard): Remove.
14336 * data/bison.hairy: Remove.
14337 * doc/bison.texinfo (Environment Variables): Remove occurrences of
14338 BISON_HAIRY.
14339
14340 2002-05-02 Akim Demaille <akim@epita.fr>
14341
14342 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
14343 (parse_guard): Rename the formal argument `stack_offset' as
14344 `rule_length', which is more readable.
14345 Adjust callers.
14346 (copy_at, copy_dollar): Instead of outputting the hard coded
14347 values of $$, $n and so forth, output invocation to b4_lhs_value,
14348 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
14349 Note: this patch partially drops `semantic-parser' support: it
14350 always does `rule_length - n', where semantic parsers ought to
14351 always use `-n'.
14352 * data/bison.simple, data/bison.c++ (b4_lhs_value)
14353 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
14354
14355 2002-05-02 Akim Demaille <akim@epita.fr>
14356
14357 * configure.in (AC_INIT): Bump to 1.49b.
14358 (AM_INIT_AUTOMAKE): Short invocation.
14359
14360 2002-05-02 Akim Demaille <akim@epita.fr>
14361
14362 Version 1.49a.
14363
14364 2002-05-01 Akim Demaille <akim@epita.fr>
14365
14366 * src/skeleton.h: Remove.
14367
14368 2002-05-01 Akim Demaille <akim@epita.fr>
14369
14370 * src/skeleton.h: Fix the #endif.
14371 Reported by Magnus Fromreide.
14372
14373 2002-04-26 Paul Eggert <eggert@twinsun.com>
14374
14375 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
14376 Define if we define YYSTYPE and YYLTYPE, respectively.
14377 (YYCOPY): Fix [] quoting problem in the non-GCC case.
14378
14379 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
14380
14381 * src/scan-skel.l: Postprocess quadrigraphs.
14382
14383 * src/reader.c (copy_character): New function, used to output
14384 single characters while replacing `[' and `]' with quadrigraphs, to
14385 avoid troubles with M4 quotes.
14386 (copy_comment): Output characters with copy_character.
14387 (read_additionnal_code): Likewise.
14388 (copy_string2): Likewise.
14389 (copy_definition): Likewise.
14390
14391 * tests/calc.at: Exercise M4 quoting.
14392
14393 2002-04-25 Akim Demaille <akim@epita.fr>
14394
14395 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
14396 between `!' and the command.
14397 Reported by Paul Eggert.
14398
14399 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
14400
14401 * tests/calc.at: Exercise prologue splitting.
14402
14403 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
14404 `b4_post_prologue' instead of `b4_prologue'.
14405
14406 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
14407 muscles.
14408 (output): Free pre_prologue_obstack and post_prologue_obstack.
14409 * src/files.h, src/files.c (attrs_obstack): Remove.
14410 (pre_prologue_obstack, post_prologue_obstack): New.
14411 * src/reader.c (copy_definition): Add a parameter to specify the
14412 obstack to fill, instead of using attrs_obstack unconditionally.
14413 (read_declarations): Pass pre_prologue_obstack to copy_definition if
14414 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
14415
14416 2002-04-23 Paul Eggert <eggert@twinsun.com>
14417
14418 * data/bison.simple: Remove unnecessary commentary and white
14419 space differences from 1_29-branch.
14420 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
14421
14422 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
14423 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
14424 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
14425 constructors or destructors.
14426
14427 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
14428
14429 2002-04-23 Akim Demaille <akim@epita.fr>
14430
14431 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
14432 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
14433 location with columns.
14434 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
14435 All reported by Paul Eggert.
14436
14437 2002-04-22 Akim Demaille <akim@epita.fr>
14438
14439 * src/reduce.c (dump_grammar): Move to...
14440 * src/gram.h, src/gram.c (grammar_dump): here.
14441 Be sure to separate long item numbers.
14442 Don't read the members of a rule's prec if its nil.
14443
14444 2002-04-22 Akim Demaille <akim@epita.fr>
14445
14446 * src/output.c (table_size, table_grow): New.
14447 (MAXTABLE): Remove, replace uses with table_size.
14448 (pack_vector): Instead of dying when the table is too big, grow it.
14449
14450 2002-04-22 Akim Demaille <akim@epita.fr>
14451
14452 * data/bison.simple (yyr1): Its type is that of a token number.
14453 * data/bison.c++ (r1_): Likewise.
14454 * tests/regression.at (Web2c Actions): Adjust.
14455
14456 2002-04-22 Akim Demaille <akim@epita.fr>
14457
14458 * src/reader.c (token_translations_init): 256 is now the default
14459 value for the error token, i.e., it will be assigned another
14460 number if the user assigned 256 to one of her tokens.
14461 (reader): Don't force 256 to error.
14462 * doc/bison.texinfo (Symbols): Adjust.
14463 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
14464 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
14465 etc. instead of 10, 20, 30 (which was used to `jump' over error
14466 (256) and undefined (2)).
14467
14468 2002-04-22 Akim Demaille <akim@epita.fr>
14469
14470 Propagate more token_number_t.
14471
14472 * src/gram.h (token_number_as_item_number)
14473 (item_number_as_token_number): New.
14474 * src/output.c (GENERATE_OUTPUT_TABLE): New.
14475 Use it to create output_item_number_table and
14476 output_token_number_table.
14477 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14478 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
14479 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
14480 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
14481
14482 2002-04-22 Akim Demaille <akim@epita.fr>
14483
14484 * src/output.h, src/output.c (get_lines_number): Remove.
14485
14486 2002-04-19 Akim Demaille <akim@epita.fr>
14487
14488 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
14489 as Lex/Flex'.
14490 (Debugging): More details about enabling the debugging features.
14491 (Table of Symbols): Describe $$, $n, @$, and @n.
14492 Suggested by Tim Josling.
14493
14494 2002-04-19 Akim Demaille <akim@epita.fr>
14495
14496 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
14497
14498 2002-04-10 Akim Demaille <akim@epita.fr>
14499
14500 * src/system.h: Rely on HAVE_LIMITS_H.
14501 Suggested by Paul Eggert.
14502
14503 2002-04-09 Akim Demaille <akim@epita.fr>
14504
14505 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
14506 full stderr, and strip it according to the bison options, instead
14507 of composing the error message from different bits.
14508 This makes it easier to check for several error messages.
14509 Adjust all the invocations.
14510 Add an invocation exercising the error token.
14511 Add an invocation demonstrating a stupid error message.
14512 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
14513 Adjust the tests.
14514 Error message are for stderr, not stdout.
14515
14516 2002-04-09 Akim Demaille <akim@epita.fr>
14517
14518 * src/gram.h, src/gram.c (error_token_number): Remove, use
14519 errtoken->number.
14520 * src/reader.c (reader): Don't specify the user token number (2)
14521 for $undefined, as it uselessly prevents using it.
14522 * src/gram.h (token_number_t): Move to...
14523 * src/symtab.h: here.
14524 (state_t.number): Is a token_number_t.
14525 * src/print.c, src/reader.c: Use undeftoken->number instead of
14526 hard coded 2.
14527 (Even though this 2 is not the same as above: the number of the
14528 undeftoken remains being 2, it is its user token number which
14529 might not be 2).
14530 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
14531 `user_token_number_max'.
14532 Output `undef_token_number'.
14533 * data/bison.simple, data/bison.c++: Use them.
14534 Be sure to map invalid yylex return values to
14535 `undef_token_number'. This saves us from gratuitous SEGV.
14536
14537 * tests/conflicts.at (Solved SR Conflicts)
14538 (Unresolved SR Conflicts): Adjust.
14539 * tests/regression.at (Web2c Actions): Adjust.
14540
14541 2002-04-08 Akim Demaille <akim@epita.fr>
14542
14543 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
14544 Adding #line.
14545 Remove the duplicate `typedefs'.
14546 (RhsNumberType): Fix the declaration and various other typos.
14547 Use __ofile__.
14548 * data/bison.simple: Use __ofile__.
14549 * src/scan-skel.l: Handle __ofile__.
14550
14551 2002-04-08 Akim Demaille <akim@epita.fr>
14552
14553 * src/gram.h (item_number_t): New, the type of item numbers in
14554 RITEM. Note that it must be able to code symbol numbers as
14555 positive number, and the negation of rule numbers as negative
14556 numbers.
14557 Adjust all dependencies (pretty many).
14558 * src/reduce.c (rule): Remove this `short *' pointer: use
14559 item_number_t.
14560 * src/system.h (MINSHORT, MAXSHORT): Remove.
14561 Include `limits.h'.
14562 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
14563 (shortcpy): Remove.
14564 (MAXTABLE): Move to...
14565 * src/output.c (MAXTABLE): here.
14566 (prepare_rules): Use output_int_table to output rhs.
14567 * data/bison.simple, data/bison.c++: Adjust.
14568 * tests/torture.at (Big triangle): Move the limit from 254 to
14569 500.
14570 * tests/regression.at (Web2c Actions): Ajust.
14571
14572 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
14573 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
14574 passes, but produces negative #line number, once fixed, GCC is
14575 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
14576 C), it passes.
14577 * src/state.h (state_h): Code input lines on ints, not shorts.
14578
14579 2002-04-08 Akim Demaille <akim@epita.fr>
14580
14581 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
14582 and then the grammar.
14583
14584 2002-04-08 Akim Demaille <akim@epita.fr>
14585
14586 * src/system.h: No longer using strndup.
14587
14588 2002-04-07 Akim Demaille <akim@epita.fr>
14589
14590 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
14591 * src/output.c (output_table_data): Return the longest number.
14592 (prepare_tokens): Output `token_number_max').
14593 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
14594 New.
14595 Use them to define yy_token_number_type/TokenNumberType.
14596 Use this type for yytranslate.
14597 * tests/torture.at (Big triangle): Push the limit from 124 to
14598 253.
14599 * tests/regression.at (Web2c Actions): Adjust.
14600
14601 2002-04-07 Akim Demaille <akim@epita.fr>
14602
14603 * tests/torture.at (Big triangle): New.
14604 (GNU AWK Grammar, GNU Cim Grammar): Move to...
14605 * tests/existing.at: here.
14606
14607 2002-04-07 Akim Demaille <akim@epita.fr>
14608
14609 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
14610 nritems.
14611 Adjust dependencies.
14612
14613 2002-04-07 Akim Demaille <akim@epita.fr>
14614
14615 * src/reader.c: Normalize increments to prefix form.
14616
14617 2002-04-07 Akim Demaille <akim@epita.fr>
14618
14619 * src/reader.c, symtab.c: Remove debugging code.
14620
14621 2002-04-07 Akim Demaille <akim@epita.fr>
14622
14623 Rename all the `bucket's as `symbol_t'.
14624
14625 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
14626 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
14627 * src/symtab.c, src/symtab.h (bucket): Rename as...
14628 (symbol_t): this.
14629 (symbol_list_new, bucket_check_defined, bucket_make_alias)
14630 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
14631 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14632 (buckets_new, buckets_free, buckets_do): Rename as...
14633 (symbol_list_new, symbol_check_defined, symbol_make_alias)
14634 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14635 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
14636 (symbols_new, symbols_free, symbols_do): these.
14637
14638 2002-04-07 Akim Demaille <akim@epita.fr>
14639
14640 Use lib/hash for the symbol table.
14641
14642 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
14643 EOF.
14644 * src/lex.c (lex): Set the `number' member of new terminals.
14645 * src/reader.c (bucket_check_defined, bucket_make_alias)
14646 (bucket_check_alias_consistence, bucket_translation): New.
14647 (reader, grammar_free, readgram, token_translations_init)
14648 (packsymbols): Adjust.
14649 (reader): Number the predefined tokens.
14650 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
14651 for predefined tokens.
14652 * src/symtab.h (bucket): Remove all the hash table related
14653 members.
14654 * src/symtab.c (symtab): Replace by...
14655 (bucket_table): this.
14656 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14657 (buckets_new, buckets_do): New.
14658
14659 2002-04-07 Akim Demaille <akim@epita.fr>
14660
14661 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
14662 (start_symbol, max_user_token_number, semantic_parser)
14663 (error_token_number): Initialize.
14664 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
14665 Initialize.
14666 (reader): Don't.
14667 (errtoken, eoftoken, undeftoken, axiom): Extern.
14668
14669 2002-04-07 Akim Demaille <akim@epita.fr>
14670
14671 * src/gram.h (rule_s): prec and precsym are now pointers
14672 to the bucket giving the priority/associativity.
14673 Member `associativity' removed: useless.
14674 * src/reduce.c, src/conflicts.c: Adjust.
14675
14676 2002-04-07 Akim Demaille <akim@epita.fr>
14677
14678 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
14679 Properly escape the symbols' TAG when outputting them.
14680
14681 2002-04-07 Akim Demaille <akim@epita.fr>
14682
14683 * src/lalr.h (LA): Is a bitsetv, not bitset*.
14684
14685 2002-04-07 Akim Demaille <akim@epita.fr>
14686
14687 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
14688 (LArule): this, which is an array to rule_t*.
14689 * src/print.c, src/conflicts.c: Adjust.
14690
14691 2002-04-07 Akim Demaille <akim@epita.fr>
14692
14693 * src/gram.h (rule_t): Rename `number' as `user_number'.
14694 `number' is a new member.
14695 Adjust dependencies.
14696 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
14697
14698 2002-04-07 Akim Demaille <akim@epita.fr>
14699
14700 As a result of the previous patch, it is no longer needed
14701 to reorder ritem itself.
14702
14703 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
14704
14705 2002-04-07 Akim Demaille <akim@epita.fr>
14706
14707 Be sure never to walk through RITEMS, but use only data related to
14708 the rules themselves. RITEMS should be banished.
14709
14710 * src/output.c (output_token_translations): Rename as...
14711 (prepare_tokens): this.
14712 In addition to `translate', prepare the muscles `tname' and
14713 `toknum', which were handled by...
14714 (output_rule_data): this.
14715 Remove, and move the remainder of its outputs into...
14716 (prepare_rules): this new routines, which also merges content from
14717 (output_gram): this.
14718 (prepare_rules): Be sure never to walk through RITEMS.
14719 (output_stos): Rename as...
14720 (prepare_stos): this.
14721 (output): Always invoke prepare_states, after all, just don't use it
14722 in the output if you don't need it.
14723
14724 2002-04-07 Akim Demaille <akim@epita.fr>
14725
14726 * src/LR0.c (new_state): Display `nstates' as the name of the
14727 newly created state.
14728 Adjust to initialize first_state and last_state if needed.
14729 Be sure to distinguish the initial from the final state.
14730 (new_states): Create the itemset of the initial state, and use
14731 new_state.
14732 * src/closure.c (closure): Now that the initial state has its
14733 items properly set, there is no need for a special case when
14734 creating `ruleset'.
14735
14736 As a result, now the rule 0, reducing to $axiom, is visible in the
14737 outputs. Adjust the test suite.
14738
14739 * tests/conflicts.at (Solved SR Conflicts)
14740 (Unresolved SR Conflicts): Adjust.
14741 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
14742 * tests/conflicts.at (S/R in initial): New.
14743
14744 2002-04-07 Akim Demaille <akim@epita.fr>
14745
14746 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
14747 the RHS of the rules.
14748 * src/output.c (output_gram): Likewise.
14749
14750 2002-04-07 Akim Demaille <akim@epita.fr>
14751
14752 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
14753 bucket.
14754 Adjust all dependencies.
14755 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
14756 `number' of the buckets too.
14757 * src/gram.h: Include `symtab.h'.
14758 (associativity): Move to...
14759 * src/symtab.h: here.
14760 No longer include `gram.h'.
14761
14762 2002-04-07 Akim Demaille <akim@epita.fr>
14763
14764 * src/gram.h, src/gram.c (rules_rhs_length): New.
14765 (ritem_longest_rhs): Use it.
14766 * src/gram.h (rule_t): `number' is a new member.
14767 * src/reader.c (packgram): Set it.
14768 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
14769 the end of `rules', and count them out of `nrules'.
14770 (reduce_output, dump_grammar): Adjust.
14771 * src/print.c (print_grammar): It is no longer needed to check for
14772 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
14773 * tests/reduce.at (Reduced Automaton): New test.
14774
14775 2002-04-07 Akim Demaille <akim@epita.fr>
14776
14777 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
14778 lacking `+ 1' to nrules, Bison reported as useless a token if it
14779 was used solely to set the precedence of the last rule...
14780
14781 2002-04-07 Akim Demaille <akim@epita.fr>
14782
14783 * data/bison.c++, data/bison.simple: Don't output the current file
14784 name in #line, to avoid useless diffs between two identical
14785 outputs under different names.
14786
14787 2002-04-07 Akim Demaille <akim@epita.fr>
14788
14789 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
14790 Normalize loops to using `< nrules + 1', not `<= nrules'.
14791
14792 2002-04-07 Akim Demaille <akim@epita.fr>
14793
14794 * TODO: Update.
14795
14796 2002-04-07 Akim Demaille <akim@epita.fr>
14797
14798 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
14799 bucket.value as bucket.number.
14800
14801 2002-04-07 Akim Demaille <akim@epita.fr>
14802
14803 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
14804 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14805 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
14806 RHS, instead of being an index in RITEMS.
14807
14808 2002-04-04 Paul Eggert <eggert@twinsun.com>
14809
14810 * doc/bison.texinfo: Update copyright date.
14811 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
14812 (Symbols): Warn about running Bison in one character set,
14813 but compiling and/or running in an incompatible one.
14814 Warn about character code 256, too.
14815
14816 2002-04-03 Paul Eggert <eggert@twinsun.com>
14817
14818 * src/bison.data (YYSTACK_ALLOC): Depend on whether
14819 YYERROR_VERBOSE is nonzero, not whether it is defined.
14820
14821 Merge changes from bison-1_29-branch.
14822
14823 2002-03-20 Paul Eggert <eggert@twinsun.com>
14824
14825 Merge fixes from Debian bison_1.34-1.diff.
14826
14827 * configure.in (AC_PREREQ): 2.53.
14828
14829 2002-03-20 Akim Demaille <akim@epita.fr>
14830
14831 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14832
14833 2002-03-19 Paul Eggert <eggert@twinsun.com>
14834
14835 * src/bison.simple (YYCOPY): New macro.
14836 (YYSTACK_RELOCATE): Use it.
14837 Remove Type arg; no longer needed. All callers changed.
14838 (yymemcpy): Remove; no longer needed.
14839
14840 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14841 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14842
14843 2002-03-19 Akim Demaille <akim@epita.fr>
14844
14845 Test and fix the #line outputs.
14846
14847 * tests/atlocal.at (GCC): New.
14848 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
14849 (Prologue synch line, %union synch line, Postprologue synch line)
14850 (Action synch line, Epilogue synch line): New tests.
14851 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14852 * data/bison.simple, data/bison.c++: Use it.
14853
14854 2002-03-19 Akim Demaille <akim@epita.fr>
14855
14856 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14857 (Solved SR Conflicts, %expect not enough, %expect right)
14858 (%expect too much): Move to...
14859 * tests/conflicts.at: this new file.
14860
14861 2002-03-19 Akim Demaille <akim@epita.fr>
14862
14863 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14864 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14865 that we can move to enums for instance.
14866 * src/output.c (token_definitions_output): Output a list of
14867 `token-name, token-number' instead of the #define.
14868 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14869
14870 2002-03-14 Akim Demaille <akim@epita.fr>
14871
14872 Use Gettext 0.11.1.
14873
14874 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
14875
14876 * data/bison.c++: Make the user able to add members to the generated
14877 parser by subclassing.
14878
14879 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
14880
14881 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14882 a character.
14883 Reported by Nicolas Tisserand and Nicolas Burrus.
14884
14885 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14886
14887 * src/reader.c: Warn about lacking semi-colons, do not complain.
14888
14889 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14890
14891 * data/bison.c++: Remove a debug line.
14892
14893 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14894
14895 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14896 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14897 provide a default implementation.
14898
14899 2002-03-04 Akim Demaille <akim@epita.fr>
14900
14901 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14902 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14903 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14904 * tests/semantic.at (Parsing Guards): Similarly.
14905 * src/reader.at (readgram): Complain if the last rule is not ended
14906 with a semi-colon.
14907
14908 2002-03-04 Akim Demaille <akim@epita.fr>
14909
14910 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14911 * src/closure.c: here.
14912 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14913 RTC.
14914 * src/warshall.h, src/warshall.c: Remove.
14915 * tests/sets.at (Broken Closure): Adjust.
14916
14917 2002-03-04 Akim Demaille <akim@epita.fr>
14918
14919 * src/output.c (output_skeleton): tempdir is const.
14920 bytes_read is unused.
14921
14922 2002-03-04 Akim Demaille <akim@epita.fr>
14923
14924 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14925 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14926 Update.
14927 From Michael Hayes.
14928
14929 2002-03-04 Akim Demaille <akim@epita.fr>
14930
14931 * src/closure.c (closure): `r' is unused.
14932
14933 2002-03-04 Akim Demaille <akim@epita.fr>
14934
14935 * tests/sets.at (Broken Closure): Add the ending `;'.
14936 * src/reader.at (readgram): Complain if a rule is not ended with a
14937 semi-colon.
14938
14939 2002-03-04 Akim Demaille <akim@epita.fr>
14940
14941 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14942 (count_sr_conflicts): Use bitset_count.
14943 * src/reduce.c (inaccessable_symbols): Ditto.
14944 (bits_size): Remove.
14945 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14946
14947 2002-03-04 Akim Demaille <akim@epita.fr>
14948
14949 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14950 * src/reduce.c: Remove the `bitset_zero's following the
14951 `bitset_create's, as now it is performed by the latter.
14952
14953 2002-03-04 Akim Demaille <akim@epita.fr>
14954
14955 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14956 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14957 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14958 latest sources from Michael.
14959
14960 2002-03-04 Akim Demaille <akim@epita.fr>
14961
14962 * src/output.c (output): Don't free the grammar.
14963 * src/reader.c (grammar_free): New.
14964 * src/main.c (main): Call it and don't free symtab here.
14965
14966 2002-03-04 Akim Demaille <akim@epita.fr>
14967
14968 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14969 before returning.
14970 Reported by Benoit Perrot.
14971
14972 2002-03-04 Akim Demaille <akim@epita.fr>
14973
14974 Use bitset operations when possible, not loops over bits.
14975
14976 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14977 bitset_or.
14978 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14979 * src/reduce.c (useless_nonterminals): Formatting changes.
14980 * src/warshall.c (TC): Use bitset_or.
14981
14982 2002-03-04 Akim Demaille <akim@epita.fr>
14983
14984 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14985 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14986 Ditto.
14987
14988 2002-03-04 Akim Demaille <akim@epita.fr>
14989
14990 * src/lalr.c (F): Now a bitset*.
14991 Adjust all dependencies.
14992
14993 2002-03-04 Akim Demaille <akim@epita.fr>
14994
14995 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14996 Adjust all dependencies.
14997
14998 2002-03-04 Akim Demaille <akim@epita.fr>
14999
15000 * src/L0.c, src/LR0.h (nstates): Be size_t.
15001 Adjust comparisons (signed vs unsigned).
15002 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
15003 bitset*.
15004 Adjust all dependencies.
15005
15006 2002-03-04 Akim Demaille <akim@epita.fr>
15007
15008 * src/closure.c (firsts): Now, also a bitset.
15009 Adjust all dependencies.
15010 (varsetsize): Remove, now unused.
15011 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
15012
15013 2002-03-04 Akim Demaille <akim@epita.fr>
15014
15015 * src/print.c: Convert to use bitset.h, not hand coded iterations
15016 over ints.
15017
15018 2002-03-04 Akim Demaille <akim@epita.fr>
15019
15020 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
15021
15022 2002-03-04 Akim Demaille <akim@epita.fr>
15023
15024 * src/closure.c (ruleset): Be a bitset.
15025 (rulesetsize): Remove.
15026
15027 2002-03-04 Akim Demaille <akim@epita.fr>
15028
15029 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
15030 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
15031 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
15032 * src/closure.c (fderives): Be an array of bitsets.
15033
15034 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
15035
15036 * data/bison.c++: Merge the two generated headers. Insert a copyright
15037 notice in each output file.
15038
15039 2002-02-28 Akim Demaille <akim@epita.fr>
15040
15041 * data/bison.c++: Copy the prologue of bison.simple to fetch
15042 useful M4 definitions, such as b4_header_guard.
15043
15044 2002-02-25 Akim Demaille <akim@epita.fr>
15045
15046 * src/getargs.c (version): Give the name of the authors, and use a
15047 translator friendly scheme for the bgr
15048 copyright notice.
15049
15050 2002-02-25 Akim Demaille <akim@epita.fr>
15051
15052 * src/output.c (header_output): Remove, now handled completely via
15053 M4.
15054
15055 2002-02-25 Akim Demaille <akim@epita.fr>
15056
15057 * m4/m4.m4: New, from CVS Autoconf.
15058 * configure.in: Invoke it.
15059 * src/output.c (output_skeleton): Use its result instead of the
15060 hard coded name.
15061
15062 2002-02-25 Akim Demaille <akim@epita.fr>
15063
15064 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
15065 Fileutils 4.1.5.
15066 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
15067 * src/output.c (output_skeleton): Use mkstemp to create a real
15068 temporary file.
15069 Move the filling of `skeleton' and its muscle to...
15070 (prepare): here.
15071 (output): Move the definition of the prologue muscle to...
15072 (prepare): here.
15073 * src/system.h (DEFAULT_TMPDIR): New.
15074
15075 2002-02-14 Paul Eggert <eggert@twinsun.com>
15076
15077 Remove the support for C++ namespace cleanliness; it was
15078 causing more problems than it was curing, since it didn't work
15079 properly on some nonstandard C++ compilers. This can wait
15080 for a proper C++ parser.
15081
15082 * NEWS: Document this.
15083 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
15084 of C++, as it's treated like C now.
15085 * src/bison.simple (YYSTD): Remove.
15086 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
15087 Treat C++ just like Standard C instead of trying to support
15088 namespace cleanliness.
15089
15090 2002-02-14 Akim Demaille <akim@epita.fr>
15091
15092 * tests/regression.at (else): Adjust to Andreas' change.
15093
15094 2002-02-14 Akim Demaille <akim@epita.fr>
15095
15096 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
15097
15098 2002-02-13 Andreas Schwab <schwab@suse.de>
15099
15100 * src/output.c (output_rule_data): Don't output NULL, it might
15101 not be defined yet.
15102
15103 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
15104
15105 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
15106 (Copyright notice): Update.
15107
15108 2002-02-11 Akim Demaille <akim@epita.fr>
15109
15110 * tests/regression.at (%nonassoc and eof): Don't include
15111 nonportable headers.
15112
15113 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
15114
15115 * data/bison.c++: Correct error recovery. Make the user able to
15116 initialize the starting location.
15117
15118 2002-02-07 Akim Demaille <akim@epita.fr>
15119
15120 * tests/input.at: New.
15121
15122 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
15123
15124 * data/bison.c++: Replace some direct m4 expansions by constants. Be
15125 more consistent when naming methods and variables. Put preprocessor
15126 directives around tables only needed for debugging.
15127
15128 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
15129
15130 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
15131 C++ parsers.
15132 (yy::b4_name::parse): Use print_.
15133
15134 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
15135
15136 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
15137
15138 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
15139
15140 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
15141 C++ parsers.
15142 (yy::b4_name::parse): Build verbose error messages, and use error_.
15143
15144 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
15145
15146 * data/bison.c++: Fix m4 quoting in comments.
15147
15148 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
15149
15150 * data/bison.c++: Adjust the parser code. Fix some muscles that were
15151 not expanded by m4.
15152
15153 2002-02-05 Akim Demaille <akim@epita.fr>
15154
15155 * data/bison.c++: Adjust to the M4 back end.
15156 More is certainly needed.
15157
15158 2002-02-05 Akim Demaille <akim@epita.fr>
15159
15160 Give a try to M4 as a back end.
15161
15162 * lib/readpipe.c: New, from wdiff.
15163 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
15164 BISON_HAIRY.
15165 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
15166 specific values. Now it is m4 that performs the lookup.
15167 * src/parse-skel.y: Remove.
15168 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
15169 * src/output.c (actions_output, guards_output)
15170 (token_definitions_output): No longer keeps track of the output
15171 line number, hence remove the second argument.
15172 (guards_output): Check against the guard member of a rule, not the
15173 action member.
15174 Adjust callers.
15175 (output_skeleton): Don't look for the skeleton location, let m4 do
15176 that.
15177 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
15178 file will be used.
15179 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
15180 (prepare): Given that for the time being changesyntax is not
15181 usable in M4, rename the muscles using `-' to `_'.
15182 Define `defines_flag', `output_parser_name' and `output_header_name'.
15183 * src/output.h (actions_output, guards_output)
15184 (token_definitions_output): Adjust prototypes.
15185 * src/scan-skel.l: Instead of scanning the skeletons, it now
15186 processes the output of m4: `__oline__' and `#output'.
15187 * data/bison.simple: Adjust to be used by M4(sugar).
15188 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
15189 to date.
15190 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
15191 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
15192 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
15193 shamelessly stolen from CVS Autoconf.
15194
15195 2002-02-05 Akim Demaille <akim@epita.fr>
15196
15197 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
15198 * configure.in: Check for the declarations of free and malloc.
15199 * src/muscle_tab.c: Adjust.
15200
15201 2002-02-05 Akim Demaille <akim@epita.fr>
15202
15203 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
15204 which have no values.
15205
15206 2002-02-05 Akim Demaille <akim@epita.fr>
15207
15208 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
15209 * data/: here.
15210
15211 2002-01-29 Paul Eggert <eggert@twinsun.com>
15212
15213 * src/bison.simple (YYSIZE_T): Do not define merely because
15214 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
15215 On some platforms, <alloca.h> does not declare YYSTD (size_t).
15216
15217 2002-01-27 Akim Demaille <akim@epita.fr>
15218
15219 Fix `%nonassoc and eof'.
15220
15221 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
15222 which were not properly copied! Replace
15223 memcpy (res->errs, src->errs, src->nerrs);
15224 with
15225 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
15226 !!!
15227 * tests/regression.at (%nonassoc and eof): Adjust to newest
15228 Autotest: `.' is not in the PATH.
15229
15230 2002-01-27 Akim Demaille <akim@epita.fr>
15231
15232 * tests/sets.at (AT_EXTRACT_SETS): New.
15233 (Nullable): Use it.
15234 (Firsts): New.
15235
15236 2002-01-26 Akim Demaille <akim@epita.fr>
15237
15238 * tests/actions.at, tests/calc.at, tests/headers.at,
15239 * tests/torture.at: Adjust to the newest Autotest which no longer
15240 forces `.' in the PATH.
15241
15242 2002-01-25 Akim Demaille <akim@epita.fr>
15243
15244 * tests/regression.at (%nonassoc and eof): New.
15245 Suggested by Robert Anisko.
15246
15247 2002-01-24 Akim Demaille <akim@epita.fr>
15248
15249 Bison dumps core when trying to complain about broken input files.
15250 Reported by Cris van Pelt.
15251
15252 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
15253 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
15254 into...
15255 (Invalid inputs): Strengthen: exercise parse_percent_token.
15256
15257 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
15258
15259 * src/Makefile.am: Add bison.c++.
15260 * src/bison.c++: New skeleton.
15261
15262 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
15263
15264 * po/it.po: New.
15265
15266 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
15267
15268 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
15269
15270 2002-01-20 Marc Autret <marc@gnu.org>
15271
15272 * src/files.c (compute_output_file_names): Fix
15273
15274 2002-01-20 Marc Autret <marc@gnu.org>
15275
15276 * tests/output.at: New test.
15277 * src/files.c (compute_base_names): Don't map extensions when
15278 the YACC flag is set, use defaults.
15279 Reported by Evgeny Stambulchik.
15280
15281 2002-01-20 Marc Autret <marc@gnu.org>
15282
15283 * src/system.h: Need to define __attribute__ away for non-GCC
15284 compilers as well (i.e., the vendor C compiler).
15285 Suggested by Albert Chin-A-Young.
15286
15287 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
15288
15289 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
15290 canonical definition.
15291 * src/system.h: Use the canonical definition for PARAMS (avoids
15292 a conflict with the macro from lib/hash.h).
15293
15294 2002-01-11 Akim Demaille <akim@epita.fr>
15295
15296 * configure.in: Use AC_FUNC_STRNLEN.
15297 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
15298
15299 2002-01-09 Akim Demaille <akim@epita.fr>
15300
15301 * src/files.c, src/files.h (output_infix): New.
15302 (tab_extension): Remove.
15303 (compute_base_names): Compute the former, drop the latter.
15304 * src/output.c (prepare): Insert the muscles `output-infix', and
15305 `output-suffix'.
15306 * src/parse-skel.y (string, string.1): New.
15307 (section.header): Use it.
15308 (section.yacc): Remove.
15309 (prefix): Remove too.
15310 * src/scan-skel.l: Adjust.
15311 * src/bison.simple, src/bison.hairy: Adjust.
15312
15313 2002-01-09 Akim Demaille <akim@epita.fr>
15314
15315 * configure.in (WERROR_CFLAGS): Compute it.
15316 * src/Makefile.am (CFLAGS): Pass it.
15317 * tests/atlocal.in (CFLAGS): Idem.
15318 * src/files.c: Fix a few warnings.
15319 (get_extension_index): Remove, unused.
15320
15321 2002-01-08 Akim Demaille <akim@epita.fr>
15322
15323 * src/getargs.c (AS_FILE_NAME): New.
15324 (getargs): Use it to convert DOSish file names.
15325 * src/files.c (base_name): Rename as full_base_name to avoid
15326 clashes with `base_name ()'.
15327 (filename_split): New.
15328 (compute_base_names): N-th rewrite, using filename_split.
15329
15330 2002-01-08 Akim Demaille <akim@epita.fr>
15331
15332 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
15333 New, stolen from the Fileutils 4.1.
15334 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15335 * configure.in: Check for the presence of memrchr, and of its
15336 prototype.
15337
15338 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
15339
15340 * lib/hash.h (__P): Added definition for this macro.
15341 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
15342 BUILT_SOURCES, to ensure they are generated first.
15343 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
15344 %error-verbose to allow bootstrapping with bison 1.30x.
15345
15346 2002-01-06 Akim Demaille <akim@epita.fr>
15347
15348 * src/reader.c (parse_braces): Don't fetch the next char, the
15349 convention is to fetch on entry.
15350 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
15351 'switch' without a following semicolon.
15352 * tests/regression.at (braces parsing): New.
15353
15354 2002-01-06 Akim Demaille <akim@epita.fr>
15355
15356 Bison is dead wrong in its RR conflict reports.
15357
15358 * tests/torture.at (GNU Cim Grammar): New.
15359 * src/conflicts.c (count_rr_conflicts): Fix.
15360
15361 2002-01-06 Akim Demaille <akim@epita.fr>
15362
15363 Creating package.m4 from configure.ac causes too many problems.
15364
15365 * tests/Makefile.am (package.m4): Create it by hand,
15366 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
15367
15368 2002-01-06 Akim Demaille <akim@epita.fr>
15369
15370 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
15371 skeleton.h.
15372
15373 2002-01-04 Paul Eggert <eggert@twinsun.com>
15374
15375 * doc/bison.texinfo (Debugging):
15376 Remove YYSTDERR; it's no longer defined or used.
15377 Also, s/cstdio.h/cstdio/.
15378
15379 2002-01-03 Akim Demaille <akim@epita.fr>
15380
15381 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
15382
15383 2002-01-03 Akim Demaille <akim@epita.fr>
15384
15385 * src/parse-skel.y (process_skeleton): Don't bind the parser's
15386 tracing code to --trace, wait for a better --trace option, with
15387 args.
15388
15389 2002-01-03 Akim Demaille <akim@epita.fr>
15390
15391 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
15392 The ISO C++ standard is extremely clear about it: stderr is
15393 considered a macro, not a regular symbol (see table 94 `Header
15394 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
15395 Therefore std:: does not apply to it. It still does with fprintf.
15396 Also, s/cstdio.h/cstdio/.
15397
15398 2002-01-03 Akim Demaille <akim@epita.fr>
15399
15400 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
15401 for non system headers.
15402
15403 2002-01-02 Akim Demaille <akim@epita.fr>
15404
15405 Equip the skeleton chain with location tracking, runtime trace,
15406 pure parser and scanner.
15407
15408 * src/parse-skel.y: Request a pure parser, locations, and prefix
15409 renaming.
15410 (%union): Having several members with the same type does not help
15411 type mismatches, simplify.
15412 (YYPRINT, yyprint): New.
15413 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
15414 (skel_error): this.
15415 Handle locations.
15416 * src/scan-skel.l: Adjust to these changes.
15417 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
15418 (LOCATION_PRINT, skel_control_t): New.
15419
15420 2001-12-30 Akim Demaille <akim@epita.fr>
15421
15422 * src/parse-skel.y: Get rid of the shift/reduce conflict:
15423 replace `gb' with BLANKS.
15424 * src/scan-skel.l: Adjust.
15425
15426 2001-12-30 Akim Demaille <akim@epita.fr>
15427
15428 * src/system.h: We don't need nor want bcopy.
15429 Throw away MS-DOS crap: we don't need getpid.
15430 * configure.in: We don't need strndup. It was even causing
15431 problems: because Flex includes the headers *before* us,
15432 _GNU_SOURCE is not defined by config.h, and therefore strndup was
15433 not visible.
15434 * lib/xstrndup.c: New.
15435 * src/scan-skel.l: Use it.
15436 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
15437 * src/parse-skel.y: Use %directives instead of #defines.
15438
15439 2001-12-30 Akim Demaille <akim@epita.fr>
15440
15441 * src/skeleton.h: New.
15442 * src/output.c (output_parser, output_master_parser): Remove, dead
15443 code.
15444 * src/output.h (get_lines_number, actions_output, guards_output)
15445 (token_definitions_output): Prototype them.
15446 * src/parse-skel.y: Add the license notice.
15447 Include output.h and skeleton.h.
15448 (process_skeleton): Returns void, and takes a single parameter.
15449 * src/scan-skel.l: Add the license notice.
15450 Include skeleton.h.
15451 Don't use %option yylineno: it seems that then Flex imagines
15452 REJECT has been used, and therefore it won't reallocate its
15453 buffers (which makes no other sense to me than a bug). It results
15454 in warnings for `unused: yy_flex_realloc'.
15455
15456 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
15457
15458 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15459 (MUSCLE_INSERT_PREFIX): ...to there.
15460 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15461 (MUSCLE_INSERT_PREFIX): Move from here...
15462
15463 * src/bison.hairy: Add a section directive. Put braces around muscle
15464 names. This parser skeleton is still broken, but Bison should not
15465 choke on a bad muscle 'syntax'.
15466 * src/bison.simple: Add a section directive. Put braces around muscle
15467 names.
15468
15469 * src/files.h (strsuffix, stringappend): Add declarations.
15470 (tab_extension): Add declaration.
15471 (short_base_name): Add declaration.
15472
15473 * src/files.c (strsuffix, stringappend): No longer static. These
15474 functions are used in the skeleton parser.
15475 (tab_extension): New.
15476 (compute_base_names): Use the computations done in this function
15477 to guess if the generated parsers should have '.tab' in their
15478 names.
15479 (short_base_name): No longer static.
15480
15481 * src/output.c (output_skeleton): New.
15482 (output): Disable call to output_master_parser, and give a try to
15483 a new skeleton handling system.
15484 (guards_output, actions_output): No longer static.
15485 (token_definitions_output, get_lines_number): No longer static.
15486
15487 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
15488
15489 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
15490 parse-skel.y.
15491
15492 * src/parse-skel.y: New file.
15493 * src/scan-skel.l: New file.
15494
15495 2001-12-29 Akim Demaille <akim@epita.fr>
15496
15497 %name-prefix is broken.
15498
15499 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
15500 Adjust all dependencies.
15501 * tests/headers.at (export YYLTYPE): Strengthen this test: use
15502 %name-prefix.
15503
15504 Renaming yylval but not yylloc is not consistent. Now we do.
15505
15506 * src/bison.simple: Prefix yylloc if used.
15507 * doc/bison.texinfo (Decl Summary): Document that.
15508
15509 2001-12-29 Akim Demaille <akim@epita.fr>
15510
15511 * doc/bison.texinfo: Promote `%long-directive' over
15512 `%long_directive'.
15513 Remove all references to fixed-output-files, yacc is enough.
15514
15515 2001-12-29 Akim Demaille <akim@epita.fr>
15516
15517 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
15518 user prologue. These are defaults.
15519 * tests/actions.at (Mid-rule actions): Make sure the user can
15520 define YYDEBUG and YYERROR_VERBOSE.
15521
15522 2001-12-29 Akim Demaille <akim@epita.fr>
15523
15524 * src/output.c (header_output): Don't forget to export YYLTYPE and
15525 yylloc.
15526 * tests/headers.at (export YYLTYPE): New, make sure it does.
15527 * tests/regression.at (%union and --defines, Invalid CPP headers):
15528 Move to...
15529 * tests/headers.at: here.
15530
15531 2001-12-29 Akim Demaille <akim@epita.fr>
15532
15533 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
15534
15535 2001-12-29 Akim Demaille <akim@epita.fr>
15536
15537 * tests/actions.at (Mid-rule actions): Output on a single line
15538 instead of several.
15539
15540 2001-12-29 Akim Demaille <akim@epita.fr>
15541
15542 * doc/bison.texinfo: Formatting changes.
15543
15544 2001-12-29 Akim Demaille <akim@epita.fr>
15545
15546 Don't store the token defs in a muscle, just be ready to output it
15547 on command. Now possible via `symbols'. Fixes a memory leak.
15548
15549 * src/output.c (token_definitions_output): New.
15550 (output_parser, header_output): Use it.
15551 * src/reader.c (symbols_save): Remove.
15552
15553 2001-12-29 Akim Demaille <akim@epita.fr>
15554
15555 * src/bison.simple: Do not provide a default for YYSTYPE and
15556 YYLTYPE before the user's prologue. Otherwise it's hardly... a
15557 default.
15558
15559 2001-12-29 Akim Demaille <akim@epita.fr>
15560
15561 Mid-rule actions are simply... ignored!
15562
15563 * src/reader.c (readgram): Be sure to attach mid-rule actions to
15564 the empty-rule associated to the dummy symbol, not to the host
15565 rule.
15566 * tests/actions.at (Mid-rule actions): New.
15567
15568 2001-12-29 Akim Demaille <akim@epita.fr>
15569
15570 Memory leak.
15571
15572 * src/reader.c (reader): Free grammar.
15573
15574 2001-12-29 Akim Demaille <akim@epita.fr>
15575
15576 Memory leak.
15577
15578 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
15579 since it allocates it for each state, although only one is needed.
15580 (allocate_storage): Do it here.
15581
15582 2001-12-29 Akim Demaille <akim@epita.fr>
15583
15584 * src/options.h, src/options.c (create_long_option_table): Rename
15585 as...
15586 (long_option_table_new): this, with a clearer prototype.
15587 (percent_table): Remove, unused,
15588 * src/getargs.c (getargs): Adjust.
15589
15590 2001-12-29 Akim Demaille <akim@epita.fr>
15591
15592 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
15593 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
15594 as states.
15595
15596 2001-12-29 Akim Demaille <akim@epita.fr>
15597
15598 * src/lalr.c (build_relations): Rename `states' as `states1'.
15599 Sorry, I don't understand exactly what it is, no better name...
15600
15601 2001-12-29 Akim Demaille <akim@epita.fr>
15602
15603 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
15604 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
15605 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
15606 as rules.
15607
15608 2001-12-29 Akim Demaille <akim@epita.fr>
15609
15610 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
15611 ago.
15612
15613 2001-12-29 Akim Demaille <akim@epita.fr>
15614
15615 * src/reader.c, src/reader.h (user_toknums): Remove.
15616 Adjust all users to use symbols[i]->user_token_number.
15617
15618 2001-12-29 Akim Demaille <akim@epita.fr>
15619
15620 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
15621 Adjust all users to use symbols[i]->prec or ->assoc.
15622
15623 2001-12-29 Akim Demaille <akim@epita.fr>
15624
15625 * src/reader.c, src/reader.h (tags): Remove.
15626 Adjust all users to use symbols[i]->tag.
15627
15628 2001-12-29 Akim Demaille <akim@epita.fr>
15629
15630 * src/gram.h, src/gram.c (symbols): New, similar to state_table
15631 and rule_table.
15632 * src/reader.c (packsymbols): Fill this table.
15633 Drop sprec.
15634 * src/conflicts.c (resolve_sr_conflict): Adjust.
15635 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
15636 single table.
15637 Use symbols[i]->tag instead of tags[i].
15638
15639 2001-12-29 Akim Demaille <akim@epita.fr>
15640
15641 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
15642 In addition, put a comment in there, to replace...
15643 * tests/regression.at (%union and C comments): Remove.
15644
15645 2001-12-29 Akim Demaille <akim@epita.fr>
15646
15647 * tests/regression.at (Web2c Actions): Blindly move the actual
15648 output as expected output. The contents *seem* right to me, but I
15649 can't pretend reading perfectly parser tables... Nonetheless, all
15650 the other tests pass correctly, the table look OK, even though the
15651 presence of `$axiom' is to be noted: AFAICS it is useless (but
15652 harmless).
15653
15654 2001-12-29 Akim Demaille <akim@epita.fr>
15655
15656 * src/reader.c (readgram): Don't add the rule 0 if there were no
15657 rules read. In other words, add it _after_ having performed
15658 grammar sanity checks.
15659 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
15660
15661 2001-12-29 Akim Demaille <akim@epita.fr>
15662
15663 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
15664 visible, and some states have now a different number.
15665
15666 2001-12-29 Akim Demaille <akim@epita.fr>
15667
15668 * src/reader.c (readgram): Bind the initial rule's lineno to that
15669 of the first rule.
15670 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
15671 (Solved SR Conflicts): Adjust rule 0's line number.
15672
15673 2001-12-29 Akim Demaille <akim@epita.fr>
15674
15675 Fix the `GAWK Grammar' failure.
15676
15677 * src/LR0.c (final_state): Initialize to -1 so that we do compute
15678 the reductions of the first state which was mistakenly confused
15679 with the final state because precisely final_state was initialized
15680 to 0.
15681 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
15682 now noticed by Bison.
15683 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
15684 have a reduction on $default.
15685
15686 2001-12-29 Akim Demaille <akim@epita.fr>
15687
15688 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
15689 rule line numbers.
15690 * src/closure.c (print_closure): Likewise.
15691 * src/derives.c (print_derives): Likewise.
15692 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
15693 now.
15694
15695 2001-12-29 Akim Demaille <akim@epita.fr>
15696
15697 * src/lalr.c (lookaheads_print): New.
15698 (lalr): Call it when --trace-flag.
15699 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
15700 are dumped.
15701
15702 2001-12-29 Akim Demaille <akim@epita.fr>
15703
15704 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
15705 when walking through ritem, even via rule->rhs.
15706 * src/reduce.c (dump_grammar, useful_production, reduce_output)
15707 (useful_production, useless_nonterminals): Likewise.
15708 (reduce_grammar_tables): Likewise, plus update nritems.
15709 * src/nullable.c (set_nullable): Likewise.
15710 * src/lalr.c (build_relations): Likewise.
15711 * tests/sets.at (Nullable): Adjust.
15712 Fortunately, now, the $axiom is no longer nullable.
15713
15714 2001-12-29 Akim Demaille <akim@epita.fr>
15715
15716 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
15717 the 0-sentinel.
15718 * src/gram.c (ritem_longest_rhs): Likewise.
15719 * src/reduce.c (nonterminals_reduce): Likewise.
15720 * src/print_graph.c (print_graph): Likewise.
15721 * src/output.c (output_rule_data): Likewise.
15722 * src/nullable.c (set_nullable): Likewise.
15723
15724 2001-12-29 Akim Demaille <akim@epita.fr>
15725
15726 * src/output.c: Comment changes.
15727
15728 2001-12-27 Paul Eggert <eggert@twinsun.com>
15729
15730 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
15731 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
15732 Sparc, as they were causing more porting problems than the
15733 (minor) performance improvement was worth.
15734
15735 Also, catch up with 1.31's YYSTD.
15736
15737 2001-12-27 Akim Demaille <akim@epita.fr>
15738
15739 * src/output.c (output_gram): Rely on nritems, not the
15740 0-sentinel. See below.
15741 Use -1 as separator, not 0.
15742 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
15743 Rely on -1 as separator in yyrhs, instead of 0.
15744 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
15745 twice `Now at end of input', therefore there are two lines less to
15746 expect.
15747
15748 2001-12-27 Akim Demaille <akim@epita.fr>
15749
15750 * tests/regression.at (Unresolved SR Conflicts):
15751 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
15752 below.
15753
15754 2001-12-27 Akim Demaille <akim@epita.fr>
15755
15756 * src/LR0.c (new_state): Recognize the final state by the fact it
15757 is reached by eoftoken.
15758 (insert_start_shifting_state, insert_eof_shifting_state)
15759 (insert_accepting_state, augment_automaton): Remove, since now
15760 these states are automatically computed from the initial state.
15761 (generate_states): Adjust.
15762 * src/print.c: When reporting a rule number to the user, substract
15763 1, so that the axiom rule is rule 0, and the first user rule is 1.
15764 * src/reduce.c: Likewise.
15765 * src/print_graph.c (print_core): For the time being, just as for
15766 the report, depend upon --trace-flags to dump the full set of
15767 items.
15768 * src/reader.c (readgram): Once the grammar read, insert the rule
15769 0: `$axiom: START-SYMBOL $'.
15770 * tests/set.at: Adjust: rule 0 is now displayed, and since the
15771 number of the states has changed (the final state is no longer
15772 necessarily the last), catch up.
15773
15774 2001-12-27 Akim Demaille <akim@epita.fr>
15775
15776 Try to make the use of the eoftoken valid. Given that its value
15777 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
15778 is used instead of > 0 where appropriate, (ii), depend upon nritems
15779 instead of the 0-sentinel.
15780
15781 * src/gram.h, src/gram.c (nritems): New.
15782 Expected to be duplication of nitems, but for the time being...
15783 * src/reader.c (packgram): Assert nritems and nitems are equal.
15784 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
15785 * src/closure.c (print_closure, print_fderives): Likewise.
15786 * src/gram.c (ritem_print): Likewise.
15787 * src/print.c (print_core, print_grammar): Likewise.
15788 * src/print_graph.c: Likewise.
15789
15790 2001-12-27 Akim Demaille <akim@epita.fr>
15791
15792 * src/main.c (main): If there are complains after grammar
15793 reductions, then output the report anyway if requested, then die.
15794 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
15795 * src/reader.c (eoftoken): New.
15796 (parse_token_decl): If the token being defined has value `0', it
15797 is the eoftoken.
15798 (packsymbols): No longer hack `tags' to insert `$' by hand.
15799 Be sure to preserve the value of the eoftoken.
15800 (reader): Make sure eoftoken is defined.
15801 Initialize nsyms to 0: now eoftoken is created just like the others.
15802 * src/print.c (print_grammar): Don't special case the eof token.
15803 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
15804 lie anyway, albeit pleasant.
15805 * tests/calc.at: Exercise error messages with eoftoken.
15806 Change the grammar so that empty input is invalid.
15807 Adjust expectations.
15808 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
15809
15810 2001-12-27 Akim Demaille <akim@epita.fr>
15811
15812 * configure.in: Check the protos of strchr ans strspn.
15813 Replace strchr if needed.
15814 * src/system.h: Provide the protos of strchr, strspn and memchr if
15815 missing.
15816 * lib/strchr.c: New.
15817 * src/reader.c (symbols_save): Use strchr.
15818
15819 2001-12-27 Akim Demaille <akim@epita.fr>
15820
15821 * src/print.c, src/print_graph.c (escape): New.
15822 Use it to quote the TAGS outputs.
15823 * src/print_graph.c (print_state): Now errors are in red, and
15824 reductions in green.
15825 Prefer high to wide: output the state number on a line of its own.
15826
15827 2001-12-27 Akim Demaille <akim@epita.fr>
15828
15829 * src/state.h, src/state.c (reductions_new): New.
15830 * src/LR0.c (set_state_table): Let all the states have a
15831 `reductions', even if reduced to 0.
15832 (save_reductions): Adjust.
15833 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15834 * src/print.c (print_reductions, print_actions): Adjust.
15835 * src/output.c (action_row): Adjust.
15836
15837 2001-12-27 Akim Demaille <akim@epita.fr>
15838
15839 * src/state.h, src/state.c (errs_new, errs_dup): New.
15840 * src/LR0.c (set_state_table): Let all the states have an errs,
15841 even if reduced to 0.
15842 * src/print.c (print_errs, print_reductions): Adjust.
15843 * src/output.c (output_actions, action_row): Adjust.
15844 * src/conflicts.c (resolve_sr_conflict): Adjust.
15845
15846 2001-12-27 Akim Demaille <akim@epita.fr>
15847
15848 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15849
15850 2001-12-27 Akim Demaille <akim@epita.fr>
15851
15852 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15853 * src/print.c: here.
15854 (lookaheadset, shiftset): New, used as additional storage by
15855 print_reductions.
15856 (print_results): Adjust.
15857 (print_shifts, print_gotos, print_errs): New, extracted from...
15858 (print_actions): here.
15859 * src/print_graph.c (print_actions): Remove dead code.
15860
15861 2001-12-27 Akim Demaille <akim@epita.fr>
15862
15863 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15864 `$n' and `@n'.
15865
15866 2001-12-27 Akim Demaille <akim@epita.fr>
15867
15868 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15869 (build_relations): Adjust.
15870
15871 2001-12-27 Akim Demaille <akim@epita.fr>
15872
15873 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15874 duplication.
15875
15876 2001-12-27 Akim Demaille <akim@epita.fr>
15877
15878 * src/reader.c (packgram): Catch nitems overflows.
15879
15880 2001-12-27 Akim Demaille <akim@epita.fr>
15881
15882 * src/files.c, src/files.h (guard_obstack): Remove.
15883 * src/output.c (output): Adjust.
15884 * src/reader.c (parse_braces): New, factoring...
15885 (copy_action, copy_guard): these two which are renamed as...
15886 (parse_action, parse_guard): these.
15887 As a voluntary consequence, using braces around guards is now
15888 mandatory.
15889
15890 2001-12-27 Akim Demaille <akim@epita.fr>
15891
15892 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15893 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15894 members.
15895 (symbol_list_new): Adjust.
15896 (copy_action): action_line is the first line, not the last.
15897 (copy_guard): Just as for actions, store the `action' only, not
15898 the switch/case/break flesh.
15899 Don't parse the user action that might follow the guard, let...
15900 (readgram): do it, i.e., now, there can be an action after a
15901 guard.
15902 In other words the guard is just explicitly optional.
15903 (packgram): Adjust.
15904 * src/output.c (guards_output): New.
15905 (output_parser): Call it when needed.
15906 (output): Also free the guard and attrs obstacks.
15907 * src/files.c, src/files.h (obstack_save): Remove.
15908 (output_files): Remove.
15909 As a result, if one needs the former `.act' file, using an
15910 appropriate skeleton which requires actions and guards is now
15911 required.
15912 * src/main.c (main): Adjust.
15913 * tests/semantic.at: New.
15914 * tests/regression.at: Use `input.y' as input file name.
15915 Avoid 8+3 problems by requiring input.c when the test needs the
15916 parser.
15917
15918 2001-12-27 Akim Demaille <akim@epita.fr>
15919
15920 * src/reader.c (symbol_list_new): Be sure to initialize all the
15921 fields.
15922
15923 2001-12-27 Akim Demaille <akim@epita.fr>
15924
15925 All the hacks using a final pseudo state are now useless.
15926
15927 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15928 * src/lalr.c (nLA): New.
15929 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15930 instead of lookaheadsp from the pseudo state (nstate + 1).
15931
15932 2001-12-27 Akim Demaille <akim@epita.fr>
15933
15934 * src/output.c (action_row, token_actions): Use a state_t instead
15935 of a integer, and nlookaheads instead of the following state's
15936 lookaheadsp.
15937
15938 2001-12-27 Akim Demaille <akim@epita.fr>
15939
15940 * src/conflicts.c (log_resolution, flush_shift)
15941 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15942 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15943 (conflicts_print, print_reductions): Use a state_t instead of an
15944 integer when referring to a state.
15945 As much as possible, depend upon nlookaheads, instead of the
15946 `lookaheadsp' member of the following state (since lookaheads of
15947 successive states are successive, the difference between state n + 1
15948 and n served as the number of lookaheads for state n).
15949 * src/lalr.c (add_lookback_edge): Likewise.
15950 * src/print.c (print_core, print_actions, print_state)
15951 (print_results): Likewise.
15952 * src/print_graph.c (print_core, print_actions, print_state)
15953 (print_graph): Likewise.
15954 * src/conflicts.h: Adjust.
15955
15956 2001-12-27 Akim Demaille <akim@epita.fr>
15957
15958 * src/bison.hairy: Formatting/comment changes.
15959 ANSIfy.
15960 Remove `register' indications.
15961 Add plenty of `static'.
15962
15963 2001-12-27 Akim Demaille <akim@epita.fr>
15964
15965 * src/output.c (prepare): Drop the muscle `ntbase' which
15966 duplicates ntokens.
15967 * src/bison.simple: Formatting/comment changes.
15968 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15969 is an undocumented synonym.
15970
15971 2001-12-22 Akim Demaille <akim@epita.fr>
15972
15973 * src/output.c (output_table_data): Change the prototype to use
15974 `int' for array ranges: some invocations do pass an int, not a
15975 short.
15976 Reported by Wayne Green.
15977
15978 2001-12-22 Akim Demaille <akim@epita.fr>
15979
15980 Some actions of web2c.y are improperly triggered.
15981 Reported by Mike Castle.
15982
15983 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15984 * tests/regression.at (Web2c): Rename as...
15985 (Web2c Report): this.
15986 (Web2c Actions): New.
15987
15988 2001-12-22 Akim Demaille <akim@epita.fr>
15989
15990 Reductions in web2c.y are improperly reported.
15991 Reported by Mike Castle.
15992
15993 * src/conflicts.c (print_reductions): Fix.
15994 * tests/regression.at (Web2c): New.
15995
15996 2001-12-18 Akim Demaille <akim@epita.fr>
15997
15998 Some host fail on `assert (!"foo")', which expands to
15999 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
16000 Reported by Nelson Beebee.
16001
16002 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
16003 `#define it_succeeded 0' and `assert (it_succeeded)'.
16004
16005 2001-12-17 Marc Autret <autret_m@epita.fr>
16006
16007 * src/bison.simple: Don't hard code the skeleton line and filename.
16008 * src/output.c (output_parser): Rename 'line' as 'output_line'.
16009 New line counter 'skeleton_line' (skeleton-line muscle).
16010
16011 2001-12-17 Paul Eggert <eggert@twinsun.com>
16012
16013 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
16014 YYDEBUG must be defined to a nonzero value.
16015
16016 * src/bison.simple (yytname): Do not assume that the user defines
16017 YYDEBUG to a properly parenthesized expression.
16018
16019 2001-12-17 Akim Demaille <akim@epita.fr>
16020
16021 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
16022 nlookaheads is a new member.
16023 Adjust all users.
16024 * src/lalr.h (nlookaheads): Remove this orphan declaration.
16025 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
16026 state.
16027
16028 2001-12-17 Akim Demaille <akim@epita.fr>
16029
16030 * src/files.h, src/files.c (open_files, close_files): Remove.
16031 * src/main.c (main): Don't open/close files, nor invoke lex_free,
16032 let...
16033 * src/reader.c (reader): Do it.
16034
16035 2001-12-17 Akim Demaille <akim@epita.fr>
16036
16037 * src/conflicts.c (print_reductions): Formatting changes.
16038
16039 2001-12-17 Akim Demaille <akim@epita.fr>
16040
16041 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
16042 (flush_reduce): New.
16043 (resolve_sr_conflict): Adjust.
16044
16045 2001-12-17 Akim Demaille <akim@epita.fr>
16046
16047 * src/output.c (output_obstack): Be static and rename as...
16048 (format_obstack): this, to avoid any confusion with files.c's
16049 output_obstack.
16050 * src/reader.h (muscle_obstack): Move to...
16051 * src/output.h: here, since it's defined in output.c.
16052
16053 2001-12-17 Akim Demaille <akim@epita.fr>
16054
16055 * src/output.c (action_row, save_column, default_goto)
16056 (sort_actions, matching_state, pack_vector): Better variable
16057 locality.
16058
16059 2001-12-17 Akim Demaille <akim@epita.fr>
16060
16061 * src/output.c: Various formatting changes.
16062
16063 2001-12-17 Akim Demaille <akim@epita.fr>
16064
16065 * src/files.c (output_files): Free the output_obstack.
16066 * src/main.c (main): Call print and print_graph conditionally.
16067 * src/print.c (print): Work unconditionally.
16068 * src/print_graph.c (print_graph): Work unconditionally.
16069 * src/conflicts.c (log_resolution): Output only if verbose_flag.
16070
16071 2001-12-16 Marc Autret <autret_m@epita.fr>
16072
16073 * src/output.c (actions_output): Fix. When we use %no-lines,
16074 there is one less line per action.
16075
16076 2001-12-16 Marc Autret <autret_m@epita.fr>
16077
16078 * src/bison.simple: Remove a useless #line directive.
16079 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
16080 * src/output.c (get_lines_number): New.
16081 (output_parser): Adjust, now takes care about the lines of a
16082 output muscles.
16083 Fix line numbering.
16084 (actions_output): Computes the number of lines taken by actions.
16085 (output_master_parser): Insert new skeleton which is the name of
16086 the output parser file name.
16087
16088 2001-12-15 Marc Autret <autret_m@epita.fr>
16089
16090 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
16091
16092 2001-12-15 Marc Autret <autret_m@epita.fr>
16093
16094 * src/output.c (output_gram): Keep track of the hairy one.
16095
16096 2001-12-15 Akim Demaille <akim@epita.fr>
16097
16098 Make `make distcheck' work.
16099
16100 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
16101 system.h which uses libgettext.h.
16102
16103 2001-12-15 Akim Demaille <akim@epita.fr>
16104
16105 * src/nullable.c (set_nullable): Useless rules must be skipped,
16106 otherwise, since we range over their symbols, we might look at a
16107 nonterminal which no longer ``exists'', i.e., it is not counted in
16108 `nvars', hence we overflow our arrays.
16109
16110 2001-12-15 Akim Demaille <akim@epita.fr>
16111
16112 The header can also be produced directly, without any obstack!
16113 Yahoo!
16114
16115 * src/files.c, src/files.h (defines_obstack): Remove.
16116 (compute_header_macro): Global.
16117 (defines_obstack_save): Remove.
16118 * src/reader.c (parse_union_decl): No longer output to
16119 defines_obstack: its content can be found in the `stype' muscle
16120 anyway.
16121 (output_token_translations): Merge into...
16122 (symbols_output): this.
16123 Rename as...
16124 (symbols_save): this.
16125 (reader): Adjust.
16126 * src/output.c (header_output): New.
16127 (output): Call it.
16128
16129 2001-12-15 Akim Demaille <akim@epita.fr>
16130
16131 * src/reader.c (parse_union_decl): Instead of handling two obstack
16132 simultaneously, use one to define the `stype' muscle, and use the
16133 value of the latter to fill defines_obstack.
16134 (copy_comment): Remove.
16135 (copy_comment2): Work for a single obstack.
16136 Rename as...
16137 (copy_comment): this.
16138
16139 2001-12-15 Akim Demaille <akim@epita.fr>
16140
16141 * src/lex.c, src/lex.h (xgetc): No longer static.
16142 * src/reader.c (parse_union_decl): Revamp.
16143
16144 2001-12-15 Akim Demaille <akim@epita.fr>
16145
16146 Still making progress in separating Bison into (i) input, (ii)
16147 process, (iii) output: now we can directly output the parser file
16148 without using table_obstack at all.
16149
16150 * src/files.c, src/files.h (table_obstack): Bye bye.
16151 (parser_file_name): New.
16152 * src/files.c (compute_output_file_names): Compute it.
16153 * src/output.c (actions_output, output_parser)
16154 (output_master_parser): To a file instead of an obstack.
16155
16156 2001-12-15 Akim Demaille <akim@epita.fr>
16157
16158 Attach actions to rules, instead of pre-outputting them to
16159 actions_obstack.
16160
16161 * src/gram.h (rule_t): action and action_line are new members.
16162 * src/reader.c (symbol_list): Likewise.
16163 (copy_action): Save the actions within the rule.
16164 (packgram): Save them in rule_table.
16165 * src/output.c (actions_output): New.
16166 (output_parser): Use it on `%%actions'.
16167 (output_rule_data): Don't free rule_table.
16168 (output): Do it.
16169 (prepare): Don't save the `action' muscle.
16170 * src/bison.simple: s/%%action/%%actions/.
16171
16172 2001-12-15 Akim Demaille <akim@epita.fr>
16173
16174 * src/reader.c (copy_action): When --yacc, don't append a `;'
16175 to the user action: let it fail if lacking.
16176 Suggested by Arnold Robbins and Tom Tromey.
16177
16178 2001-12-14 Akim Demaille <akim@epita.fr>
16179
16180 * src/lex.c (literalchar): Simply return the char you decoded, non
16181 longer mess around with obstacks and int pointers.
16182 Adjust all callers.
16183
16184 2001-12-14 Akim Demaille <akim@epita.fr>
16185
16186 * src/lex.c (literalchar): Don't escape the special characters,
16187 just decode them, and keep them as char (before, eol was output as
16188 the 2 char string `\n' etc.).
16189 * src/output.c (output_rule_data): Use quotearg to output the
16190 token strings.
16191
16192 2001-12-13 Paul Eggert <eggert@twinsun.com>
16193
16194 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
16195 Do not infringe on the global user namespace when using C++.
16196 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
16197 All uses of `fprintf' and `stderr' changed.
16198
16199 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
16200
16201 2001-12-13 Akim Demaille <akim@epita.fr>
16202
16203 The computation of nullable is broken: it doesn't handle empty
16204 RHS's properly.
16205
16206 * tests/torture.at (GNU AWK Grammar): New.
16207 * tests/sets.at (Nullable): New.
16208 * src/nullable.c (set_nullable): Instead of blindly looping over
16209 `ritems', loop over the rules, and then over their rhs's.
16210
16211 Work around Autotest bugs.
16212
16213 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
16214 frame, because Autotest understand lines starting with a `+' as
16215 traces from the shell. Then, they are not processed properly.
16216 Admittedly an Autotest bug, but we don't have time to wait for
16217 Autotest to catch up.
16218 * tests/regression.at (Broken Closure): Adjust to the new table
16219 frames.
16220 Move to...
16221 * tests/sets.at: here.
16222
16223 2001-12-13 Akim Demaille <akim@epita.fr>
16224
16225 * src/closure.c (closure): Use nrules instead of playing tricks
16226 with BITS_PER_WORD.
16227
16228 2001-12-13 Akim Demaille <akim@epita.fr>
16229
16230 * src/print.c (print_actions): Output the handling of `$' as the
16231 traces do: shifting the token EOF. Before EOF was treated as a
16232 nonterminal.
16233 * tests/regression.at: Adjust some tests.
16234 * src/print_graph.c (print_core): Complete the set of items via
16235 closure. The next-to-final and final states are still unsatisfying,
16236 but that's to be addressed elsewhere.
16237 No longer output the rule numbers, but do output the state number.
16238 A single loop for the shifts + gotos is enough, but picked a
16239 distinct color for each.
16240 (print_graph): Initialize and finalize closure.
16241
16242 2001-12-13 Akim Demaille <akim@epita.fr>
16243
16244 * src/reader.c (readgram): Remove dead code, an strip useless
16245 braces.
16246 (get_type): Remove, unused.
16247
16248 2001-12-12 Akim Demaille <akim@epita.fr>
16249
16250 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
16251 on that of lib/error.c.
16252
16253 2001-12-12 Akim Demaille <akim@epita.fr>
16254
16255 Some hosts don't like `/' in includes.
16256
16257 * src/system.h: Include libgettext.h without qualifying the path.
16258 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
16259 $(top_srcdir).
16260
16261 2001-12-11 Marc Autret <autret_m@epita.fr>
16262
16263 * src/output.c (output_parser): Remove useless muscle.
16264
16265 2001-12-11 Marc Autret <autret_m@epita.fr>
16266
16267 * src/bison.simple: Remove #line just before %%epilogue. It
16268 is now handled in ...
16269 * src/reader.c (read_additionnal_code): Add the output of a
16270 #line for the epilogue.
16271
16272 2001-12-10 Marc Autret <autret_m@epita.fr>
16273
16274 * src/reader.c (copy_definition): Re-use CPP-outed code which
16275 replace precedent remove.
16276 * src/bison.simple: Remove #line before %%prologue because
16277 %%input-line is wrong at this time.
16278
16279 2001-12-10 Marc Autret <autret_m@epita.fr>
16280
16281 * src/reader.c (symbols_output): Clean up.
16282 * src/output.c (output_gram, output): Clean up.
16283
16284 2001-12-10 Akim Demaille <akim@epita.fr>
16285
16286 * src/lalr.c (initialize_lookaheads): New. Extracted from...
16287 * src/LR0.c (set_state_table): here.
16288 * src/lalr.c (lalr): Call it.
16289
16290 2001-12-10 Akim Demaille <akim@epita.fr>
16291
16292 * src/state.h (shifts): Remove the `number' member: shifts are
16293 attached to state, hence no longer need to be labelled with a
16294 state number.
16295
16296 2001-12-10 Akim Demaille <akim@epita.fr>
16297
16298 Now that states have a complete set of members, the linked list of
16299 shifts is useless: just fill directly the state's shifts member.
16300
16301 * src/state.h (shifts): Remove the `next' member.
16302 * src/LR0.c (first_state, last_state): Remove.
16303 Adjust the callers.
16304 (augment_automaton): Don't look for the shifts that must be added
16305 a shift on EOF: it is those of the state we looked for! But now,
16306 since shifts are attached, it is no longer needed to looking
16307 merely by its id: its number.
16308
16309 2001-12-10 Akim Demaille <akim@epita.fr>
16310
16311 * src/LR0.c (augment_automaton): Better variable locality.
16312 Remove an impossible branch: if there is a state corresponding to
16313 the start symbol being shifted, then there is shift for the start
16314 symbol from the initial state.
16315
16316 2001-12-10 Akim Demaille <akim@epita.fr>
16317
16318 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
16319 only when appropriate: when insert_start_shifting_state' is not
16320 invoked.
16321 * tests/regression.at (Rule Line Numbers): Adjust.
16322
16323 2001-12-10 Akim Demaille <akim@epita.fr>
16324
16325 * src/LR0.c (augment_automaton): Now that all states have shifts,
16326 merge the two cases addition shifts to the initial state.
16327
16328 2001-12-10 Akim Demaille <akim@epita.fr>
16329
16330 * src/lalr.c (set_state_table): Move to...
16331 * src/LR0.c: here.
16332 * src/lalr.c (lalr): Don't call it...
16333 * src/LR0.c (generate_states): do it.
16334 * src/LR0.h (first_state): Remove, only the table is used.
16335
16336 2001-12-10 Akim Demaille <akim@epita.fr>
16337
16338 * src/LR0.h (first_shift, first_reduction): Remove.
16339 * src/lalr.c: Don't use first_shift: find shifts through the
16340 states.
16341
16342 2001-12-10 Akim Demaille <akim@epita.fr>
16343
16344 * src/LR0.c: Attach shifts to states as soon as they are
16345 computed.
16346 * src/lalr.c (set_state_table): Instead of assigning shifts to
16347 state, just assert that the mapping was properly done.
16348
16349 2001-12-10 Akim Demaille <akim@epita.fr>
16350
16351 * src/LR0.c (insert_start_shift): Rename as...
16352 (insert_start_shifting_state): this.
16353 (insert_eof_shifting_state, insert_accepting_state): New.
16354 (augment_automaton): Adjust.
16355 Better locality of the variables.
16356 When looking if the start_symbol is shifted from the initial
16357 state, using `while (... symbol != start_symbol ...)' sounds
16358 better than `while (... symbol < start_symbol ...)': If fail
16359 to see how the order between symbols could be relevant!
16360
16361 2001-12-10 Akim Demaille <akim@epita.fr>
16362
16363 * src/getargs.h: Don't declare `spec_name_prefix' and
16364 `spec_file_prefix', declared by src/files.h.
16365 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
16366 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
16367 * src/output.c (prepare): Adjust.
16368 * src/reader.c (symbols_output): Likewise.
16369 * src/vmsgetargs.c: Vaguely adjust, but who cares?
16370
16371 2001-12-10 Akim Demaille <akim@epita.fr>
16372
16373 * src/muscle_tab.c (muscle_init): NULL is a better default than
16374 `"0"'.
16375
16376 2001-12-10 Akim Demaille <akim@epita.fr>
16377
16378 * src/reader.c (reader): Calling symbols_output once is enough.
16379
16380 2001-12-10 Akim Demaille <akim@epita.fr>
16381
16382 Now that states have a complete set of members, the linked list of
16383 reductions is useless: just fill directly the state's reductions
16384 member.
16385
16386 * src/state.h (struct reductions): Remove member `number' and
16387 `next'.
16388 * src/LR0.c (first_reduction, last_reduction): Remove.
16389 (save_reductions): Don't link the new reductions, store them in
16390 this_state.
16391 * src/lalr.c (set_state_table): No need to attach reductions to
16392 states, it's already done.
16393 * src/output.c (output_actions): No longer free the shifts, then
16394 the reductions, then the states: free all the states and their
16395 members.
16396
16397 2001-12-10 Akim Demaille <akim@epita.fr>
16398
16399 * src/options.c (OPTN, DRTV, BOTH): New.
16400 (option_table): Use them.
16401
16402 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
16403 the job of system.h.
16404 * src/options.c: Don't include stdio.h and xalloc.h for the same
16405 reasons.
16406
16407 2001-12-10 Akim Demaille <akim@epita.fr>
16408
16409 * src/output.c (output, prepare): Make sure the values of the
16410 muscles `action' and `prologue' are 0-terminated.
16411
16412 2001-12-10 Akim Demaille <akim@epita.fr>
16413
16414 Clean up GCC warnings.
16415
16416 * src/reader.c (copy_action): `buf' is not used.
16417 (parse_skel_decl): Be static.
16418 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
16419 * src/options.h (create_long_option_table): Have a real prototype.
16420 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
16421 (hash_delete_at): Return const void *.
16422 Adjust casts to preserve the const.
16423
16424 2001-12-10 Akim Demaille <akim@epita.fr>
16425
16426 * configure.in: Require 2.52g.
16427 M4 is not needed, but AUTOM4TE is.
16428 * m4/m4.m4: Remove.
16429 * tests/Makefile.am: Adjust.
16430
16431 2001-12-10 Akim Demaille <akim@epita.fr>
16432
16433 One structure for states is enough, even though theoretically
16434 there are LR(0) states and LALR(1) states.
16435
16436 * src/lalr.h (state_t): Remove.
16437 (state_table): Be state_t **, not state_t *.
16438 * src/state.h (core, CORE_ALLOC): Rename as...
16439 (state_t, STATE_ALLOC): this.
16440 Add the LALR(1) members: shifts, reductions, errs.
16441 * src/LR0.c (state_table): Rename as...
16442 (state_hash): this, to avoid name clashes with the global
16443 `state_table'.
16444 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
16445 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
16446
16447 2001-12-10 Akim Demaille <akim@epita.fr>
16448
16449 Bison dumps core on bash.y.
16450 Reported by Pascal Bart.
16451
16452 * src/warshall.c (bitmatrix_print): New.
16453 (TC): Use it.
16454 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
16455 j must be the outer loop.
16456 * tests/regression.at (Broken Closure): New.
16457
16458 2001-12-05 Akim Demaille <akim@epita.fr>
16459
16460 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
16461 its argument.
16462 Reported by Peter Hamorsky.
16463
16464 2001-12-05 Akim Demaille <akim@epita.fr>
16465
16466 * src/conflicts.c (err_table): Remove.
16467 (resolve_sr_conflict): Adjust.
16468 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
16469 Rename as...
16470 (state_t.reductions, state_t.shifts): this.
16471
16472 2001-12-05 Akim Demaille <akim@epita.fr>
16473
16474 * src/reduce.c (reduce_grammar_tables): No longer disable the
16475 removal of useless rules via CPP but via `if (0)', so that the
16476 compiler still check the code is valid.
16477 For instance, it should have noticed `rline' no longer exists: use
16478 the `line' member of rule_t.
16479 * src/gram.c (dummy, rline): Remove, unused.
16480
16481 2001-12-05 Akim Demaille <akim@epita.fr>
16482
16483 * src/output.c (pack_vector): Use assert, not berror.
16484 * src/main.c (berror): Remove, unused.
16485
16486 2001-12-05 Akim Demaille <akim@epita.fr>
16487
16488 New experimental feature: if --verbose --trace output all the
16489 items of a state, not only its kernel.
16490
16491 * src/print.c (print_core): If `trace_flag', then invoke closure
16492 before outputting the items of the state (print_core is no longer
16493 a correct name them).
16494 (print_results): Invoke new_closure/free_closure if needed.
16495
16496 2001-12-05 Akim Demaille <akim@epita.fr>
16497
16498 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
16499 * src/closure.c, src/closure.h (itemsetsize): Rename as...
16500 (nitemset): for consistency with the rest of the project.
16501
16502 2001-12-05 Akim Demaille <akim@epita.fr>
16503
16504 * src/closure.c (print_closure): Improve.
16505 (closure): Use it for printing input and output.
16506
16507 2001-12-05 Akim Demaille <akim@epita.fr>
16508
16509 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
16510 indexed by nonterminals.
16511
16512 2001-12-05 Akim Demaille <akim@epita.fr>
16513
16514 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
16515 what it was!).
16516 * src/warshall.h: Remove accidental duplication of the content.
16517
16518 2001-12-05 Akim Demaille <akim@epita.fr>
16519
16520 * src/closure.c (set_fderives): De-obfuscate.
16521
16522 2001-12-05 Akim Demaille <akim@epita.fr>
16523
16524 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
16525
16526 2001-12-05 Akim Demaille <akim@epita.fr>
16527
16528 * src/closure.c (set_firsts): De-obfuscate.
16529
16530 2001-12-05 Akim Demaille <akim@epita.fr>
16531
16532 * src/output.c (action_row): De-obfuscate
16533 using the good o' techniques: arrays not pointers, variable
16534 locality, BITISSET, RESETBIT etc.
16535
16536 2001-12-05 Akim Demaille <akim@epita.fr>
16537
16538 Pessimize the code to simplify it: from now on, all the states
16539 have a valid SHIFTS, which NSHIFTS is possibly 0.
16540
16541 * src/LR0.c (shifts_new): Be global and move to..
16542 * src/state.c, src/state.h: here.
16543 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
16544 * src/print_graph: Adjust.
16545
16546 2001-12-05 Akim Demaille <akim@epita.fr>
16547
16548 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
16549 * src/conflicts.c: Use it.
16550 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
16551 incorrectly ``simplified''.
16552
16553 2001-12-05 Akim Demaille <akim@epita.fr>
16554
16555 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
16556 using the good o' techniques: arrays not pointers, variable
16557 locality, BITISSET, RESETBIT etc.
16558
16559 2001-12-05 Akim Demaille <akim@epita.fr>
16560
16561 * src/state.h (SHIFT_SYMBOL): New.
16562 * src/conflicts.c: Use it to deobfuscate.
16563
16564 2001-12-05 Akim Demaille <akim@epita.fr>
16565
16566 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
16567 (print_reductions): De-obfuscate using the good o' techniques:
16568 arrays not pointers, variable locality, BITISSET.
16569
16570 2001-12-05 Akim Demaille <akim@epita.fr>
16571
16572 * src/conflicts.c (print_reductions): Arrays, not pointers.
16573 Use BITISSET.
16574
16575 2001-12-05 Akim Demaille <akim@epita.fr>
16576
16577 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16578
16579 2001-12-05 Akim Demaille <akim@epita.fr>
16580
16581 * src/conflicts.c (print_reductions): Improve variable locality.
16582
16583 2001-12-05 Akim Demaille <akim@epita.fr>
16584
16585 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16586
16587 2001-12-05 Akim Demaille <akim@epita.fr>
16588
16589 * src/conflicts.c (print_reductions): Improve variable locality.
16590
16591 2001-12-05 Akim Demaille <akim@epita.fr>
16592
16593 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
16594 * src/lalr.c: Use them.
16595
16596 2001-12-05 Akim Demaille <akim@epita.fr>
16597
16598 * src/LR0.c (augment_automaton): Formatting changes.
16599 Better variable locality.
16600
16601 2001-12-05 Akim Demaille <akim@epita.fr>
16602
16603 * src/lalr.c (matrix_print): New.
16604 (transpose): Use it.
16605 Use arrays instead of pointers.
16606
16607 2001-12-05 Akim Demaille <akim@epita.fr>
16608
16609 * src/lalr.c (maxrhs): Move to...
16610 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
16611 * src/lalr.c (build_relations): Adjust.
16612
16613 2001-12-05 Akim Demaille <akim@epita.fr>
16614
16615 * src/lalr.c (transpose): Free the memory allocated to the
16616 argument, as it is replaced by the results by the unique caller.
16617 (build_relations): Merely invoke transpose: it handles the memory
16618 deallocation.
16619 Improve variable locality.
16620 Avoid variables used as mere abbreviations.
16621 (compute_lookaheads): Use arrays instead of pointers.
16622
16623 2001-12-05 Akim Demaille <akim@epita.fr>
16624
16625 * src/lalr.c (initialize_F): Improve variable locality.
16626 Avoid variables used as mere abbreviations.
16627
16628 2001-12-05 Akim Demaille <akim@epita.fr>
16629
16630 * src/derives.c (print_derives): Display the ruleno.
16631 * src/lalr.c (initialize_F, transpose): Better variable locality
16632 to improve readability.
16633 Avoid variables used as mere abbreviations.
16634
16635 2001-12-05 Akim Demaille <akim@epita.fr>
16636
16637 * src/lalr.c (traverse): Use arrays instead of pointers.
16638
16639 2001-12-05 Akim Demaille <akim@epita.fr>
16640
16641 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
16642 the handling of squeue.
16643 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16644
16645 2001-12-05 Akim Demaille <akim@epita.fr>
16646
16647 Because useless nonterminals are now kept alive (instead of being
16648 `destroyed'), we now sometimes examine them, and store information
16649 related to them. Hence we need to know their number, and adjust
16650 memory allocations.
16651
16652 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
16653 static.
16654 * src/LR0.c (allocate_itemsets): The memory allocated to
16655 `symbol_count' was used for two different purpose: once to count
16656 the number of occurrences of each symbol, and later reassigned to
16657 `shift_symbol', containing the symbol that can be shifted from a
16658 given state.
16659 Deobfuscate, i.e., allocate, use and free `symbol_count' here
16660 only, and...
16661 (new_itemsets): Allocate `shift_symbol' here.
16662 (allocate_itemsets): symbol_count includes useless nonterminals.
16663 Make room for them.
16664 (free_storage): Use `free', not `XFREE', for pointers that cannot
16665 be null.
16666
16667 2001-12-05 Akim Demaille <akim@epita.fr>
16668
16669 * src/nullable.c (set_nullable): Deobfuscate the handling of
16670 ritem.
16671 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16672
16673 2001-12-05 Akim Demaille <akim@epita.fr>
16674
16675 * src/gram.c, src/gram.h (ritem_print): New.
16676 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
16677 (This useless function was defined only to work around VMS linkers
16678 that can't handle compilation units with variables only).
16679 * src/reduce.c (dump_grammar): Use it to trace the construction of
16680 ritem.
16681
16682 2001-12-04 Paul Eggert <eggert@twinsun.com>
16683
16684 * src/bison.simple (union yyalloc): Change member names
16685 to be the same as the stack names.
16686 (yyparse): yyptr is now union yyalloc *, not char *.
16687 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
16688 and may generate better code on some machines.
16689 (yystpcpy): Use prototype if __STDC__ is defined, not just
16690 if __cplusplus is defined.
16691
16692 2001-11-30 Akim Demaille <akim@epita.fr>
16693
16694 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
16695 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
16696 Gettext doesn't compile cleanly, and dies with -Werror.
16697 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
16698 Include WARNING_CFLAGS here.
16699 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
16700 before being defined.
16701
16702 2001-11-27 Paul Eggert <eggert@twinsun.com>
16703
16704 * lib/quotearg.h (quotearg_n, quotearg_n_style):
16705 First arg is int, not unsigned.
16706 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
16707 (SIZE_MAX, UINT_MAX): New macros.
16708 (quotearg_n_options): Abort if N is negative.
16709 Avoid overflow check on hosts where size_t is 64 bits and int
16710 is 32 bits, as overflow is impossible there.
16711 Fix off-by-one typo that caused unnecessary reallocation.
16712
16713 2001-11-29 Paul Eggert <eggert@twinsun.com>
16714
16715 Name space cleanup in generated parser.
16716
16717 * doc/bison.texinfo (Bison Parser): Discuss system headers
16718 and their effect on the user name space.
16719
16720 * src/bison.simple:
16721 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
16722 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
16723 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
16724
16725 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
16726 on user names when possible.
16727
16728 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
16729 Simplify test for whather <alloca.h> exists.
16730
16731 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
16732
16733 (<stdio.h>): Include if YYDEBUG.
16734
16735 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
16736 ! defined (yyoverflow) && ! defined (yymemcpy).
16737
16738 (yymemcpy, yyparse): Rename local variables as needed so that
16739 they all begin with 'yy'.
16740
16741 (yystrlen, yystpcpy): New functions.
16742
16743 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
16744 All uses changed.
16745
16746 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
16747 instead of relying on string.h functions. Use YYSTACK_ALLOC
16748 and YYSTACK_FREE instead of malloc and free.
16749
16750 2001-11-30 Akim Demaille <akim@epita.fr>
16751
16752 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
16753 before their first uses.
16754 (YYBISON, YYPURE): Move to the top of the output.
16755
16756 2001-11-30 Akim Demaille <akim@epita.fr>
16757
16758 * tests/reduce.at (Useless Nonterminals): Fix.
16759
16760 2001-11-30 Akim Demaille <akim@epita.fr>
16761
16762 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
16763 if body instead of `;' to pacify GCC's warnings.
16764
16765 2001-11-30 Akim Demaille <akim@epita.fr>
16766
16767 Instead of mapping the LHS of unused rules to -1, keep the LHS
16768 valid, but flag the rules as invalid.
16769
16770 * src/gram.h (rule_t): `useful' is a new member.
16771 * src/print.c (print_grammar): Adjust.
16772 * src/derives.c (set_derives): Likewise.
16773 * src/reader.c (packgram, reduce_output): Likewise.
16774 * src/reduce.c (reduce_grammar_tables): Likewise.
16775 * tests/reduce.at (Underivable Rules, Useless Rules): New.
16776
16777 2001-11-30 Akim Demaille <akim@epita.fr>
16778
16779 * src/reduce.c (reduce_output): Formatting changes.
16780 * src/print.c (print_results, print_grammar): Likewise.
16781 * tests/regression.at (Rule Line Numbers)
16782 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
16783
16784 2001-11-30 Akim Demaille <akim@epita.fr>
16785
16786 * src/reduce.c (nonterminals_reduce): Instead of throwing away
16787 useless nonterminals, move them at the end of the symbol arrays.
16788 (reduce_output): Adjust.
16789 * tests/reduce.at (Useless Nonterminals): Adjust.
16790
16791 2001-11-30 Akim Demaille <akim@epita.fr>
16792
16793 * src/reduce.c: Various comment/formatting changes.
16794 (nonterminals_reduce): New, extracted from...
16795 (reduce_grammar_tables): here.
16796 (reduce_grammar): Call nonterminals_reduce.
16797
16798 2001-11-29 Paul Eggert <eggert@twinsun.com>
16799
16800 * src/bison.simple (YYSTACK_REALLOC): Remove.
16801 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
16802 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
16803 New macros.
16804 (union yyalloc): New type.
16805 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
16806 an arbitrary restriction on hosts where size_t is wider than int.
16807
16808 (yyparse): Don't dump core if alloca or malloc fails; instead, report
16809 a parser stack overflow. Allocate just one block of memory for all
16810 three stacks, instead of allocating three blocks; this typically is
16811 faster and reduces fragmentation.
16812
16813 Do not limit the number of items in the stack to a value that fits
16814 in 'int', as this is an arbitrary limit on hosts with 64-bit
16815 size_t and 32-bit int.
16816
16817 2001-11-29 Marc Autret <autret_m@epita.fr>
16818
16819 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
16820 of defining YYERROR_VERBOSE.
16821 [AT_DATA]: $4 is now out of C declarations in the prologue.
16822
16823 2001-11-28 Marc Autret <autret_m@epita.fr>
16824
16825 * src/reader.c (parse_dquoted_param): New.
16826 (parse_skel_decl): Use it.
16827 * src/lex.h: Add its prototype.
16828 * src/lex.c (literalchar): Become not static.
16829
16830 2001-11-28 Marc Autret <autret_m@epita.fr>
16831
16832 * src/output.h: And put its extern declaration here.
16833 * src/output.c (error_verbose): Define here.
16834 (prepare): Echo name modification.
16835 * src/getargs.h: Clean its extern declaration.
16836 * src/getargs.c (error_verbose_flag): Remove.
16837 (getargs): Remove case 'e'.
16838 * src/options.c (option_table): 'error-verbose' is now seen as simple
16839 percent option.
16840 Include output.h.
16841
16842 * src/reader.c (read_declarations): Remove case tok_include.
16843 (parse_include_decl): Remove.
16844 * src/lex.h (token_t): Remove tok_include.
16845 * src/options.c (option_table): 'include' is now a simple command line
16846 option.
16847
16848 2001-11-28 Marc Autret <autret_m@epita.fr>
16849
16850 * src/bison.simple: Adjust muscle names.
16851 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16852 * src/output.c (prepare): s/_/-/ for the muscles names.
16853 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16854
16855 2001-11-28 Marc Autret <autret_m@epita.fr>
16856
16857 * src/bison.simple: Fix debug.
16858 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16859
16860 2001-11-28 Akim Demaille <akim@epita.fr>
16861
16862 * src/LR0.c (shifts_new): New.
16863 (save_shifts, insert_start_shift, augment_automaton): Use it.
16864
16865 2001-11-28 Akim Demaille <akim@epita.fr>
16866
16867 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16868 keep ruleno only.
16869
16870 2001-11-28 Akim Demaille <akim@epita.fr>
16871
16872 * src/closure.c (closure): Instead of looping over word in array
16873 then bits in words, loop over bits in array.
16874
16875 2001-11-28 Akim Demaille <akim@epita.fr>
16876
16877 * src/closure.c (closure): No longer optimize the special case
16878 where all the bits of `ruleset[r]' are set to 0, to make the code
16879 clearer.
16880
16881 2001-11-28 Akim Demaille <akim@epita.fr>
16882
16883 * src/closure.c (closure): `r' and `c' are new variables, used to
16884 de-obfuscate accesses to RULESET and CORE.
16885
16886 2001-11-28 Akim Demaille <akim@epita.fr>
16887
16888 * src/reduce.c (reduce_print): Use ngettext.
16889 (dump_grammar): Improve the trace accuracy.
16890
16891 2001-11-28 Akim Demaille <akim@epita.fr>
16892
16893 * src/reduce.c (dump_grammar): Don't translate trace messages.
16894
16895 2001-11-28 Akim Demaille <akim@epita.fr>
16896
16897 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16898 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16899 as all tags are free'ed afterwards.
16900 From Enrico Scholz.
16901
16902 2001-11-27 Paul Eggert <eggert@twinsun.com>
16903
16904 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16905 use alloca when we didn't want to, and vice versa.
16906
16907 2001-11-27 Marc Autret <autret_m@epita.fr>
16908
16909 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16910 initialization.
16911 * src/output.c (prepare): Remove its update.
16912
16913 2001-11-27 Marc Autret <autret_m@epita.fr>
16914
16915 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16916 Use %error-verbose.
16917
16918 2001-11-27 Marc Autret <autret_m@epita.fr>
16919
16920 * src/bison.simple: Remove YYERROR_VERBOSE using.
16921 Use %%error_verbose.
16922 (yyparse): Likewise.
16923 * src/output.c (prepare): Give its final value.
16924 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16925 * src/getargs.h: Add its extern declaration.
16926 * src/getargs.c (error_verbose_flag): New int.
16927 (getargs): Update to catch new case.
16928 * src/options.c (option_table): 'error-verbose' is a new option.
16929 (shortopts): Update.
16930
16931 2001-11-27 Akim Demaille <akim@epita.fr>
16932
16933 * src/system.h: Use intl/libgettext.h.
16934 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16935
16936 2001-11-27 Akim Demaille <akim@epita.fr>
16937
16938 * tests/torture.at (Exploding the Stack Size with Malloc):
16939 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16940
16941 2001-11-27 Akim Demaille <akim@epita.fr>
16942
16943 * src/files.c: Include error.h.
16944 Reported by Hans Aberg.
16945
16946 2001-11-26 Marc Autret <autret_m@epita.fr>
16947
16948 * src/reader.c (parse_include_decl): New, not yet implemented.
16949 (read_declarations): Add case tok_include.
16950 * src/getargs.h (include): Add its extern definition.
16951 * src/getargs.c (include): New const char *.
16952 (getargs): Add case '-I'.
16953 * src/options.c (option_table): Add include as command line and
16954 percent option.
16955 * src/lex.h (token_t): Add tok_include.
16956
16957 2001-11-26 Akim Demaille <akim@epita.fr>
16958
16959 * src/reader.c (readgram): Make sure rules for mid-rule actions
16960 have a lineno equal to that of their host rule.
16961 Reported by Hans Aberg.
16962 * tests/regression.at (Rule Line Numbers): New.
16963
16964 2001-11-26 Akim Demaille <akim@epita.fr>
16965
16966 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16967 size_ts.
16968
16969 2001-11-26 Akim Demaille <akim@epita.fr>
16970
16971 * src/complain.c, src/complain.h (error): Remove, provided by
16972 lib/error.[ch].
16973
16974 2001-11-26 Akim Demaille <akim@epita.fr>
16975
16976 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16977 issue an error message.
16978 * tests/regression.at (Invalid %directive): New.
16979 Reported by Hans Aberg.
16980
16981 2001-11-26 Akim Demaille <akim@epita.fr>
16982
16983 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16984 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16985
16986 2001-11-26 Akim Demaille <akim@epita.fr>
16987
16988 * src/conflicts.c (conflicts_print): Don't complain at all when
16989 there are no reduce/reduce conflicts, and as many shift/reduce
16990 conflicts as expected.
16991 * tests/regression.at (%expect right): Adjust.
16992
16993 2001-11-23 Akim Demaille <akim@epita.fr>
16994
16995 * lib/alloca.c: Update, from fileutils.
16996
16997 2001-11-23 Akim Demaille <akim@epita.fr>
16998
16999 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
17000
17001 2001-11-23 Akim Demaille <akim@epita.fr>
17002
17003 * src/system.h: Include alloca.h.
17004 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
17005
17006 2001-11-23 Akim Demaille <akim@epita.fr>
17007
17008 * src/print_graph.c (print_actions): Remove `rule', unused.
17009 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
17010 pacify GCC's signed < unsigned warnings.
17011 * src/closure.c (itemsetsize): Likewise.
17012 * src/reader.c (symbol_list_new): Static.
17013
17014 2001-11-23 Akim Demaille <akim@epita.fr>
17015
17016 Attaching lineno to buckets is stupid, since only one copy of each
17017 symbol is kept, only the line of the first occurrence is kept too.
17018
17019 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
17020 * src/reader.c (rline_allocated): Remove, unused.
17021 (symbol_list): Have a `line' member.
17022 (symbol_list_new): New.
17023 (readgram): Use it.
17024 * src/print.c (print_grammar): Output the rule line numbers.
17025 * tests/regression.at (Solved SR Conflicts)
17026 (Unresolved SR Conflicts): Adjust.
17027 Reported by Hans Aberg.
17028
17029 2001-11-22 Marc Autret <autret_m@epita.fr>
17030
17031 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
17032
17033 2001-11-22 Marc Autret <autret_m@epita.fr>
17034
17035 * src/muscle_tab.c (muscle_init): Remove initialization of
17036 skeleton muscle.
17037 * src/output.c (output_master_parser): Do it here.
17038
17039 2001-11-20 Akim Demaille <akim@epita.fr>
17040
17041 * po/sv.po: New.
17042 * configure.in (ALL_LINGUAS): Adjust.
17043 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
17044 longer contains strings to translate.
17045
17046 2001-11-19 Akim Demaille <akim@epita.fr>
17047
17048 * src/conflicts.c (conflicts_print): Add a missing \n.
17049
17050 2001-11-19 Akim Demaille <akim@epita.fr>
17051
17052 * src/nullable.c (nullable_print): New.
17053 (set_nullable): Call it when tracing.
17054 Better locality of variables.
17055
17056 2001-11-19 Akim Demaille <akim@epita.fr>
17057
17058 * src/print.c (print_actions): Better locality of variables.
17059
17060 2001-11-19 Akim Demaille <akim@epita.fr>
17061
17062 * src/derives.c (print_derives): Fix and enrich.
17063 * src/closure.c (print_fderives): Likewise.
17064
17065 2001-11-19 Akim Demaille <akim@epita.fr>
17066
17067 * src/closure.c (itemsetend): Remove, replaced with...
17068 (itemsetsize): new.
17069
17070 2001-11-19 Akim Demaille <akim@epita.fr>
17071
17072 * src/LR0.c (kernel_end): Remove, replaced with...
17073 (kernel_size): new.
17074
17075 2001-11-19 Akim Demaille <akim@epita.fr>
17076
17077 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
17078 to clarify.
17079
17080 2001-11-19 Akim Demaille <akim@epita.fr>
17081
17082 * src/closure.c (closure): Use arrays instead of pointers to clarify.
17083
17084 2001-11-19 Akim Demaille <akim@epita.fr>
17085
17086 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
17087 trace messages.
17088 * src/LR0.c: Likewise.
17089 (allocate_itemsets): Use arrays instead of pointers to clarify.
17090
17091 2001-11-19 Akim Demaille <akim@epita.fr>
17092
17093 * src/getargs.c (statistics_flag): Replace with...
17094 (trace_flag): New.
17095 (longopts): Accept --trace instead of --statistics.
17096 * src/getargs.h, src/options.c: Adjust.
17097 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
17098 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
17099
17100 2001-11-19 Akim Demaille <akim@epita.fr>
17101
17102 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
17103 pointers to clarify the code.
17104 (save_reductions, save_shifts): Factor common parts of alternatives.
17105
17106 2001-11-19 Akim Demaille <akim@epita.fr>
17107
17108 * src/LR0.c (new_state, get_state): Complete TRACE code.
17109 * src/closure.c: Include `reader.h' to get `tags', needed by the
17110 trace code.
17111 Rename the conditional DEBUG as TRACE.
17112 Output consistently TRACEs to stderr, not stdout.
17113 * src/derives.c: Likewise.
17114 * src/reduce.c: (inaccessable_symbols): Using if is better style
17115 than goto.
17116 Use `#if TRACE' instead of `#if 0' for tracing code.
17117
17118 2001-11-19 Akim Demaille <akim@epita.fr>
17119
17120 * src/system.h (LIST_FREE, shortcpy): New.
17121 * src/LR0.c: Use them.
17122 * src/output.c (free_itemsets, free_reductions, free_shifts):
17123 Remove, replaced by LIST_FREE.
17124
17125 2001-11-19 Akim Demaille <akim@epita.fr>
17126
17127 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
17128 (REDUCTIONS_ALLOC): New.
17129 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
17130 allocation.
17131
17132 2001-11-19 Akim Demaille <akim@epita.fr>
17133
17134 * src/LR0.c (new_state): Complete trace code.
17135 * src/nullable.c (set_nullable): Don't translate traces.
17136
17137 2001-11-19 Akim Demaille <akim@epita.fr>
17138
17139 * src/print_graph.c (print_core): Better locality of variables.
17140 * src/print.c (print_core): Likewise.
17141
17142 2001-11-19 Akim Demaille <akim@epita.fr>
17143
17144 * src/vcg.c: You do the output, so you are responsible of the
17145 handling of VCG syntax, in particular: use quotearg.
17146 * src/print_graph.c: Don't.
17147 (print_actions): Don't output the actions as part of the nodes,
17148 since that's the job of the edges.
17149 (print_state): Don't output by hand: fill the node description,
17150 and ask for its output.
17151
17152 2001-11-19 Akim Demaille <akim@epita.fr>
17153
17154 * src/bison.simple (yyparse): When verbosely reporting an error,
17155 no longer put additional quotes around token names.
17156 * tests/calc.at: Adjust.
17157
17158 2001-11-19 Akim Demaille <akim@epita.fr>
17159
17160 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
17161 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
17162 * src/output.c: Adjust.
17163
17164 2001-11-19 Akim Demaille <akim@epita.fr>
17165
17166 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
17167 (rule_t): this.
17168 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
17169
17170 2001-11-19 Akim Demaille <akim@epita.fr>
17171
17172 * src/gram.h (rule_t): New.
17173 (rule_table): New.
17174 (rrhs, rlhs): Remove, part of state_t.
17175 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
17176 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17177 * src/reader.c, src/reduce.c: Adjust.
17178
17179 2001-11-19 Akim Demaille <akim@epita.fr>
17180
17181 * src/reader.c (symbols_output): New, extracted from...
17182 (packsymbols): Here.
17183 (reader): Call it.
17184
17185 2001-11-19 Akim Demaille <akim@epita.fr>
17186
17187 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
17188 (maxrhs): this new function.
17189
17190 2001-11-19 Akim Demaille <akim@epita.fr>
17191
17192 * src/lalr.c (F): New macro to access the variable F.
17193 Adjust.
17194
17195 2001-11-19 Akim Demaille <akim@epita.fr>
17196
17197 * src/lalr.h (LA): New macro to access the variable LA.
17198 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17199 * src/lalr.c: Adjust.
17200
17201 2001-11-19 Akim Demaille <akim@epita.fr>
17202
17203 * src/lalr.c (initialize_LA): Only initialize LA. Let...
17204 (set_state_table): handle the `lookaheads' members.
17205
17206 2001-11-19 Akim Demaille <akim@epita.fr>
17207
17208 * src/lalr.h (lookaheads): Removed array, whose contents is now
17209 a member of...
17210 (state_t): this structure.
17211 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17212 Adjust.
17213
17214 2001-11-19 Akim Demaille <akim@epita.fr>
17215
17216 * src/lalr.h (consistent): Removed array, whose contents is now
17217 a member of...
17218 (state_t): this structure.
17219 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17220 Adjust.
17221
17222 2001-11-19 Akim Demaille <akim@epita.fr>
17223
17224 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
17225 contents are now members of...
17226 (state_t): this structure.
17227 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17228 Adjust.
17229
17230 2001-11-19 Akim Demaille <akim@epita.fr>
17231
17232 * src/lalr.h (state_t): New.
17233 (state_table): Be a state_t * instead of a core **.
17234 (accessing_symbol): Remove, part of state_t.
17235 * src/lalr.c: Adjust.
17236 (set_accessing_symbol): Merge into...
17237 (set_state_table): this.
17238 * src/print_graph.c, src/conflicts.c: Adjust.
17239
17240 2001-11-14 Akim Demaille <akim@epita.fr>
17241
17242 * tests/calc.at, tests/output.at, tests/regression.at,
17243 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
17244 now the tests are run in private dirs, therefore AC_CLEANUP and
17245 family can be simplified to 0-ary.
17246 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
17247 use abs. path to find config.h.
17248 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
17249 stderr, there can be way too much random noise.
17250 Instead pass -Werror to GCC and rely on the exit status.
17251 Reported by Wolfram Wagner.
17252
17253 2001-11-14 Akim Demaille <akim@epita.fr>
17254
17255 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
17256 defined only if yyoverflow is defined, to avoid `warning: unused
17257 variable `yyvs1''.
17258 Reported by The Test Suite.
17259
17260 2001-11-14 Akim Demaille <akim@epita.fr>
17261
17262 * src/print.c: Include reduce.h.
17263 Reported by Hans Aberg.
17264
17265 2001-11-14 Akim Demaille <akim@epita.fr>
17266
17267 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
17268 Revert a previous patch: these are really const.
17269 * src/conflicts.c (conflict_report): Additional useless pair of
17270 braces to pacify GCC's warnings for `if () if () {} else {}'.
17271 * src/lex.c (parse_percent_token): Replace equal_offset with
17272 arg_offset.
17273 arg is const.
17274 Be sure to strdup `arg' when used, since there is no reason for
17275 token_buffer not to change.
17276
17277 2001-11-14 Akim Demaille <akim@epita.fr>
17278
17279 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
17280 definition.
17281 * src/main.c (main): Use them.
17282 Suggested by Hans Aberg.
17283
17284 2001-11-12 Akim Demaille <akim@epita.fr>
17285
17286 * src/system.h (ngettext): Now that we use ngettext, be sure to
17287 provide a default definition when NLS are not used.
17288
17289 2001-11-12 Akim Demaille <akim@epita.fr>
17290
17291 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
17292 Use @kbd to denote user input.
17293 (Language and Grammar): ANSIfy the example.
17294 Adjust its layout for info/notinfo.
17295 (Location Tracking Calc): Output error messages to stderr.
17296 Output locations in a more GNUtically correct way.
17297 Fix a couple of Englishos.
17298 Adjust @group/@end group pairs.
17299
17300 2001-11-12 Akim Demaille <akim@epita.fr>
17301
17302 %expect was not functioning at all.
17303
17304 * src/conflicts.c (expected_conflicts): Set to -1.
17305 (conflict_report): Use ngettext.
17306 (conflicts_print): Check %expect and make its violation an error.
17307 * doc/bison.texinfo (Expect Decl): Adjust.
17308 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
17309 * tests/regression.at (%expect not enough, %expect right)
17310 (%expect too much): New.
17311
17312 2001-11-12 Akim Demaille <akim@epita.fr>
17313
17314 * tests/regression.at (Conflicts): Rename as...
17315 (Unresolved SR Conflicts): this.
17316 (Solved SR Conflicts): New.
17317
17318 2001-11-12 Akim Demaille <akim@epita.fr>
17319
17320 * src/reduce.c (print_results): Rename as...
17321 (reduce_output): This.
17322 Output to OUT, passed as argument, instead of output_obstack.
17323 (dump_grammar): Likewise.
17324 (reduce_free): New.
17325 Also free V1.
17326 (reduce_grammar): No longer call reduce_output, since...
17327 * src/print.c (print_results): do it.
17328 * src/main.c (main): Call reduce_free;
17329
17330 2001-11-12 Akim Demaille <akim@epita.fr>
17331
17332 * src/conflicts.c (print_reductions): Accept OUT as argument.
17333 Output to it, not to output_obstack.
17334 * src/print.c (print_actions): Adjust.
17335
17336 2001-11-12 Akim Demaille <akim@epita.fr>
17337
17338 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
17339 the result instead of using...
17340 (src_total, rrc_total, src_count, rrc_count): Remove.
17341 (any_conflicts): Remove.
17342 (print_conflicts): Split into...
17343 (conflicts_print, conflicts_output): New.
17344 * src/conflicts.h: Adjust.
17345 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
17346 * src/print.c (print_grammar): Issue `\n' between two rules.
17347 * tests/regression.at (Conflicts): New.
17348 Reported by Tom Lane.
17349
17350 2001-11-12 Akim Demaille <akim@epita.fr>
17351
17352 * tests/regression.at (Invalid input): Remove, duplicate with
17353 ``Invalid input: 1''.
17354
17355 2001-11-12 Akim Demaille <akim@epita.fr>
17356
17357 * tests/torture.at (AT_DATA_STACK_TORTURE)
17358 (Exploding the Stack Size with Alloca)
17359 (Exploding the Stack Size with Malloc): New.
17360
17361 2001-11-12 Akim Demaille <akim@epita.fr>
17362
17363 * src/bison.simple (YYSTACK_REALLOC): New.
17364 (yyparse) [!yyoverflow]: Use it and free the old stack.
17365 Reported by Per Allansson.
17366
17367 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
17368
17369 * src/bison.simple: Define type yystype instead of YYSTYPE, and
17370 define CPP macro, which substitute YYSTYPE by yystype.
17371 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
17372 with yyltype/YYLTYPE. This allows inclusion of the generated
17373 header within the parser if the compiler, such as GGC, accepts
17374 multiple equivalent #defines.
17375 From Akim.
17376
17377 2001-11-05 Akim Demaille <akim@epita.fr>
17378
17379 * src/reader.c (symbols_output): New, extracted from...
17380 (packsymbols): here.
17381 (reader): Adjust.
17382
17383 2001-11-05 Akim Demaille <akim@epita.fr>
17384
17385 * src/lex.c (parse_percent_token): s/quotearg/quote/.
17386
17387 2001-11-05 Akim Demaille <akim@epita.fr>
17388
17389 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
17390 pattern.
17391
17392 2001-11-05 Akim Demaille <akim@epita.fr>
17393
17394 * src/options.h (struct option_table_struct): set_flags is void*.
17395 * src/options.c (longopts): Support `--output' and `%output'.
17396 (usage): Adjust.
17397 * src/lex.h (tok_setopt): Remove, replaced with...
17398 (tok_intopt, tok_stropt): these new guys.
17399 * src/lex.c (getopt.h): Not needed.
17400 (token_buffer, unlexed_token_buffer): Not const.
17401 (percent_table): Promote `-' over `_' in directive names.
17402 Active `%name-prefix', `file-prefix', and `output'.
17403 (parse_percent_token): Accept possible arguments to directives.
17404 Promote `-' over `_' in directive names.
17405
17406 2001-11-04 Akim Demaille <akim@epita.fr>
17407
17408 * doc/bison.texinfo (Decl Summary): Split the list into
17409 `directives for grammars' and `directives for bison'.
17410 Sort'em.
17411 Add description of `%name-prefix', `file-prefix', and `output'.
17412 Promote `-' over `_' in directive names.
17413 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
17414 Simplify the description of `--name-prefix'.
17415 Promote `-' over `_' in directive names.
17416 Promote `--output' over `--output-file'.
17417 Fix the description of `--defines'.
17418 * tests/output.at: Exercise %file-prefix and %output.
17419
17420 2001-11-02 Akim Demaille <akim@epita.fr>
17421
17422 * doc/refcard.tex: Update.
17423
17424 2001-11-02 Akim Demaille <akim@epita.fr>
17425
17426 * src/symtab.h (SUNDEF): New.
17427 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
17428 stand for `uninitialized', instead of 0.
17429 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
17430 * src/lex.c (lex): Adjust.
17431
17432 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
17433 Number it 0.
17434 Let yylex return it instead of a plain 0.
17435 Reported by Dick Streefland.
17436
17437 2001-11-02 Akim Demaille <akim@epita.fr>
17438
17439 * tests/regression.at (Mixing %token styles): New test.
17440
17441 2001-11-02 Akim Demaille <akim@epita.fr>
17442
17443 * src/reader.c (parse_thong_decl): Formatting changes.
17444 (token_translations_init): New, extracted from...
17445 (packsymbols): Here.
17446 Adjust.
17447
17448 2001-11-01 Akim Demaille <akim@epita.fr>
17449
17450 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
17451 Check that `9foo.y' produces correct cpp guards.
17452 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
17453 guards.
17454 Reported by Wwp.
17455
17456 2001-11-01 Akim Demaille <akim@epita.fr>
17457
17458 * tests/regression.at (Invalid input: 2): New.
17459 * src/lex.c (unlexed_token_buffer): New.
17460 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
17461 too.
17462 Reported by Wwp.
17463
17464 2001-11-01 Akim Demaille <akim@epita.fr>
17465
17466 * tests/calc.at: Catch up with 1.30.
17467 * configure.in: Bump to 1.49a.
17468 Adjust to newer Autotest.
17469
17470 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
17471
17472 * src/conflicts.c: Move global variables rrc_total and src_total ...
17473 (print_conflicts): here.
17474 * src/output.c (output): Free global variable user_toknums.
17475 * src/lex.c (token_obstack): Become static.
17476
17477 2001-10-18 Akim Demaille <akim@epita.fr>
17478
17479 * tests/atlocal.in (GCC): Add.
17480 * tests/calc.at: s/m4_match/m4_bmatch/.
17481 s/m4_patsubst/m4_bpatsubst/.
17482 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
17483 * configure.in: AC_SUBST(GCC).
17484
17485 2001-10-14 Marc Autret <autret_m@epita.fr>
17486
17487 * src/options.c (create_long_option_table): Fix.
17488
17489 2001-10-10 Akim Demaille <akim@epita.fr>
17490
17491 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
17492
17493 2001-10-04 Akim Demaille <akim@epita.fr>
17494
17495 * src/reader.c (parse_union_decl): Push the caracters in
17496 union_obstack, not attrs_obstack.
17497
17498 2001-10-04 Akim Demaille <akim@epita.fr>
17499
17500 Merge in the branch 1.29.
17501
17502 * src/reader.c (packsymbols): Use a temporary obstack for
17503 `%%tokendef', since output_stack is already used elsewhere.
17504
17505 2001-10-02 Akim Demaille <akim@epita.fr>
17506
17507 Bump 1.29d.
17508
17509 2001-10-02 Akim Demaille <akim@epita.fr>
17510
17511 Version 1.29c.
17512
17513 2001-10-02 Akim Demaille <akim@epita.fr>
17514
17515 * tests/regression.at (Invalid CPP headers): New.
17516 From Alexander Belopolsky.
17517 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
17518
17519 2001-10-02 Akim Demaille <akim@epita.fr>
17520
17521 * tests/regression.at (Invalid input): New.
17522 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
17523 Reported by Shura.
17524
17525 2001-10-02 Akim Demaille <akim@epita.fr>
17526
17527 * tests/calc.at: Now that --debug works, the tests must be adjusted.
17528
17529 2001-10-02 Akim Demaille <akim@epita.fr>
17530
17531 * src/output.c (output_parser): Assert `skeleton'.
17532 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
17533 systems.
17534 From Shura.
17535
17536 2001-10-01 Marc Autret <autret_m@epita.fr>
17537
17538 * src/lex.h: Echo modifications.
17539 * src/lex.c (unlex): Parameter is now token_t.
17540 From Hans Aberg.
17541
17542 2001-10-01 Marc Autret <autret_m@epita.fr>
17543
17544 * src/main.c: Include lex.h.
17545 From Hans Aberg.
17546
17547 2001-09-29 Akim Demaille <akim@epita.fr>
17548
17549 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
17550
17551 2001-09-28 Akim Demaille <akim@epita.fr>
17552
17553 * tests/testsuite.at: Update to newer Autotest.
17554 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
17555
17556 2001-09-27 Akim Demaille <akim@epita.fr>
17557
17558 Position independent wrapper.
17559
17560 * tests/bison: Remove.
17561 * tests/bison.in: New.
17562 * configure.in: Adjust.
17563
17564 2001-09-27 Paul Eggert <eggert@twinsun.com>
17565
17566 Port quotearg fixes from tar 1.13.24.
17567
17568 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
17569 tm to be declared.
17570 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
17571 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
17572
17573 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
17574 * m4/mbrtowc.m4: New file.
17575 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
17576 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
17577
17578 2001-09-27 Akim Demaille <akim@epita.fr>
17579
17580 Bump to 1.29c.
17581
17582 2001-09-27 Akim Demaille <akim@epita.fr>
17583
17584 Version 1.29b.
17585
17586 2001-09-25 Akim Demaille <akim@epita.fr>
17587
17588 * src/system.h: Include `xalloc.h'.
17589 Remove it from the C files.
17590 * src/files.c (output_files): Free the obstacks.
17591 * src/lex.c (init_lex): Rename as...
17592 (lex_init): this.
17593 (lex_free): New.
17594 * src/main.c (main): Use it.
17595
17596 2001-09-24 Marc Autret <autret_m@epita.fr>
17597
17598 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
17599 to output informations in fout (FILE*).
17600 (open_graph, close_graph): Likewise.
17601 (output_graph, output_edge, output_node): Likewise.
17602 * src/vcg.h: Update function prototypes.
17603 * src/print_graph.c (print_graph): Open output graph file.
17604 (print_actions): Adjust.
17605 * src/files.h: Remove extern declaration.
17606 * src/files.c: Remove graph_obstack declaration.
17607 (open_files): Remove graph_obstack initialization.
17608 (output_files): Remove graph_obstack saving.
17609
17610 2001-09-24 Marc Autret <autret_m@epita.fr>
17611
17612 * src/files.c (compute_output_file_names): Fix.
17613
17614 2001-09-24 Marc Autret <autret_m@epita.fr>,
17615 Akim Demaille <akim@epita.fr>
17616
17617 * src/reader.c (reader): Remove call to free_symtab ().
17618 * src/main.c (main): Call it here.
17619 Include symtab.h.
17620 * src/conflicts.c (initialize_conflicts): Rename as...
17621 (solve_conflicts): this.
17622 * src/print.c (print_core, print_actions, print_state)
17623 (print_grammar): Dump to a file instead a `output_obstack'.
17624 (print_results): Dump `output_obstack', and then proceed with the
17625 FILE *.
17626 * src/files.c (compute_output_file_names, close_files): New.
17627 (output_files): Adjust.
17628 * src/main.c (main): Adjust.
17629
17630 2001-09-23 Marc Autret <autret_m@epita.fr>
17631
17632 * src/files.c (compute_header_macro): Computes header macro name
17633 from spec_defines_file when given.
17634
17635 2001-09-23 Marc Autret <autret_m@epita.fr>
17636
17637 * src/files.c (output_files): Add default extensions.
17638
17639 2001-09-22 Akim Demaille <akim@epita.fr>
17640
17641 * src/conflicts.c (finalize_conflicts): Rename as...
17642 (free_conflicts): this.
17643
17644 2001-09-22 Akim Demaille <akim@epita.fr>
17645
17646 * src/gram.c (gram_free): Rename back as...
17647 (dummy): this.
17648 (output_token_translations): Free `token_translations'.
17649 * src/symtab.c (free_symtab): Free the tag field.
17650
17651 2001-09-22 Akim Demaille <akim@epita.fr>
17652
17653 Remove `translations' as it is always set to true.
17654
17655 * src/gram.h: Adjust.
17656 * src/reader.c (packsymbols, parse_token_decl): Adjust
17657 * src/print.c (print_grammar): Adjust.
17658 * src/output.c (output_token_translations): Adjust.
17659 * src/lex.c (lex): Adjust.
17660 * src/gram.c: Be sure the set pointers to NULL.
17661 (dummy): Rename as...
17662 (gram_free): this.
17663
17664 2001-09-22 Akim Demaille <akim@epita.fr>
17665
17666 * configure.in: Invoke AM_LIB_DMALLOC.
17667 * src/system.h: Use dmalloc.
17668 * src/LR0.c: Be sure to have pointers initialized to NULL.
17669 (allocate_itemsets): Allocate kernel_items only if needed.
17670
17671 2001-09-22 Akim Demaille <akim@epita.fr>
17672
17673 * configure.in: Bump to 1.29b.
17674 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
17675 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
17676 need xmalloc.c in calc.y.
17677 From Pascal Bart.
17678
17679 2001-09-21 Akim Demaille <akim@epita.fr>
17680
17681 Version 1.29a.
17682 * Makefile.maint, config/config.guess, config/config.sub,
17683 * config/missing: Update from masters.
17684 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
17685 upon package.m4.
17686 * configure.in (ALL_LINGUAS): Add `tr'.
17687
17688 2001-09-21 Akim Demaille <akim@epita.fr>
17689
17690 * tests/Makefile.am (package.m4): Move to...
17691 ($(srcdir)/$(TESTSUITE)): here.
17692
17693 2001-09-20 Akim Demaille <akim@epita.fr>
17694
17695 * src/complain.c: No longer try to be standalone: use system.h.
17696 Don't assume __STDC__ is defined to 1. Just test if it is defined.
17697 * src/complain.h: Likewise.
17698 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
17699 Remove the unused variable `n'.
17700 From Albert Chin-A-Young.
17701
17702 2001-09-18 Marc Autret <autret_m@epita.fr>
17703
17704 * doc/bison.1: Update.
17705 * doc/bison.texinfo (Bison Options): Update --defines and --graph
17706 descriptions.
17707 (Option Cross Key): Update.
17708 Add --graph.
17709
17710 2001-09-18 Marc Autret <autret_m@epita.fr>
17711
17712 * tests/regression.at: New test (comment in %union).
17713
17714 2001-09-18 Marc Autret <autret_m@epita.fr>
17715
17716 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
17717 do that.
17718 Reported by Keith Browne.
17719
17720 2001-09-18 Marc Autret <autret_m@epita.fr>
17721
17722 * tests/output.at: Add tests for --defines and --graph.
17723
17724 2001-09-18 Marc Autret <autret_m@epita.fr>
17725
17726 * tests/output.at: Removes tests of %{header,src}_extension features.
17727
17728 2001-09-18 Akim Demaille <akim@epita.fr>
17729
17730 * tests/Makefile.am (package.m4): New.
17731 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
17732 (_AT_CHECK_CALC_ERROR): Likewise.
17733 Factor the `, ' part of verbose error messages.
17734
17735 2001-09-18 Marc Autret <autret_m@epita.fr>
17736
17737 * src/getargs.c (longopts): Declare --defines and --graph as options
17738 with optional arguments.
17739 * src/files.h: Add extern declarations.
17740 * src/files.c (spec_graph_file, spec_defines_file): New.
17741 (output_files): Update.
17742 Remove CPP-outed code.
17743
17744 2001-09-18 Marc Autret <autret_m@epita.fr>
17745
17746 Turn off %{source,header}_extension feature.
17747
17748 * src/files.c (compute_exts_from_gf): Update.
17749 (compute_exts_from_src): Update.
17750 (output_files): CPP-out useless code.
17751 * src/files.h: Remove {header,source}_extension extern declarations.
17752 * src/reader.c (parse_dquoted_param): CPP-out.
17753 (parse_header_extension_decl): Remove.
17754 (parse_source_extension_decl): Remove.
17755 (read_declarations): Remove cases tok_{hdrext,srcext}.
17756 * src/lex.c (percent_table): Remove {header,source}_extension entries.
17757 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
17758
17759 2001-09-10 Akim Demaille <akim@epita.fr>
17760
17761 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
17762 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
17763 (AT_CHECK_OUTPUT): this.
17764 Merely check ls' exit status, its output is useless.
17765
17766 2001-09-10 Akim Demaille <akim@epita.fr>
17767
17768 * tests/calc.at: Use m4_match.
17769 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
17770
17771 2001-09-10 Marc Autret <autret_m@epita.fr>,
17772 Akim Demaille <akim@epita.fr>
17773
17774 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
17775 enum color_e.
17776 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
17777 to `normal'.
17778 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
17779 * src/lex.h: Adjust prototype.
17780 (token_t): Add `tok_undef'.
17781 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
17782 (parse_percent_token): Now returns token_t.
17783 Add default statement in switch.
17784 (lex): Separate `c' as an input variable, from the token_t result
17785 part.
17786 (unlexed): Is a token_t.
17787
17788 2001-09-10 Akim Demaille <akim@epita.fr>
17789
17790 * configure.in: Bump to 1.29a.
17791
17792 2001-09-07 Akim Demaille <akim@epita.fr>
17793
17794 Version 1.29.
17795
17796 2001-08-30 Akim Demaille <akim@epita.fr>
17797
17798 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
17799 * m4/atconfig.m4: Remove.
17800 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
17801 * tests/bison: New.
17802 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
17803 m4_if, m4_patsubst, and m4_regexp.
17804 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
17805 `input' file instead of echo.
17806
17807 2001-08-29 Akim Demaille <akim@epita.fr>
17808
17809 Bump to 1.28e.
17810
17811 2001-08-29 Akim Demaille <akim@epita.fr>
17812
17813 Version 1.28d.
17814
17815 2001-08-29 Paul Eggert <eggert@twinsun.com>
17816
17817 * src/bison.simple (yyparse): Don't take the address of an
17818 item before the start of an array, as that doesn't conform to
17819 the C Standard.
17820
17821 2001-08-29 Robert Anisko <anisko_r@epita.fr>
17822
17823 * doc/bison.texinfo (Location Tracking Calc): New node.
17824
17825 2001-08-29 Paul Eggert <eggert@twinsun.com>
17826
17827 * src/output.c (output): Do not define const, as this now
17828 causes more problems than it cures.
17829
17830 2001-08-29 Akim Demaille <akim@epita.fr>
17831
17832 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17833 the nodes.
17834 Be sure to tag the `detailmenu'.
17835
17836 2001-08-29 Akim Demaille <akim@epita.fr>
17837
17838 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17839 download in a tmp dir.
17840
17841 2001-08-28 Marc Autret <autret_m@epita.fr>
17842
17843 * config/depcomp: New file.
17844
17845 2001-08-28 Marc Autret <autret_m@epita.fr>
17846
17847 * doc/bison.1 (mandoc): Adjust.
17848 From Juan Manuel Guerrero.
17849
17850 2001-08-28 Marc Autret <autret_m@epita.fr>
17851
17852 * src/print_graph.c (print_state): Fix.
17853
17854 2001-08-27 Marc Autret <autret_m@epita.fr>
17855
17856 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17857 char * members.
17858 Echo modifications to the functions prototypes.
17859 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17860
17861 2001-08-27 Marc Autret <autret_m@epita.fr>
17862
17863 * src/vcg.c: Include `xalloc.h'.
17864 (add_colorentry): New.
17865 (add_classname): New.
17866 (add_infoname): New.
17867 * src/vcg.h: Add new prototypes.
17868
17869 2001-08-27 Akim Demaille <akim@epita.fr>
17870
17871 * Makefile.maint: Sync. again with CVS Autoconf.
17872
17873 2001-08-27 Akim Demaille <akim@epita.fr>
17874
17875 * Makefile.maint: Formatting changes.
17876 (po-update, cvs-update, update): New targets.
17877 (AMTAR): Remove.
17878
17879 2001-08-27 Akim Demaille <akim@epita.fr>
17880
17881 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17882 * Makefile.maint: Sync. with CVS Autoconf.
17883
17884 2001-08-27 Marc Autret <autret_m@epita.fr>
17885
17886 * src/vcg.h (struct infoname_s): New.
17887 (struct colorentry_s): New.
17888 (graph_s): New fields {vertical,horizontal}_order in structure.
17889 Add `infoname' field.
17890 Add `colorentry' field;
17891 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17892 (G_HORIZONTAL_ORDER): New.
17893 (G_INFONAME): New.
17894 (G_COLORENTRY): New.
17895 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17896 Add output of `infoname'.
17897 Add output of `colorentry'.
17898
17899 2001-08-27 Marc Autret <autret_m@epita.fr>
17900
17901 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17902 This one shadowed a global parameter.
17903
17904 2001-08-24 Marc Autret <autret_m@epita.fr>
17905
17906 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17907 instead of `unsigned'.
17908 (print_state): Do not call obstack_object_size () in obstack_grow ()
17909 to avoid macro variables shadowing.
17910
17911 2001-08-23 Marc Autret <autret_m@epita.fr>
17912
17913 * src/lex.c (percent_table): Typo: s/naem/name/.
17914 Add graph option.
17915 Normalize new options declarations.
17916
17917 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17918
17919 * tests/suite.at: Exercise %header_extension and %source_extension.
17920
17921 2001-08-16 Marc Autret <autret_m@epita.fr>
17922
17923 * src/reader.c (parse_dquoted_param): New.
17924 (parse_header_extension_decl): Use it.
17925 (parse_source_extension_decl): Likewise.
17926
17927 2001-08-16 Marc Autret <autret_m@epita.fr>
17928
17929 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17930 (get_xxxx_str): Use assert () instead of complain ().
17931 Remove return invokations in default cases.
17932 (get_decision_str): Modify default behaviour. Remove second argument.
17933 Echo modifications on calls.
17934 (output_graph): Fix.
17935
17936 2001-08-16 Marc Autret <autret_m@epita.fr>
17937
17938 * src/getargs.c (usage): Update with ``-g, --graph''.
17939
17940 2001-08-16 Marc Autret <autret_m@epita.fr>
17941
17942 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17943 (Option Cross Key): Likewise.
17944 * doc/bison.1: Update.
17945
17946 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
17947
17948 * src/output.c (output_master_parser): Don't finish action_obstack.
17949 (output_parser): Don't care about the muscle action, here.
17950 (prepare): Copy the action_obstack in the action muscle.
17951 (output): Free action_obstack.
17952
17953 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
17954
17955 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17956 will contain `%union' declaration.
17957 (parse_union_decl): Delete #line directive output.
17958 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17959 informations about %union.
17960 (parse_union_decl): Copy the union_obstack in the muscle stype.
17961 * src/bison.simple: Add new #line directive.
17962 Add typdef %%stype YYSTYPE.
17963
17964 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
17965
17966 * src/bison.simple: Add new `#line' directive.
17967
17968 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
17969
17970 * src/bison.simple: New `#line' directive.
17971 * src/output.c (output_parser): Support new dynamic muscle input_line.
17972
17973 2001-09-22 Marc Autret <autret_m@epita.fr>
17974
17975 * src/output.c (output_master_parser): New.
17976 (output_parser): Be more re-entrant.
17977
17978 2001-09-21 Marc Autret <autret_m@epita.fr>
17979
17980 * src/reader.c (copy_definition, parse_union_decl): Update and use
17981 `linef' muscle.
17982 (copy_action): Likewise.
17983 Use obstack_1grow ().
17984 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17985
17986 2001-09-21 Marc Autret <autret_m@epita.fr>
17987
17988 * src/options.c (option_table): Adjust.
17989 * src/lex.c (parse_percent_token): Fix.
17990
17991 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
17992
17993 * src/options.c (symtab.h): Include it, need by lex.h.
17994
17995 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
17996
17997 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17998 is now an option_table_struct*.
17999 (option_strcmp): New function option_strcmp.
18000 (parse_percent_token): Call option_strcmp.
18001 * src/getargs.c (xalloc.h, options.h): Include it.
18002 (getargs): Call create_long_option_table.
18003 (getargs): Free longopts at the end of the function.
18004 (shortopts): Move in options.c.
18005 * src/options.c (create_long_option_table): New function. Convert
18006 information from option_table to option structure.
18007 * src/reader.c (options.h): Include it.
18008
18009 * src/Makefile.am: Adjust.
18010 * src/options.c (option_table): Create from longopts and percent_table.
18011 * src/getargs.c (longopts): Delete.
18012 * src/lex.c (struct percent_table_struct): Delete.
18013 (percent_table): Delete.
18014 (options.h): Include it.
18015 * src/options.c: Create.
18016 * src/options.h: Create.
18017 Declare enum opt_access_e.
18018 Define struct option_table_struct.
18019
18020 2001-09-20 Marc Autret <autret_m@epita.fr>
18021
18022 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
18023 sections of Bison.
18024
18025 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
18026
18027 * src/bison.simple: s/%%filename/%%skeleton.
18028 * src/muscle_tab.c (getargs.h): Include it.
18029 (muscle_init): Insert new muscle skeleton.
18030
18031 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
18032
18033 * src/output.c (output_parser): Delete unused variable actions_dumped.
18034
18035 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
18036
18037 * src/output.c (output): Delete call to reader_output_yylsp.
18038 * src/reader.c (reader): Likewise.
18039 * src/reader.h: Delete declaration of reader_output_yylsp.
18040
18041 2001-09-02 Marc Autret <autret_m@epita.fr>
18042
18043 * src/reader.c: Include muscle_tab.h.
18044 (parse_union_decl): Update.
18045 (parse_macro_decl): Rename parse_muscle_decl.
18046 Update to use renamed functions and variable.
18047 (read_declarations, copy_action, read_additionnal_code, : Updated
18048 with correct variables and functions names.
18049 (packsymbols, reader): Likewise.
18050
18051 * src/reader.h (muscle_obstack): Extern declaration update.
18052
18053 * src/output.c: Include muscle_tab.h
18054 In all functions using macro_insert, change by using muscle_insert ().
18055 (macro_obstack): Rename muscle_obstack.
18056 Echo modifications in the whole file.
18057 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
18058 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
18059 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
18060
18061 * src/muscle_tab.h: Update double inclusion macros.
18062 (macro_entry_s): Rename muscle_entry_s.
18063 Update prototypes.
18064
18065 * src/muscle_tab.c: Include muscle_tab.h.
18066 Rename macro_tabble to muscle_table.
18067 (mhash1, mhash2, mcmp): Use muscle_entry.
18068 (macro_init): Rename muscle_init. Update.
18069 (macro_insert): Rename muscle_insert. Update.
18070 (macro_find): Rename muscle_find. Update.
18071
18072 * src/main.c: Include muscle_tab.h.
18073 (main): Call muscle_init ().
18074 * src/Makefile.am (bison_SOURCES): Echo modifications.
18075
18076 2001-09-02 Marc Autret <autret_m@epita.fr>
18077
18078 Now the files macro_tab.[ch] are named muscle_tab.[ch].
18079
18080 * src/muscle_tab.c, src/muscle_tab.h: Add files.
18081
18082 2001-09-02 Marc Autret <autret_m@epita.fr>
18083
18084 * src/macrotab.c, src/macrotab.h: Remove.
18085
18086 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
18087
18088 * src/reader.c (copy_guard): Use muscle to specify the `#line'
18089 filename.
18090
18091 2001-09-01 Marc Autret <autret_m@epita.fr>
18092
18093 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
18094 to an explicit value to activate the feature. We do it here.
18095
18096 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
18097
18098 * src/output.c (prepare): Delete the `filename' muscule insertion.
18099 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
18100 (parse_union_decl): Likewise.
18101 * src/macrotab.c (macro_init): Initialize filename by infile.
18102
18103 2001-08-31 Marc Autret <autret_m@epita.fr>
18104
18105 * src/bison.simple (YYLSP_NEEDED): New definition.
18106 * src/output.c (prepare): Add macro insertion of `locations_flag'
18107
18108 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
18109
18110 * src/output.c (prepare): Delete insertion of previous muscles,
18111 and insert the `prefix' muscles.
18112 * src/macrotab.c (macro_init): Likewise.
18113 (macro_init): Initialization prefix directive by `yy'.
18114 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
18115 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
18116 yylval, yydebug, yyerror, yynerrs and yyparse.
18117 New directive `#define' to substitute yydebug, ... with option
18118 name_prefix.
18119
18120 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
18121
18122 * src/main.c (main): Standardize.
18123 * src/output.c (output_table_data, output_parser): Likewise.
18124 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
18125
18126 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
18127
18128 * src/reader.c (read_additionnal_code): Rename %%user_code to
18129 %%epilogue.
18130 * src/output.c (output): Rename %%declarations to %%prologue.
18131 * src/bison.simple: Echo modifications.
18132
18133 2001-08-31 Marc Autret <autret_m@epita.fr>
18134
18135 * src/reader.c (readgram): CleanUp.
18136 (output_token_defines): Likewise.
18137 (packsymbols): Likewise.
18138 (reader): Likewise.
18139 * src/output.c (output): CPP-out useless code.
18140
18141 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
18142
18143 * src/reader.c (reader): Delete obsolete call to function
18144 output_trailers and output_headers.
18145 * src/output.h: Remove obsolete functions prototypes of output_headers
18146 and output_trailers.
18147
18148 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
18149
18150 * src/main.c: Include macrotab.h.
18151 * src/macrotab.h (macro_entry_s): Constify fields.
18152 Adjust functions prototypes.
18153 * src/macrotab.c (macro_insert): Constify key and value.
18154 (macro_find): Constify key.
18155 (macro_insert): Include 'xalloc.h'
18156 (macro_insert): Use XMALLOC.
18157 (macro_find): Constify return value.
18158 * src/output.c (output_table_data): Rename table to table_data.
18159 (output_parser): Constify macro_key, macro_value.
18160
18161 2001-08-30 Marc Autret <autret_m@epita.fr>
18162
18163 * src/reader.c (parse_skel_decl): New.
18164 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
18165 * src/lex.h (token_t): New token `tok_skel'.
18166 * src/lex.c (percent_table): Add skeleton option entry.
18167 Standardize.
18168
18169 2001-08-29 Marc Autret <autret_m@epita.fr>
18170
18171 * src/bison.simple: Add %%user_code directive at the end.
18172 * src/reader.c (read_additionnal_code): New.
18173 (reader): Use it.
18174 * src/output.c (output_program): Remove.
18175 (output): Update.
18176
18177 2001-08-28 Marc Autret <autret_m@epita.fr>
18178
18179 * src/output.c (output_actions): Clean up.
18180 (output_gram): CPP-out useless code.
18181 * src/reader.c (reader): Clean up, CPP-out useless code.
18182
18183 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
18184
18185 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
18186 directive.
18187 * src/bison.simple: Add `%%definitions'.
18188
18189 2001-08-28 Marc Autret <autret_m@epita.fr>
18190
18191 * config/depcomp: New file.
18192
18193 2001-08-27 Paul Eggert <eggert@twinsun.com>
18194
18195 * src/bison.simple (yyparse): Don't take the address of an
18196 item before the start of an array, as that doesn't conform to
18197 the C Standard.
18198
18199 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
18200
18201 * src/output.c (output): Remove the initialization of the macro
18202 obstack. It was done too late here.
18203
18204 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
18205 completely wrong.
18206 (reader): Initialize the macro obstack here, since we need it to grow
18207 '%define' directives.
18208
18209 * src/reader.h: Declare the macro obstack as extern.
18210
18211 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
18212
18213 * src/output.c (output_parser): Fix. Store single '%' characters in
18214 the output obstack instead of throwing them away.
18215
18216 2001-08-27 Akim Demaille <akim@epita.fr>
18217
18218 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18219
18220 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18221
18222 * lib/Makefile.am: Adjust.
18223
18224 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18225
18226 * src/bison.simple: Update and add '%%' directives.
18227
18228 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18229
18230 * src/reader.c (reader): Remove calls to 'output_headers' and
18231 'output_trailers'. Remove some C output.
18232 (readgram): Disable a piece of code that was writing a default
18233 definition for 'YYSTYPE'.
18234 (reader_output_yylsp): Remove.
18235 (packsymbols): Output token defintions to a macro.
18236 (copy_definition): Disable C output.
18237
18238 * src/reader.c (parse_macro_decl): New function used to parse macro
18239 declarations.
18240 (copy_string2): Put the body of copy_string into this new function.
18241 Add a parameter to let the caller choose whether he wants to copy the
18242 string delimiters or not.
18243 (copy_string): Be a simple call to copy_string2 with the last argument
18244 bound to true.
18245 (read_declarations): Add case for macro definition.
18246 (copy_identifier): New.
18247 (parse_macro_decl): Read macro identifiers using copy_identifier
18248 rather than lex.
18249
18250 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18251
18252 * src/output.c (prepare): Add prefixed names.
18253 (output_parser): Output semantic actions.
18254 (output_parser): Fix bug on '%%line' directives.
18255
18256 * src/output.c (output_headers): Remove. The C code printed by this
18257 function should now be in the skeletons.
18258 (output_trailers): Remove.
18259 (output): Disable call to 'reader_output_yylsp'.
18260 (output_rule_data): Do not output tables to the table obstack.
18261
18262 * src/output.c: Remove some C dedicated output.
18263 Improve the use of macro and output obstacks.
18264 (output_defines): Remove.
18265
18266 * src/output.c (output_token_translations): Associate 'translate'
18267 table with a macro. No output to the table obstack.
18268 (output_gram): Same for 'rhs' and 'prhs'.
18269 (output_stos): Same for 'stos'.
18270 (output_rule_data): Same for 'r1' and 'r2'.
18271 (token_actions): Same for 'defact'.
18272 (goto_actions): Same for 'defgoto'.
18273 (output_base): Same for 'pact' and 'pgoto'.
18274 (output_table): Same for 'table'.
18275 (output_check): Same for 'check'.
18276
18277 * src/output.c (output_table_data): New function.
18278 (output_short_table): Remove.
18279 (output_short_or_char_table): Remove.
18280
18281 * src/output.c (output_parser): Replace most of the skeleton copy code
18282 with something new. Skeletons are now processed character by character
18283 rather than line by line, and Bison looks for '%%' macros. This is the
18284 first step in making Bison's output process (a lot) more flexible.
18285 (output_parser): Use the macro table.
18286
18287 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18288
18289 * src/main.c (main): Initialize the macro table.
18290
18291 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18292
18293 * src/lex.c (percent_table): Add tok_define.
18294 * src/lex.h: Add tok_define.
18295
18296 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18297
18298 * src/macrotab.c: New file.
18299 * src/macrotab.h: New file.
18300 * src/Makefile.am: Update.
18301
18302 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18303
18304 * lib/hash.c: New file.
18305 * lib/hash.h: New file.
18306 * lib/Makefile.am: Update.
18307
18308 2001-08-15 Akim Demaille <akim@epita.fr>
18309
18310 Version 1.28c.
18311
18312 2001-08-15 Marc Autret <autret_m@epita.fr>
18313
18314 * src/reader.c (readgram): Indent output macro YYSTYPE.
18315 (packsymbols): Likewise.
18316 (output_token_defines): Likewise.
18317 * src/files.c: Standardize.
18318 (compute_header_macro): New.
18319 (defines_obstack_save): New. Use compute_header_macro.
18320 (output_files): Update. Use defines_obstack_save.
18321
18322 2001-08-15 Akim Demaille <akim@epita.fr>
18323
18324 * doc/bison.texinfo (Table of Symbols): Document
18325 YYSTACK_USE_ALLOCA.
18326
18327 2001-08-15 Akim Demaille <akim@epita.fr>
18328
18329 * missing: Update from CVS Automake.
18330 * config/config.guess, config/config.sub, config/texinfo.tex:
18331 Update from gnu.org.
18332
18333 2001-08-15 Akim Demaille <akim@epita.fr>
18334
18335 * Makefile.maint: Sync with CVS Autoconf.
18336
18337 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
18338
18339 * doc/bison.texinfo: Include GNU Free Documentation License from
18340 `fdl.texi'.
18341 * doc/fdl.texi: Add to package.
18342
18343 2001-08-14 Marc Autret <autret_m@epita.fr>
18344
18345 Turn on %{source,header}_extension features.
18346
18347 * src/lex.c (percent_table): Un-CPP out header_extension and
18348 source_extension.
18349 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
18350 (compute_exts_from_src): Remove conditions. It restores priorities
18351 between options.
18352
18353 2001-08-14 Marc Autret <autret_m@epita.fr>
18354
18355 * src/files.c (compute_base_names): Add extensions computing when
18356 `--file-prefix' used.
18357 Standardize function calls.
18358
18359 2001-08-13 Marc Autret <autret_m@epita.fr>
18360
18361 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
18362 defining it (defined but null disables alloca).
18363
18364 2001-08-13 Marc Autret <autret_m@epita.fr>
18365
18366 * src/bison.simple (_yy_memcpy): CPP reformat.
18367
18368 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
18369
18370 * tests/atconfig.in (CPPFLAGS): Fix.
18371
18372 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
18373
18374 * doc/bison.texinfo: Include GNU General Public License from
18375 `gpl.texi'.
18376 * doc/gpl.texi: Add to package.
18377
18378 2001-08-10 Marc Autret <autret_m@epita.fr>
18379
18380 * src/print_graph.h: Fix.
18381 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
18382
18383 2001-08-10 Akim Demaille <akim@epita.fr>
18384
18385 * src/system.h: Provide default declarations for stpcpy, strndup,
18386 and strnlen.
18387
18388 2001-08-10 Robert Anisko <anisko_r@epita.fr>
18389
18390 * doc/bison.texinfo (Locations): Update @$ stuff.
18391
18392 2001-08-09 Robert Anisko <anisko_r@epita.fr>
18393
18394 * src/bison.simple (YYLLOC_DEFAULT): Update.
18395 (yyparse): Adjust.
18396
18397 2001-08-08 Marc Autret <autret_m@epita.fr>
18398
18399 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
18400 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
18401 Reported by Fabrice Bauzac.
18402
18403 2001-08-08 Marc Autret <autret_m@epita.fr>
18404
18405 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
18406 * src/vcg.c (output_node): Fix.
18407 * src/vcg.h: Cleanup.
18408 * src/print_graph.c: Add comments.
18409 (node_output_size): New global variable. Simplify the formatting of
18410 the VCG graph output.
18411 (print_actions): Unused code is now used. It notifies the final state
18412 and no action states in the VCG graph. It also give the reduce actions.
18413 The `shift and goto' edges are red and the `go to state' edges are
18414 blue.
18415 Get the current node name and node_obstack by argument.
18416 (node_obstack): New variable.
18417 (print_state): Manage node_obstack.
18418 (print_core): Use node_obstack given by argument.
18419 A node is not only computed here but in print_actions also.
18420 (print_graph): CPP out useless code instead of commenting it.
18421
18422 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
18423
18424 * tests/atconfig.in (CPPFLAGS): Fix.
18425
18426 2001-08-07 Akim Demaille <akim@epita.fr>
18427
18428 * src/print_graph.c (quote): New.
18429 (print_core): Use it.
18430
18431 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
18432
18433 * src/vcg.c (complain.h): Include it.
18434 Unepitaize `return' invocations.
18435 [NDEBUG] (main): Remove.
18436 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
18437 * src/files.c (open_files): Initialize graph_obstack.
18438 * src/print_graph.c (print_actions): CPP out useless code.
18439 (print_core): Don't output the last `\n' in labels.
18440 Use `quote'.
18441 * src/files.c (output_files): Output the VCG file.
18442 * src/main.c (main): Invoke print_graph ();
18443
18444 2001-08-06 Marc Autret <autret_m@epita.fr>
18445
18446 Automaton VCG graph output.
18447 Using option ``-g'' or long option ``--graph'', you can generate
18448 a gram_filename.vcg file containing a VCG description of the LALR (1)
18449 automaton of your grammar.
18450
18451 * src/main.c: Call to print_graph() function.
18452 * src/getargs.h: Update.
18453 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
18454 (graph_flag): New flag.
18455 (longopts): Update.
18456 (getargs): Add case `g'.
18457 * src/files.c (graph_obstack): New obstack struct.
18458 (open_files): Initialize new obstack.
18459 (output_files): Saves graph_obstack if required.
18460 * src/files.h (graph_obstack): New extern declaration.
18461 * src/Makefile.am: Add new source files.
18462
18463 2001-08-06 Marc Autret <autret_m@epita.fr>
18464
18465 * src/print_graph.c, src/print_graph.h (graph): New.
18466 * src/vcg.h: New file.
18467 * src/vcg.c: New file, VCG graph handling.
18468
18469 2001-08-06 Marc Autret <autret_m@epita.fr>
18470
18471 Add of %source_extension and %header_extension which specify
18472 the source or/and the header output file extension.
18473
18474 * src/files.c (compute_base_names): Remove initialisation of
18475 src_extension and header_extension.
18476 (compute_exts_from_gf): Update.
18477 (compute_exts_from_src): Update.
18478 (output_files): Update.
18479 * src/reader.c (parse_header_extension_decl): New.
18480 (parse_source_extension_decl): New.
18481 (read_declarations): New case statements for the new tokens.
18482 * src/lex.c (percent_table): Add entries for %source_extension
18483 and %header_extension.
18484 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
18485
18486 2001-08-06 Marc Autret <autret_m@epita.fr>
18487
18488 * configure.in: Bump to 1.28c.
18489 * doc/bison.texinfo: Texinfo thingies.
18490
18491 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
18492
18493 * tests/atconfig.in (CPPFLAGS): Add.
18494 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
18495
18496 2001-08-03 Akim Demaille <akim@epita.fr>
18497
18498 Version 1.28b.
18499
18500 2001-08-03 Akim Demaille <akim@epita.fr>
18501
18502 * tests/Makefile.am (check-local): Ship testsuite.
18503 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
18504 Include `string.h'.
18505
18506 2001-08-03 Akim Demaille <akim@epita.fr>
18507
18508 * configure.in: Try using -Wformat when compiling.
18509
18510 2001-08-03 Akim Demaille <akim@epita.fr>
18511
18512 * configure.in: Bump to 1.28b.
18513
18514 2001-08-03 Akim Demaille <akim@epita.fr>
18515
18516 * src/complain.c: Adjust strerror_r portability issues.
18517
18518 2001-08-03 Akim Demaille <akim@epita.fr>
18519
18520 Version 1.28a.
18521
18522 2001-08-03 Akim Demaille <akim@epita.fr>
18523
18524 * src/getargs.c, src/getarg.h (skeleton)): Constify.
18525 * src/lex.c (literalchar): Avoid name clashes on `buf'.
18526 * src/getargs.c: Include complain.h.
18527 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
18528 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
18529
18530 2001-08-03 Akim Demaille <akim@epita.fr>
18531
18532 * src/reader.c (readgram): Display hidden chars in error messages.
18533
18534 2001-08-03 Akim Demaille <akim@epita.fr>
18535
18536 Update to gettext 0.10.39.
18537
18538 2001-08-03 Akim Demaille <akim@epita.fr>
18539
18540 * lib/strspn.c: New.
18541
18542 2001-08-01 Marc Autret <autret_m@epita.fr>
18543
18544 * doc/bison.texinfo: Update.
18545 * doc/bison.1 (mandoc): Update.
18546 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
18547 * src/files.c: Support output files extensions computing.
18548 (src_extension): New static variable.
18549 (header_extension): New static variable.
18550 (tr): New function.
18551 (get_extension_index): New function, gets the index of an extension
18552 filename in a string.
18553 (compute_exts_from_gf): New function, computes extensions from the
18554 grammar file extension.
18555 (compute_exts_from_src): New functions, computes extensions from the
18556 C source file extension, file given by ``-o'' option.
18557 (compute_base_names): Update.
18558 (output_files): Update.
18559
18560 2001-08-01 Robert Anisko <anisko_r@epita.fr>
18561
18562 * doc/bison.texi: Document @$.
18563 (Locations): New section.
18564
18565 2001-07-18 Akim Demaille <akim@epita.fr>
18566
18567 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
18568 * config/prev-version.txt, config/move-if-change: New.
18569 * Makefile.am: Adjust.
18570
18571 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
18572
18573 * src/bison.simple (yyparse): Suppress warning `comparaison
18574 between signed and unsigned'.
18575
18576 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
18577
18578 * src/getargs.h (raw_flag): Remove.
18579 * src/getargs.c: Die on `-r'/`--raw'.
18580 * src/lex.c (parse_percent_token): Die on `%raw'.
18581 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
18582 * tests/calc.at: Suppress test with option `--raw'.
18583
18584 2001-07-14 Akim Demaille <akim@epita.fr>
18585
18586 * config/: New.
18587 * configure.in: Require Autoconf 2.50.
18588 Update to gettext 0.10.38.
18589
18590 2001-03-16 Akim Demaille <akim@epita.fr>
18591
18592 * doc/bison.texinfo: ANSIfy the examples.
18593
18594 2001-03-16 Akim Demaille <akim@epita.fr>
18595
18596 * getargs.c (skeleton): New variable.
18597 (longopts): --skeleton is a new option.
18598 (shortopts, getargs): -S is a new option.
18599 * getargs.h: Declare skeleton.
18600 * output.c (output_parser): Use it.
18601
18602 2001-03-16 Akim Demaille <akim@epita.fr>
18603
18604 * m4/strerror_r.m4: New.
18605 * m4/error.m4: Run AC_FUNC_STRERROR_R.
18606 * lib/error.h, lib/error.c: Update.
18607
18608 2001-03-16 Akim Demaille <akim@epita.fr>
18609
18610 * src/getargs.c (longopts): Clean up.
18611
18612 2001-02-21 Akim Demaille <akim@epita.fr>
18613
18614 * src/reader.c (gensym): `gensym_count' is your own.
18615 Use a static buf to create the symbol name, as token_buffer is no
18616 longer a buffer.
18617
18618 2001-02-08 Akim Demaille <akim@epita.fr>
18619
18620 * src/conflicts.c (conflict_report): Be sure not to append to res
18621 between two calls, which could happen if both first sprintf were
18622 skipped, but not the first cp += strlen.
18623
18624 2001-02-08 Akim Demaille <akim@epita.fr>
18625
18626 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
18627 New, from fileutils 4.0.37.
18628 * configure.in: Require Autoconf 2.49c. I took some time before
18629 making this decision. This is the only way out for portability
18630 issues in Bison, it would mean way too much duplicate effort to
18631 import in Bison features implemented in 2.49c since 2.13.
18632 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
18633
18634 2001-02-02 Akim Demaille <akim@epita.fr>
18635
18636 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
18637 * lib/xalloc.h, lib/xmalloc.c: Update.
18638
18639 2001-01-19 Akim Demaille <akim@epita.fr>
18640
18641 Get rid of the ad hoc handling of token_buffer in the scanner: use
18642 the obstacks.
18643
18644 * src/lex.c (token_obstack): New.
18645 (init_lex): Initialize it. No longer call...
18646 (grow_token_buffer): this. Remove it.
18647 Adjust all the places which used it to use the obstack.
18648
18649 2001-01-19 Akim Demaille <akim@epita.fr>
18650
18651 * src/lex.h: Rename all the tokens:
18652 s/\bENDFILE\b/tok_eof/g;
18653 s/\bIDENTIFIER\b/tok_identifier/g;
18654 etc.
18655 Let them be enums, not #define, to ease debugging.
18656 Adjust all the code.
18657
18658 2001-01-18 Akim Demaille <akim@epita.fr>
18659
18660 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
18661 * src/lex.c (maxtoken, grow_token_buffer): Static.
18662
18663 2001-01-18 Akim Demaille <akim@epita.fr>
18664
18665 Since we now use obstacks, more % directives can be enabled.
18666
18667 * src/lex.c (percent_table): Also accept `%yacc',
18668 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
18669 `%debug'.
18670 Handle the actions for `%semantic_parser' and `%pure_parser' here,
18671 instead of returning a token.
18672 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
18673 * src/reader.c (read_declarations): Adjust.
18674 * src/files.c (open_files): Don't call `compute_base_names', don't
18675 compute `attrsfile' since they depend upon data which might be
18676 *in* the input file now.
18677 (output_files): Do it here.
18678 * src/output.c (output_headers): Document the fact that this patch
18679 introduces a guaranteed SEGV for semantic parsers.
18680 * doc/bison.texinfo: Document them.
18681 * tests/suite.at: Exercise these %options.
18682
18683 2000-12-20 Akim Demaille <akim@epita.fr>
18684
18685 Also handle the output file (--verbose) with obstacks.
18686
18687 * files.c (foutput): Remove.
18688 (output_obstack): New.
18689 Adjust all dependencies.
18690 * src/conflicts.c: Return a string.
18691 * src/system.h (obstack_grow_string): Rename as...
18692 (obstack_sgrow): this. Be ready to work with non literals.
18693 (obstack_fgrow4): New.
18694
18695 2000-12-20 Akim Demaille <akim@epita.fr>
18696
18697 * src/files.c (open_files): Fix the computation of short_base_name
18698 in the case of `-o foo.tab.c'.
18699
18700 2000-12-20 Akim Demaille <akim@epita.fr>
18701
18702 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
18703 (copy_dollar): Now that everything uses obstacks, get rid of the
18704 FILE * parameters.
18705
18706 2000-12-20 Akim Demaille <akim@epita.fr>
18707
18708 * src/files.c (open_files): Actually the `.output' file is based
18709 on the short_base_name, not base_name.
18710 * tests/suite.at (Checking output file names): Adjust.
18711
18712 2000-12-20 Akim Demaille <akim@epita.fr>
18713
18714 * src/bison.s1: Remove, we now use directly...
18715 * src/bison.simple: this.
18716 * src/Makefile.am: Use pkgdata instead of data.
18717
18718 2000-12-20 Akim Demaille <akim@epita.fr>
18719
18720 * src/files.c (guard_obstack): New.
18721 (open_files): Initialize it.
18722 (output_files): Dump it...
18723 * src/files.h: Export it.
18724 * src/reader.c (copy_guard): Use it.
18725
18726 2000-12-19 Akim Demaille <akim@epita.fr>
18727
18728 * src/files.c (outfile, defsfile, actfile): Removed as global
18729 vars.
18730 (open_files): Don't compute them.
18731 (output_files): Adjust.
18732 (base_name, short_base_name): Be global.
18733 Adjust dependencies.
18734
18735 2000-12-19 Akim Demaille <akim@epita.fr>
18736
18737 * src/files.c (strsuffix): New.
18738 (stringappend): Be just like strcat but allocate.
18739 (base_names): Eve out from open_files.
18740 Try to simplify the rather hairy computation of base_name and
18741 short_base_name.
18742 (open_files): Use it.
18743 * tests/suite.at (Checking output file names): New test.
18744
18745 2000-12-19 Akim Demaille <akim@epita.fr>
18746
18747 * src/system.h (obstack_grow_literal_string): Rename as...
18748 (obstack_grow_string): this.
18749 * src/output.c (output_parser): Recognize `%% actions' instead of
18750 `$'.
18751 * src/bison.s1: s/$/%% actions/.
18752 * src/bison.hairy: Likewise.
18753
18754 2000-12-19 Akim Demaille <akim@epita.fr>
18755
18756 * src/output.c (output_parser): Compute the `#line' lines when
18757 there are.
18758 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
18759 Suggested by Hans Aberg.
18760
18761 2000-12-19 Akim Demaille <akim@epita.fr>
18762
18763 Let the handling of the skeleton files be local to the procedures
18764 that use it.
18765
18766 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
18767 longer static.
18768 (fparser, open_extra_files): Remove.
18769 (open_files, output_files): Don't take care of fparser.
18770 * src/files.h: Adjust.
18771 * src/output.c (output_parser): Open and close the file to the
18772 skeleton.
18773 * src/reader.c (read_declarations): When %semantic_parser, open
18774 fguard.
18775
18776 2000-12-19 Akim Demaille <akim@epita.fr>
18777
18778 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
18779 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
18780
18781 2000-12-19 Akim Demaille <akim@epita.fr>
18782
18783 * src/files.c (open_files): Yipee! We no longer need all the code
18784 looking for `/tmp' since we have no tmp file.
18785
18786 2000-12-19 Akim Demaille <akim@epita.fr>
18787
18788 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
18789 New macros.
18790 * src/files.c (open_files): Less dependency on MSDOS etc.
18791
18792 2000-12-14 Akim Demaille <akim@epita.fr>
18793
18794 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
18795 Provide a default definition.
18796 Use it when executing the default @ action.
18797 * src/reader.c (reader_output_yylsp): No longer include
18798 `timestamp' and `text' in the default YYLTYPE.
18799
18800 2000-12-12 Akim Demaille <akim@epita.fr>
18801
18802 * src/reader.c (copy_definition, parse_union_decl, copy_action)
18803 (copy_guard): Quote the file names.
18804 Reported by Laurent Mascherpa.
18805
18806 2000-12-12 Akim Demaille <akim@epita.fr>
18807
18808 * src/output.c (output_headers, output_program, output): Be sure
18809 to escape special characters when outputting filenames.
18810 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
18811 (output_headers): Don't depend on them, Use ACTSTR.
18812
18813 2000-11-17 Akim Demaille <akim@epita.fr>
18814
18815 * lib/obstack.h: Formatting changes.
18816 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
18817 prevents type checking.
18818 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
18819 cast the value to (void *): assigning a `foo *' to a `void *'
18820 variable is valid.
18821 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
18822 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
18823 append characters.
18824
18825 2000-11-17 Akim Demaille <akim@epita.fr>
18826
18827 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
18828 as...
18829 (suite.m4, regression.m4, calc.m4): these.
18830 * tests/atgeneral.m4: Update from CVS Autoconf.
18831
18832 2000-11-17 Akim Demaille <akim@epita.fr>
18833
18834 * tests/regression.m4 (%union and --defines): New test,
18835 demonstrating a current bug in the obstack implementation.
18836
18837 2000-11-17 Akim Demaille <akim@epita.fr>
18838
18839 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18840 macros.
18841 Use them to declare the variables which are global or local to
18842 `yyparse'.
18843
18844 2000-11-17 Akim Demaille <akim@epita.fr>
18845
18846 * acconfig.h: Remove, no longer used.
18847
18848 2000-11-07 Akim Demaille <akim@epita.fr>
18849
18850 * src: s/Copyright (C)/Copyright/g.
18851
18852 2000-11-07 Akim Demaille <akim@epita.fr>
18853
18854 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18855 defining.
18856 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18857
18858 2000-11-07 Akim Demaille <akim@epita.fr>
18859
18860 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18861 Merge in a single CPP if/else.
18862
18863 2000-11-07 Akim Demaille <akim@epita.fr>
18864
18865 * src/output.c (output): Remove useless variables.
18866 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18867 argument `data' for consistency with the prototypes.
18868 Qualify it `const'.
18869 (obstack_copy, obstack_copy0): Rename the second argument as
18870 `address' for consistency. Qualify it `const'.
18871 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18872 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18873 `const' their input argument (`data' or `address').
18874 Adjust the corresponding macros to include `const' in casts.
18875
18876 2000-11-03 Akim Demaille <akim@epita.fr>
18877
18878 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18879 s/PFILE1/BISON_HAIRY/.
18880 Adjust dependencies.
18881
18882 2000-11-03 Akim Demaille <akim@epita.fr>
18883
18884 For some reason, this was not applied.
18885
18886 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18887 `unlink': it's no longer used.
18888
18889 2000-11-03 Akim Demaille <akim@epita.fr>
18890
18891 * src/files.c (skeleton_find): New function, eved out of...
18892 (open_files, open_extra_files): here.
18893
18894 2000-11-03 Akim Demaille <akim@epita.fr>
18895
18896 Don't use `atexit'.
18897
18898 * src/files.c (obstack_save): New function.
18899 (done): Rename as...
18900 (output_files): this.
18901 Use `obstack_save'.
18902 * src/main.c (main): Don't use `atexit' to register `done', since
18903 it no longer has to remove tmp files, just call `output_files'
18904 when there are no errors.
18905
18906 2000-11-02 Akim Demaille <akim@epita.fr>
18907
18908 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18909 `unlink': it's no longer used.
18910 * src/files.h: Formatting changes.
18911
18912 2000-11-02 Akim Demaille <akim@epita.fr>
18913
18914 Remove the last uses of mktemp and unlink/delete.
18915
18916 * src/files.c (fdefines, ftable): Removed.
18917 (defines_ostack, table_obstack): New.
18918 Adjust dependencies of the former into uses of the latter.
18919 * src/output.c (output_short_or_char_table, output_short_table):
18920 Convert to using obstacks.
18921 * src/reader.c (copy_comment2): Accept one FILE * and two
18922 obstacks.
18923 (output_token_defines, reader_output_yylsp): Use obstacks.
18924 * src/system.h (obstack_fgrow3): New.
18925 * po/POTFILES.in: Adjust.
18926
18927 2000-11-01 Akim Demaille <akim@epita.fr>
18928
18929 Change each use of `fattrs' into a use of `attrs_obstack'.
18930
18931 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18932 * src/files.c (fattrs): Remove.
18933 (attrs_obstack): New.
18934 Adjust all dependencies.
18935 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18936
18937 2000-11-01 Akim Demaille <akim@epita.fr>
18938
18939 Introduce obstacks.
18940 Change each use of `faction' into a use of `action_obstack'.
18941
18942 * lib/obstack.h, lib/obstack.c: New files.
18943 * src/files.c (faction): Remove.
18944 (action_obstack): New.
18945 Adjust all dependencies.
18946
18947 2000-10-20 Akim Demaille <akim@epita.fr>
18948
18949 * lib/quote.h (PARAMS): New macro. Use it.
18950
18951 2000-10-16 Akim Demaille <akim@epita.fr>
18952
18953 * src/output.c (output_short_or_char_table): New function.
18954 (output_short_table, output_token_translations): Use it.
18955 (goto_actions): Use output_short_table.
18956
18957 2000-10-16 Akim Demaille <akim@epita.fr>
18958
18959 * src/symtab.c (bucket_new): New function.
18960 (getsym): Use it.
18961
18962 * src/output.c (output_short_table): New argument to display the
18963 comment associated with the table.
18964 Adjust dependencies.
18965 (output_gram): Use it.
18966 (output_rule_data): Nicer output layout for YYTNAME.
18967
18968 2000-10-16 Akim Demaille <akim@epita.fr>
18969
18970 * src/lex.c (read_typename): New function.
18971 (lex): Use it.
18972 * src/reader.c (copy_dollar): Likewise.
18973
18974 2000-10-16 Akim Demaille <akim@epita.fr>
18975
18976 * src/reader.c (copy_comment2): Expect the input stream to be on
18977 the `/' which is suspected to open a comment, instead of being
18978 called after `//' or `/*' was read.
18979 (copy_comment, copy_definition, parse_union_decl, copy_action)
18980 (copy_guard): Adjust.
18981
18982 2000-10-16 Akim Demaille <akim@epita.fr>
18983
18984 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18985 `read_signed_integer'.
18986
18987 2000-10-16 Akim Demaille <akim@epita.fr>
18988
18989 * src/reader.c (copy_dollar): New function.
18990 (copy_guard, copy_action): Use it.
18991
18992 2000-10-16 Akim Demaille <akim@epita.fr>
18993
18994 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18995 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18996 New files, from Fileutils 4.0.27.
18997 * src/main.c (printable_version): Remove.
18998 * src/lex.c, src/reader.c: Use `quote'.
18999
19000 2000-10-04 Akim Demaille <akim@epita.fr>
19001
19002 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
19003
19004 2000-10-04 Akim Demaille <akim@epita.fr>
19005
19006 * doc/bison.texinfo: Various typos spotted by Neil Booth.
19007
19008 2000-10-04 Akim Demaille <akim@epita.fr>
19009
19010 When a literal string is used to define two different tokens,
19011 `bison -v' segfaults.
19012 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
19013
19014 * tests/regression.m4: New file.
19015 Include the core of the sample provided by Piotr Gackiewicz.
19016 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
19017 properly.
19018
19019 2000-10-04 Akim Demaille <akim@epita.fr>
19020
19021 * src/reader.c (parse_expect_decl): Keep `count' within the size
19022 of `buffer'.
19023 From Neil Booth.
19024
19025 2000-10-02 Paul Eggert <eggert@twinsun.com>
19026
19027 * bison.s1 (yyparse): Assign the default value
19028 unconditionally, to avoid a GCC warning and make the parser a
19029 tad smaller.
19030
19031 2000-10-02 Akim Demaille <akim@epita.fr>
19032
19033 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
19034 options.
19035
19036 2000-10-02 Akim Demaille <akim@epita.fr>
19037
19038 * src/derives.c, src/print.c, src/reduce.c: To ease the
19039 translation, move some `\n' out of the translated strings.
19040
19041 2000-10-02 Akim Demaille <akim@epita.fr>
19042
19043 The location tracking mechanism is precious for parse error
19044 messages. Nevertheless, it is enabled only when `@n' is used in
19045 the grammar, which is a different issue (you can use it in error
19046 message, but not in the grammar per se). Therefore, there should
19047 be another means to enable it.
19048
19049 * src/getargs.c (getargs): Support `--locations'.
19050 (usage): Report it.
19051 * src/getargs.h (locationsflag): Export it.
19052 * src/lex.c (percent_table): Support `%locations'.
19053 * src/reader.c (yylsp_needed): Remove this variable, now replaced
19054 with `locationsflag'.
19055 * doc/bison.texinfo: Document `--locations' and `%locations'.
19056 Sort the options.
19057 * tests/calc.m4: Test it.
19058
19059 For regularity of the names, replace each
19060 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
19061 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
19062 In addition replace each `flag' with `_flag'.
19063
19064 2000-10-02 Akim Demaille <akim@epita.fr>
19065
19066 Also test parse error messages, including with YYERROR_VERBOSE.
19067
19068 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
19069 associative).
19070 Use it to check the computations.
19071 Use it to check `nonassoc' is honored.
19072 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
19073 `--yyerror-verbose'.
19074 (_AT_CHECK_CALC): Adjust to this option.
19075 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
19076
19077 2000-10-02 Akim Demaille <akim@epita.fr>
19078
19079 Test also `--verbose', `--defines' and `--name-prefix'. Testing
19080 the latter demonstrates a flaw in the handling of non debugging
19081 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
19082 was used in order to simplify:
19083
19084 #if YYDEBUG
19085 if (yydebug)
19086 {
19087 ...
19088 }
19089 #endif
19090
19091 into
19092
19093 if (yydebug)
19094 {
19095 ...
19096 }
19097
19098 unfortunately this leads to a CPP conflict when
19099 `--name-prefix=foo' is used since it produces `#define yydebug
19100 foodebug'.
19101
19102 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
19103 (YYDPRINTF): New macro.
19104 Spread its use.
19105 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
19106 the bison options.
19107 Also test `--verbose', `--defines' and `--name-prefix'.
19108
19109 2000-10-02 Akim Demaille <akim@epita.fr>
19110
19111 Improve the readability of the produced parsers.
19112
19113 * src/bison.s1: Formatting changes.
19114 Improve the comment related to the `$' mark.
19115 (yydefault): Don't fall through to `yyresume': `goto' there.
19116 * src/output.c (output_parser): When the `$' is met, skip the end
19117 of its line.
19118 New variable, `number_of_dollar_signs', to check there's exactly
19119 one `$' in the parser skeleton.
19120
19121 2000-10-02 Akim Demaille <akim@epita.fr>
19122
19123 * lib/xstrdup.c: New file, from the fileutils.
19124 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
19125 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
19126 instead of strlen + xmalloc + strcpy.
19127 * src/symtab.c (copys): Remove, use xstrdup instead.
19128
19129 2000-10-02 Akim Demaille <akim@epita.fr>
19130
19131 * src/gram.h (associativity): New enum type which replaces the
19132 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
19133 `right_assoc', `left_assoc' and `non_assoc'.
19134 Adjust all dependencies.
19135 * src/reader.c: Formatting changes.
19136 (LTYPESTR): Don't define it, use it as a literal in
19137 `reader_output_yylsp'.
19138 * src/symtab.h (symbol_class): New enum type which replaces the
19139 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
19140 `sunknown', `stoken and `snterm'.
19141
19142 2000-10-02 Akim Demaille <akim@epita.fr>
19143
19144 * src/getargs.c (fixed_outfiles): Rename as...
19145 (yaccflag): for consistency and accuracy.
19146 Adjust dependencies.
19147
19148 2000-10-02 Akim Demaille <akim@epita.fr>
19149
19150 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
19151 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
19152 difficult and introduced a lot of core dump. It turns out that
19153 Bison used an implementation of `xmalloc' based on `calloc', and
19154 at various places it does depend upon the initialization to 0. I
19155 have not tried to isolate the pertinent places, and all the former
19156 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
19157 someone should address this issue.
19158
19159 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
19160 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
19161 files.
19162 Adjust dependencies.
19163 * src/warshall.h: New file.
19164 Propagate.
19165
19166 2000-10-02 Akim Demaille <akim@epita.fr>
19167
19168 Various anti-`extern in *.c' changes.
19169
19170 * src/system.h: Include `assert.h'.
19171
19172 2000-10-02 Akim Demaille <akim@epita.fr>
19173
19174 * src/state.h (nstates, final_state, first_state, first_shift)
19175 (first_reduction): Move their exportation from here...
19176 * src/LR0.h: to here.
19177 Adjust dependencies.
19178 * src/getargs.c (statisticsflag): New variable.
19179 Add support for `--statistics'.
19180 Adjust dependencies.
19181
19182 Remove a lot of now useless `extern' statements in most files.
19183
19184 2000-10-02 Akim Demaille <akim@epita.fr>
19185
19186 * src/LR0.h: New file.
19187 Propagate its use.
19188
19189 2000-10-02 Akim Demaille <akim@epita.fr>
19190
19191 * src/print.h: New file.
19192 Propagate its use.
19193 * src/print.c: Formatting and ordering changes.
19194 (verbose, terse): Replace with...
19195 (print_results): this new function.
19196 Adjust dependencies.
19197
19198 2000-10-02 Akim Demaille <akim@epita.fr>
19199
19200 * src/conflicts.c (conflict_report): New function.
19201 (conflict_log, verbose_conflict_log): Replace with...
19202 (print_conflicts): this function.
19203 Adjust dependencies.
19204 * src/conflicts.h: New file.
19205 Propagate its inclusion.
19206
19207 2000-10-02 Akim Demaille <akim@epita.fr>
19208
19209 * src/nullable.h: New file.
19210 Propagate its inclusion.
19211 * src/nullable.c: Formatting changes.
19212
19213 2000-10-02 Akim Demaille <akim@epita.fr>
19214
19215 * src/reduce.h: New file.
19216 Propagate its inclusion.
19217 * src/reduce.c: Topological sort and other formatting changes.
19218 (bool, TRUE, FALSE): Move their definition to...
19219 * src/system.h: here.
19220
19221 2000-10-02 Akim Demaille <akim@epita.fr>
19222
19223 * src/files.c: Formatting changes.
19224 (tryopen, tryclose, openfiles): Rename as...
19225 (xfopen, xfclose, open_files): this.
19226 (stringappend): static.
19227 * src/files.h: Complete the list of exported symbols.
19228 Propagate its use.
19229
19230 2000-10-02 Akim Demaille <akim@epita.fr>
19231
19232 * src/reader.h: New file.
19233 Propagate its use instead of tedious list of `extern' and
19234 prototypes.
19235 * src/reader.c: Formatting changes, topological sort,
19236 s/register//.
19237
19238 2000-10-02 Akim Demaille <akim@epita.fr>
19239
19240 * src/lex.h: Prototype `lex.c' exported functions.
19241 * src/reader.c: Adjust.
19242 * src/lex.c: Formatting changes.
19243 (safegetc): Rename as...
19244 (xgetc): this.
19245
19246 2000-10-02 Akim Demaille <akim@epita.fr>
19247
19248 * src/lalr.h: New file.
19249 Propagate its inclusion instead of prototypes and `extern'.
19250 * src/lalr.c: Formatting changes, topological sorting etc.
19251
19252 2000-10-02 Akim Demaille <akim@epita.fr>
19253
19254 * src/output.c (token_actions): Introduce a temporary array,
19255 YYDEFACT, that makes it possible for this function to use
19256 output_short_table.
19257
19258 2000-10-02 Akim Demaille <akim@epita.fr>
19259
19260 `user_toknums' is output as a `short[]' in `output.c', while it is
19261 defined as a `int[]' in `reader.c'. For consistency with the
19262 other output tables, `user_toknums' is now defined as a table of
19263 shorts.
19264
19265 * src/reader.c (user_toknums): Be a short table instead of an int
19266 table.
19267 Adjust dependencies.
19268
19269 Factor the short table outputs.
19270
19271 * src/output.c (output_short_table): New function.
19272 * src/output.c (output_gram, output_stos, output_rule_data)
19273 (output_base, output_table, output_check): Use it.
19274
19275 2000-10-02 Akim Demaille <akim@epita.fr>
19276
19277 * src/output.c (output): Topological sort of the functions, in
19278 order to get rid of the `static' prototypes.
19279 No longer use `register'.
19280 * src/output.h: New file.
19281 Propagate its inclusion in files explicitly prototyping functions
19282 from output.c.
19283
19284 2000-09-21 Akim Demaille <akim@epita.fr>
19285
19286 * src/atgeneral.m4: Update from Autoconf.
19287
19288 2000-09-21 Akim Demaille <akim@epita.fr>
19289
19290 * src/closure.h: New file.
19291 * src/closure.c: Formatting changes, topological sort over the
19292 functions, use of closure.h.
19293 (initialize_closure, finalize_closure): Rename as...
19294 (new_closure, free_closure): these. Adjust dependencies.
19295 * src/LR0.c: Formatting changes, topological sort, use of
19296 cloture.h.
19297 (initialize_states): Rename as...
19298 (new_states): this.
19299 * src/Makefile.am (noinst_HEADERS): Adjust.
19300
19301 2000-09-20 Akim Demaille <akim@epita.fr>
19302
19303 * src/acconfig.h: Don't protect config.h against multiple
19304 inclusion.
19305 Don't define PARAMS.
19306 * src/system.h: Define PARAMS.
19307 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
19308 purpose of config.h. system.h must not try to fix wrong
19309 definitions in config.h.
19310
19311 2000-09-20 Akim Demaille <akim@epita.fr>
19312
19313 * src/derives.h: New file.
19314 * src/main.c, src/derives.h: Use it.
19315 Formatting changes.
19316 * src/Makefile.am (noinst_HEADERS): Adjust.
19317
19318 2000-09-20 Akim Demaille <akim@epita.fr>
19319
19320 * tests/atgeneral.m4: Update from Autoconf.
19321 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
19322 (AT_CHECK_CALC): New macros.
19323 Use these macros to test bison with options `', `--raw',
19324 `--debug', `--yacc', `--yacc --debug'.
19325
19326 2000-09-19 Akim Demaille <akim@epita.fr>
19327
19328 * src/output.c: Formatting changes.
19329 * src/machine.h: Remove, leaving its contents in...
19330 * src/system.h: here.
19331 Include stdio.h.
19332 Adjust all dependencies on stdio.h and machine.h.
19333 * src/getargs.h: New file.
19334 Let all `extern' declarations about getargs.c be replaced with
19335 inclusion of `getargs.h'.
19336 * src/Makefile.am (noinst_HEADERS): Adjust.
19337
19338 * tests/calc.m4 (yyin): Be initialized in main, not on the global
19339 scope.
19340 (yyerror): Returns void, not int.
19341 * doc/bison.texinfo: Formatting changes.
19342
19343 2000-09-19 Akim Demaille <akim@epita.fr>
19344
19345 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
19346 portable.
19347
19348 2000-09-18 Akim Demaille <akim@epita.fr>
19349
19350 * configure.in: Append WARNING_CFLAGS to CFLAGS.
19351 * src/Makefile.am (INCLUDES): Don't.
19352 Be ready to fetch headers in lib/.
19353
19354 2000-09-18 Akim Demaille <akim@epita.fr>
19355
19356 * doc/bison.texinfo: Update the copyright.
19357 ANSIfy and GNUify the examples.
19358 Remove the old menu.
19359
19360 2000-09-18 Akim Demaille <akim@epita.fr>
19361
19362 First set of tests: use the `calc' example from the documentation.
19363
19364 * src/bison.s1 (yyparse): Condition the code using `yytname' which
19365 is defined only when YYDEBUG is.
19366 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
19367 * src/files.c (tryopen, tryclose): Formatting changes.
19368 Move to the top and be static.
19369 * src/reader.c (read_signed_integer): Likewise.
19370 * tests/calc.m4: New file.
19371 * Makefile.am, suite.m4: Adjust.
19372 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
19373
19374 2000-09-18 Akim Demaille <akim@epita.fr>
19375
19376 Add support for an Autotest test suite for Bison.
19377
19378 * m4/m4.m4, m4/atconfig.m4: New files.
19379 * m4/Makefile.am (EXTRA_DIST): Adjust.
19380 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
19381 files.
19382 * src/getargs.c: Display a more standard --version message.
19383 * src/reader.c (reader): Formatting changes.
19384 No longer depend upon VERSION_STRING.
19385 * configure.in: No longer use `dnl'.
19386 Set up the test suite and the new directory `tests/.
19387 (VERSION_STRING): Remove.
19388
19389 2000-04-14 Akim Demaille <akim@epita.fr>
19390
19391 * src/reader.c (copy_comment2): New function, same as former
19392 `copy_comment', but outputs into two FILE *.
19393 (copy_comment): Use it.
19394 (parse_union_decl): Use it.
19395 (get_type, parse_start_decl): Use the same `invalid' message.
19396 (parse_start_decl, parse_union_decl): Use the same `multiple'
19397 message.
19398 (parse_union_decl, copy_guard, copy_action): Use the same
19399 `unmatched' message.
19400 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
19401
19402 2000-03-31 Akim Demaille <akim@epita.fr>
19403
19404 * src/files.c (tryopen, tryclose): Move to the top.
19405 Be static.
19406
19407 2000-03-31 Akim Demaille <akim@epita.fr>
19408
19409 * src/main.c (main): Don't call `done', exit does it.
19410
19411 2000-03-31 Akim Demaille <akim@epita.fr>
19412
19413 * allocate.c: s/return (foo)/return foo/.
19414 * lalr.c: Likewise.
19415 * LR0.c: Likewise.
19416 * output.c: Likewise.
19417 * reader.c: Likewise.
19418 * symtab.c: Likewise.
19419 * vmsgetargs.c: Likewise.
19420
19421 2000-03-31 Akim Demaille <akim@epita.fr>
19422
19423 Clean up the error reporting functions.
19424
19425 * src/report.c: New file.
19426 * src/report.h: Likewise.
19427 * src/Makefile.am: Adjust.
19428 * m4/error.m4: New file.
19429 * m4/Makefile.am: Adjust.
19430 * configure.in (jm_PREREQ_ERROR): Call it.
19431 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
19432 Remove.
19433 (fatal, fatals): Remove. All callers use complain.c::fatal.
19434 (warn, warni, warns, warnss, warnss): Remove. All callers use
19435 complain.c::complain.
19436 (toomany): Remove, use fatal instead.
19437 * src/files.c (done): No argument, use complain_message_count.
19438 * src/main.c (main): Register `done' to `atexit'.
19439
19440 * src/getargs.c (usage): More `fputs', less `fprintf'.
19441
19442 2000-03-28 Akim Demaille <akim@epita.fr>
19443
19444 * lib/: New directory.
19445 * Makefile.am (SUBDIRS): Adjust.
19446 * configure.in: Adjust.
19447 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
19448 useless.
19449 * src/alloca.c: Moved to lib/.
19450 * src/getopt.c: Likewise.
19451 * src/getopt1.c: Likewise.
19452 * src/getopt.h: Likewise.
19453 * src/ansi2knr.c: Likewise.
19454 * src/ansi2knr.1: Likewise.
19455 * src/Makefile.am: Adjust.
19456 * lib/Makefile.am: New file.
19457
19458 2000-03-28 Akim Demaille <akim@epita.fr>
19459
19460 * src/getargs.c (usage): Refresh the help message.
19461
19462 2000-03-17 Akim Demaille <akim@epita.fr>
19463
19464 * src/getopt1.c: Updated from textutils 2.0e
19465 * src/getopt.c: Likewise.
19466 * src/getopt.h: Likewise.
19467
19468 2000-03-17 Akim Demaille <akim@epita.fr>
19469
19470 * src/Makefile.am (bison.simple): Fix the awk program: quote only
19471 the file name, not the whole `#line LINE FILE'.
19472
19473 2000-03-17 Akim Demaille <akim@epita.fr>
19474
19475 On syntax errors, report the token on which we choked.
19476
19477 * src/bison.s1 (yyparse): In the label yyerrlab, when
19478 YYERROR_VERBOSE, add yychar in msg.
19479
19480 2000-03-17 Akim Demaille <akim@epita.fr>
19481
19482 * src/reader.c (copy_at): New function.
19483 (copy_guard): Use it.
19484 (copy_action): Use it.
19485
19486 2000-03-17 Akim Demaille <akim@epita.fr>
19487
19488 Be kind to translators, save some useless translations.
19489
19490 * src/main.c (banner): New function.
19491 (fatal_banner): Use it.
19492 (warn_banner): Use it.
19493
19494 2000-03-17 Akim Demaille <akim@epita.fr>
19495
19496 * src/reader.c (copy_definition): Use copy_string and
19497 copy_comment. Removed now unused `match', `ended',
19498 `cplus_comment'.
19499 (copy_comment, copy_string): Moved, to be visible from
19500 copy_definition.
19501
19502 2000-03-17 Akim Demaille <akim@epita.fr>
19503
19504 * src/reader.c (copy_string): Declare `static inline'. No
19505 problems with inline, since it is checked by configure.
19506 (copy_comment): Likewise.
19507
19508 2000-03-17 Akim Demaille <akim@epita.fr>
19509
19510 * src/reader.c (packsymbols): Formatting changes.
19511
19512 2000-03-17 Akim Demaille <akim@epita.fr>
19513
19514 * src/reader.c (copy_comment): New function, factored out from:
19515 (copy_action): Use it. Removed now unused `match', `ended',
19516 `cplus_comment'.
19517 (copy_guard): Likewise.
19518
19519 2000-03-17 Akim Demaille <akim@epita.fr>
19520
19521 * src/reader.c (copy_string): New function, factored out from:
19522 (copy_action): Use it.
19523 (copy_guard): Likewise.
19524
19525 2000-03-17 Akim Demaille <akim@epita.fr>
19526
19527 Change the handling of @s so that they behave exactly like $s.
19528 There is now a pseudo variable @$ (readble and writable), location
19529 of the lhs of the rule (by default ranging from the location of
19530 the first symbol of the rhs, to the location of the last symbol,
19531 or, if the rhs is empty, YYLLOC).
19532
19533 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
19534 yyval.
19535 (yyparse): When providing a default semantic action, provide a
19536 default location action.
19537 (after the $): No longer change `*YYLSP', just stack YYLOC the
19538 same way you stack YYVAL.
19539 * src/reader.c (read_declarations): Use warns.
19540 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
19541 (copy_action, case '@'): Likewise.
19542 Use a standard error message, to save useless work from
19543 translators.
19544
19545 2000-03-17 Akim Demaille <akim@epita.fr>
19546
19547 * src/bison.s1: Formatting and cosmetics changes.
19548 * src/reader.c: Likewise.
19549 Update the Copyright notice.
19550
19551 2000-03-17 Akim Demaille <akim@epita.fr>
19552
19553 * src/bison.s1 (#line): All set to `#line' only, since the
19554 Makefile now handles them.
19555
19556 2000-03-16 Akim Demaille <akim@epita.fr>
19557
19558 * src/output.c (output_rule_data): Output the documentation of
19559 some of the tables.
19560 (Copyright notice): Update.
19561 Formatting changes.
19562
19563 2000-03-16 Akim Demaille <akim@epita.fr>
19564
19565 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
19566 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
19567 One `#if YYDEBUG' remains, since it uses variables which are
19568 defined only if `YYDEBUG != 0'.
19569
19570 2000-03-16 Akim Demaille <akim@epita.fr>
19571
19572 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
19573 and related variables so that the similarities are highlighted.
19574
19575 2000-03-16 Akim Demaille <akim@epita.fr>
19576
19577 * src/bison.s1: Properly indent CPP directives.
19578
19579 2000-03-16 Akim Demaille <akim@epita.fr>
19580
19581 * src/bison.s1: Properly indent the `alloca' CPP section.
19582
19583 2000-03-16 Akim Demaille <akim@epita.fr>
19584
19585 Do not hard code values of directories in `configure.in'.
19586 Update the `configure' tool chain.
19587
19588 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
19589 src/makefile.am.
19590 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
19591 (AC_OUTPUT): Add m4/Makefile.
19592 Bump to bison 1.28a, 1.29 has never been released.
19593 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
19594 handled via src/Makefile.am.
19595 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
19596 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
19597 autoheader.
19598 * Makefile.am (SUBDIRS): Add m4.
19599 (ACLOCAL_AM_FLAGS): New variable.
19600 (AUTOMAKE_OPTIONS): Add check-news.
19601 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
19602 the proper line number and file name.
19603 (DEFS): Propagate the location of bison library files and of the
19604 locale files.
19605 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
19606 builddir.
19607 * acinclude.m4: Remove, replaced by the directory m4.
19608 * m4/Makefile.am (EXTRA_DIST): New variable.
19609 * m4/gettext.m4: New file, from the fileutils.
19610 * m4/lcmessage.m4: Likewise
19611 * m4/progtest.m4: Likewise.
19612 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
19613
19614 2000-03-10 Akim Demaille <akim@epita.fr>
19615
19616 * src/closure.c:
19617 Formatting changes of various comments.
19618 Respect the GNU coding standards at various places.
19619 Don't use `_()' when no translation is needed.
19620
19621 1999-12-13 Jesse Thilo <jthilo@gnu.org>
19622
19623 * src/files.c:
19624 OS/2 honors TMPDIR environment variable.
19625
19626 1999-12-13 Jesse Thilo <jthilo@gnu.org>
19627
19628 * doc/bison.texinfo: Tweaked spelling and grammar.
19629 Updated ISBN.
19630 Removed reference to price of printed copy.
19631 Mention BISON_SIMPLE and BISON_HAIRY.
19632
19633 1999-12-13 Jesse Thilo <jthilo@gnu.org>
19634
19635 * configure.in, NEWS:
19636 Bison 1.29 released.
19637
19638 1999-10-27 Jesse Thilo <jthilo@gnu.org>
19639
19640 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
19641 Added reference card.
19642
19643 1999-07-26 Jesse Thilo <jthilo@gnu.org>
19644
19645 * po/ru.po: Added Russian translation.
19646
19647 1999-07-26 Jesse Thilo <jthilo@gnu.org>
19648
19649 * configure.in: Added Russian translation.
19650
19651 1999-07-06 Jesse Thilo <jthilo@gnu.org>
19652
19653 * configure.in, NEWS, README:
19654 Released version 1.28.
19655
19656 1999-06-14 Jesse Thilo <jthilo@gnu.org>
19657
19658 * src/system.h:
19659 Squashed redefinition warning on some systems.
19660
19661 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
19662 Have configure build version string instead of relying on ANSI string
19663 concatentation.
19664
19665 1999-06-14 Jesse Thilo <jthilo@gnu.org>
19666
19667 * po/POTFILES.in: Got rid of version.c.
19668
19669 1999-06-14 Jesse Thilo <jthilo@gnu.org>
19670
19671 * acconfig.h, configure.in:
19672 Have configure build version string instead of relying on ANSI string
19673 concatentation.
19674
19675 1999-06-08 Jesse Thilo <jthilo@gnu.org>
19676
19677 * doc/bison.1:
19678 Dropped mention of `+' for long-named options.
19679
19680 1999-05-30 Jesse Thilo <jthilo@gnu.org>
19681
19682 * src/files.c: Added <unistd.h> for unlink().
19683
19684 * src/Makefile.am, src/system.h:
19685 I18n fixes.
19686
19687 1999-05-30 Jesse Thilo <jthilo@gnu.org>
19688
19689 * README: Added a FAQ list.
19690
19691 * configure.in, acconfig.h:
19692 I18n fixes.
19693
19694 1999-05-30 Jesse Thilo <jthilo@gnu.org>
19695
19696 * doc/FAQ, doc/Makefile.am:
19697 Added a FAQ list.
19698
19699 1999-05-19 Jesse Thilo <jthilo@gnu.org>
19700
19701 * src/alloc.h, src/symtab.h, src/version.c:
19702 Protected inclusion of "config.h" with HAVE_CONFIG_H.
19703
19704 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19705
19706 * src/.cvsignore, src/Makefile.am:
19707 Reorganized: sources in `src', documentation in `doc'.
19708
19709 * src/lex.c (literalchar):
19710 fixed the code for escaping double quotes (thanks
19711 Jonathan Czisny.)
19712
19713 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19714
19715 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
19716 Adjusted paths to reflect directory reorganization.
19717
19718 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19719
19720 * doc/.cvsignore, doc/Makefile.am:
19721 Reorganized: sources in `src', documentation in `doc'.
19722
19723 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19724
19725 * configure.in:
19726 Updated AC_INIT file to reflect directory reorganization.
19727
19728 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
19729 Reorganized: sources in `src', documentation in `doc'.
19730
19731 1999-04-13 Jesse Thilo <jthilo@gnu.org>
19732
19733 * src/allocate.c:
19734 Don't declare calloc() and realloc() if not necessary.
19735
19736 1999-04-13 Jesse Thilo <jthilo@gnu.org>
19737
19738 * configure.in, acconfig.h, acinclude.m4:
19739 Don't declare calloc() and realloc() if not necessary.
19740
19741 1999-03-23 Jesse Thilo <jthilo@gnu.org>
19742
19743 * po/.cvsignore: Added i18n support.
19744
19745 1999-03-23 Jesse Thilo <jthilo@gnu.org>
19746
19747 * acconfig.h, configure.in, Makefile.am:
19748 Added i18n support.
19749
19750 1999-03-22 Jesse Thilo <jthilo@gnu.org>
19751
19752 * src/bison.s1: Fixed #line numbers.
19753
19754 1999-03-15 Jesse Thilo <jthilo@gnu.org>
19755
19756 * po/es.po, po/fr.po, po/nl.po, po/de.po:
19757 Added PO files from Translation Project.
19758
19759 1999-03-03 Jesse Thilo <jthilo@gnu.org>
19760
19761 * Makefile.am:
19762 Added support for non-ANSI compilers (ansi2knr).
19763
19764 1999-02-16 Jesse Thilo <jthilo@gnu.org>
19765
19766 * configure.in: Bumped version number to 1.27.
19767
19768 * Makefile.am:
19769 Added `bison.simple' to list of files removed by `make distclean'.
19770
19771 1999-02-12 Jesse Thilo <jthilo@gnu.org>
19772
19773 * src/files.c, src/files.h:
19774 Defined locations of parser files in config.h instead of Makefile.
19775
19776 1999-02-12 Jesse Thilo <jthilo@gnu.org>
19777
19778 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
19779 Defined locations of parser files in config.h instead of Makefile.
19780
19781 1999-02-09 Jesse Thilo <jthilo@gnu.org>
19782
19783 * Makefile.am:
19784 Removed inappropriate use of $< macro.
19785
19786 1999-02-05 Jesse Thilo <jthilo@gnu.org>
19787
19788 * po/Makefile.in.in, po/POTFILES.in:
19789 Add `po' directory skeleton.
19790
19791 1999-01-27 Jesse Thilo <jthilo@gnu.org>
19792
19793 * README: Document help-bison list.
19794
19795 * configure.in: Add check for mkstemp().
19796
19797 1999-01-20 Jesse Thilo <jthilo@gnu.org>
19798
19799 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
19800 Hush a few compiler warnings.
19801
19802 * src/files.c:
19803 Add tryclose(), which verifies that fclose was successful.
19804 Hush a couple of compiler warnings.
19805
19806 1999-01-20 Jesse Thilo <jthilo@gnu.org>
19807
19808 * Makefile.am, OChangeLog:
19809 ChangeLog is now automatically generated. Include the old version as
19810 OChangeLog.
19811
19812 1999-01-14 Jesse Thilo <jthilo@gnu.org>
19813
19814 * 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:
19815 Update FSF address.
19816
19817 1999-01-14 Jesse Thilo <jthilo@gnu.org>
19818
19819 * doc/bison.texinfo: Fix formatting glitch.
19820
19821 * doc/bison.texinfo: Update FSF address.
19822
19823 1999-01-14 Jesse Thilo <jthilo@gnu.org>
19824
19825 * acconfig.h: Update FSF address.
19826
19827 1999-01-08 Jesse Thilo <jthilo@gnu.org>
19828
19829 * src/system.h:
19830 Don't define PACKAGE here, since config.h defines it.
19831
19832 1998-12-30 Jesse Thilo <jthilo@gnu.org>
19833
19834 * src/reader.c: Update copyright date.
19835
19836 * src/main.c:
19837 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19838 favor of output directly to stderr (avoids buffer overruns).
19839
19840 * src/reader.c: Some checks for premature EOF.
19841
19842 * 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:
19843 Use prototypes if the compiler understands them.
19844
19845 * src/files.c: Honor TMPDIR on Unix hosts.
19846 Use prototypes if the compiler understands them.
19847
19848 * src/reader.c:
19849 Fix a couple of buffer overrun bugs.
19850 Use prototypes if the compiler understands them.
19851
19852 * src/system.h: Include unistd.h and ctype.h.
19853 Use #ifdef instead of #if for NLS symbols.
19854
19855 1998-12-30 Jesse Thilo <jthilo@gnu.org>
19856
19857 * doc/bison.texinfo:
19858 Delete comment "consider using @set for edition number, etc..." since
19859 we now are doing so.
19860
19861 1998-12-30 Jesse Thilo <jthilo@gnu.org>
19862
19863 * configure.in:
19864 Use prototypes if the compiler understands them.
19865
19866 * NEWS: Document 1.26 highlights.
19867
19868 * Makefile.am: Require Automake 1.3 or later.
19869
19870 * acconfig.h:
19871 Use prototypes if the compiler understands them.
19872
19873 1998-12-29 Jesse Thilo <jthilo@gnu.org>
19874
19875 * src/version.c:
19876 Use VERSION symbol from automake for version number.
19877
19878 1998-12-29 Jesse Thilo <jthilo@gnu.org>
19879
19880 * acconfig.h, configure.in, version.cin:
19881 Use VERSION symbol from automake for version number.
19882
19883 1998-11-28 Jesse Thilo <jthilo@gnu.org>
19884
19885 * Makefile.am:
19886 Distribute original version of simple parser (bison.s1), not built
19887 version (bison.simple).
19888
19889 1998-11-28 Jesse Thilo <jthilo@gnu.org>
19890
19891 * doc/bison.texinfo: Add info dir entry.
19892
19893 * doc/bison.texinfo:
19894 Let automake put version number into documentation.
19895
19896 1998-11-26 Jesse Thilo <jthilo@gnu.org>
19897
19898 * src/bison.cld, src/build.com, src/vmshlp.mar:
19899 Add non-RCS files from /gd/gnu/bison.
19900
19901 1998-11-26 Jesse Thilo <jthilo@gnu.org>
19902
19903 * doc/bison.1:
19904 Document the BISON_HAIRY and BISON_SIMPLE variables.
19905
19906 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19907
19908 * src/version.c: Build version.c automatically.
19909
19910 * src/reader.c:
19911 Fix token numbering (used to start at 258, not 257).
19912
19913 * src/system.h: Include config.h.
19914
19915 * src/getargs.c: Update bug report address.
19916
19917 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19918 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19919
19920 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19921
19922 * Makefile.am:
19923 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19924
19925 * configure.in, version.cin:
19926 Build version.c automatically.
19927
19928 * AUTHORS: Add AUTHORS file.
19929
19930 * README: Update bug report address.
19931
19932 * bison.simple:
19933 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19934
19935 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19936 Add automake stuff.
19937
19938 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19939
19940 * doc/bison.texinfo: Clean up some formatting.
19941
19942 1998-05-05 Richard Stallman <rms@gnu.org>
19943
19944 * doc/bison.texinfo:
19945 Explain better why to make a pure parser.
19946
19947 1998-01-05 Richard Stallman <rms@gnu.org>
19948
19949 * src/files.c (openfiles):
19950 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19951 find a temporary directory, if possible. Do not unlink files while
19952 they are open.
19953
19954 1997-08-25 Richard Stallman <rms@gnu.org>
19955
19956 * src/reader.c (stack_offset;):
19957 Change some warni to warns.
19958
19959 * src/lex.c (literalchar): Use warns, not warni.
19960
19961 1997-06-28 Richard Stallman <rms@gnu.org>
19962
19963 * src/bison.s1: Add a Bison version comment.
19964
19965 * src/main.c (fatal, warn, berror):
19966 Use program_name.
19967
19968 1997-06-28 Richard Stallman <rms@gnu.org>
19969
19970 * Makefile.in (bison_version): New variable.
19971 (dist): Use that variable.
19972 (bison.s1): Substitute the Bison version into bison.simple.
19973
19974 * bison.simple: Add a Bison version comment.
19975
19976 1997-06-18 Richard Stallman <rms@gnu.org>
19977
19978 * src/main.c (fatal, warn, berror):
19979 Make error messages standard.
19980 (toomany): Improve error message text.
19981
19982 * 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:
19983 new.h renamed to alloc.h.
19984
19985 1997-06-18 Richard Stallman <rms@gnu.org>
19986
19987 * Makefile.in: new.h renamed to alloc.h.
19988
19989 1997-05-24 Richard Stallman <rms@gnu.org>
19990
19991 * src/lex.c (literalchar):
19992 Fix the code for escaping \, " and '.
19993
19994 (lex): Avoid trouble when there are many chars
19995 to discard in a char literal with just several chars in it.
19996
19997 1997-05-17 Richard Stallman <rms@gnu.org>
19998
19999 * src/bison.s1:
20000 Use malloc, if using alloca is troublesome.
20001 (YYSTACK_USE_ALLOCA): New flag macro.
20002 Define it for some systems and compilers.
20003 (YYSTACK_ALLOC): New macro.
20004 (yyparse): Use YYSTACK_ALLOC to allocate stack.
20005 If it was malloc'd, free it.
20006
20007 1997-05-17 Richard Stallman <rms@gnu.org>
20008
20009 * bison.simple:
20010 Use malloc, if using alloca is troublesome.
20011 (YYSTACK_USE_ALLOCA): New flag macro.
20012 Define it for some systems and compilers.
20013 (YYSTACK_ALLOC): New macro.
20014 (yyparse): Use YYSTACK_ALLOC to allocate stack.
20015 If it was malloc'd, free it.
20016
20017 1997-04-23 Richard Stallman <rms@gnu.org>
20018
20019 * src/bison.s1:
20020 (alloca) [__hpux]: Always define as __builtin_alloca.
20021
20022 1997-04-23 Richard Stallman <rms@gnu.org>
20023
20024 * bison.simple:
20025 (alloca) [__hpux]: Always define as __builtin_alloca.
20026
20027 1997-04-22 Richard Stallman <rms@gnu.org>
20028
20029 * src/bison.s1:
20030 [__hpux]: Include alloca.h (right for HPUX 10)
20031 instead of declaring alloca (right for HPUX 9).
20032
20033 * src/bison.s1 (__yy_memcpy):
20034 Declare arg `count' as unsigned int.
20035 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
20036
20037 1997-04-22 Richard Stallman <rms@gnu.org>
20038
20039 * bison.simple:
20040 [__hpux]: Include alloca.h (right for HPUX 10)
20041 instead of declaring alloca (right for HPUX 9).
20042
20043 * bison.simple (__yy_memcpy):
20044 Declare arg `count' as unsigned int.
20045 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
20046
20047 1997-01-03 Richard Stallman <rms@gnu.org>
20048
20049 * src/allocate.c: [__STDC__ or _MSC_VER]:
20050 Declare calloc and realloc to return void *.
20051
20052 1997-01-02 Richard Stallman <rms@gnu.org>
20053
20054 * src/system.h:
20055 [_MSC_VER]: Include stdlib.h and process.h.
20056 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
20057
20058 * src/main.c (main): Return FAILURE as a value.
20059 (printable_version): Declare arg as int, not char.
20060
20061 1997-01-02 Richard Stallman <rms@gnu.org>
20062
20063 * Makefile.in (dist):
20064 Explicitly check for symlinks, and copy them.
20065
20066 1996-12-19 Richard Stallman <rms@gnu.org>
20067
20068 * src/files.c:
20069 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
20070
20071 1996-12-18 Paul Eggert <eggert@gnu.org>
20072
20073 * src/bison.s1 (yyparse):
20074 If __GNUC__ and YYPARSE_PARAM are both defined,
20075 declare yyparse to have a void * argument.
20076
20077 1996-12-18 Paul Eggert <eggert@gnu.org>
20078
20079 * bison.simple (yyparse):
20080 If __GNUC__ and YYPARSE_PARAM are both defined,
20081 declare yyparse to have a void * argument.
20082
20083 1996-12-17 Richard Stallman <rms@gnu.org>
20084
20085 * src/reduce.c (nbits): Add some casts.
20086
20087 1996-08-12 Richard Stallman <rms@gnu.org>
20088
20089 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
20090
20091 1996-08-12 Richard Stallman <rms@gnu.org>
20092
20093 * bison.simple: Test _MSDOS as well as _MSDOS_.
20094
20095 1996-07-31 Richard Stallman <rms@gnu.org>
20096
20097 * src/bison.s1:
20098 [__sun && __i386]: Include alloca.h.
20099
20100 1996-07-31 Richard Stallman <rms@gnu.org>
20101
20102 * bison.simple:
20103 [__sun && __i386]: Include alloca.h.
20104
20105 1996-07-30 Richard Stallman <rms@gnu.org>
20106
20107 * src/bison.s1: Comment change.
20108
20109 * src/bison.s1: Test _MSDOS_, not MSDOS.
20110
20111 1996-07-30 Richard Stallman <rms@gnu.org>
20112
20113 * bison.simple: Comment change.
20114
20115 * bison.simple: Test _MSDOS_, not MSDOS.
20116
20117 1996-06-01 Richard Stallman <rms@gnu.org>
20118
20119 * 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:
20120 Insert `_' macro around many string constants.
20121
20122 * src/main.c:
20123 Insert `_' macro around many string constants.
20124
20125 (main): Call setlocale, bindtextdomain and textdomain.
20126
20127 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
20128 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
20129 [ENABLE_NLS]: Include libintl.h.
20130 [ENABLE_NLS] (gettext): Define.
20131 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
20132 (N_, PACKAGE, LOCALEDIR): New macros.
20133
20134 1996-06-01 Richard Stallman <rms@gnu.org>
20135
20136 * POTFILES.in: New file.
20137
20138 * Makefile.in (allocate.o):
20139 Define target explicitly.
20140
20141 * Makefile.in (CFLAGS): Set to @CFLAGS@.
20142 (LDFLAGS): Set to @LDFLAGS@.
20143 (configure): Run autoconf only if preceding `cd' succeeds.
20144 (bison.s1): Redirect output to temporary file then move the
20145 temporary to the target, rather than redirecting directly to bison.s1.
20146 (clean): Remove config.status and config.log.
20147 (distclean): Don't remove config.status here.
20148
20149 1996-05-12 Richard Stallman <rms@gnu.org>
20150
20151 * src/bison.s1:
20152 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20153
20154 1996-05-12 Richard Stallman <rms@gnu.org>
20155
20156 * bison.simple:
20157 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20158
20159 1996-05-11 Richard Stallman <rms@gnu.org>
20160
20161 * src/bison.s1 (__yy_memcpy):
20162 Really reorder the args, as was supposedly done on Feb 14 1995.
20163 (yyparse): Calls changed accordingly.
20164
20165 1996-05-11 Richard Stallman <rms@gnu.org>
20166
20167 * Makefile.in (dist): Don't use $(srcdir).
20168
20169 * bison.simple (__yy_memcpy):
20170 Really reorder the args, as was supposedly done on Feb 14 1995.
20171 (yyparse): Calls changed accordingly.
20172
20173 1996-01-27 Richard Stallman <rms@gnu.org>
20174
20175 * src/output.c (output_rule_data):
20176 Test YYERROR_VERBOSE in the conditional
20177 around the definition of ttyname.
20178
20179 1995-12-29 Richard Stallman <rms@gnu.org>
20180
20181 * src/bison.s1:
20182 Fix line numbers in #line commands.
20183
20184 1995-12-29 Richard Stallman <rms@gnu.org>
20185
20186 * bison.simple:
20187 Fix line numbers in #line commands.
20188
20189 1995-12-27 Richard Stallman <rms@gnu.org>
20190
20191 * src/bison.s1 (YYPARSE_PARAM_DECL):
20192 In C++, make it always null.
20193 (YYPARSE_PARAM_ARG): New macro.
20194 (yyparse): Use YYPARSE_PARAM_ARG.
20195
20196 1995-12-27 Richard Stallman <rms@gnu.org>
20197
20198 * bison.simple (YYPARSE_PARAM_DECL):
20199 In C++, make it always null.
20200 (YYPARSE_PARAM_ARG): New macro.
20201 (yyparse): Use YYPARSE_PARAM_ARG.
20202
20203 1995-11-29 Richard Stallman <rms@gnu.org>
20204
20205 * doc/bison.texinfo:
20206 Describe literal string tokens, %raw, %no_lines, %token_table.
20207
20208 1995-11-29 Daniel Hagerty <hag@gnu.org>
20209
20210 * doc/bison.texinfo: Fixed update date
20211
20212 1995-10-16 Richard Stallman <rms@gnu.org>
20213
20214 * src/version.c: Version 1.25.
20215
20216 1995-10-16 Richard Stallman <rms@gnu.org>
20217
20218 * NEWS: *** empty log message ***
20219
20220 1995-10-16 Richard Stallman <rms@gnu.org>
20221
20222 * doc/bison.1, doc/bison.rnh:
20223 Add new options.
20224
20225 1995-10-15 Richard Stallman <rms@gnu.org>
20226
20227 * src/vmsgetargs.c, src/getargs.c:
20228 Added -n, -k, and -raw switches.
20229 (noparserflag, toknumflag, rawtoknumflag): New variables.
20230
20231 * src/symtab.h (SALIAS):
20232 New #define for adding aliases to %token.
20233 (struct bucket): Added `alias' field.
20234
20235 * src/reduce.c (reduce_grammar):
20236 Revise error message.
20237 (print_notices): Remove final `.' from error message.
20238
20239 * src/reader.c (reader_output_yylsp):
20240 New function.
20241 (readgram): Use `#if 0' around code that accepted %command
20242 inside grammar rules: The documentation doesn't allow it,
20243 and it will fail since the %command processors scan for the next %.
20244 (parse_token_decl): Extended the %token
20245 declaration to allow a multi-character symbol as an alias.
20246 (parse_thong_decl): New function.
20247 (read_declarations): Added %thong declarations.
20248 (read_declarations): Handle NOOP to deal with allowing
20249 % declarations as another means to specify the flags.
20250 (readgram): Allow %prec prior to semantics embedded in a rule.
20251 (skip_to_char, read_declarations, copy_definition)
20252 (parse_token_decl, parse_start_decl, parse_type_decl)
20253 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
20254 (get_type_name, copy_guard, copy_action, readgram)
20255 (get_type, packsymbols): Revised most error messages.
20256 Changed `fatal' to `warnxxx' to avoid aborting for error.
20257 Revised and use multiple warnxxx functions to avoid using VARARGS1.
20258 (read_declarations): Improve the error message for
20259 an invalid character. Do not abort.
20260 (read_declarations, copy_guard, copy_action): Use
20261 printable_version to avoid unprintable characters in printed output.
20262 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
20263 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
20264 Allow the type of a non-terminal can be given
20265 more than once, as long as all specifications give the same type.
20266
20267 * src/output.c:
20268 (output_headers, output_trailers, output, output_gram)
20269 (output_rule_data): Implement noparserflag variable.
20270 Implement toknumflag variable.
20271 (output): Call reader_output_yylsp to output LTYPESTR.
20272
20273 * src/main.c (main):
20274 If reader sees an error, don't process the grammar.
20275 (fatals): Updated to not use VARARGS1.
20276 (printable_version, int_to_string, warn, warni, warns, warnss)
20277 (warnsss): New error reporting functions. Avoid abort for error.
20278
20279 * src/lex.h:
20280 Added THONG and NOOP for alias processing.
20281 Added SETOPT for the new code that allows setting options with %flags.
20282
20283 * src/lex.c:
20284 Include getopt.h. Add some extern decls.
20285 (safegetc): New function to deal with EOF gracefully.
20286 (literalchar); new function to deal with reading \ escapes.
20287 (lex): Use literalchar.
20288 (lex): Implemented "..." tokens.
20289 (literalchar, lex, parse_percent_token): Made tokenbuffer
20290 always contain the token. This includes growing the token
20291 buffer while reading an integer.
20292 (parse_percent_token): Replaced if-else statement with percent_table.
20293 (parse_percent_token): Added % declarations as another
20294 way to specify the flags -n, -l, and -r. Also added hooks for
20295 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
20296 major changes to files.c.
20297 (lex) Retain in the incoming stream a character following
20298 an incorrect '/'.
20299 (skip_white_space, lex): Revised most error messages
20300 and changed fatal to warn to avoid aborting.
20301 (percent_table): Added %thong declarations.
20302
20303 * src/gram.h: Comment changes.
20304
20305 * src/files.c (openfiles, open_extra_files, done):
20306 Add faction flag
20307 and actfile file. Handle noparserflag. Both for -n switch.
20308
20309 * src/conflicts.c (resolve_sr_conflict):
20310 Remove use of alloca.
20311
20312 1995-06-01 Jim Meyering <meyering@gnu.org>
20313
20314 * doc/bison.texinfo: *** empty log message ***
20315
20316 1995-05-06 Richard Stallman <rms@gnu.org>
20317
20318 * src/bison.s1: Comment change.
20319
20320 1995-05-06 Richard Stallman <rms@gnu.org>
20321
20322 * bison.simple: Comment change.
20323
20324 1995-05-03 Richard Stallman <rms@gnu.org>
20325
20326 * src/version.c: Version now 1.24.
20327
20328 * src/bison.s1: Change distribution terms.
20329
20330 * src/version.c: Version now 1.23.
20331
20332 1995-05-03 Richard Stallman <rms@gnu.org>
20333
20334 * doc/bison.texinfo:
20335 Rewrite "Conditions for Using Bison".
20336 Update version to 1.24.
20337
20338 1995-05-03 Richard Stallman <rms@gnu.org>
20339
20340 * bison.simple: Change distribution terms.
20341
20342 1995-02-23 Richard Stallman <rms@gnu.org>
20343
20344 * src/files.c: Test __VMS_POSIX as well as VMS.
20345
20346 1995-02-14 Jim Meyering <meyering@gnu.org>
20347
20348 * src/bison.s1 (__yy_memcpy):
20349 Renamed from __yy_bcopy to avoid
20350 confusion. Reverse FROM and TO arguments to be consistent with
20351 those of memcpy.
20352
20353 1995-02-14 Jim Meyering <meyering@gnu.org>
20354
20355 * bison.simple (__yy_memcpy):
20356 Renamed from __yy_bcopy to avoid
20357 confusion. Reverse FROM and TO arguments to be consistent with
20358 those of memcpy.
20359
20360 1994-11-10 David J. MacKenzie <djm@gnu.org>
20361
20362 * NEWS: reformat
20363
20364 * NEWS: New file.
20365
20366 * Makefile.in (DISTFILES): Include NEWS.
20367
20368 * Makefile.in (DISTFILES):
20369 Include install-sh, not install.sh.
20370
20371 * configure.in: Update to Autoconf v2 macro names.
20372
20373 1994-10-05 David J. MacKenzie <djm@gnu.org>
20374
20375 * Makefile.in: fix typo
20376
20377 * Makefile.in (prefix, exec_prefix):
20378 Let configure set them.
20379
20380 1994-09-28 David J. MacKenzie <djm@gnu.org>
20381
20382 * Makefile.in: Set datadir to $(prefix)/share.
20383
20384 1994-09-15 Richard Stallman <rms@gnu.org>
20385
20386 * src/bison.s1:
20387 Update copyright notice and GPL version.
20388
20389 1994-09-15 Richard Stallman <rms@gnu.org>
20390
20391 * bison.simple:
20392 Update copyright notice and GPL version.
20393
20394 1994-07-12 Richard Stallman <rms@gnu.org>
20395
20396 * src/reduce.c, src/reader.c:
20397 entered into RCS
20398
20399 1994-05-05 David J. MacKenzie <djm@gnu.org>
20400
20401 * Makefile.in: entered into RCS
20402
20403 1994-03-26 Richard Stallman <rms@gnu.org>
20404
20405 * src/bison.s1: entered into RCS
20406
20407 1994-03-26 Richard Stallman <rms@gnu.org>
20408
20409 * bison.simple: entered into RCS
20410
20411 1994-03-25 Richard Stallman <rms@gnu.org>
20412
20413 * src/main.c: entered into RCS
20414
20415 1994-03-24 Richard Stallman <rms@gnu.org>
20416
20417 * src/conflicts.c: entered into RCS
20418
20419 1994-01-02 Richard Stallman <rms@gnu.org>
20420
20421 * Makefile.in: *** empty log message ***
20422
20423 1993-11-21 Richard Stallman <rms@gnu.org>
20424
20425 * src/bison.s1: *** empty log message ***
20426
20427 1993-11-21 Richard Stallman <rms@gnu.org>
20428
20429 * doc/bison.texinfo: entered into RCS
20430
20431 * doc/bison.texinfo: *** empty log message ***
20432
20433 1993-11-21 Richard Stallman <rms@gnu.org>
20434
20435 * bison.simple: *** empty log message ***
20436
20437 1993-10-25 David J. MacKenzie <djm@gnu.org>
20438
20439 * doc/bison.texinfo: *** empty log message ***
20440
20441 1993-10-19 Richard Stallman <rms@gnu.org>
20442
20443 * src/bison.s1: *** empty log message ***
20444
20445 1993-10-19 Richard Stallman <rms@gnu.org>
20446
20447 * bison.simple: *** empty log message ***
20448
20449 1993-10-14 Richard Stallman <rms@gnu.org>
20450
20451 * src/bison.s1: *** empty log message ***
20452
20453 1993-10-14 Richard Stallman <rms@gnu.org>
20454
20455 * bison.simple: *** empty log message ***
20456
20457 1993-09-14 David J. MacKenzie <djm@gnu.org>
20458
20459 * doc/bison.texinfo: *** empty log message ***
20460
20461 1993-09-13 Noah Friedman <friedman@gnu.org>
20462
20463 * Makefile.in: *** empty log message ***
20464
20465 1993-09-10 Richard Stallman <rms@gnu.org>
20466
20467 * src/conflicts.c: *** empty log message ***
20468
20469 * src/system.h: entered into RCS
20470
20471 1993-09-10 Richard Stallman <rms@gnu.org>
20472
20473 * doc/bison.1: entered into RCS
20474
20475 1993-09-06 Noah Friedman <friedman@gnu.org>
20476
20477 * src/version.c: entered into RCS
20478
20479 1993-09-06 Noah Friedman <friedman@gnu.org>
20480
20481 * Makefile.in: *** empty log message ***
20482
20483 1993-07-30 David J. MacKenzie <djm@gnu.org>
20484
20485 * Makefile.in: *** empty log message ***
20486
20487 1993-07-24 Richard Stallman <rms@gnu.org>
20488
20489 * src/bison.s1: *** empty log message ***
20490
20491 1993-07-24 Richard Stallman <rms@gnu.org>
20492
20493 * bison.simple: *** empty log message ***
20494
20495 1993-07-08 David J. MacKenzie <djm@gnu.org>
20496
20497 * Makefile.in: *** empty log message ***
20498
20499 1993-07-04 Richard Stallman <rms@gnu.org>
20500
20501 * src/bison.s1: *** empty log message ***
20502
20503 1993-07-04 Richard Stallman <rms@gnu.org>
20504
20505 * bison.simple: *** empty log message ***
20506
20507 1993-06-26 David J. MacKenzie <djm@gnu.org>
20508
20509 * src/getargs.c: entered into RCS
20510
20511 1993-06-26 David J. MacKenzie <djm@gnu.org>
20512
20513 * doc/bison.texinfo: *** empty log message ***
20514
20515 * doc/bison.1: New file.
20516
20517 1993-06-25 Richard Stallman <rms@gnu.org>
20518
20519 * src/getargs.c: New file.
20520
20521 1993-06-16 Richard Stallman <rms@gnu.org>
20522
20523 * src/bison.s1: *** empty log message ***
20524
20525 1993-06-16 Richard Stallman <rms@gnu.org>
20526
20527 * bison.simple: *** empty log message ***
20528
20529 1993-06-03 Richard Stallman <rms@gnu.org>
20530
20531 * src/bison.s1: New file.
20532
20533 1993-06-03 Richard Stallman <rms@gnu.org>
20534
20535 * doc/bison.texinfo: *** empty log message ***
20536
20537 1993-06-03 Richard Stallman <rms@gnu.org>
20538
20539 * bison.simple: New file.
20540
20541 1993-05-19 Richard Stallman <rms@gnu.org>
20542
20543 * doc/bison.texinfo: New file.
20544
20545 1993-05-07 Noah Friedman <friedman@gnu.org>
20546
20547 * Makefile.in: *** empty log message ***
20548
20549 1993-04-28 Noah Friedman <friedman@gnu.org>
20550
20551 * src/reader.c: *** empty log message ***
20552
20553 1993-04-23 Noah Friedman <friedman@gnu.org>
20554
20555 * src/alloc.h: entered into RCS
20556
20557 1993-04-20 David J. MacKenzie <djm@gnu.org>
20558
20559 * src/version.c: *** empty log message ***
20560
20561 * src/files.c, src/allocate.c:
20562 entered into RCS
20563
20564 * src/reader.c: *** empty log message ***
20565
20566 * src/lex.c: entered into RCS
20567
20568 * src/conflicts.c: New file.
20569
20570 * src/symtab.c: entered into RCS
20571
20572 * src/alloc.h: New file.
20573
20574 * src/LR0.c: entered into RCS
20575
20576 1993-04-18 Noah Friedman <friedman@gnu.org>
20577
20578 * src/reader.c: New file.
20579
20580 * src/version.c: *** empty log message ***
20581
20582 1993-04-18 Noah Friedman <friedman@gnu.org>
20583
20584 * Makefile.in: *** empty log message ***
20585
20586 1993-04-17 Noah Friedman <friedman@gnu.org>
20587
20588 * Makefile.in: *** empty log message ***
20589
20590 1993-04-15 Richard Stallman <rms@gnu.org>
20591
20592 * src/main.c, src/files.c:
20593 New file.
20594
20595 1993-04-15 Noah Friedman <friedman@gnu.org>
20596
20597 * configure.in: entered into RCS
20598
20599 * configure.in: *** empty log message ***
20600
20601 * configure.in: New file.
20602
20603 1993-04-14 Richard Stallman <rms@gnu.org>
20604
20605 * Makefile.in: New file.
20606
20607 1993-04-13 Richard Stallman <rms@gnu.org>
20608
20609 * src/version.c: New file.
20610
20611 1993-03-25 Richard Stallman <rms@gnu.org>
20612
20613 * src/output.c: entered into RCS
20614
20615 1992-09-25 Richard Stallman <rms@gnu.org>
20616
20617 * configure.bat: entered into RCS
20618
20619 1992-06-22 Richard Stallman <rms@gnu.org>
20620
20621 * src/vmsgetargs.c: entered into RCS
20622
20623 1992-06-22 Richard Stallman <rms@gnu.org>
20624
20625 * doc/bison.rnh: entered into RCS
20626
20627 1992-04-20 David J. MacKenzie <djm@gnu.org>
20628
20629 * README: entered into RCS
20630
20631 1992-01-22 Richard Stallman <rms@gnu.org>
20632
20633 * src/machine.h: entered into RCS
20634
20635 1991-12-21 Richard Stallman <rms@gnu.org>
20636
20637 * src/lalr.c, src/closure.c:
20638 entered into RCS
20639
20640 1991-12-20 Richard Stallman <rms@gnu.org>
20641
20642 * src/state.h: entered into RCS
20643
20644 1991-12-18 Richard Stallman <rms@gnu.org>
20645
20646 * src/print.c, src/nullable.c, src/derives.c:
20647 entered into RCS
20648
20649 1991-11-03 David J. MacKenzie <djm@gnu.org>
20650
20651 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
20652 entered into RCS
20653
20654 1988-09-09 Richard Stallman <rms@gnu.org>
20655
20656 * src/bison.hairy: entered into RCS
20657
20658 1987-12-16 Richard Stallman <rms@gnu.org>
20659
20660 * REFERENCES: entered into RCS
20661
20662
20663 -----
20664
20665 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
20666 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
20667 Free Software Foundation, Inc.
20668
20669 Copying and distribution of this file, with or without
20670 modification, are permitted provided the copyright notice and this
20671 notice are preserved.