]> git.saurik.com Git - bison.git/blame - ChangeLog
maint: automate b4_copyright updates.
[bison.git] / ChangeLog
CommitLineData
c9e0a880
JD
12009-08-04 Joel E. Denny <jdenny@clemson.edu>
2
3 maint: automate b4_copyright updates.
4 * Makefile.am (update-b4-copyright): New target rule.
5 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
6 * build-aux/update-b4-copyright: New.
7 * data/yacc.c: Remove stray characters around b4_copyright
8 invocations.
9
50bcb22c
JD
102009-08-04 Joel E. Denny <jdenny@clemson.edu>
11
12 maint: automate annual package-wide copyright-year update.
13 * .x-update-copyright: New.
14 * Makefile.am (EXTRA_DIST): Remove maint.mk.
15 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
16 update-copyright. Remove gnumakefile, which is implied by
17 maintainer-makefile.
18 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
19 * gnulib: Update.
20 * maint.mk: Remove, now copied from gnulib.
21 * examples/extexi: Add missing "(C)" in copyright statement so
22 update-copyright can recognize it.
23 * src/LR0.h: Likewise.
24 * src/print.h: Likewise.
25 * src/print_graph.h: Likewise.
26 * src/gram.c: Add missing comma in copyright statement.
27 * src/gram.h: Likewise.
28
cfc9e431
JD
292009-08-04 Joel E. Denny <jdenny@clemson.edu>
30
31 Fix "make distcheck".
32 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
33 of just calc.stamp.
34
42f8609b
JD
352009-08-01 Joel E. Denny <jdenny@clemson.edu>
36
37 Pacify "gcc -Wunused" for the input function from Flex.
38 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
39 and later.
40 * src/scan-code.l: Add "%option noinput", which I cannot find in
41 the Flex manual, but which Flex has supported since at least as
42 far back as 2.5.4. However, if any of our developers still use
43 Flex 2.5.4, they'll need to stop configuring with
44 --enable-gcc-warnings because "%option noinput" didn't work
45 correctly until Flex 2.5.6.
46 * src/scan-gram.l: Likewise.
47 * src/scan-skel.l: Likewise.
48
9e408f84
AD
492009-06-29 Akim Demaille <demaille@gostai.com>
50
51 build: avoid concurrent extraction of calc++.
52 * examples/calc++/Makefile.am (calc.stamp): New.
53 Depend on it to create the sources of calc++ so that concurrent
54 builds don't launch several "extexi" in parallel.
55 Not only this is inefficient, this also builds incorrect sources
56 with several extractions mixed together.
57
48578d6c
AD
582009-06-25 Akim Demaille <demaille@gostai.com>
59
60 hash: check insertion for memory exhaustion.
61 * src/uniqstr.c (uniqstr_new): New.
62
914e713d
AD
632009-06-11 Akim Demaille <demaille@gostai.com>
64
65 hash: check insertion for memory exhaustion.
66 * src/muscle-tab.c (muscle_insert, muscle_grow)
67 * src/state.c (state_hash_insert): Check the return value of
68 hash_insert.
69
94505fb7
AD
702009-06-10 Akim Demaille <demaille@gostai.com>
71
72 gnulib: update.
73 * gnulib: Update to latest.
74 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
75 * m4/.gitignore: Regen.
76 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
77 Call xalloc_die on hash_insert failures.
78 Requested by the new __warn_unused_result__ attribute of
79 hash_insert.
80
1bcbca43
JD
812009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
82
83 * data/c++.m4: Update copyright year.
84
a17352a9
JD
852009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
86
87 Handle a trailing `:' in a user-supplied C++ namespace better.
88 * data/c++.m4 (b4_namespace_close): Don't let it be printed
89 among the closing braces here. This fix might make the
90 generated code easier to debug, but otherwise it should be
91 insignificant because a trailing `:' is a C++ error already.
92
c984dee8
AD
932009-05-11 Akim Demaille <demaille@gostai.com>
94
95 doc: use C++ headers.
96 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
97 headers.
98
cefb1828
JD
992009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
100
101 Declare %code to be a permanent feature.
102 * NEWS (2.4.2): Here.
103 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
104 experimental.
105 (Decl Summary): Likewise.
106
2f3064f0
AD
1072009-04-14 Akim Demaille <demaille@gostai.com>
108
109 doc: minor fixes.
110 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
111 (Table of Symbols): Remove duplicate entry for %debug.
112
ab3a683f
EB
1132009-04-06 Eric Blake <ebb9@byu.net>
114
115 Work around autoconf 2.63b bug in testsuite.
116 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
117 autoconf bug related to # in test.
118
ecd1b61c
JD
1192009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
120
121 Fix options documentation.
122 * build-aux/cross-options.pl: As in --help output, write optional
123 arguments as [=ARG] not =[ARG].
124 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
125
f67c4037
AD
1262008-11-07 Akim Demaille <demaille@gostai.com>
127
128 Fix --help.
129 * src/getargs.c (usage): Fix help string for -W.
130
0213d651
AD
1312008-11-07 Akim Demaille <demaille@gostai.com>
132
133 Handle more general types of option arguments.
134 * build-aux/cross-options.pl: The argument ends at the first
135 space, not the first non-symbol character.
136 Use @var for each word appearing the argument description.
137
c19178bf
JD
1382009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
139
140 Remove spurious initial empty lines.
141 * data/location.cc: End the @output lines with an @.
142
0d2b2ab0
AD
1432008-11-04 Akim Demaille <demaille@gostai.com>
144
145 Remove spurious initial empty lines.
146 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
147 * data/yacc.c: End the @output lines with an @.
148
8ba62e3e
JD
1492009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
150
151 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
152 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
153 requirements for a correct m4 are stricter.
154 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
155 * configure.ac: Update to use AC_PROG_GNU_M4.
156 Reported by Eric Blake.
157
5bc993d9
JD
1582009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
159
160 Help with updating web manual.
161 * HACKING: Incorporate instructions from gnulib/doc/README.
162 * bootstrap.conf (gnulib_modules): Add gendocs.
163
580c075d
JD
1642009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
165
166 Fix strange %define locations for default values.
167 Reported by Akim Demaille at
168 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
169 and discussed again starting at
170 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
171 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
172 because location information is bogus.
173 Use angle brackets to delimit fake file name because square brackets
174 look like underexpanded m4. Choose a better fake file name.
175 Use negative line numbers.
176 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
177 * src/location.c (location_print): If line for a boundary is negative,
178 only print that boundary's file name.
179 * src/location.h: Document that.
180 * tests/skeletons.at (%define Boolean variables: invalid skeleton
181 defaults): Update output.
182
5d3a1ecb
AD
1832008-11-07 Akim Demaille <demaille@gostai.com>
184
185 Locations without columns for command line arguments.
186 * src/location.c (location_print): Don't display negative columns.
187 * src/location.h: Document this.
188
015e86a7
JD
1892009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
190
191 Add reminder about uploading public key to keys.gnupg.net.
192 * HACKING (Release Procedure): Here.
193
c1455bab
AD
1942009-03-31 Akim Demaille <demaille@gostai.com>
195
196 bootstrap: --help to stdout.
197 * bootstrap (usage): Don't send --help to stderr.
198 Use a here doc instead of a long string.
199
2075a82a
AD
2002009-03-31 Akim Demaille <demaille@gostai.com>
201
202 bootstrap: README-hacking no longer exists
203 * bootstrap (checkout_only_file): Set to HACKING.
204
26fccd4d
AD
2052009-03-26 Akim Demaille <demaille@gostai.com>
206
207 doc: merge HACKING and README-hacking.
208 Two files is confusing.
209 Reported by Alexandre Duret-Lutz.
5bc993d9 210
26fccd4d
AD
211 * README-hacking: Merge into...
212 * HACKING (Working from the repository): here.
213
6469c4d7
AD
2142009-03-26 Akim Demaille <demaille@gostai.com>
215
216 doc: update README-hacking.
217 * README-hacking: We now use git and git submodules.
218 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
219
b328890a
AD
2202009-03-26 Akim Demaille <demaille@gostai.com>
221
222 lalr1.cc: avoid GCC 4.3 warnings.
223 GCC 4.3 now warns about "a || b && c" and asks for explicit
224 parentheses.
225 Reported by Alexandre Duret-Lutz.
226 * data/location.cc: Update copyright years.
227 (Position::operator==): Use parens to make precedence explicit.
228 Compare lines and columns first, as they are more likely to be
229 different, and they are faster to compare.
230
f3079439
AD
2312009-03-26 Akim Demaille <demaille@gostai.com>
232
233 gnulib: update.
234 * gnulib: Update to latest.
235 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
236 use +=.
237
8defe11b
AD
2382009-01-08 Akim Demaille <demaille@gostai.com>
239
240 Fix grep portability issues.
241 Grep on Solaris does not support -q.
242 Reported by Summum Bonum.
5bc993d9 243
8defe11b
AD
244 * NEWS: Add a stub for 2.4.2.
245 * THANKS: Add Summum Bonum.
246 * tests/atlocal.in (EGREP): New.
247 (CC, CXX, XSLTPROC): Make it possible to override them via
248 envvars.
249 * tests/java.at: Use $EGREP instead of egrep.
250 Use AT_CHECK's ignore instead of grep's -q.
251
41930e7a
JD
2522008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
253
254 Version 2.4.1.
255 * NEWS: Set version and date.
256 * lib/Makefile.am: Update copyright year.
257 * tests/atlocal.in: Update copyright year.
258
d07932ef
JD
2592008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
260
261 Semicolon feature removal is not about future language support.
262 * NEWS: The semicolon feature is no longer active for newer languages,
263 so don't claim that it causes trouble for them.
264
0364b334
JD
2652008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
266
267 * gnulib: Update submodule to HEAD.
268
876fd835
AD
2692008-12-09 Akim Demaille <demaille@gostai.com>
270
271 Update data/README.
272 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
273
bee1df15
EB
2742008-12-05 Eric Blake <ebb9@byu.net>
275
276 Build testsuite with newer autoconf.
277 * tests/output.at (m4_expand): Don't override in newer autoconf,
278 where the underlying implementation changed.
279 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
280 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
281 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
282 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
283 since some of them contain unbalanced ')'.
284
7e6d1e22
JD
2852008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
286
287 * NEWS: Clarify a little.
288
a957d06c
JD
2892008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
290
291 * NEWS: Update for recent changes.
292
462503f8
JD
2932008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
294
295 Fix unexpanded macros in GLR defines file.
296 Reported by Csaba Raduly at
297 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
298 * THANKS (Csaba Raduly): Add.
299 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
300 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
301 lexer in a separate module that includes the defines file.
302 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
303 source.
304 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
305 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
306 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
307 (AT_DATA_SOURCE_PROLOGUE): New.
308 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
309 (AT_DATA_SOURCE): New.
310 (AT_FULL_COMPILE): New, copied from master branch and extended to
311 support an additional source file.
312
bf151b75
JD
3132008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
314
315 Don't let maintainer-*-check targets force a version update.
316 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
317 handled.
318
f56274a8
DJ
3192008-11-17 Di-an Jan <dianj@freeshell.org>
320
321 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
322 Align menus. Adjust word wrapping. Use node names for menu names.
323 (Examples): Don't abbreviate node names.
324 (LocalWords): Remove abbreviations.
325 (Copying): Make description a sentence.
bf151b75 326 (Java Action Features): Remove period to match the rest of menu.
f56274a8 327
b5775a81
PB
3282008-11-11 Paolo Bonzini <bonzini@gnu.org>
329
330 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
331 * configure.ac: Adjust usage.
332 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
333 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
334 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
335
7ed73f82
JD
3362008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
337
338 Don't add a semicolon to actions for %skeleton or %language.
339 It breaks Java test cases as reported by Akim Demaille.
340 * src/scan-code.l: Implement.
341
4b1ebc49
JD
3422008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
343
344 Clean up %skeleton and %language priority implementation.
345 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
346 remove static qualifier because others will soon need to see it.
347 (language_prio): Likewise.
348 (getargs): Use command_line_prio rather than 0.
349 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
350 enum fields.
351 (skeleton_prio): Extern it.
352 (language_prio): Extern it.
353 * src/parse-gram.y: Use grammar_prio rather than 1.
354
738cde3e
AD
3552008-11-04 Akim Demaille <demaille@gostai.com>
356
357 * NEWS: Mention the trailing semicolon in action.
358
d6fb461d
AD
3592008-11-04 Akim Demaille <demaille@gostai.com>
360
361 Reformat NEWS.
362 * NEWS: Use more outline-mode markup.
363 Suggested by Jim Meyering.
364
14da0cdd
JD
3652008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
366
367 Fix user actions without a trailing semicolon.
368 Reported by Sergei Steshenko at
369 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
370 * THANKS (Sergei Steshenko): Add.
371 * src/scan-code.l (SC_RULE_ACTION): Fix it.
372 * tests/regression.at (Fix user actions without a trailing semicolon):
373 New test case.
374
c9ba9e59
JD
3752008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
376
377 Initiate further development.
378 * NEWS: Create an empty section for new entries.
379 * gnulib: Update submodule to HEAD.
380
bfb40910
JD
3812008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
382
383 * NEWS: Version 2.4.
384
241fda7a
JD
3852008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
386
387 Prepare for next release.
388 * NEWS: Briefly mention changes since 2.3b.
389 * README: Say GNU m4 1.4.6, which we've been requiring in release
390 announcements already, not 1.4.3, which breaks the build.
391
ed4d67dc
JD
3922008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
393
394 Say %language is experimental.
395 We're thinking of extending it's effect on output file naming. See the
396 thread at
397 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
398 * NEWS: Say it's experimental.
399 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
400 recommend it over %skeleton for now.
401 (Bison Options): Likewise.
402 (C++ Bison Interface): Use %skeleton not %language.
403 (Calc++ Parser): Use %skeleton not %language.
404 * src/getargs.c (usage): Say it's experimental.
405
e254a580
DJ
4062008-11-01 Di-an Jan <dianj@freeshell.org>
407 Paolo Bonzini <bonzini@gnu.org>
408
409 Support all Java parser class modifiers.
410 * data/java.m4 (b4_percent_define_get3): New.
411 (b4_final_if, b4_strictfp_if): New.
412 * data/lalr1.java (final, strictfp, extends, implements): Support.
413 * doc/bison.texinfo (final, strictfp, extends, implements): Add
414 documentation.
415 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
416 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
417 (AT_CHECK_JAVA_GREP): New.
418 (Java parser class modifiers): New test.
419 (Java parser class extends and implements): New test.
420
421 Model exception propagation better with throws and lex_throws.
422 * data/java.m4 (b4_list2): New.
423 (throws): Change default.
424 * data/lalr1.java (yyaction): Add throws.
425 (parse): Add lex_throws in addition to throws.
426 * doc/bison.texinfo (throws, lex_throws): Add documentation.
427 * tests/java.at (Java throws specifications): New test.
428
429 Improve documentation for Java parsers.
430 * doc/bison.texinfo (Java Parsers): Add subsections.
431 Don't quote first argument of %define.
432 (Java Bison Interface): Document output files. Move documentation
433 of parser class and merge into Java Parser Interface. Document
434 features that error out. Document directives with no effect.
435 Move note about Javadoc higher.
436 (Java Semantic Values): Explicitly mention stype.
437 Document that generic types cannot be used.
438 (Java Location Values): Use @deftypeivar. Document constructors.
439 Correct return value for toString.
440 (Java Parser Interface): List undocumented constants/fields.
441 Move documentation of fields added by %parse-param closer to list
442 of members. Document that token names are added as fields.
443 Document constructors accurately. Remove error method.
444 (Java Scanner Interface): Move note on %pure-parser to Java Bison
445 Interface. Describe %code lexer and yylex accutately.
446 Remove documentation that does not match the code.
447 (Java Action Features): New.
448 (Java Differences): Add reference. Add item on semantic values.
449 Add note about @{ ... @}. Clarify %% epilogue placement.
450 (Java Declarations Summary): New.
451
452 Fix Java skeleton.
453 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
454 (b4_remove_comma): Quote test argument.
455 (b4_identification): Remove "bison" field.
456 * tests/java.at (Java parser class and package names): New test.
457 (Java %parse-param and %lex-param): New test.
458 (Java stype, position_class and location_class): New test.
459
f259e4e6
PB
4602008-10-31 Di-an Jan <dianj@freeshell.org>
461
462 * data/lalr1.jave: Update copyright years.
463 (YYParser): Correct name of "generated from" file in Javadoc:
464 use b4_file_name instead of @ofile@.
465 (Location constructor): Correct Javadoc parameter name.
466 (yylloc): Add missing opening m4 quote after b4_location_if.
467 This removes a stray [ in the Javadoc of Lexer.getStartPos.
468 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
469 (YYParser constructor): Correct Javadoc parameter name.
470
cae5057f
JD
4712008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
472
473 Always put auxiliary code files in the same dir as other output files.
474 * src/files.c (compute_file_name_parts): When the user specifies
475 --output but not --file-prefix, extract the directory prefix from the
476 file prefix not from the grammar file name. This affects the location
477 of files like location.hh generated by the C++ skeleton. The includes
478 in the other output files require this fix.
479 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
480 for expected output files.
481 (Output files): Add a test for the above.
482
4af432ba
JD
4832008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
484
485 * gnulib: Update submodule to HEAD.
486
e26d4e43
JD
4872008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
488
489 Update copyright year.
490 * src/files.c: Here.
491
c0ee9e21
DJ
4922008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
493
494 Don't overwrite the input file.
495 * src/files.c (output_file_name_check): Fatal error if using input file
496 for output.
497 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
498 argument.
499 (Conflicting output files): Add test.
500
482dc52f
AD
5012008-10-28 Akim Demaille <demaille@gostai.com>
502
503 Space changes.
504 * data/lalr1.cc: Formatting changes.
505
52cbbe84
AD
5062008-10-28 Akim Demaille <demaille@gostai.com>
507
508 Don't define debugging functions when !YYDEBUG.
509 * data/lalr1.cc (debug_stream, set_debug_stream)
510 (debug_level_type, debug_level, set_debug_level): Don't
511 declare them when YYDEBUG is not defined.
512 The implementation are already YYDEBUG-aware.
513
0925d5bf
AD
5142008-10-28 Akim Demaille <demaille@gostai.com>
515
516 Prefer "continue" for empty loop bodies.
517 * etc/bench.pl.in: Use "continue" instead of {}.
518
cf98343c
AD
5192008-10-28 Akim Demaille <demaille@gostai.com>
520
521 Space and comments changes.
522 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
523 * data/c.m4, data/lalr1.cc: Space changes.
524
9f467b7d
AD
5252008-10-28 Akim Demaille <demaille@gostai.com>
526
527 Make gnulib a submodule.
528 * gnulib: New.
529 * .gitmodules (gnulib): New.
530
0f0e1ace
JD
5312008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
532
533 Fix yyerror_range for user-defined location type in C++. Reported by
534 Georg Sauthoff at
535 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
536 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
537 * THANKS (Georg Sauthoff): Add.
538
548e2104
JD
5392008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
540
541 Update several administrative files mainly to facilitate releasing.
542 * HACKING (Administrivia): Make the git-merge-changelog notes more
543 helpful.
544 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
545 (Release Procedure): Update for git and add numerous details that were
546 previously missing.
547 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
548 * maint.mk (announcement): Don't list bison as a bootstrap tool so
549 that announcements don't claim we bootstrapped with whatever bison
550 happened to be in PATH. Add flex as a bootstrap tool.
551 * Makefile.maint: Remove, previously replaced by maint.mk.
552 * Makefile.cfg: Remove, and migrate settings to...
553 * cfg.mk: ... here for the sake of `make announcement'.
554 * bootstrap.conf (gnulib_modules): Add announce-gen.
555 * README: Say GNU Bison instead of just Bison. Suggested by Karl
556 Berry.
557
ddf17a6e
PB
5582008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
559
560 Small but important bugfixes for the Java skeleton.
561 * data/lalr1.java (yyerror): Change Location to b4_location_type.
562 (yy_symbol_print): Call toString on yyvaluep.
563
e1145ad8
AD
5642008-08-29 Akim Demaille <demaille@gostai.com>
565
566 Clarify UPDATED use.
bee1df15 567 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 568 not to the release date of Bison.
bee1df15 569 Reported by Joel E. Denny.
e1145ad8 570
0df72d78
AD
5712008-08-29 Akim Demaille <demaille@gostai.com>
572
573 * README: Update FAQ pointer.
574 Reported by Joel E. Denny.
575
9a90b6bb
EB
5762008-08-27 Eric Blake <ebb9@byu.net>
577
578 Resync m4sugar from autoconf.
579 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
580 (m4_init): Adjust to latest m4.git changes.
581 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
582 effects.
583 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
584 (_m4_list_cmp): Reduce side effects.
585
65015668
AD
5862008-08-27 Akim Demaille <demaille@gostai.com>
587
588 Check yyerrok in calc.at.
bee1df15
EB
589 * tests/calc.at (calc.y): Use yyerrok on "( error )".
590 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
591 expected.
65015668 592
98e26a92
AD
5932008-08-27 Akim Demaille <demaille@gostai.com>
594
595 Support yyerrok in lalr1.cc.
596 YYBACKUP is still to import back into lalr1.cc.
bee1df15 597 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 598
86c0e784
JD
5992008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
600
601 For maintainer-check*, don't recompile for a $(VERSION) update.
602 * cfg.mk: New file.
603 (_is-dist-target): Override the one in GNUmakefile.
604 * Makefile.am (EXTRA_DIST): Add cfg.mk.
605
88511166
JD
6062008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
607
608 Update for recent change to gnulib.
609 * src/parse-gram.y: Don't include strverscmp.h. It comes from
610 string.h now.
611
6bbb2ed5
EB
6122008-08-15 Eric Blake <ebb9@byu.net>
613
d67c52e8
EB
614 Remaining m4sugar merge from autoconf.
615 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
616 * data/m4sugar/foreach.m4: New file, copied from autoconf.
617 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
618 * src/output.c (output_skeleton): Tell m4 how to find it.
619
6bbb2ed5
EB
620 Partial m4sugar merge from autoconf: m4_map.
621 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
622 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
623 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
624 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
625 for empty list.
626 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
627 Likewise.
628 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
629 declares it.
630
8dce3875
JD
6312008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
632
633 Keep .version and PACKAGE_VERSION in sync.
634 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
635 dependency, and add comments justifying this in more detail. Discussed
636 starting at
637 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
638
882a1fbf
EB
6392008-08-06 Eric Blake <ebb9@byu.net>
640
a3764451
EB
641 Partial m4sugar merge from autoconf: m4_shiftn.
642 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
643 (m4_shift2, m4_shift3): New macros.
644 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
645 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
646 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
647 * data/java.m4 (b4_remove_comma): Likewise.
648
882a1fbf
EB
649 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
650 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
651 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
652 (m4_init): Consolidate wrapped text into single m4_wrap.
653 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
654 in wrapped text.
655
a30e920d
EB
6562008-08-05 Eric Blake <ebb9@byu.net>
657
dfcc5959
EB
658 Partial m4sugar merge from autoconf: builtins, version.m4.
659 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
660 (m4_prepend): Remove, as it is unused and inherently quadratic,
661 whereas m4_append is linear in newer m4.
662 (m4_mkstemp): New builtin.
663 (m4_symbols): Make rename conditional.
664 (m4_version_prereq): Ensure fatal error if used in bison, which
665 intentionally lacks version.m4.
666
a30e920d
EB
667 Fix comments in m4sugar.
668 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
669
445b7470
JD
6702008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
671
672 Update for recent .gitignore fix in Gnulib.
673 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
674 anchored .gitignore entries.
675
a1e50014
JD
6762008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
677
678 Set gnu or gnits strictness.
679 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
680 development and gnits strictness for releases. Based on Eric Blake's
681 suggestion at
682 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
683
d43f77e7
PB
6842008-07-31 Paolo Bonzini <bonzini@gnu.org>
685
686 * NEWS: Clarify documentation of %language.
687
fee2ed87
PB
6882008-07-31 Paolo Bonzini <bonzini@gnu.org>
689
690 Support usage of git-merge-changelog.
691 * .gitattributes: New.
692 * HACKING: Document usage of git-merge-changelog.
693 * bootstrap: Install git-merge-changelog entries in .git/config
694 if appropriate.
695
78029cd5
JD
6962008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
697
698 Remove remaining dependence on CVS Id keyword.
699 * ChangeLog: For the sake of people still using CVS, don't use dollars
700 when mentioning Id.
701 * data/xslt/bison.xsl: Remove Id from header comments, where it was
702 unusual anyway.
703 * data/xslt/xml2dot.xsl: Likewise.
704 * data/xslt/xml2text.xsl: Likewise.
705 * data/xslt/xml2xhtml.xsl: Likewise.
706 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
707 * doc/Makefile.am (neutralize): Remove, no longer needed.
708 (.x.1): Don't use neutralize.
709 (edit): Don't substitute for ID.
710 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
711
c53d18b1
JD
7122008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
713
714 Fix dependence on computed configure variables.
715 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
716 $(top_srcdir)/configure.ac so that changes to computed variables, such
717 as PACKAGE_VERSION, are seen.
718 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
719
5523ac79
JD
7202008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
721
722 Update copyright dates for recent changes.
723 * Makefile.am: Here.
724 * src/Makefile.am: Here.
725 * src/reduce.c: Here.
726 * tests/reduce.at: Here.
727
8fa36911
JD
7282008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
729
730 Use git-version-gen for version names between releases.
731 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
732 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
733 * .prev-version: New.
734 * .version.in: Remove.
78029cd5 735 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
736 revision.
737 * GNUmakefile: Remove, now copied from Gnulib.
738 * Makefile.am: Add code suggested by comments in
739 build-aux/git-version-gen.
740 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
741 .prev-version, and .version.
742 * NEWS (2.3b+): Rename to...
743 (?.?): ... this because we're dropping the "+" version naming scheme,
744 but, in general, we still can't be sure of our next release name.
745 * bootstrap: Add a quick hack to remove from .gitignore the
746 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
747 entry. This should really be fixed in gnulib instead.
748 * bootstrap.conf (gnulib_modules): Add gnumakefile.
749 * configure.ac (AC_INIT): Set version name by invoking
750 build-aux/git-version-gen.
751 (AC_CONFIG_FILES): Remove .version, now generated by
752 build-aux/git-version-gen.
753 * maint.mk: New, copied from coreutils.
754 * doc/.cvsignore (bison.1): Add.
755 * doc/.gitignore (/bison.1): Add.
756 * doc/bison.1: Remove, generated.
757 * src/.cvsignore (revision.c): Remove.
758 * src/.gitignore (/revision.c): Remove.
759 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
760 (BUILT_SOURCES): Remove revision.c.
761 (revision.c): Remove.
762 * src/getargs.c (version): Don't print revision after the VERSION.
763 * src/revision.h: Remove.
764
bcf07cb7
JD
7652008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
766
767 Fix untranslatable composition of sentences. Reported by Goran
768 Uddeborg at
769 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
770 * THANKS (Goran Uddeborg): Add.
771 * src/reduce.c (reduce_print): Report the number of nonterminals and
772 rules useless in the grammar in separate sentences.
773 * tests/reduce.at (Useless Rules): Update output.
774 (Reduced Automaton): Likewise.
775 (Underivable Rules): Likewise.
776 (Empty Language): Likewise.
777
9aacab9a
JD
7782008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
779
780 Fix some .gitignore and .cvsignore problems.
781 * bootstrap (insert_sorted_if_absent): Replace all uses with...
782 (insert_vc_ignore): ... this new function, which prepends `/' to all
783 .gitignore entries before passing them to insert_sorted_if_absent.
784 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
785 .cvsignore files are maintained even though Bison developers run
786 bootstrap while using Git.
787 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
788 unneeded by Bison.
789 (gnulib): Add.
790 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
791 unneeded. Reported by Eric Blake.
792 * lib/.gitignore (/*~): Add.
793 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
794 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
795 Blake.
796 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
797
a9fc7990
JD
7982008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
799
800 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
801 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
802 * bootstrap.conf (gnulib_modules): Add unsetenv.
803 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
804 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
805 (/setenv.m4): Add.
806 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
807 the first argument because it may become position-dependent, and unset
808 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
809 Add comments explaining these issues in more detail.
810
0f1d6f10
JD
8112008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
812
813 Add .gitignore everywhere based on .cvsignore.
814 * .gitignore: New.
815 * build-aux/.gitignore: New.
816 * data/.gitignore: New.
817 * doc/.gitignore: New.
818 * etc/.gitignore: New.
819 * examples/.gitignore: New.
820 * examples/calc++/.gitignore: New.
821 * lib/.gitignore: New.
822 * m4/.gitignore: New.
823 * po/.gitignore: New.
824 * runtime-po/.gitignore: New.
825 * src/.gitignore: New.
826 * tests/.gitignore: New.
827
7bd1665a
JD
8282008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
829
830 * NEWS (2.3b+): New section, empty for now.
831 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
832
72c5b982
JD
8332008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
834
835 * NEWS (2.3b): Update release date since there has been a delay in
836 getting the announcements and tarballs out.
837
bd02cd5d
JD
8382008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
839
840 * NEWS: Version 2.3b.
841 * configure.ac (AC_INIT): Likewise.
842 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
843
9126263e
JD
8442008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
845
846 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
847 been doing it for years.
848 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
849 (Release Procedure): Add FIXME about make alpha being unmaintained.
850
fa6aa7b3
JD
8512008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
852
853 * data/yacc.c: Reformat m4 a little for readability.
854 * src/lalr.c (build_relations): Correct comment.
855
d30b312d
JMG
8562008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
857
858 DJGPP specific issue.
859 * djgpp/config.sed: Fixes required to run configure scripts generated
860 by autoconf 2.62.
861
138d4cd9
JD
8622008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
863
864 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
865 coordinator@translationproject.org.
866
8f7e2e1f
JD
8672008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
868
869 * THANKS: Add Eric Blake.
870
f55efa38
JD
8712008-04-23 Eric Blake <ebb9@byu.net>
872
873 Revert prior patch, by working around autoconf regression.
874 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
875 ("Output file name: ("): Uncomment test.
876 ("Output file name: )"): Likewise.
877 Based on an idea from Noah Misch.
878
096c9f9d
JD
8792008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
880
881 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
882 2.61. Reported by Juan Manuel Guerrero at
883 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
884 * tests/output.at ("Output file name: ("): Comment out test case for
885 now.
886 ("Output file name: )"): Likewise.
887
0f664b89
JD
8882008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
889
890 * GNUmakefile: Update git-version-gen invocation so make dist
891 succeeds.
892
1cfe6375
JD
8932008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
894
895 Update to the current gnulib CVS repository, and fix trigraph handling
896 in Bison.
897 * bootstrap: Update gnulib CVS repository URL.
898 (symlink_to_dir): Encapsulate the code that guarantees the destination
899 directory exists into...
900 (check_dst_dir): ... this new function, and...
901 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
902 fail when copying files into lib/uniwidth/.
903 * src/output.c (prepare_symbols): When writing yytname muscles, where
904 symbol names will be encoded in C-string literals, tell quotearg to
905 escape trigraphs. This used to be the default in gnulib.
906 * tests/regression.at (Token definitions): Because of the change in
907 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
908 escapes trigraphs in symbol names. Thus, yytname no longer has
909 trigraphs unnecessarily doubly escaped. Update test case output.
910 Extend test case to be sure Bison's own error messages will no longer
911 have trigraphs in symbol names unnecessarily escaped once.
912
74c52fc8
JD
9132008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
914
915 Fix make dist infinite loop reported by Juan Manuel Guerrero at
916 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
917 * .cvsignore: Add .version.
918 * .version.in: New.
919 * bootstrap.conf (gnulib_modules): Add git-version-gen.
920 * configure.ac (AC_CONFIG_FILES): Add .version.
921 * build-aux/.cvsignore: Add git-version-gen.
922
8e55b3aa
JD
9232008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
924
925 * NEWS (2.3a+): Mention that -g now takes an argument.
926 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
927 consistency. Update the -g and -x entries now that they take
928 arguments. Use brackets to indicate optional arguments.
929 * src/getargs.c (usage): Explain the relationship between arguments of
930 long and short options more completely. Document --defines and -d
931 separately since the former takes an argument but, for POSIX Yacc, the
932 latter does not.
933 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 934 (getargs): Sort cases.
8e55b3aa 935
59c5ac72
AD
9362008-02-28 Akim Demaille <demaille@gostai.com>
937
938 * doc/bison.texinfo: Fix a few typos.
939
118d4978
AD
9402008-02-28 Akim Demaille <akim@epita.fr>
941
942 * doc/bison.texinfo (Bison Options): Document -W.
943 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
944
7020f1e9
AD
9452008-02-28 Akim Demaille <akim@epita.fr>
946
947 * src/getargs.c (short_options): Split and sort for readability.
948 -g and -x take optional arguments, just like their long options.
949 * build-aux/cross-options.pl: Use /x to make the regexp easier to
950 understand.
951 Fix the handling of $opt which resulted in all the argument to be
952 considered as optional.
953
59da312b
JD
9542008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
955
956 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
957 say its interface is experimental.
958 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
959 Java.
960 (Bison Options): In the -L and --language entry, mention Java.
961 (Java Bison Interface): Say the interface is experimental.
962 * src/getargs.c (usage): Mention -L and --language.
963
964 * NEWS (2.3a+): Say the push parsing interface is experimental.
965 * doc/bison.texinfo (Push Decl): Likewise.
966 (Decl Summary): Likewise in the "%define api.push_pull" entry.
967 (Push Parser Function): Likewise.
968 (Pull Parser Function): Likewise.
969 (Parser Create Function): Likewise.
970 (Parser Delete Function): Likewise.
971 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
972 yypull_parse, and yypush_parse entries.
973
974 * NEWS (2.3a+): Mention XML support, and say the schema is
975 experimental.
976 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
977 * src/getargs.c (usage): Say the XML schema is experimental.
978
979 * NEWS (2.3a+): Say option instead of flag.
980
2bb3ebec
WP
9812008-02-21 Wojciech Polak <polak@gnu.org>
982
983 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
984 text.
985
333e670c
JD
9862008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
987
988 Fix impure push parser compile error reported by Bob Rossi at
989 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
990 * data/yacc.c: Clean up whitespace in the output a little.
991 (yypstate_allocated): Define for impure push parsers regardless of
992 whether the pull interface is also requested.
993 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
994 check impure push parsers without the pull interface.
995
996 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
997 yyerror takes arguments specified by %parse-param while yypstate_new
998 does not.
999 * doc/bison.texinfo (Parser Create Function): Document that
1000 yypstate_new returns 0 for multiple impure parser instances.
1001 * tests/push.at (Push Parsing: Multiple impure instances): Update
1002 expected stderr output.
1003
798096e1
JD
10042008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1005
1006 * runtime-po/POTFILES.in (push.c): Remove.
1007
9ca7f077
JD
10082008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1009
1010 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
1011 * data/push.c: Rename to...
1012 * data/yacc.c: ... this, overwriting it.
1013 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
1014 `%push-pull-parser' -> `%define api.push_pull "both"'.
1015 Remove old yacc.c tests, and update push.c tests to yacc.c.
1016
42ee26bb
JD
10172008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1018
1019 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
1020 `"%code top" blocks' instead of `%code "top" blocks'.
1021 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
1022 Clean up whitespace in the output a little.
1023
b1cc23c4
JD
10242008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1025
1026 Fix documentation problems reported by Tim Josling at
1027 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
1028 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
1029 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
1030 integers. Explain the effect of literal string aliases on error
1031 messages. Copy token 0 documentation from the C++ skeleton
1032 documentation.
1033
ab7f29f8
JD
10342008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1035
1036 Accept a token number in a %left, %right, or %nonassoc for POSIX
1037 conformance. Reported by Tim Josling at
1038 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
1039 * NEWS (2.3a+): Mention.
1040 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
1041 and code numbers are treated by precedence declarations.
1042 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
1043 of symbols.1.
1044 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
1045 of symbol.
1046 (symbol.prec): New, just like symbol but allows INT.
1047 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
1048 longer holds.
1049 * tests/regression.at (Token number in precedence declaration): New
1050 test case.
1051
a924ef36
JMG
10522008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1053
1054 DJGPP specific issues.
1055 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
1056 be changed. Copyright timestamp adjusted.
1057 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
1058 be changed. Copyright timestamp adjusted.
1059 * djgpp/config.site: Copyright timestamp adjusted.
1060 * djgpp/config_h.sed: Copyright timestamp adjusted.
1061 * djgpp/djunpack.bat: Copyright timestamp adjusted.
1062 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
1063 filename translation list.
1064 * djgpp/subpipe.c (init_subpipe): Check the environment variables
1065 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
1066 files shall be created. Before trying to use the temp dir where the
1067 environment variable points to check that the dir really exists. If
1068 not default to the cwd as temp dir. Copyright timestamp adjusted.
1069 * djgpp/subpipe.h: Copyright timestamp adjusted.
1070 * djgpp/testsuite.sed: Copyright timestamp adjusted.
1071
389c8cfd
PE
10722008-01-30 Paul Eggert <eggert@cs.ucla.edu>
1073
1074 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
1075
5d1cfef4
PE
10762008-01-09 Paul Eggert <eggert@cs.ucla.edu>
1077
1078 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
1079 Problem reported by Claudio Saavedra in
1080 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
1081
e2dcf996
WP
10822008-01-05 Wojciech Polak <polak@gnu.org>
1083
1084 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
1085 document's title with the input grammar file name.
1086
da730230
JD
10872007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
1088
1089 Automate regression testing of the XML/XSLT implementation. Discussed
1090 starting at
1091 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
1092 * configure.ac (XSLTPROC): New substitution.
1093 * Makefile.am (maintainer-xml-check): New phony target invoking...
1094 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
1095 invoking make maintainer-check with BISON_TEST_XML=1.
1096 * tests/atlocal.in (XSLTPROC): New.
1097 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
1098 not to report reachable memory when Bison is expected to have a
1099 non-zero exit status and (2) to compare XML/XSLT output with --graph
1100 and --report=all output for every working grammar when
1101 BISON_TEST_XML=1.
1102 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
1103 (AT_BISON_CHECK_XML): New.
1104 (AT_QUELL_VALGRIND): New.
1105 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
1106 (AT_CHECK): ... don't redefine this since this was the old way to
1107 quell Valgrind.
1108 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
1109 AT_BISON_CHECK invocations.
1110 * tests/c++.at: Likewise.
1111 * tests/calc.at: Likewise.
1112 * tests/conflicts.at: Likewise.
1113 * tests/cxx-type.at: Likewise.
1114 * tests/existing.at: Likewise.
1115 * tests/glr-regression.at: Likewise.
1116 * tests/headers.at: Likewise.
1117 * tests/input.at: Likewise.
1118 * tests/java.at: Likewise.
1119 * tests/output.at: Likewise.
1120 * tests/push.at: Likewise.
1121 * tests/reduce.at: Likewise.
1122 * tests/regression.at: Likewise.
1123 * tests/sets.at: Likewise.
1124 * tests/skeletons.at: Likewise.
1125 * tests/synclines.at: Likewise.
1126 * tests/torture.at: Likewise.
1127 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
1128 tends to hang xsltproc.
1129 (Big horizontal): Likewise.
1130
408476bc
JD
11312007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1132
1133 In XML output, remove redundant class attribute on symbol element.
1134 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
1135 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
1136 look up a symbol to determine whether it's a nonterminal or terminal.
1137 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
1138 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
1139
1140 Add prec/assoc information to XML output.
1141 * src/gram.c (grammar_rules_print_xml): For each rule that has a
1142 %prec, add a percent_prec attribute.
1143 * src/print-xml.c (print_grammar): For each terminal that has a
1144 precedence or associativity, add a prec or assoc attribute.
1145 (xml_indent): New.
1146 (xml_puts): Use xml_indent.
1147 (xml_printf): Use xml_indent.
1148 * src/print-xml.h (xml_indent): Prototype.
1149
1150 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
1151 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
1152
d4a26c48
JD
11532007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1154
1155 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
1156 (bison:ruleByNumber): ... this for clarity.
1157 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
1158 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
1159 (xsl:template match="reduction"): Update.
1160 (xsl:template match="item"): Update.
1161 (xsl:template match="reduction"): Update.
1162
1163 In the XML output, don't print the list of rules where symbols appear.
1164 Compute it in XSLT instead. Discussed at
1165 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
1166 * data/xslt/bison.xsl (bison:ruleByLhs): New.
1167 (bison:ruleByRhs): New.
1168 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
1169 bison:ruleByRhs.
1170 (xsl:template match="terminal/rule"): Remove.
1171 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1172 bison:ruleByRhs.
1173 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1174 Remove.
1175 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
1176 bison:ruleByRhs and mode="number-link" for rule template.
1177 (xsl:template match="terminal/rule"): Remove.
1178 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1179 bison:ruleByRhs and mode="number-link" for rule template.
1180 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1181 Rewrite as...
1182 (xsl:template match="rule" mode="number-link"): ... this.
1183 * src/print-xml.c (print_grammar): Don't print the list of rules.
1184
ef1b4273
JD
11852007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
1186
1187 Don't let --report affect XML output; always print all information.
1188 Discussed at
1189 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
1190 * src/conflicts.c (log_resolution): Implement.
1191 * src/print-xml.c (print_core): Implement.
1192 (print_state): Implement.
1193 (print_xml): Implement.
1194
1195 * NEWS (2.3a+): Fix quotes.
1196 * src/parse-gram.y (prologue_declaration): For consistency with -v,
1197 don't let %verbose clear the list specified by --report.
1198
0f6cd9e3
AD
11992007-11-26 Akim Demaille <akim@epita.fr>
1200
1201 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
1202
d80fb37a
JD
12032007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
1204
1205 In the XML output, list useless and unused symbols and rules with the
1206 useful ones and add a "usefulness" attribute. Discussed starting at
1207 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
1208 * src/gram.c (grammar_rules_partial_print_xml): Remove.
1209 (grammar_rules_print_xml): Print all rules instead of just those
1210 useful in the grammar, and add a "usefulness" attribute.
1211 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
1212 * src/print-xml.c (print_rules_useless_in_parser): Remove.
1213 (print_grammar): Print all nonterminals instead of just useful ones,
1214 and add a "usefulness" attribute to nonterminals and terminals.
1215 (print_xml): Don't print a separate "reductions" or
1216 "rules-useless-in-parser" element.
1217 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
1218 (reduce_xml): Remove.
1219 (reduce_token_unused_in_grammar): New.
1220 (reduce_nonterminal_useless_in_grammar): New.
1221 * src/reduce.h (reduce_xml): Remove prototype.
1222 (reduce_token_unused_in_grammar): Add prototype.
1223 (reduce_nonterminal_useless_in_grammar): Add prototype.
1224 * data/xslt/xml2text.xsl: Update for XML changes.
1225 * data/xslt/xml2xhtml.xsl: Update for XML changes.
1226 * tests/reduce.at (Useless Terminals): Update output.
1227 (Useless Rules): Update output.
1228 (Reduced Automaton): Update output.
1229
1230 Say "Terminals unused in grammar" instead of "Unused terminals".
1231 * NEWS (2.3a+): Update.
1232 * doc/bison.texinfo (Understanding): Update example output.
1233 * src/reduce.c (reduce_output): Implement.
1234 * data/xslt/xml2text.xsl: Implement.
1235 * data/xslt/xml2xhtml.xsl: Implement.
1236
1bb2bd75
JD
12372007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1238
1239 Accept --report-file=FILE to override the default `.output' filename.
1240 * NEWS (2.3a+): Mention.
1241 * doc/bison.texinfo (Bison Options): Add an entry.
1242 * src/files.c (compute_output_file_names): Don't override
1243 spec_verbose_file if already set.
1244 * src/getargs.c (usage): Document --report-file.
1245 (REPORT_FILE_OPTION): New anonymous enum member.
1246 (long_options): Add entry for it.
1247 (getargs): Add case for it setting spec_verbose_file.
1248
1249 * build-aux/cross-options.pl: Don't record a short option just because
1250 there's an arg.
1251 * doc/.cvsignore: Add yacc.1.
1252
a005a9c4
AD
12532007-11-14 Akim Demaille <akim@epita.fr>
1254
1255 * doc/yacc.1.in: New.
1256 * configure.ac, doc/Makefile.am: Adjust.
1257 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
1258 config.h symbol.
1259 Use AC_SUBST for assignments too.
1260 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
1261
cff03fb2
JD
12622007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1263
1264 * src/gram.c: Remove comments that duplicate comments in gram.h.
1265
1266 When reporting useless rules and nonterminals, say "useless in grammar"
1267 instead of "useless", and say "useless in parser" instead of "never
1268 reduced". Discussed starting at
1269 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
1270 * NEWS (2.3a+): Mention this change.
1271 * data/xslt/xml2text.xsl: Update output text and expected input XML
1272 element names to match changes below.
1273 * data/xslt/xml2xhtml.xsl: Likewise.
1274 (xsl:template match="bison-xml-report"): Add missing entry in Table of
1275 Contents: "Rules useless in parser due to conflicts".
1276 * doc/bison.texinfo (Decl Summary): Reword a little.
1277 (Understanding): Update example output for changes below.
1278 * src/gram.c: (rule_useful_p): Rename to...
1279 (rule_useful_in_grammar_p): ... this.
1280 (rule_useless_p): Rename to...
1281 (rule_useless_in_grammar_p): ... this.
1282 (rule_never_reduced_p): Rename to...
1283 (rule_useless_in_parser_p): ... this.
1284 (grammar_rules_print): Update for renames.
1285 (grammar_rules_print_xml): Update for renames.
1286 (grammar_rules_never_reduced_report): Rename to...
1287 (grammar_rules_useless_report): ... this since it is used for either
1288 kind of useless rule.
1289 * src/gram.h: Reword comments and update function names in prototypes.
1290 * src/main.c (main): Say "rule useless in parser due to conflicts".
1291 * src/print-xml.c (print_rules_never_reduced): Rename to...
1292 (print_rules_useless_in_parser): ... this, and rename output XML
1293 element "rules-never-reduced" to "rules-useless-in-parser".
1294 (print_xml): Update for rename.
1295 * src/print.c (print_results): Say "Rules useless in parser due to
1296 conflicts".
1297 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
1298 (nonterminals_reduce): Say "nonterminal useless in grammar".
1299 (reduce_output): Say "Nonterminals useless in grammar".
1300 Say "Rules useless in grammar".
1301 (reduce_xml): Rename output XML element "useless" to
1302 "useless-in-grammar".
1303 (reduce_print): Don't report the count of grammatically useless rules
1304 as "rules never reduced" just because %yacc is specified.
1305 In the correct report of this count, say nonterminal(s) and rule(s)
1306 "useless in grammar".
1307 * tests/conflicts.at (S/R in initial): Update expected output.
1308 (Defaulted Conflicted Reduction): Likewise.
1309 (Unreachable States After Conflict Resolution): Likewise.
1310 * tests/existing.at (GNU pic Grammar): Likewise.
1311 * tests/reduce.at (Useless Nonterminals): Likewise.
1312 (Useless Rules): Likewise.
1313 (Reduced Automaton): Likewise.
1314 (Underivable Rules): Likewise.
1315 (Empty Language): Likewise.
1316
66f0441d
JD
13172007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
1318
1319 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
1320 here document and before the EOF so that BSD's implementation of Bourne
1321 shell doesn't parse the delimiter as part of the here document.
1322 * doc/.cvsignore: Add cross-options.texi.
1323 * src/getargs.c (usage): Add a blank line after the warning categories.
1324
d0ee4105
PB
13252007-11-08 Paolo Bonzini <bonzini@gnu.org>
1326
1327 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
1328
e8b1fb9b
AD
13292007-11-05 Akim Demaille <akim@epita.fr>
1330
1331 Remove Id: from bison.1.
1332 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
1333 (perl -0777 -pi -e 's/\.PP\nId): New.
1334 (.x.1): Use it to ignore the version control revision.
1335
2f7a96b5
AD
13362007-11-05 Akim Demaille <demaille@gostai.com>
1337
1338 * build-aux/Makefile.am: Ship cross-options.pl.
1339 * doc/Makefile.am: Always refer to cross-options.texi with
1340 $(srcdir).
1341 (MAINTAINERCLEANFILES): Add it.
1342
f4101aa6
AD
13432007-11-04 Akim Demaille <demaille@gostai.com>
1344
1345 Generate the long/short option cross-table.
1346 * build-aux/cross-options.pl: New.
1347 * doc/Makefile.am (cross-options.texi): New.
1348 * doc/bison.texinfo: Use it.
1349
727a1401
AD
13502007-11-04 Akim Demaille <demaille@gostai.com>
1351
1352 Generate bison.1 using help2man.
1353 * doc/common.x, doc/bison.x: New.
1354 * doc/Makefile.am (bison.1, .x.1): New.
1355 The code is taken from autoconf-2.61/man/Makefile.am.
1356 * configure.ac: Look for help2man.
1357
6aeb9c57
AD
13582007-11-04 Akim Demaille <demaille@gostai.com>
1359
1360 Complete --help.
1361 * src/getargs.c (usage): Document -W, make it clear that -d,
1362 -g and -x have optional arguments.
1363
d7be4085
AD
13642007-11-04 Akim Demaille <demaille@gostai.com>
1365
1366 Find sha1sum when named gsha1sum.
1367 * bootstrap (find_tool): New.
1368 ($SHA1SUM): New.
1369
d9df47b6
JD
13702007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1371
1372 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
1373 at
1374 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
1375 * NEWS (2.3a+): Mention.
1376 * data/bison.m4 (b4_pure_if): Don't define it here.
1377 * data/c.m4 (b4_identification): Depend on individual skeletons to
1378 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
1379 values of the %define variables api.pure or api.push_pull. Define
1380 YYPURE, YYPUSH, and YYPULL accordingly.
1381 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
1382 glr.cc has already defined b4_pure_flag.
1383 * data/push.c: Define b4_pure_if based on `%define api.pure'.
1384 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 1385 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
1386 * doc/bison.texinfo (Pure Decl): Update.
1387 (Push Decl): Update.
1388 (Decl Summary): Add api.pure to %define entry.
1389 In %pure-parser entry, say it's deprecated and reference %define.
1390 (Pure Calling): Update.
1391 (Error Reporting): Update.
1392 (C++ Scanner Interface): Update.
1393 (How Can I Reset the Parser): Update.
1394 (Table of Symbols): In %pure-parser entry, say it's deprecated and
1395 reference %define.
1396 * src/getargs.c (pure_parser): Remove global variable.
1397 * src/getargs.h (pure_parser): Remove extern.
1398 * src/output.c (prepare): Don't define pure_flag muscle.
1399 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
1400 wrapper around `%define api.pure'.
1401 * tests/calc.at (Simple LALR Calculator): Update.
1402 (Simple GLR Calculator): Update.
1403 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
1404 Update.
1405 (GLR: Resolve ambiguity, pure, locations): Update.
1406 (GLR: Merge conflicting parses, pure, no locations): Update.
1407 (GLR: Merge conflicting parses, pure, locations): Update.
1408 * tests/glr-regression.at (Uninitialized location when reporting
1409 ambiguity): Update
1410 * tests/input.at (Unused %define api.pure): New test case.
1411 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
1412 AT_PURE_IF and AT_PURE_AND_LOC_IF.
1413 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
1414
c373bf8b
JD
14152007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1416
1417 %define push_pull -> %define api.push_pull. Discussed starting at
1418 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
1419 * data/push.c: Expect the new name.
1420 * data/yacc.c: Likewise.
1421 * doc/bison.texinfo (Push Decl): Update.
1422 (Decl Summary): Update %define entry.
1423 (Push Parser Function): Update.
1424 (Pull Parser Function): Update.
1425 (Parser Create Function): Update.
1426 (Parser Delete Function): Update.
1427 * tests/calc.at (Simple LALR Calculator): Update.
1428 * tests/input.at (%define enum variables): Update.
1429 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
1430 (Push Parsing: Multiple impure instances): Update.
1431 (Push Parsing: Unsupported Skeletons): Update.
1432 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
1433 (Exploding the Stack Size with Malloc): Update.
1434
1435 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
1436 other entries some.
1437
32f19b6b
JD
14382007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
1439
1440 For the XML output's terminal element, rename @number to @token-number,
1441 and add @symbol-number. In the nonterminal element, rename @number to
1442 @symbol-number. Discussed starting at
1443 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
1444 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
1445 renames.
1446 (xsl:template match="nonterminal"): Likewise.
1447 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
1448 (xsl:template match="nonterminal"): Likewise.
1449 * src/print-xml.c (print_grammar): Implement.
1450
255a6b90
JD
14512007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1452
1453 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
1454 2007-10-11 change, the child elements here are items not rules.
408476bc 1455 (xsl:template match="item"): New.
255a6b90
JD
1456 (xsl:template match="rule"): Update for new reduced itemset.
1457 (xsl:template match="point"): Remove.
1458 (xsl:template match="empty"): For consistency with --graph, don't
1459 output "/* empty */".
1460 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
1461 line-wrap, don't pass a negative value as first-line-length since this
1462 won't work with the following changes.
1463 (xsl:template name="line-wrap"): Simplify slightly.
1464 (xsl:template name="ws-search"): Eliminate recursion.
1465 * src/print_graph.c (print_core): Don't print a reduction's lookahead
1466 set next to an item whose dot is not at the end of the RHS even if it
1467 happens to be associated with the same rule.
1468
88c78747
JD
14692007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
1470
31984206
JD
1471 Add %define lr.keep_unreachable_states.
1472 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
1473 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
1474 * src/main.c (main): Implement it.
1475 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1476 Extend to test it, and fix a typo.
1477
14782007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
1479
1480 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
1481 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
1482 the example .output text.
1483 * tests/regression.at (Extra lookahead sets in report): Improve wording
1484 of comments.
1485
b7a70162
WP
14862007-10-17 Wojciech Polak <polak@gnu.org>
1487
1488 * src/print-xml.c (print_grammar): Renamed
1489 <terminal> and <nonterminal> attributes:
1490 "type" to "number" and "symbol" to "name".
1491 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
1492 Use new attribute names.
1493 (xsl:template match="nonterminal"): Likewise.
1494 * data/xslt/xml2xhtml.xsl: Likewise.
1495
a0de5091
JD
14962007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
1497
1498 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
1499 (Option Cross Key): Likewise.
1500
1501 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
1502 next to an item whose dot is not at the end of the RHS even if it
1503 happens to be associated with the same rule.
1504 * src/print.c (print_core): Likewise.
1505 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
1506 (Resolved SR Conflicts): Update output.
1507 * tests/regression.at (Extra lookahead sets in report): New test case.
1508
4c20d18d
WP
15092007-10-11 Wojciech Polak <polak@gnu.org>
1510
1511 * src/print-xml.c (print_core): Remove item set
1512 redundancy.
1513 * data/xslt/bison.xsl (bison:ruleNumber): New key.
1514 Improve processing time. Suggested by Joel E. Denny.
1515 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
1516 Write xsl:param "required" attribute as comment.
1517 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
1518 (xsl:template match="rule"): Support new reduced itemset.
1519 (xsl:template match="point"): Remove.
1520 * data/xslt/xml2xhtml.xsl: Likewise.
1521
f506ad1c
JD
15222007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
1523
1524 * src/getargs.c (version): Update copyright year.
1525
21f1b063
JD
15262007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
1527
1528 Make xml2dot.xsl and --graph produce the same output.
1529 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
1530 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
1531 escaped later.
1532 (xsl:template name="output-node"): Use the new escape template instead
1533 of the string-replace template directly.
1534 (xsl:template name="output-edge"): Likewise.
1535 (xsl:template name="escape"): New, escapes backslashes and newlines in
1536 addition to quotation marks.
1537 * src/graphviz.c (start_graph, output_node, output_edge): Add
1538 whitespace to output for legibility.
1539
1540 Make xml2text.xsl and --report produce the same output, and remove the
1541 XML "conflicts" element since a conflict summary is easily extracted
1542 from the automaton.
1543 * data/xslt/bison.xsl: New.
1544 (xsl:template match="state" mode="bison:count-conflicts): New.
1545 * data/xslt/xml2text.xsl: Import bison.xsl.
1546 (xsl:template match="bison-xml-report"): Instead of styling the
1547 "conflicts" element, style the "automaton" element with mode
1548 "conflicts". Unlike the former, the latter lists S/R and R/R
1549 conflicts for a state on the same line.
1550 (xsl:template match="conflicts"): Remove.
1551 (xsl:template match="conflict"): Remove.
1552 (xsl:template match="terminal"): Line-wrap the list of rules in which
1553 the terminal is used.
1554 (xsl:template match="nonterminal"): Likewise for nonterminals.
1555 (xsl:template match="automaton" mode="conflicts"): New.
1556 (xsl:template match="state" mode="conflicts"): New.
1557 (xsl:template name="line-wrap"): New.
1558 (xsl:template name="ws-search"): New.
1559 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
1560 (xsl:template match="bison-xml-report"): Instead of styling the
1561 "conflicts" element, style the "automaton" element with mode
1562 "conflicts."
1563 (xsl:template match="conflicts"): Remove.
1564 (xsl:template match="conflict"): Remove.
1565 (xsl:template match="automaton" mode="conflicts"): New.
1566 (xsl:template match="state" mode="conflicts): New.
1567 * src/conflicts.c (conflicts_output_xml): Remove.
1568 * src/conflicts.h (conflicts_output_xml): Remove prototype.
1569 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
1570 * src/print.c (print_grammar): Consistently wrap at the 66th column so
1571 the corresponding XSLT is easier. Also, never wrap between a word and
1572 the comma that follows it.
1573
793fbca5
JD
15742007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
1575
1576 Improve C++ namespace support. Discussed starting at
1577 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
1578 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
1579 b4_namespace_close): New macros that interpret the %define variable
1580 "namespace" so its value can contain "::" to indicate nested
1581 namespaces.
1582 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
1583 the above macros.
1584 * data/lalr1.cc (b4_namespace): Likewise.
1585 * data/location.cc (b4_namespace): Likewise.
1586 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
1587 inside a new table in the general %define entry. Document `%define
1588 namespace' there as well. Point the %name-prefix entry to it since it
1589 explains it more completely in the case of C++.
1590 (C++ Bison Interface): Mention `%define namespace' instead of
1591 %name-prefix.
1592 (Table of Symbols): Remove the `%define push_pull' entry. The %define
1593 entry suffices.
1594 * tests/c++.at (Relative namespace references): New test case.
1595 (Absolute namespace references): New test case.
1596 (Syntactically invalid namespace references): New test case.
1597 * tests/input.at (C++ namespace reference errors): New test case.
1598
35b8730d
JD
15992007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
1600
1601 Add syncline support and location accessor to internal %define
1602 interfaces.
1603 * data/bison.m4 (b4_percent_define_get_loc): New.
1604 (b4_percent_define_get_syncline): New.
1605 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
1606 (b4_percent_define_default): Record defining location as line 1 rather
1607 than 0 for the sake of synchronizing #line's, and define
1608 b4_percent_define_syncline(VARIABLE).
1609 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
1610 * src/muscle_tab.c (muscle_syncline_grow): New.
1611 (muscle_code_grow): Use muscle_syncline_grow.
1612 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
1613 define b4_percent_define_syncline(VARIABLE).
1614 (muscle_percent_define_get_loc): New.
1615 (muscle_percent_define_get_syncline): New.
1616 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
1617 remove some unused variables.
1618 (muscle_percent_define_default): Record defining location as line 1
1619 rather than 0 for the sake of synchronizing #line's, and define
1620 b4_percent_define_syncline(VARIABLE).
1621 (muscle_percent_define_check_values): Use
1622 muscle_percent_define_get_loc.
1623 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
1624 (muscle_percent_define_get_syncline): Prototype.
1625 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1626 defaults): Update output for location change.
1627 (Complaining during macro argument expansion): Extend to test
1628 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
1629
7dc4a694
JD
16302007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
1631
1632 Fix some error-reporting macro bugs.
1633 * data/bison.m4 (b4_cat): New.
1634 (b4_error, b4_error_at): Use b4_cat to send error directives directly
1635 to stdout so they don't become arguments to other macros. Update
1636 comments and add examples.
1637 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
1638 add examples.
1639 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
1640 after printing the error directive so that M4 doesn't report subsequent
1641 problems that are induced by this problem.
1642 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
1643 instead of just in them. Recognize @\n in both places. Both expand to
1644 the empty string. Needed by b4_cat.
1645 * tests/skeletons.at (Complaining during macro argument expansion):
1646 New test case.
1647 (Fatal errors make M4 exit immediately): New test case.
1648
d4bd2295
JD
16492007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
1650
1651 Implement --print-datadir.
1652 * src/getargs.c (usage): Mention.
1653 (PRINT_DATADIR_OPTION): New anonymous enum member.
1654 (long_options): Add entry for it.
1655 (getargs): Add case for it calling compute_pkgdatadir.
1656 * src/output.c (output_skeleton): Encapsulate data directory
1657 computation from here...
1658 (prepare): ... and from here...
1659 (compute_pkgdatadir): ... into this new function.
1660 * src/output.h (compute_pkgdatadir): Prototype.
1661
34cdeddf
JD
16622007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
1663
1664 * src/print-xml.c (escape_bufs): New static global variable
1665 replacing...
1666 (xml_escape_n): ... the static local variable buf here.
1667 (print_xml): Free memory for escape_bufs.
1668 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
1669
d782395d
JD
16702007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
1671
1672 Replace `%push-parser' and `%push-pull-parser' with
1673 `%define push_pull "push"' and `%define push_pull "both"'.
1674 `%define push_pull "pull"' is the default.
1675 * doc/bison.texinfo (Push Decl, Push Parser Function,
1676 Pull Parser Function, Parser Create Function, Parser Delete Function):
1677 Update declarations.
1678 (Decl Summary, Table of Symbols): Replace %push-parser and
1679 %push-pull-parser entries with a %define push_pull entry.
1680 * data/bison.m4 (b4_percent_define_check_values): New macro.
1681 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
1682 definitions...
1683 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
1684 definitions...
1685 * data/push.c: ... to here and compute them from the value of the
1686 %define variable push_pull.
1687 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
1688 parsing requests here...
1689 * data/yacc.c: ... hack this to switch to push.c any time
1690 b4_use_push_pull_flag or the %define variable push_pull is set. This
1691 will go away when we mv push.c yacc.c.
1692 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
1693 push parsing is not supported since unused %define variables are
1694 reported anyway.
1695 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
1696 * src/muscle_tab.h (muscle_percent_define_check_values): Update
1697 comments for consistency with b4_percent_define_check_values.
1698 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
1699 muscles.
1700 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
1701 Remove.
1702 (prologue_declaration): Remove %push-parser and %push-pull-parser
1703 rules.
1704 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
1705 * tests/calc.at: Update declarations.
1706 * tests/input.at (%define enum variables): New test case.
1707 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
1708 declaration.
1709 (Push Parsing: Multiple impure instances): Update declaration.
1710 (Push Parsing: Unsupported Skeletons): New test case.
1711 * tests/torture.at (Exploding the Stack Size with Alloca): Update
1712 declaration.
1713 (Exploding the Stack Size with Malloc): Update declaration.
1714
3f999f78
WP
17152007-09-24 Wojciech Polak <polak@gnu.org>
1716
1717 Add XSLT transformations.
1718
1719 * data/xslt/xml2dot.xsl: Transform XML into DOT.
1720 * data/xslt/xml2text.xsl: Transform XML into plain text.
1721 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
1722 * data/Makefile.am (xsltdir): New variable.
1723 (dist_xslt_DATA): Add xslt/*.xsl files.
1724
a4f75309
PE
17252007-09-23 Paul Eggert <eggert@cs.ucla.edu>
1726
1727 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
1728 Problem reported by Wojciech Polak.
1729 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
1730 (xml_printf): Undo change I made on 21 September; that is,
1731 indent 2 spaces, not 1.
1732
ad5feac4
JD
17332007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
1734
1735 Pacify ./configure --enable-gcc-warnings.
1736 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
1737 `char const *' instead of `char *'.
1738 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
1739 local variable `sep'.
1740
41d7a5f2
PE
17412007-09-21 Paul Eggert <eggert@cs.ucla.edu>
1742
1743 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
1744 elsewhere.
1745 * src/print-xml.c: Prefer "const" after types; that's more consistent.
1746 (xml_printf): Indent just 1 space for level.
1747 (e_char, xlate_char): Remove.
1748 (xml_escape_string): Rewrite to avoid undefined behavior (used
1749 storage that was freed from the stack).
1750 (xml_escape_n): Don't bother checking for subscript error.
1751
3f999f78
WP
17522007-09-21 Wojciech Polak <polak@gnu.org>
1753
1754 Add Bison XML Automaton Report.
41d7a5f2
PE
1755
1756 Add support for an -x option to generate an XML report.
1757 It is not documented yet.
1758 * src/print-xml.c: New file.
1759 * src/print-xml.h: Likewise.
1760 * lib/timevar.def (TV_XML): New var.
1761 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
1762 * src/conflicts.c: Include print-xml.h.
1763 (solved_conflicts_xml_obstack): New var.
1764 (log_resolution, conflicts_solve, conflicts_free):
1765 Add support for XML report.
1766 (conflicts_output_val): New function.
1767 * src/conflicts.h (conflicts_output_val): New decl.
1768 * src/files.c (spec_xml_file): New var.
1769 (compute_output_file_names, output_file_names_free): Add XML support.
1770 * src/files.h (spec_xml_file): New decl.
1771 * src/getargs.c (xml_flag): New var.
1772 (usage, short_options, long_options, getargs): Add XML support.
1773 * src/getargs.h (xml_flag): New decl.
1774 * src/gram.c: Include print-xml.h.
1775 (rule_lhs_print_xml, rule_rhs_print_xml):
1776 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
1777 New functions.
1778 * src/gram.h: Declare external ones.
1779 * src/main.c: Include print-xml.h.
1780 (main): Add XML support.
1781 * src/reduce.c: Include print-xml.h.
1782 (reduce_xml): New function.
1783 * src/reduce.h: Declare it.
1784 * src/state.c: Include print-xml.h.
1785 (state_new): Add XML support.
1786 (state_rule_lookahead_tokens_print_xml): New function.
1787 * src/state.h: Declare it.
1788 (struct state): New member solved_conflicts_xml.
1789 * src/symtab.c (symbol_class_get_string): New function.
1790 * src/symtab.h: Declare it.
1791
6d8e724d
PE
17922007-09-21 Paul Eggert <eggert@cs.ucla.edu>
1793
1794 * GNUmakefile: Switch to coreutils's version.
1795 * bootstrap: Likewise.
1796 * Makefile.cfg: Adjust to new GNUmakefile.
1797 * README-hacking: Likewise.
1798
1799 Import from gnulib:
1800
1801 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
1802 Bruno Haible <bruno@clisp.org>
1803
1804 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
1805 and is a script that invokes bison. Tighten the code. Add comments.
1806
922bdd7f
JD
18072007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
1808
1809 Spell "boolean" as "Boolean". Reported by Akim Demaille.
1810 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
1811 * doc/bison.texinfo (Decl Summary): Fix.
1812 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
1813 * tests/input.at (Boolean %define variables): Update output.
1814 * tests/skeletons.at (%define boolean variables: invalid skeleton
1815 defaults): Rename to...
1816 (%define Boolean variables: invalid skeleton defaults): ... this and
1817 update output.
1818
1b17b01d
JD
18192007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
1820
1821 In impure push mode, don't allow more than one yypstate to be allocated
1822 since multiple impure parsers would corrupt yynerrs.
1823 * data/push.c (yypstate_allocated): New static global variable
1824 initialized to 0.
1825 (yypull_parse): If yypstate_new returns 0, don't report it as memory
1826 exhaustion if yypstate_allocated is 1, but still return 2.
1827 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
1828 already 1. Otherwise, set it to 1.
1829 (yypstate_delete): Set it to 0.
1830 * tests/push.at (Push Parsing: Multiple impure instances): New test
1831 case.
1832
9987d1b3
JD
18332007-08-17 Bob Rossi <bob@brasko.net>
1834
1835 * doc/bison.texinfo (Push Decl): Document the push parser.
1836 (Table of Symbols): Ditto.
1837 (Pure Decl): Ditto.
1838 (Decl Summary): Ditto.
1839 (Multiple Parsers, Push Parser Function, Pull Parser Function,
1840 Parser Create Function, Parser Delete Function):
1841 Add new push parser symbols.
1842 (Table of Symbols): Document push-parser, push-pull-parser,
1843 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
1844
f16b0819
PE
18452007-08-15 Paul Eggert <eggert@cs.ucla.edu>
1846
1847 Update to GPLv3.
1848 * doc/gpl-3.0.texi: New file.
1849 * doc/gpl.texi: Remove.
1850 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
1851 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
1852 * README-hacking, TODO, bootstrap, bootstrap.conf:
1853 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
1854 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
1855 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
1856 * data/lalr1.cc, data/lalr1.java, data/location.cc:
1857 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
1858 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
1859 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
1860 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
1861 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
1862 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
1863 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
1864 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
1865 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
1866 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
1867 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
1868 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
1869 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
1870 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
1871 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
1872 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
1873 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
1874 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
1875 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
1876 * src/complain.c, src/complain.h, src/conflicts.c:
1877 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
1878 * src/files.h, src/flex-scanner.h, src/getargs.c:
1879 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
1880 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
1881 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
1882 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
1883 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
1884 * src/print.c, src/print.h, src/print_graph.c:
1885 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
1886 * src/reduce.h, src/relation.c, src/relation.h:
1887 * src/revision.h, src/scan-code.h, src/scan-code.l:
1888 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
1889 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
1890 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
1891 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
1892 * tests/Makefile.am, tests/actions.at, tests/c++.at:
1893 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
1894 * tests/existing.at, tests/glr-regression.at:
1895 * tests/headers.at, tests/input.at, tests/java.at:
1896 * tests/local.at, tests/output.at, tests/push.at:
1897 * tests/reduce.at, tests/regression.at, tests/sets.at:
1898 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
1899 * tests/torture.at:
1900 Update to GPLv3.
1901
728c4be2
JD
19022007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1903
1904 Get rid of broken %no-parser, -n, and --no-parser implementation and
1905 documentation.
1906 * TODO: Don't mention them.
1907 * doc/bison.1: Likewise.
1908 * doc/bison.texinfo (Decl Summary): Likewise.
1909 (Bison Options): Likewise.
1910 (Option Cross Key): Likewise.
1911 * src/getargs.c (no_parser_flag): Remove global variable.
1912 (usage): Don't print description of -n and --no-parser.
1913 (long_options): Remove --no-parser entry here.
1914 (getargs): Remove -n case in the switch here.
1915 * src/getargs.h (no_parser_flag): Remove extern.
1916 * tests/regression.at (Web2c Actions): Remove comment that mentions
1917 --no-parser.
1918
5d31a216
JD
19192007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1920
1921 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
1922 name user variables starting with `yy'. Just pass NULL instead of a
1923 dummy local &yylval to yypush_parse.
1924 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
1925 starting with `yy'.
1926
a2ea208d
JD
19272007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
1928
1929 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
1930 true since it's then always used regardless of whether yyoverflow is
1931 defined. Reported by Christian Burger at
1932 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
1933 * THANKS: Add Christian Burger.
1934
91661ebb
JD
1935 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1936 node names: say "Decl Summary" not "Bison Declaration Summary".
1937
cbd50549
JD
19382007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
1939
1940 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
1941 determine whether this function has already complained about an invalid
1942 value for a %define boolean variable, don't check whether Bison has
1943 ever examined the value. As written, the check was a tautology.
1944 Instead, record and check for this complaint using a separate muscle.
1945
eb1b0740
JD
19462007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1947
1948 Fix push parsing memory leak reported by Brandon Lucia at
1949 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
1950 * THANKS: Add Brandon Lucia.
1951 * data/push.c (yypstate_delete): Free the stack if it was reallocated
1952 but the parse never completed and thus freed it.
1953 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
1954 * tests/testsuite.at: Include push.at.
1955 * test/push.at: New.
1956 (Push Parsing: Memory Leak for Early Deletion): New test case.
1957
9d774aff
JD
19582007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
1959
1960 Improve handling of multiple S/R conflicts in the same state and of S/R
1961 conflicts involving multiple reductions.
1962 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
1963 set for a state here or Bison will abort if it is reassigned on a
1964 later conflicted reduction in the same state.
1965 Similarly, don't finalize and assign the solved conflicts report here
1966 or it will be lost if it is reassigned on a later conflicted reduction
1967 in the same state.
1968 (set_conflicts): Instead, assign them both here after all S/R conflicts
1969 in the state have been fully examined.
1970 * src/print.c (shift_set): Rename to...
1971 (no_reduce_set): ... this.
1972 (print_reductions): Update for rename, and add %nonassoc error action
1973 tokens to no_reduce_set so that, when printing the first remaining
1974 reduction on an error action token, the reduction is enclosed in
1975 brackets.
1976 (print_results): Update for rename.
1977 * tests/conflicts.at (Solved conflicts report for multiple reductions
1978 in a state): New test case.
1979 (%nonassoc error actions for multiple reductions in a state): New test
1980 case.
1981
1982 * src/main.c (main): Don't depend on C99 features.
1983
10159d2a
JD
19842007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1985
1986 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
1987 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
1988 uniwidth.
10159d2a 1989
953b3935
JD
19902007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
1991
1992 * bootstrap (slurp): Create target directories that don't exist.
1993 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
1994
6ce2d93a
JD
19952007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1996
1997 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
1998 than item number.
1999 * closure.c (closure): Likewise.
2000 * state.h (reductions): Comment sorting of rules.
2001 (state): Comment sorting of items.
2002
ce3448d5
JD
20032007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
2004
2005 Fix C++ test cases after recent Gnulib changes. Discussed starting at
2006 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
2007 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
2008 definition in order to avoid Gnulib headers since we don't use config.h
2009 here.
2010 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
2011 rather than AT_DATA so that config.h is included.
2012
8a86eef0
JD
20132007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
2014
2015 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
2016 instead of fprintf. Guard these functions with #if YYDEBUG instead of
2017 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
2018 and so that YYFPRINTF is guaranteed to be defined here.
2019
b1a81613
JD
20202007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2021
2022 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
2023 with...
2024 (muscle_percent_define_check_values): ... this more helpful function.
2025 Again, it's not used yet, but it will be.
2026 * src/muscle_tab.h: Likewise.
2027
71b61d4d
JD
2028 Improve some comments in parser table construction.
2029 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
2030 (generate_states): Don't mention ruleset, which is internal to closure.
2031 * src/closure.c (closure): Explain sorting of core and itemset, which
2032 is required for this function to behave correctly.
2033 * src/closure.h (closure): Mention sorting.
2034
2a6b783d
JD
20352007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
2036
2037 * src/lalr.c (state_lookahead_tokens_count): For code readability,
2038 move the check for disabled transitions to an aver since conflict
2039 resolution hasn't happened yet.
2040
2041 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
2042 labels a state as inconsistent just because it has error transitions.
2043 The original form of this check appeared in revision 1.1 of lalr.c,
2044 which was committed on 1991-12-21. Now (at least), changing the
2045 consistency label on such a state appears to have no useful effect in
2046 any of the places it is examined, which I enumerate below. The key
2047 point to understanding each item in this enumeration is that a state
2048 with an error transition is labelled consistent in the first place only
2049 if it has no rules, so the check cannot matter for states that have
2050 rules. (1) Labelling a state as inconsistent will cause set_conflicts
2051 to try to identify its conflicts, and a state must have *rules* to have
2052 conflicts. (2) Labelling a state as inconsistent will affect how
2053 action_row sets the default *rule* for the state. (3) Labelling a
2054 state as inconsistent will cause build_relations to add lookback edges
2055 to *rules* in that state.
2056 * src/state.h (struct state): Word the comment for member consistent
2057 more carefully.
2058
14462c2b
JD
20592007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2060
2061 Don't depend on C99 features.
2062 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
2063 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
2064 * src/reader.c (check_and_convert_grammar): Fix for-loop.
2065 * src/state.c (state_mark_reachable_states): Fix for-loop.
2066 (state_remove_unreachable_states): Fix for-loop.
2067
2068 Don't widen struct state with member reachable just to temporarily
2069 record reachability. Instead, use a local bitset.
2070 * src/state.h (struct state): Remove member.
2071 * src/state.c (state_new): Don't initialize it.
2072 (state_mark_reachable_states): Rename to...
2073 (state_record_reachable_states): ... this, and use bitset.
2074 (state_remove_unreachable_states): Use bitset.
2075
5a43d418
JD
20762007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
2077
2078 * src/Makefile.am (yacc): Quote target action commands properly so
2079 that the yacc script isn't corrupt. Reported by Hans Aberg at
2080 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
2081
0c650a20
JD
2082 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
2083 the case of pure parsers. Reported by Frans Englich at
2084 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
2085 * THANKS: Add Frans Englich.
2086
61fee93e
JD
2087 * NEWS (2.3a+): In the %code entry, reference section `Bison
2088 Declaration Summary' from the manual now since the %code summary has
2089 moved there.
2090 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
2091 in the rules section must be terminated by semicolons.
2092
f124d423
JD
20932007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2094
2095 Extend the front-end API for %define variables to more completely
2096 mirror the back-end. This will be useful in the future.
2097 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
2098 Update comments to mention the new front-end counterparts of these
2099 macros.
2100 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
2101 for muscle_string_decode and muscle_location_decode.
2102 (muscle_string_decode): New static function.
2103 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
2104 (muscle_percent_define_get, muscle_percent_define_ifdef): New
2105 functions.
2106 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
2107 muscle_percent_define_get to mimic the b4_percent_define_flag_if
2108 implementation more closely.
2109 (muscle_percent_define_invalid_value): New function.
2110 * src/muscle_tab.h (muscle_percent_define_get,
2111 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
2112 Prototype.
2113
75ad86ee
JD
21142007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2115
2116 * NEWS (2.3a+): Mention yesterday's state-removal change.
2117 (2.3a): Remove the %language entry, which was added after 2.3a.
2118 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
2119 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
2120 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
2121 tests/existing.at: Update copyright date.
2122
5967f0cf
JD
21232007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2124
2125 If conflict resolution makes states unreachable, remove those states,
2126 report rules that are then unused, and don't report conflicts in those
2127 states.
2128 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
2129 New global function.
2130 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
2131 function.
2132 * src/main.c (main): After conflict resolution, remove the unreachable
2133 states and update all data structures that reference states by number.
2134 * src/state.c (state_new): Initialize each state's reachable member to
2135 false.
2136 (state_mark_reachable_states): New static function.
2137 (state_remove_unreachable_states): New global function.
2138 * src/state.h (struct state): Add member bool reachable.
2139 (state_remove_unreachable_states): Prototype.
2140 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2141 New test case.
2142 * tests/existing.at (GNU pic Grammar): Update test case output now that
2143 an unused rule is discovered.
2144
b09f4f48
JD
21452007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2146
2147 Minor code cleanup in parser table construction.
2148 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
2149 (new_itemsets, save_reductions): Update for rename to nitemset.
2150 * src/closure.c (nritemset): Rename to...
2151 (nitemset): ... this since the "r" appears to meaningless and isn't
2152 used in the comments.
2153 (closure): Update for rename.
2154 * src/closure.h (nritemset): Update extern to...
2155 (nitemset): ... this.
2156 * src/lalr.c (LA): Fix a typo in comments.
2157 * src/print.c (print_core): Update for rename to nitemset.
2158 * src/print_graph.c (print_graph): Likewise.
2159 * src/state.h: Fix some typos in header comments.
2160
bbb44d83
PE
21612007-04-04 Paul Eggert <eggert@cs.ucla.edu>
2162
9b33de72
PE
2163 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
2164 still sticks to ASCII. Sorry!
2165
bbb44d83
PE
2166 * README-hacking: New file, taken mostly from coreutils, with changes
2167 for Bison. Contains much of the contents of:
2168 * README-cvs: Remove.
2169 * bootstrap: Sync from gnulib.
2170 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
2171 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
2172
29553547
JD
21732007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
2174
2175 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
2176 Setzer.
2177 (Java Differences): Fix some typos.
2178 * THANKS: Add Sebastian Setzer.
2179
01b477c6
PB
21802007-03-07 Paolo Bonzini <bonzini@gnu.org>
2181
730739e4
AD
2182 * data/java.m4 (b4_single_class_if): Remove.
2183 (b4_abstract_if): Look at "%define abstract".
2184 (b4_lexer_if): New.
2185 (b4_union_name): Rename...
2186 (b4_yystype): ... to this. Map to "%define stype".
2187 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
2188 b4_maybe_throws): Fix quoting.
2189 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
2190 * data/lalr1.java (Lexer interface): Always define.
2191 (Lexer interface within parser class): Remove.
2192 (YYLexer class): New, used when "%code lexer" is present.
2193 (constructor): When "%code lexer" is used, pass %lex-param
2194 to the lexer constructor.
2195 (yylex, yyparse): Remove %lex-param from method invocations
2196 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
2197
2198 * doc/bison.texinfo (Java Bison Interface): Mention "%define
2199 abstract". Rename "%define union_name" to "%define stype".
2200 Rename method names according to previous patch.
2201 (Java Scanner Interface): Describe "%code lexer" instead of
2202 "%pure-parser" and "%define single_class".
2203 (Java Differences): Mention "%code lexer".
2204
2205 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
2206 Include scanner here, using macros from tests/local.at.
2207 (AT_DATA_CALC_Y): Remove final argument.
2208 (_AT_CHECK_JAVA_CALC): Likewise.
2209 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
2210 of %locations and %error-verbose.
2211 (main): Test with and without %lex-param.
2212 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
2213 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 2214
122bea3a
JMG
22152007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2216
2217 DJGPP spefic issue. Inhibit the use of disallowed characters for
2218 file name genertion on Win98, WinXP, etc. These are |<>":?*\
2219 and concern testsuite case 46.
2220 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
2221 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
2222 * djgpp/config.bat: Inhibit the use of disallowed characters.
2223
9611cfa2
JD
22242007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2225
2226 Miscellaneous %define and %code cleanup.
2227 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
2228 values are interpreted.
2229 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
2230 documentation a little more.
2231 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
2232 muscle_percent_define_insert, muscle_percent_code_grow): New
2233 functions/macros.
2234 * src/muscle_tab.h (muscle_percent_define_insert,
2235 muscle_percent_code_grow): Prototype.
2236 * src/parse-gram.y (prologue_declaration): Use
2237 muscle_percent_define_insert and muscle_percent_code_grow when parsing
2238 %define and %code directives.
2239
2240 Make it easy to share %define boolean variables between the front-end
2241 and back-end. Though not used yet, this will be useful in the future.
2242 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
2243 Bison uses of names rather than just skeleton uses of names.
2244 (b4_percent_define_get, b4_percent_define_ifdef): Rename
2245 b4_percent_define_skeleton_variables(VARIABLE) to
2246 b4_percent_define_bison_variables(VARIABLE).
2247 (b4_percent_code_get, b4_percent_code_ifdef): Rename
2248 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
2249 b4_percent_code_bison_qualifiers(QUALIFIER).
2250 (b4_check_user_names_wrap): Update for renames.
2251 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
2252 muscle_percent_define_default): New functions mimicking
2253 b4_percent_define_flag_if and b4_percent_define_default.
2254
2255 For %define variables, report locations for invalid values and
bbb44d83 2256 redefinitions.
9611cfa2
JD
2257 * data/bison.m4 (b4_percent_define_flag_if): Read
2258 b4_percent_define_loc(VARIABLE) to report the location of an invalid
2259 value for VARIABLE.
2260 (b4_percent_define_default): Save a special location in
2261 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
2262 must later be reported as invalid.
2263 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
2264 functions.
2265 (muscle_percent_define_insert): Record the location of VARIABLE in
2266 muscle percent_define_loc(VARIABLE), and use it to report the previous
2267 location for a redefinition.
2268 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
2269 (muscle_percent_define_default): Update like b4_percent_define_default.
2270 (muscle_grow_user_name_list): Rename to...
2271 (muscle_user_name_list_grow): ... this for consistency and use
2272 muscle_location_grow.
2273 * src/muscle_tab.h (muscle_location_grow): Prototype.
2274 * tests/input.at (%define errors): Update expected output.
2275 * tests/skeletons.at (%define boolean variables: invalid skeleton
2276 defaults): New test case.
2277
0bf92491
JD
22782007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
2279
2280 * src/print.c (lookahead_set, state_default_rule): Remove.
2281 (print_reductions): Replace state_default_rule invocation with
2282 equivalent use of yydefact, which was computed in token_actions in
2283 tables.c.
2284 (print_results): Don't allocate lookahead_set.
2285
d3b12988
PB
22862007-02-27 Paolo Bonzini <bonzini@gnu.org>
2287
2288 * data/lalr1.java: Prefix all private members with yy.
2289
f57a7536
JD
22902007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
2291
2292 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 2293 Sebastien Fricker at
f57a7536 2294 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 2295 * THANKS: Add Sebastien Fricker.
f57a7536
JD
2296 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
2297 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
2298 accept a variable number of arguments.
2299
6404a5bf
JD
23002007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2301
2302 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
2303
e4e09639
JMG
23042007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2305
2306 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
2307 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
2308 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
2309
d7e0a1a7
PE
23102007-02-11 Paul Eggert <eggert@cs.ucla.edu>
2311
2312 Undo my 2007-02-07 change, switching back to the c-strcase module
2313 introduced in the 2007-02-03 change. Bruno Haible reported that
2314 the 2007-02-07 change would be dangerous in Turkish if we add a
2315 language whose name contains "i", since "i" is not lowercase "I"
2316 in Turkish.
2317 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
2318 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
2319 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
2320 * m4/.cvsignore: Remove strcase.m4.
2321 * src/getargs.c: Revert 2007-02-07 change, as follows.
2322 Include c-strcase.h.
2323 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
2324
deee93a1
JD
23252007-02-11 Bruno Haible <bruno@clisp.org>
2326
2327 Enable the Java related testsuite tests when the only Java compiler
2328 found is a gcj < 4.3. Discussed at
2329 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
2330 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
2331
574add85
JD
23322007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
2333
2334 * data/Makefile.am: Update copyright date.
2335 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
2336 yypstate_new returns NULL.
2337 (yypstate_new): Return NULL if malloc does.
2338 * src/reader.c (packgram): Move translation of rule actions from the
2339 beginning of packgram to...
2340 (check_and_convert_grammar): ... here right before packgram is invoked
2341 so it's easier to write more complete comments, and remove redundant
2342 code.
2343
e785ccf7
JD
23442007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
2345
2346 As in semantic actions, make @$ in %initial-action, %destructor, and
2347 %printer imply %locations.
2348 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
2349 scanning @$.
2350 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
2351 (@$ in %initial-action implies %locations,
2352 @$ in %destructor implies %locations,
2353 @$ in %printer implies %locations): ... these new test cases.
2354
1cfe1ed7
PE
23552007-02-07 Paul Eggert <eggert@cs.ucla.edu>
2356
2357 Undo most of the 2007-02-03 change, switching to the strcase module
2358 now that gnulib strcase has been fixed.
2359 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
2360 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
2361 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
2362 * m4/.cvsignore: Add strcase.m4.
2363 * src/getargs.c: Revert 2007-02-03 change, as follows.
2364 Don't include c-strcase.h.
2365 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
2366 strcasecmp has "unspecified behavior" outside the POSIX locale,
2367 but it works fine in practice if at least one argument is ASCII,
2368 as is the case in Bison.
2369
0049ec86
PB
23702007-02-07 Paolo Bonzini <bonzini@gnu.org>
2371
2372 * tests/java.at: Skip tests if only one of javac/java is present.
2373 Reported by Joel E. Denny.
2374 * tests/atlocal.in: Adjust copyright years.
2375
23762007-02-05 Paolo Bonzini <bonzini@gnu.org>
2377
2378 * data/lalr1.java (Stack): Work around old verifiers that disallow
2379 access to the private fields of an inner class, from the outer class.
2380 We can make Stack's fields public because user code doesn't have access
2381 to the instance of Stack used by parse(). Reported by Paul Eggert.
2382
2c2b7220
PE
23832007-02-03 Paul Eggert <eggert@cs.ucla.edu>
2384
2385 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
2386 the right spot for these files?
2387 * bootstrap.conf (gnulib_modules): Add c-strcase.
2388 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
2389 c-strncasecmp.c.
2390 * src/getargs.c: Include c-strcase.h.
2391 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
2392 to avoid unspecified behavior.
2393
b2b81dae
JD
23942007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
2395
2396 * doc/bison.texinfo (Decl Summary): Correct typo.
2397
c1d19e10
PB
23982007-01-30 Paolo Bonzini <bonzini@gnu.org>
2399
2400 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
2401 Complain if the value does not match empty, "true" or "false".
2402 * data/c++.m4: Adjust default definitions of %define variables.
2403 * data/java.m4: Adjust default definitions of %define variables.
2404 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
2405 to above behavior.
2406 * tests/input.at (Boolean %define variables): Test new behavior.
2407
8405b70c
PB
24082007-01-29 Paolo Bonzini <bonzini@gnu.org>
2409
2410 * NEWS: Mention java.
2411 * TODO: Remove things that are done.
2412 * bootstrap.conf: Add javacomp-script and javaexec-script.
2413 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
2414
2415 * data/Makefile.am: Add new files.
2416 * data/java-skel.m4: New.
2417 * data/java.m4: New.
2418 * data/lalr1.java: New.
2419
2420 * doc/bison.texinfo: Put "A Complete C++ Example" under
2421 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
2422 under Other Languages.
2423
2424 * src/getargs.c (valid_languages): Add Java.
2425 * src/getargs.h (struct bison_language): Update size of string fields.
2426
2427 * tests/Makefile.am: Add java.at.
2428 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
2429 * tests/java.at: New.
2430 * tests/testsuite.at: Include it.
2431
3eb82471
JD
24322007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
2433
2434 Clean up.
2435 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
2436 at_directive_argv arguments so these no longer have to be global
2437 variables. Also, update the implementation for the following changes.
2438 (fail_for_at_directive_too_many_args,
2439 fail_for_at_directive_too_few_args): Add at_directive_name argument.
2440 (at_directive_name): Remove as at_directive_argv[0] will be used for
2441 this now.
2442 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
2443 for the directive name.
2444 (at_directive_argc, at_directive_argv): Make these local within
2445 skel_lex instead of global.
2446 (INITIAL): Update directive start action for above changes.
2447 (SC_AT_DIRECTIVE_ARG): Rename to...
2448 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
2449 (SC_AT_DIRECTIVE_SKIP_WS): Update.
2450 (scan_skel): Move yylex_destroy to...
2451 (skel_scanner_free): ... here.
2452 * tests/skeletons.at (installed skeleton file name): Rename to...
2453 (installed skeleton file names): ... this.
2454
148d66d8
JD
24552007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
2456
2457 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2458 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
2459 Summary" not "Directives".
2460 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
2461 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
2462 since the former is now the more complete one.
2463 (Prologue Alternatives): Likewise and do the same for %defines.
2464 (Table of Symbols): Add summary of %code, add summary of %define, and
2465 move full %code documentation to...
2466 (Decl Summary): ... here for consistency with other entries in these
2467 sections.
2468 Move %define entry in order to keep this list alphabetized.
2469 Reword %define entry a little to put less emphasis on the skeleton
2470 concept, which most users shouldn't have to think about.
2471
665f0c24
PE
24722007-01-26 Paul Eggert <eggert@cs.ucla.edu>
2473
2474 Adjust to recent gnulib changes.
2475 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
2476 Add string.h, string_.h, unistd_.h, wchar_.h.
2477 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
2478 * src/system.h: Don't include <stpcpy.h>; this is now done by
2479 <string.h>.
2480
592d0b1e
PB
24812007-01-23 Paolo Bonzini <bonzini@gnu.org>
2482
2483 Simplify implementation of unqualified %code, implement macros for
2484 uniform treatment of boolean %define flags. Document %define.
2485 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
2486 b4_percent_code_ifdef): New.
2487 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
2488 * data/c++.m4: Define default value for global_tokens_and_yystype.
2489 * data/glr.cc: Likewise.
2490 * data/location.cc: Use b4_percent_define_flag_if.
2491
148d66d8 2492 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
2493
2494 * src/parse-gram.y (Unqualified %code): Change muscle name to
2495 b4_percent_code().
2496 (content.opt): Default to empty.
2497
a7867f53
JD
24982007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
2499
2500 Implement support for relative and absolute skeleton file names.
2501 Discussed starting at
2502 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
2503 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
2504 (Bison Options): Document in --skeleton entry.
2505 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
2506 full_skeleton can't necessarily hold all of pkgdatadir.
2507 If the specified skeleton file name contains a `/', don't prepend
2508 pkgdatadir.
2509 * src/parse-gram.y (prologue_declaration): If the specified skeleton
2510 file name contains a `/', prepend the grammar file directory.
2511 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
2512 * skeletons.at: New file.
2513 (relative skeleton file names): New test case.
2514 (installed skeleton file names): New test case.
2515 * tests/testsuite.at: Include skeletons.at.
2516
2517 * bootstrap: Update copyright to 2007.
2518
830c9b18
PB
25192007-01-17 Paolo Bonzini <bonzini@gnu.org>
2520
2521 * bootstrap: Remove occurrences of .#bootmp from the files.
2522
a8c2e813
AD
25232007-01-17 Akim Demaille <akim@epita.fr>
2524
2525 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
2526 nonterminals.
2527 Use per-type %printer.
2528
279cabb6
JD
25292007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
2530
2531 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
2532 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2533 djgpp/config.site, src/files.c, src/files.h, src/main.c,
2534 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
2535 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
2536 tests/glr-regression.at, tests/input.at, tests/local.at,
2537 tests/output.at, tests/torture.at: Update copyright to 2007.
2538
bb32f4f2
AD
25392007-01-16 Akim Demaille <akim@epita.fr>
2540
2541 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
2542 error code.
2543 (Calc++ Scanner): Exit with failure if we can't open the input
2544 file.
2545 Accept "-" standing for stdin.
2546 (Calc++ Top Level): Print the result only if the parsing was
2547 successful.
2548
7cff04b5
AD
25492007-01-16 Akim Demaille <akim@epita.fr>
2550
2551 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
2552
a4e25e1d
JD
25532007-01-15 Paolo Bonzini <bonzini@gnu.org>
2554 and Joel E. Denny <jdenny@ces.clemson.edu>
2555
2556 Clean up %define and %code implementation in M4 some. Most
2557 importantly, rename all related macros to be in the b4_percent_define
2558 and b4_percent_code namespaces. Also, complete support for `.' in
2559 %define variable names and %code qualifiers.
2560 * data/bison.m4 (b4_check_user_names): Check for special
2561 "SKELETON-NAMESPACE(name)" macros instead of using two nested
2562 m4_foreach loops.
2563 (b4_get_percent_define, b4_get_percent_code): Rename to...
2564 (b4_percent_define_get, b4_percent_code_get): ... these.
2565 Extend documentation with examples.
2566 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
2567 b4_percent_define_skeleton_variables and
2568 b4_percent_code_skeleton_qualifiers.
2569 Expect any value for the %define variable `foo' to be stored in the
2570 macro named `b4_percent_define(foo)'; expect any %code blocks for the
2571 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
2572 expect any unqualified %code blocks to be stored in a macro named
2573 `b4_percent_code_unqualified'.
2574 Use m4_indir so that %define variable names and %code qualifiers can
2575 contain `.', which is allowed by the grammar parser.
2576 (b4_percent_define_default): New macro to set a default value for a
2577 %define variable.
2578 (m4_wrap): Update wrapped code, and fix some underquoting.
2579 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
2580 Expect grammar uses of %define variables and %code qualifiers to be
2581 defined in b4_percent_define_user_variables and
2582 b4_percent_code_user_qualifiers.
2583 * data/c++.m4: Use b4_percent_define_default rather than
2584 m4_define_default. Fix some underquoting. Skeleton usage of %define
2585 variable define_location_comparison now implies skeleton usage of
2586 %define variable filename_type.
2587 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2588 data/push.c, data/yacc.c: Update macro names.
2589 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
2590 muscle names.
2591
e37c665c
JMG
25922007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2593
2594 DJGPP specific issues.
2595
2596 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
2597 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
2598
7d2d521f
JD
25992007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
2600
2601 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
2602 run parsers in all tests so that Valgrind is invoked during
2603 maintainer-check-valgrind.
2604 (Duplicate representation of merged trees): Free all semantic values.
2605 (Duplicated user destructor for lookahead): Likewise.
2606
e0ac9b4b
JD
26072007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
2608
2609 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
2610 command-line prefix.
2611 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
2612 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
2613 miss Valgrind messages.
2614 (Exploding the Stack Size with Malloc): Likewise.
2615
78143faa
JD
26162007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
2617
2618 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
2619 locals. Reported by Juan Manuel Guerrero at
2620 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
2621 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
2622 Fix some indentation also.
2623 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
2624 explaining this issue.
2625
7ecec4dd
JD
26262007-01-09 Paolo Bonzini <bonzini@gnu.org>
2627 and Joel E. Denny <jdenny@ces.clemson.edu>
2628
2629 Simplify union and prologue handling, and escape union and lex/parse
2630 params with digraphs.
2631 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
2632 values to the empty string since these are no longer guaranteed
2633 initialized by the front-end.
2634 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
2635 braces around b4_user_stype since this is no longer done by the
2636 front-end.
2637 * src/files.c, src/files.h (pre_prologue_obstack,
2638 post_prologue_obstack): Remove.
2639 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
2640 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
2641 with digraphs. This fixes lex params and parse params.
2642 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
2643 * src/output.c (prepare): Remove muscle insertion of the prologues.
2644 (output): Remove freeing of pre_prologue_obstack and
2645 post_prologue_obstack.
2646 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
2647 than prologue_augment for prologue parsing so you don't need prologue
2648 obstacks.
5c80250c
JD
2649 (grammar_declaration): For %union RHS, use `braceless' instead of
2650 "{...}" so that braces are already stripped and code is escaped with
2651 digraphs.
7ecec4dd
JD
2652 * src/reader.c (prologue_augment): Remove.
2653 (reader): Remove initialization of pre_prologue_obstack and
2654 post_prologue_obstack.
2655 * src/reader.h (prologue_augment): Remove.
2656
2657 * data/c.m4: Remove stray parenthesis.
2658
16dc6a9e
JD
26592007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2660
2661 Remove quotes from variables names in %define directives and from
2662 qualifiers in %code directives, and restrict the characters that are
2663 allowed in them to M4-friendly ones. For %define, continue to support
2664 the quoted form as a deprecated feature. Discussed starting at
2665 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
2666 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
2667 %code.
2668 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
2669 (Decl Summary): In %defines entry, update mention of `%code requires'
2670 and `%code provides'.
16dc6a9e
JD
2671 (C++ Location Values): Update %define uses.
2672 (Calc++ Parser Interface): Likewise.
2673 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 2674 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
2675 * src/parse-gram.y (prologue_declaration): For %define variables, use
2676 `variable' instead of `STRING'.
2677 (grammar_declaration): For %code qualifiers, use `ID' instead of
2678 `STRING'.
2679 (variable): New nonterminal that takes an `ID' or a `STRING'.
2680 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
2681 and %define uses.
2682 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
2683 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
2684 (%define errors): Update %define uses.
2685
e9813cd4
JD
26862007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2687
2688 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
2689 instead of muscle_insert for %define values so that M4-special
2690 characters are replaced with digraphs.
2691 * tests/input.at (%define errors): Extend to check weird values.
2692
6afc30cc
JD
26932007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2694
2695 Instead of having skeletons declare all valid %define variables and
2696 %code qualifiers, provide macros that retrieve the associated values
2697 and build these lists automatically. Thus Bison will now warn when a
2698 variable or qualifier is not used by the skeleton in the current
2699 invocation regardless of whether it might sometimes be used by that
2700 skeleton in other invocations. Also, move all %define value macros to
2701 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
2702 form, which is replaced by %code.
2703 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
2704 (b4_check_user_names): ... this, and change the series of valid name
2705 arguments to a single list argument for names used in the skeleton
2706 similar to the existing list argument for names used in the grammar.
2707 Warn instead of complaining.
2708 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
2709 values and %code code, to format %code code properly, and to build
2710 lists of all %define variables and %code qualifiers used in the
2711 skeleton: b4_skeleton_percent_define_variables and
2712 b4_skeleton_percent_code_qualifiers.
2713 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
2714 Remove, and...
2715 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
2716 the skeleton names lists can finish building first. In place of
2717 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
2718 expect the lists b4_user_percent_define_variables and
2719 b4_user_percent_code_qualifiers.
2720 * data/c++.m4: Where setting default values for b4_parser_class_name,
2721 b4_location_type, b4_filename_type, b4_namespace, and
2722 b4_define_location_comparison, update their names to the
2723 b4_percent_define_ namespace.
2724 * data/glr.c: Don't use b4_check_percent_define_variables and
2725 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
2726 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
2727 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 2728 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
2729 * data/location.cc: Use b4_get_percent_define.
2730 * data/push.c: Don't use b4_check_percent_define_variables and
2731 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
2732 * data/yacc.c: Likewise, and don't call m4_exit in
2733 b4_use_push_for_pull_if or m4_wrap code will never execute.
2734 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
2735 Rename to...
2736 (muscle_grow_user_name_list): ... this for consistency with the
2737 terminology used in bison.m4.
2738 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
2739 %define variable names, and rename muscle used_percent_define_variables
2740 to user_percent_define_variables.
2741 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
2742 user_percent_code_qualifiers.
2743 (content): Remove.
2744 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
2745 {CODE} form is no longer accepted.
2746 * tests/input.at (Reject bad %code qualifiers): Rename to...
2747 (Reject unused %code qualifiers): ... this, and update test output.
2748 (%define error): Update test output.
2749
7eb8a0bc
JD
27502007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
2751
2752 Check for unrecognized %define variables similar to checking for
2753 unrecognized %code qualifiers. Check for redefined %define variables.
2754 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
2755 generalizes...
2756 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
2757 (b4_check_percent_define_variables): New, also wraps it.
2758 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
2759 variables using b4_check_percent_define_variables.
2760 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
2761 all those exercised in the test suite and all those listed in the
2762 `Default values' section of c++.m4. Are there others?
2763 * data/push.c, data/yacc.c: Declare no valid %define variables.
2764 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
2765 similar to muscle_find, but it works even when the muscle stores a
2766 const value.
2767 (muscle_grow_used_name_list): New function for constructing the used
2768 name list muscles that b4_check_for_unrecognized_names requires.
2769 * src/parse-gram.y (prologue_declaration): Warn if a variable is
2770 %define'd more than once. Define the b4_used_percent_define_variables
2771 muscle with muscle_grow_used_name_list.
2772 (grammar_declaration): Abbreviate %code code with
2773 muscle_grow_used_name_list.
2774 * tests/input.at (%define errors): New.
2775
3fc65ead
JD
27762007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2777
2778 Provide warn_at, complain_at, and fatal_at function callbacks to the
2779 skeletons, and use this for %code qualifier complaints.
2780 * data/bison.m4 (b4_error_at): New, invoked by...
2781 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
2782 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
2783 @fatal_at(...@) directives.
2784 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
2785 qualifiers in b4_used_percent_code_qualifiers and to use
2786 b4_complain_at.
2787 * src/location.c, src/location.h (boundary_set_from_string): New global
2788 function.
2789 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
2790 function.
2791 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
2792 to b4_used_percent_code_qualifiers.
2793 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
2794 function.
2795 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
2796 (lineno): Rename to...
2797 (out_lineno): ... this so I don't misunderstand it again.
2798 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
2799 here; these newlines are in the input but not the output file.
2800 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
2801 (at_directive_perform): ... this new static function, and add handling
2802 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
2803 directives.
2804 * tests/input.at (Reject bad %code qualifiers): Update test output with
2805 locations and extend.
2806
2807 * tests/output.at (Output file name: [, Output file name: ]): Remove
2808 bogus comment about these tests failing.
2809
1c7b7e1d
JD
28102007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2811
2812 Clean up b4_check_percent_code_qualifiers a little.
2813 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
2814 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
2815 documentation and add examples.
2816 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
2817 qualifiers here.
2818
08af01c2
JD
28192007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2820
2821 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
2822 unreliable -- especially when they're hidden inside another macro.
2823 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
2824 data/c.m4: Remove m4_divert(-1).
2825 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2826 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
2827 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 2828 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
2829 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
2830 pushed and popped by m4sugar, should be first on the stack.
2831
2832 Provide warn, complain, and fatal function callbacks to the skeletons.
2833 This provides more flexibility than m4_fatal, improves the error
2834 message format, and captures messages for translation. Discussed
2835 starting at
2836 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
2837 * data/bison.m4 (b4_error): New, invoked by...
2838 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
2839 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
2840 directives. Because these M4 macros might be called when the current
2841 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
2842 the previous removal of uses of m4_divert, which caused trouble.
2843 (b4_check_percent_code_qualifiers): Use b4_complain instead of
2844 m4_fatal to report unrecognized %code qualifiers.
2845 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
2846 push parser requests.
2847 * data/glr.c: Use b4_complain instead of m4_fatal to report
2848 non-deterministic push parser requests.
2849 Update @output usage to @output(...@) form.
2850 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
2851 report missing %defines. Update @output usage to @output(...@) form.
2852 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
2853 @output(...@) form.
2854 * src/main.c (main): Invoke skel_scanner_free.
2855 * src/scan-skel.h (skel_scanner_free): Prototype new function.
2856 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
2857 obstack_for_string from flex-scanner.h.
2858 (YY_DECL): Use to declare skel_lex static.
2859 (decode_at_digraphs): Remove; now handled in the new
2860 SC_AT_DIRECTIVE_ARG start condition.
2861 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
2862 functions.
2863 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
2864 at_directive_argv): New static globals.
2865 (INITIAL): Use fail_for_invalid_at.
2866 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
2867 recognize the start of a generalized `@directive(...@)' form and
2868 start...
2869 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
2870 directive args (using the new obstack_for_string), to decode the
2871 contained @ diagraphs, and to perform the directive. It recognizes
2872 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
2873 @output(...@).
2874 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
2875 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
2876 `@,'.
2877 (scan_skel): Initialize obstack_for_string on the first call.
2878 (skel_scanner_free): New function to free obstack_for_string.
2879 * tests/input.at (Reject bad %code qualifiers): Update test output.
2880
8e0a5e9e
JD
28812007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
2882
2883 Consolidate the 4 prologue alternative directives (%code, %requires,
2884 %provides, and %code-top) into a single %code directive with an
2885 optional qualifier field. Discussed at
2886 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
2887 * NEWS (2.3a+): Rewrite the existing entry for the prologue
2888 alternatives.
2889 * doc/bison.texinfo (Prologue Alternatives): Update.
2890 (Decl Summary): Update to %code "requires" and %code "provides".
2891 (Calc++ Parser): Update to %code "requires".
148d66d8 2892 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
2893 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
2894 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
2895 are replaced by b4_percent_code_provides and b4_percent_code_requires,
2896 which are skeleton-specific.
2897 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
2898 declare what %code qualifiers it supports and to complain if any other
2899 qualifiers were used in the grammar.
2900 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
2901 and b4_user_code([b4_percent_code_provides]) in place of
2902 b4_user_requires and b4_user_provides.
2903 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
2904 Add b4_user_code([b4_percent_code_top]) and
2905 b4_user_code([b4_percent_code]).
2906 Invoke b4_check_percent_code_qualifiers.
2907 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2908 PERCENT_REQUIRES): Remove.
2909 (grammar_declaration): Remove RHS's for %code-top, %provides, and
2910 %requires. Rewrite the %code RHS as the unqualified form defining the
2911 muscle b4_percent_code. Add another RHS for the qualified %code form,
2912 which defines muscles of the form b4_percent_code_QUALIFIER and the
2913 b4_used_percent_code_qualifiers muscle.
2914 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2915 PERCENT_REQUIRES): Remove.
2916 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
2917 %code "requires" and %code "provides".
2918 * tests/input.at (Reject bad %code qualifiers): New.
2919
95021767
JD
29202007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2921
2922 Use the new code_props interface for destructors and printers.
2923 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
2924 printer_location members, and change the type of the destructor and
2925 printer members to code_props.
2926 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
2927 symbol_printer_get, semantic_type_destructor_set,
2928 semantic_type_printer_set, default_tagged_destructor_set,
2929 default_tagless_destructor_set, default_tagged_printer_set,
2930 default_tagless_printer_set): Use code_props in arguments and return
2931 types in place of char const * and location.
2932 (symbol_destructor_location_get, symbol_printer_location_get): Remove
2933 since the locations are now contained in the return of
2934 symbol_destructor_get and symbol_printer_get.
2935 * src/output.c (symbol_destructors_output, symbol_printers_output):
2936 Replace with...
2937 (symbol_code_props_output): ... this to eliminate duplicate code.
2938 (output_skeleton): Update to use symbol_code_props_output.
2939 * src/reader.c (symbol_should_be_used): Update use of
2940 symbol_destructor_get.
2941 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2942 Update uses of the various _destructor_set and _printer_set functions.
2943 * src/symtab.c: (default_tagged_destructor_location,
2944 default_tagless_destructor_location, default_tagged_printer_location,
2945 default_tagless_printer_location): Remove since we...
2946 (default_tagged_destructor, default_tagless_destructor,
2947 default_tagged_printer, default_tagless_printer): ... change the type
2948 of these to code_props.
2949 (symbol_new, semantic_type_new, symbol_destructor_set,
2950 semantic_type_destructor_set, symbol_destructor_get,
2951 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
2952 symbol_check_alias_consistency, default_tagged_destructor_set,
2953 default_tagless_destructor_set, default_tagged_printer_set,
2954 default_tagless_printer_set): Update.
2955 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
2956 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
2957 code_props members.
2958 (symbol_print): Use SYMBOL_CODE_PRINT.
2959
f6857bbf
JD
29602007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2961
2962 Use the new code_props interface for rule actions.
2963 * src/symlist.h (symbol_list): Replace action, action_location, and
2964 used members with a code_props action_props member.
2965 * src/reader.c (symbol_should_be_used, grammar_rule_check,
2966 grammar_midrule_action, grammar_current_rule_merge_set,
2967 grammar_current_rule_symbol_append, packgram): Update.
2968 * src/scan-code.h (translate_rule_action): Remove, no longer used.
2969 * src/scan-code.l (handle_action_dollar): Update.
2970 (translate_rule_action): Remove, no longer used.
2971 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
2972
7c0c6181
JD
29732007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2974
2975 Use the new code_props interface in parse-gram.y.
2976 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
2977 Update all uses of translate_* functions to use the new code_props
2978 interface and to use gram_scanner_last_string_free and
2979 code_scanner_last_string_free where possible.
2980 (grammar_declaration): symbol_list_destructor_set and
2981 symbol_list_printer_set now perform the translation, so don't do it
2982 here. Use gram_scanner_last_string_free where possible.
2983 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
2984 translate_code): Remove, no longer used.
2985 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
2986 symbol_list_printer_set): Perform code translation here rather than
2987 depending on the caller to do so.
2988
2989 * src/symlist.h (struct symbol_list): Correct some documentation typos.
2990 * src/scan-gram.h (gram_last_string): Remove declaration.
2991 * src/scan-gram.l (last_string): Declare it static.
2992
28e52c0d
JD
29932007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2994
2995 Encapsulate code properties and related functionality for the various
2996 destructors, printers, and actions into a code_props structure and
2997 interface. This patch merely implements code_props in scan-code.h and
2998 scan-code.l. Future patches will rewrite other modules to use it.
2999 Discussed starting at
3000 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
3001 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
3002 consistently initialize const structs that have an empty location
3003 field.
3004 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
3005 to ensure consistency.
3006 * src/scan-code.h (code_props): New structure.
3007 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
3008 function, macro, and const global variable for initializing a
3009 code_props with no code.
3010 (code_props_plain_init, code_props_symbol_action_init,
3011 code_props_rule_action_init, code_props_translate_code): The rest of
3012 the new code_props functional interface. Among other things, the init
3013 functions set the code_props kind field so that
3014 code_props_translate_code will know whether to behave like
3015 translate_symbol_action, translate_rule_action, or translate_code.
3016 These old translate functions must remain until all other modules are
3017 updated to use the new code_props interface.
3018 (code_scanner_last_string_free): New function similar to
3019 gram_scanner_last_string_free.
3020 (code_scanner_free): Add documentation.
3021 * src/scan-code.l: Implement the new interface.
3022 (code_lex): Make it static, add a code_props* argument, and remove the
3023 rule argument.
3024 (last_string): New static global similar to the one in scan-gram.l.
3025 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
3026 instead of rule.
3027 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
3028 code_props since Bison may one day use this information for destructors
3029 and printers.
3030 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
3031 (handle_action_dollar): Use symbol_list_n_get and set used flag
3032 directly since symbol_list_n_used_set is removed.
3033 (translate_action): Add a code_props* argument and remove the rule,
3034 action, and location arguments. Pass the code_props* on to code_lex.
3035 (translate_rule_action, translate_symbol_action, translate_code):
3036 Rewrite as wrappers around the new code_props interface.
3037 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
3038 it would eventually need to break the encapsulation of code_props.
3039
96034983
JD
30402007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3041
3042 * etc/.cvsignore: New.
3043
945e396c
JD
30442007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3045
3046 Add maintainer-push-check to run maintainer-check using push parsing in
3047 place of pull parsing where available.
3048 * Makefile.am (maintainer-push-check): New.
3049 * data/bison.m4 (b4_use_push_for_pull_if): New.
3050 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
3051 appropriately based on their existing values.
3052 (yypush_parse): Don't print push-parser-specific diagnostics if push
3053 parsing is being used in place of pull parsing.
3054 * data/yacc.c: If push parsing should replace pull parsing, redirect to
3055 push.c.
3056 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
3057 variable, and insert b4_use_push_for_pull_flag into muscles.
3058 * tests/Makefile.am (maintainer-push-check): New.
3059
7d596384
JD
30602006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3061
3062 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
3063 (whether successful or failed) so that yypush_parse can be invoked
3064 again to start a new parse using the same yypstate.
3065 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
3066 check multiple yypull_parse invocations on the same yypstate. For pull
3067 mode, extend to check multiple yyparse invocations.
3068 (Exploding the Stack Size with Alloca): Extend to try with
3069 %push-pull-parser.
3070 (Exploding the Stack Size with Malloc): Likewise.
3071
3072 * tests/calc.at (Simple LALR Calculator): Don't specify
3073 %skeleton "push.c" since %push-pull-parser implies that now.
3074 * tests/headers.at (export YYLTYPE): Don't check for the push
3075 declarations. Otherwise, this test case can't be used to see if push
3076 mode can truly emulate pull mode.
3077 * tests/input.at (Torturing the Scanner): Likewise.
3078 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
3079 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
3080 AT_YACC_IF, which now includes the case of push mode since %skeleton
3081 need not be used for push mode. This will be more intuitive once
3082 push.c is renamed to yacc.c.
3083
7172e23e
JD
30842006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3085
3086 For push mode, convert yyparse from a macro to a function, invoke yylex
3087 instead of passing a yylexp argument to yypull_parse, and don't
3088 generate yypull_parse or yyparse unless %push-pull-parser is declared.
3089 Discussed starting at
3090 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
3091 * data/bison.m4 (b4_pull_if): New.
3092 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
3093 * data/push.c: Improve M4 quoting a little.
3094 (b4_generate_macro_args, b4_parenthesize): Remove.
3095 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
3096 any time a pull parser is requested.
3097 Don't #define this as a wrapper around yypull_parse. Instead, when
3098 both push and pull are requested, make it a function that does that
3099 same thing.
3100 (yypull_parse): If there's a b4_prefix, #define this to
3101 b4_prefix[pull_parse] when both push and pull are requested.
3102 Don't define this as a function unless both push and pull are
3103 requested.
3104 Remove the yylexp argument and hard-code yylex invocation instead.
3105 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
3106 %push-parser.
3107 * src/getargs.c (pull_parser): New global initialized to true.
3108 * getargs.h (pull_parser): extern it.
3109 * src/output.c (prepare): Insert pull_flag muscle.
3110 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
3111 (prologue_declaration): Set both push_parser and pull_parser = true for
3112 %push-pull-parser. Set push_parser = true and pull_parser = false for
3113 %push-parser.
3114 * src/scan-gram.l: Don't accept %push_parser as an alternative to
3115 %push-parser since there's no backward-compatibility concern here.
3116 Scan %push-pull-parser.
3117 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
3118 instead of %push-parser.
3119 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
3120 prototype it in the module that calls yyparse.
3121 * tests/input.at (Torturing the Scanner): Likewise.
3122 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
3123
2e7944cb
JD
31242006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
3125
3126 Update etc/bench.pl. Optimize push mode a little (the yyn change
3127 deserves most of the credit).
3128 * Makefile.am (SUBDIRS): Add etc subdirectory.
3129 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
3130 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
3131 yytoken, yyval, and yyloc declarations to...
3132 (yyparse or yypush_parse): ... here to improve performance. For
3133 yypush_parse invocations after the first, be sure to assign yyn its old
3134 value again.
3135 (yypstate_new): Don't bother initializing the yyresult field since the
3136 initial value isn't used.
3137 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
3138 remove the #define that, in push mode, set it to yyps->NAME.
3139 * etc/Makefile.am: New.
3140 * etc/bench.pl: Remove and build it instead from...
3141 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
3142 "tests/bison" from the build directory by default rather than just
3143 invoking "bison" from $PATH.
3144 (calc_grammar): Update push parser code: don't declare yylval globally,
3145 don't define yyparse_wrapper, and don't #define yyparse.
3146 (bench_grammar): Update to check all working combinations of yacc.c,
3147 push.c, impure, pure, pull, and push.
3148
c3d50342
JD
31492006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3150
3151 For push mode, add pull wrappers around yypush_parse.
3152 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
3153 (yypull_parse): New function wrapping yypush_parse.
3154 (yyparse): New #define wrapping yypull_parse.
3155 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
3156 is declared.
3157 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
3158 prototype yylex in the module that calls yyparse, and don't prototype
3159 yyparse there. Otherwise, the yyparse expansion won't compile.
3160 * tests/input.at (Torturing the Scanner): Likewise.
3161
94ebeba5
JD
31622006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3163
3164 Enable push parsers to operate in impure mode. Thus, %push-parser no
3165 longer implies %pure-parser. The point of this change is to move
3166 towards being able to test the push parser code by running the entire
3167 test suite as if %push-parser had been declared.
3168 * data/push.c (yypush_parse): For impure mode, remove the
3169 yypushed_char, yypushed_val, and yypushed_loc arguments.
3170 Instead, declare these as local variables initialized to the global
3171 yychar, yylval, and yylloc.
3172 For the first yypush_parse invocation only, restore the initial values
3173 of these global variables when it's time to read a token since they
3174 have been overwritten.
3175 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
3176 %push-parser.
3177 * tests/calc.at (Simple LALR(1) Calculator): Always declare
3178 %pure-parser along with %push-parser since this test case was designed
3179 for pure push parsers.
3180 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
3181 (AT_YACC_OR_PUSH_IF): New.
3182 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
3183 add a note that it's still wrong for some cases (as it has been for a
3184 while).
3185 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
3186 %push-parser no longer implies %pure-parser.
3187
a0633178
JD
31882006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3189
3190 Remove some unnecessary differences between the pull parser code and
3191 the push parser code. This patch enables yynerrs in push mode.
3192 * data/push.c: Reformat M4 a little.
3193 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
3194 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
3195 because push mode is on. Instead, if pure mode is on, move yynerrs
3196 to...
3197 (b4_declare_parser_state_variables): ... here.
3198 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
3199 to yyps->NAME so it can be used in yypush_parse.
3200 (yypush_parse): Don't omit uses of yynerrs in push mode.
3201
8646b6a3
JD
32022006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3203
3204 Fix bug such that the first pushed token's value and location are
3205 sometimes overwritten (sometimes by %initial-action) before being used.
3206 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
3207 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
3208 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
3209 more closely mimic the pull parser logic.
3210 Don't copy the pushed token to yychar, yylval, and yylloc until it's
3211 time to read a token, which is after any initialization of yylval and
3212 yylloc.
3213 (gottoken): Rename label to...
3214 (yyread_pushed_token): ... for clarity and to avoid infringing on the
3215 user namespace.
3216
9baf4d74
JD
32172006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3218
3219 Rearrange initialization of the parser state variables so that the
3220 skeleton doesn't have to have a copy for pull mode and another for push
3221 mode. This patch also fixes at least a bug such that yylloc was not
3222 initialized (with b4_location_initial_line and
3223 b4_location_initial_column) upon calling yypush_parse. However, that
3224 initialization now overwrites the first token's location;
3225 %initial-action assigning @$ already did the same thing, and both bugs
3226 will be fixed in a later patch.
3227 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
3228 (b4_declare_parser_state_variables): Remove initialization of yytoken,
3229 yyss, yyvs, yyls, and yystacksize.
3230 (yypstate_new): Remove initialization of some yypstate fields: yystate,
3231 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
3232 yylsp.
3233 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
3234 yyps->NAME so it can be used in yypush_parse.
3235 (yyparse or yypush_parse): For yypush_parse, don't print the
3236 "Starting parse" diagnostic for invocations after the first.
3237 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
3238 yypush_parse, only do it for the first invocation.
3239 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
3240 initialization to occur in yypush_parse but only on the first
3241 invocation.
3242
23522164
JD
32432006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3244
3245 * data/push.c: Add CPP guards around push parser declarations in both
3246 the header and the code file.
3247 In the code file, move the push parser declarations to the same place
3248 they appear in the header file.
3249 Clean up the M4 some, especially the inconsistent underquoting in
3250 some b4_c_function_def and b4_c_function_decl uses.
3251
bb010fe5
JD
32522006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3253
3254 Encapsulate the push parser state variables into an M4 macro so the
3255 push skeleton doesn't have to list them again for pull mode's yyparse.
3256 For push mode, remove yypush_parse's local equivalents of these
3257 variables to eliminate unnecessary copying between the two sets at
3258 run-time. This patch also fixes at least a bug related to multiple
3259 %initial-action invocations in push mode.
3260 * data/push.c (b4_declare_parser_variables): Rename to...
3261 (b4_declare_scanner_communication_variables): ... this for clarity and
3262 update both uses.
3263 (b4_declare_yyparse_variables): Remove and move its contents to the one
3264 spot where it was invoked.
3265 (b4_declare_parser_state_variables): New macro containing the parser
3266 state variables required by push mode.
3267 (struct yypstate): Replace all fields but yynew with
3268 b4_declare_parser_state_variables.
3269 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
3270 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
3271 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
3272 (yyparse or yypush_parse): For yyparse in pull mode, replace local
3273 parser state variable declarations with
3274 b4_declare_parser_state_variables.
3275 Don't initialize parser state variables when calling yypush_parse since
3276 yypstate_new already does that.
3277 Invoke the user's initial action only upon the first yypush_parse
3278 invocation.
3279 Remove all code that copies between the local parser state variables
3280 and the yypstate.
3281
2d212f8c
JD
32822006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3283
3284 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
3285 prevent a name collision in a future patch where these names will
3286 sometimes be #define'd.
3287 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
3288 since it no longer has the same name as the existing argument.
3289 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
3290
e6e704dc
JD
32912006-12-19 Paolo Bonzini <bonzini@gnu.org>
3292 and Joel E. Denny <jdenny@ces.clemson.edu>
3293
3294 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3295 that the argument is case-insensitive, and there's no `=' here.
3296 For the %skeleton entry, mention that %language is better.
3297 (Bison Options): Likewise for --language and --skeleton. Move the
3298 --skeleton entry so that the `Tuning the parser' section is sorted
3299 alphabetically on long options.
3300 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
3301 %language directive in detail here; cross-reference the %language
3302 documentation instead.
3303 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
3304 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 3305 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
3306 * examples/extexi (normalize): Instead of replacing every %require
3307 argument with the current Bison version, just substitute for
3308 `@value{VERSION}'. This guarantees that we're testing what actually
3309 appears in the documentation.
3310 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
3311 rather than `@VERSION@'.
3312
0e021770
PE
33132006-12-18 Paul Eggert <eggert@cs.ucla.edu>
3314
fd575f05
PE
3315 * NEWS: Reword the %language news a bit, and put it earlier.
3316
0e021770
PE
3317 * src/getargs.c (skeleton_arg): Last arg is now location const *.
3318 Rewrite to simplify the logic.
3319 (language_argmatch): Likewise.
fd575f05
PE
3320 (program_name): We now own this var.
3321 * src/getargs.h (struct bison_language): Use char[] rather than
3322 const char *.
0e021770
PE
3323
3324 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
3325 Java is supported.
3326 * src/complain.c (program_name): Remove decl; no longer needed.
3327 * src/main.c (program_name): Remove; now belongs to getargs.
3328
33292006-12-18 Paolo Bonzini <bonzini@gnu.org>
3330
3331 * NEWS: Document %language.
3332
3333 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
3334
3335 * data/c-skel.m4, data/c++-skel.m4: New files.
3336 * data/glr.c: Complain on push parsers.
3337
3338 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
3339 over %skeleton.
148d66d8 3340 (Decl Summary): Document %language and %skeleton.
0e021770
PE
3341 (Command line): Document -L.
3342
3343 * examples/extexi: Rewrite %require directive.
3344 * examples/calc++/Makefile.am: Pass VERSION to extexi.
3345
3346 * src/files.c (compute_exts_from_gc): Look in language structure
3347 for .y extension.
3348 (compute_file_name_parts): Check whether .tab should be added.
3349 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
3350 (language, skeleton_arg, language_argmatch): New.
3351 (long_options): Add --language.
3352 (getargs): Use skeleton_arg, add -L/--language.
3353 * src/getargs.h: Include location.h.
3354 (struct bison_language, language, skeleton_arg, language_argmatch): New.
3355 * src/output.c (prepare): Pick default skeleton from struct language.
3356 Don't dispatch C skeletons here.
3357 * src/parse-gram.y (PERCENT_LANGUAGE): New.
3358 (prologue_declaration): Add "%language" rule, use skeleton_arg.
3359 * src/scan-gram.l ("%language"): New rule.
3360
3361 * tests/calc.at: Test %skeleton and %language.
3362 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
3363 (AT_GLR_IF): Look for %skeleton "glr.cc".
3364 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
3365 (AT_YACC_IF): Reject %language.
3366
5691bf57
PE
33672006-12-18 Paul Eggert <eggert@cs.ucla.edu>
3368
db06f0ce
PE
3369 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
3370 since it wasn't used; only the typedef name 'semantic_type' is needed.
3371 Also, omit trailing white space.
3372
5691bf57
PE
3373 * bootstrap: Sync from coreutils.
3374 (gnulib_extra_files): Add build-aux/announce.gen.
3375 (slurp): Adjust .gitignore files like .cvsignore files.
3376 * build-aux/announce-gen: Remove from CVS, since bootstrap
3377 now creates this.
3378
791934e4
JD
33792006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
3380
3381 Make %push-parser imply %pure-parser. This fixes several bugs; see
3382 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
3383 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
3384 pure_parser = true.
3385 * data/push.c: Don't bother testing b4_push_if when deciding whether
3386 to expand b4_declare_parser_variables globally.
3387 (yypush_parse): Likewise in here.
3388
3389 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
3390 (yy_reduce_print): Reformat M4 for readability.
3391
ee5abb37
JD
33922006-12-15 Bob Rossi <bob@brasko.net>
3393 and Joel Denny <jdenny@ces.clemson.edu>
3394
3395 * data/push.c (yypstate): Add typedef, and update all uses of
3396 struct yypstate to just yypstate.
3397 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
3398
16ca01f9
JD
33992006-12-14 Bob Rossi <bob@brasko.net>
3400
3401 * data/push.c (yypush_parse): Declare prototype regardless of
3402 %locations option.
3403
ab8e7e1a
JD
34042006-12-14 Bob Rossi <bob@brasko.net>
3405
3406 * data/push.c (yyparse): Remove the prototype and the #define when in
3407 push-parser mode.
3408
9bf32be3
JD
34092006-12-13 Bob Rossi <bob@brasko.net>
3410
3411 * data/push.c (yypstate_init): Rename to...
3412 (yypstate_new): ... this and use b4_c_function_def.
3413 (yypstate_delete): New.
3414 (yypush_parse): Change parameters yynval and yynlloc to be const.
3415 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
3416 yypstate_delete functions.
3417
f02e2948
JD
34182006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
3419
3420 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
3421 strange test case titles. Reported by Bob Rossi.
3422
38eb7751
PE
34232006-12-13 Paul Eggert <eggert@cs.ucla.edu>
3424
3425 * TODO: Add pointer to Sylvain Schmitz's work on static detection
3426 of potential ambiguities in GLR grammers.
3427
bd9d212b
JD
34282006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
3429
3430 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
3431 `bison ', use m4_index instead of m4_substr since chopping up a string
3432 containing M4-special characters causes problems here.
3433
3434 Fix a couple of bugs related to special characters in user-specified
3435 file names, and make it easier for skeletons to compute output file
3436 names with the same file name prefix as Bison-computed output file
3437 names.
3438 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
3439 b4_parser_file_name and b4_spec_defines_file instead of
3440 @output_parser_name@ and @output_header_name@, which are now redundant.
3441 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
3442 b4_parser_file_name, b4_spec_defines_file, and the new
3443 @basename(FILENAME@) instead of @output_parser_name@ and
3444 @output_header_name@, which inappropriately escaped the file names as
3445 C string literals.
3446 * src/files.c (all_but_ext): Remove static qualifier.
3447 (compute_output_file_names): Move `free (all_but_ext)' to...
3448 (output_file_names_free): ... here since all_but_ext is needed later.
3449 * src/files.h (all_but_ext): Extern.
3450 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
3451 exactly what MUSCLE_INSERT_STRING used to do.
3452 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
3453 characters are escaped properly.
3454 * src/output.c (prepare): Define muscle file_name_all_but_ext as
3455 all_but_ext.
3456 For pkgdatadir muscle, maintain previous functionality by using
3457 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
3458 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
3459 digraphs would never be expanded. Hopefully no one has M4-special
3460 characters in his Bison installation path.
3461 * src/scan-skel.l: Don't parse @output_header_name@ and
3462 @output_parser_name@ anymore since they're now redundant.
3463 In @output, use decode_at_digraphs.
3464 Parse a new @basename command that invokes last_component.
3465 (decode_at_digraphs): New.
3466 (BASE_QPUTS): Remove unused.
3467 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
3468 (Output file name): New tests.
3469
3f7ca628
JD
34702006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
3471
3472 Warn about output files that are generated by the skeletons and that
3473 conflict with other output files.
3474 * data/glr.c: Don't generate the header file here when glr.cc does.
3475 * src/files.c (file_names, file_names_count): New static globals.
3476 (compute_output_file_names): Invoke output_file_name_check for files
3477 not generated by the skeletons and remove existing checks.
3478 (output_file_name_check): New function that warns about conflicting
3479 output file names.
3480 (output_file_names_free): Free file_names.
3481 * src/files.h (output_file_name_check): Declare.
3482 * src/scan-skel.l: Invoke output_file_name_check for files generated by
3483 the skeletons.
3484 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
3485 (Conflicting output files): New tests.
3486
178e123e
PE
34872006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3488
3489 * doc/bison.texinfo: Fix a couple of typos.
3490
34912006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
3492
3493 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
3494 Rename to...
3495 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
3496 update all uses.
3497 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
3498 (yypush_parse): Rename yypvars argument to yyps and remove redundant
3499 local pv.
3500 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
3501 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
3502
ea17f233
JD
35032006-12-07 Bob Rossi <bob@brasko.net>
3504 and Joel Denny <jdenny@ces.clemson.edu>
3505
3506 * data/push.c (yypvarsinit): Change return type from void* to struct
3507 yypvars*. No longer cast to void* on return.
3508 (struct yypvars): Remove yylen since it need not be remembered between
3509 yypushparse invocations.
3510 (yypushparse): Don't copy between yylen and pv->yylen.
3511
55a30bda
JD
35122006-12-05 Bob Rossi <bob@brasko.net>
3513
3514 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
3515 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
3516 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
3517 (struct yypvars): Remove b4_declare_parser_variables.
3518 (yypvarsinit): Remove init code for removed variables.
3519 (global scope): Do not declare b4_declare_parser_variables if
3520 push or pure mode.
3521 (yypushparse): Add b4_declare_parser_variables.
3522 Init new local variables, and remove init code for removed
3523 yypvars variables.
3524 (yyparse): Delete.
3525 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
3526 and yyparse for other modes.
3527 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
3528 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
3529 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
3530 (AT_PURE_LEX_IF): True if pure or push parser.
3531
85894313
JD
35322006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
3533
3534 Document Yacc prologue alternatives and default %destructor's and
3535 %printer's as experimental. Don't mention Java yet. Discussed at
3536 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
3537 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
3538 (2.3a): Annotate this entry to say the old forms of these features were
3539 also experimental.
3540 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 3541 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
3542 of Java (we'll want this back eventually).
3543
02975b9a
JD
35442006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3545
3546 Support a file name argument to %defines. Deprecate `=' in
3547 %file-prefix, %name-prefix, and %output. Discussed at
3548 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
3549 * NEWS (2.3a+): Mention.
148d66d8 3550 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
3551 form of %defines, and remove `=' from entries for %file-prefix,
3552 %name-prefix, and %output.
3553 * src/parse-gram.y (prologue_declaration): Implement.
3554 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
3555 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
3556 all but one occurrence of %name-prefix.
3557 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
3558 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
3559 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
3560 occurrence of each of %file-prefix and %output. Add check for %defines
3561 with argument.
3562 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
3563 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
3564 Remove the `=' from %output.
3565
287b314e
JD
35662006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
3567
3568 Don't escape $ in test case titles since Autoconf 2.61 now does that
3569 correctly.
3570 * tests/actions.at (Default %printer and %destructor are not for error
3571 or $undefined): Here.
3572 (Default %printer and %destructor are not for $accept): Here.
3573 * tests/input.at (Invalid $n and @n): Here.
3574
3ebecc24
JD
35752006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
3576
3577 Rename <!> to <>. Discussed starting at
3578 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
3579 * NEWS (2.3a+): Update.
148d66d8 3580 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
3581 Update.
3582 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
3583 * src/scan-gram.l (INITIAL): Implement.
3584 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
3585 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
3586 comment.
3587 * tests/actions.at (Default tagless %printer and %destructor,
3588 Default tagged and per-type %printer and %destructor,
3589 Default %printer and %destructor are not for error or $undefined,
3590 Default %printer and %destructor are not for $accept,
3591 Default %printer and %destructor for mid-rule values): Update.
3592 * tests/input.at (Default %printer and %destructor redeclared,
3593 Unused values with default %destructor): Update.
3594
26b8a438
JD
35952006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3596
3597 Don't let %prec take a nonterminal.
3598 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
3599 token.
3600 * tests/input.at (%prec takes a token): New test checking that %prec
3601 won't take a nonterminal.
3602
07c39ae9
JD
36032006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3604
405d53b7
JD
3605 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
3606 it was double-quoted.
07c39ae9
JD
3607 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
3608 grammar is maintained with Bison's highest standards.
3609 * src/getargs.c: Fix some typos in Doxygen comments.
3610
580b8926
JD
36112006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3612
3613 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
3614 later. Reported by Paul Eggert in
3615 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
3616 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
3617 * src/scan-code.l (translate_action): Don't bother invoking
3618 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
3619 (code_scanner_free): Instead of invoking
3620 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
3621 which frees more.
3622 * src/scan-gram.l (gram_scanner_free): Likewise.
3623 * src/scan-skel.l (scan_skel): Likewise.
3624
4502eadc
JD
36252006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3626
3627 * src/files.c (tr): Change return type to void.
3628 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
3629 has been called previously for the same key.
3630 (muscle_find): Return storage instead of value so that
3631 --enable-gcc-warnings doesn't produce warnings that the return discards
3632 const. aver that the value and storage are the same since storage
3633 could potentially be NULL when value is not.
3634 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
3635 same as 0.
3636
7746c8f6
PE
36372006-11-08 Paul Eggert <eggert@cs.ucla.edu>
3638
3639 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
3640 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
3641 us a slightly cleaner distribution, and also works.
3642 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
3643 gnulib changes.
3644
eb095650
PE
36452006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
3646 and Paul Eggert <eggert@cs.ucla.edu>
3647
3648 Don't let Bison leak memory except when it complains.
3649 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
3650 (spec_defines_file, dir_prefix): Now char *, not const char *,
3651 since they are freed.
3652 * src/files.c: Likewise.
3653 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
3654 Likewise.
3655 (tr): Now operates in-place. All uses changed.
3656 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
3657 values.
3658 (compute_file_name_parts, compute_output_file_names): Don't store
3659 read-only data in variables that will be freed.
3660 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
3661 src_extension, and header_extension.
3662 (output_file_names_free): New public function to free
3663 spec_verbose_file, spec_graph_file, spec_defines_file,
3664 parser_file_name, and dir_prefix.
3665 * src/getargs.c (getargs): Don't store read-only data in variables that
3666 will be freed.
3667 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
3668 (which previously existed but was unused), and quotearg_free.
3669 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
3670 * src/muscle_tab.c: Likewise.
3671 (muscle_entry): Make the value char const *,
3672 and add a new storage member that is char * and can be freed.
3673 (muscle_entry_free): New private function.
3674 (muscle_init): Use it instead of free.
3675 (muscle_insert, muscle_grow): Update and use new storage member.
3676 (muscle_code_grow): Free the string passed to muscle_grow
3677 since it's not needed anymore.
3678 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
3679 add a new `char *code' member.
3680 ("{...}"): Declare semantic type as code.
3681 * src/scan-code.h (translate_rule_action):
3682 (translate_symbol_action, translate_code, translate_action): Return
3683 `char const *' rather than `char *' since external code should not free
3684 these strings.
3685 * src/scan-code.l: Likewise.
3686 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
3687 which is "{...}" in the parser.
3688 * tests/Makefile.am (maintainer-check-valgrind): Set
3689 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
3690 Valgrind.
3691 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
3692 complain.
3693 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
3694 expecting a non-zero exit status sets --leak-check=summary and
3695 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
3696 this case, and we don't want to hear about it.
3697
ac564be4
PE
36982006-11-08 Paul Eggert <eggert@cs.ucla.edu>
3699
3700 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
3701 instead of from the template, to simplify configuration a bit.
3702 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
3703 and m4/wint_t.m4, as they are needed with the latest gnulib.
3704
17bd8a73
JD
37052006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3706
3707 Disable unset/unused mid-rule value warnings by default, and recognize
3708 --warnings=midrule-values to enable them. Discussed starting at
3709 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
3710 * NEWS (2.3a+): Mention.
3711 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
3712 warnings): Add entry for midrule-values subargument.
3713 * src/reader.c (symbol_should_be_used): Don't return true just because
3714 the value is a set/used mid-rule value unless
3715 --warnings=midrule-values was specified.
3716 * tests/input.at (Unused values, Unused values before symbol
3717 declarations): Run tests with and without --warnings=midrule-values.
3718
3719 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
3720 than LIST_FREE directly.
3721
89eb3c76
JD
37222006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3723
3724 Finish implementing --warnings=error, which should not be implied by
3725 --warnings=all (or by its synonyms -W and --warnings without
3726 subarguments).
3727 * src/complain.c (set_warning_issued): New function to report that
3728 warnings are being treated as errors and to record an error if so.
3729 Invoke...
3730 (warn_at, warn): ... here.
3731 * src/getargs.c (warnings_args, warnings_types): Reorder so that
3732 "error - warnings are errors" does not appear above "all - all of the
3733 above".
3734 (getargs): For -W and --warnings without subarguments, don't let
3735 FLAGS_ARGMATCH set warnings_error in warnings_flag.
3736 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
3737
ba7560e2
JD
37382006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3739
3740 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
3741 empty subargument list. For example: `bison --warnings= parser.y'.
3742
31283fc3
JD
37432006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3744
3745 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
3746 the parser header file so that gcc doesn't warn.
3747
12e35840
JD
37482006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3749
3750 Split the default %destructor/%printer into two kinds: <*> and <!>.
3751 Discussed starting at
3752 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
3753 * NEWS (2.3a+): Mention.
3754 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
3755 previous change today related to mid-rules.
148d66d8 3756 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 3757 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
3758 (TYPE_TAG_ANY): Add as <*>.
3759 (TYPE_TAG_NONE): Add as <!>.
3760 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
3761 for <*> and <!>.
3762 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
3763 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
3764 * src/symlist.c (symbol_list_default_new): Split into tagged and
3765 tagless versions.
3766 (symbol_list_destructor_set, symbol_list_printer_set): Split
3767 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
3768 SYMLIST_DEFAULT_TAGLESS.
3769 * src/symlist.h: Update symbol_list_default*_new prototypes.
3770 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
3771 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
3772 * src/symtab.c (default_destructor, default_destructor_location,
3773 default_printer, default_printer_location): Split each into tagged and
3774 tagless versions.
3775 (symbol_destructor_get, symbol_destructor_location_get,
3776 symbol_printer_get, symbol_printer_location_get): Implement tagged
3777 default and tagless default cases.
3778 (default_destructor_set, default_printer_set): Split each into tagged
3779 and tagless versions.
3780 * src/symtab.h: Update prototypes.
3781 * tests/actions.at (Default %printer and %destructor): Rename to...
3782 (Default tagless %printer and %destructor): ... this, and extend.
3783 (Per-type %printer and %destructor): Rename to...
3784 (Default tagged and per-type %printer and %destructor): ... this, and
3785 extend.
3786 (Default %printer and %destructor for user-defined end token): Extend.
3787 (Default %printer and %destructor are not for error or $undefined):
3788 Update.
3789 (Default %printer and %destructor are not for $accept): Update.
3790 (Default %printer and %destructor for mid-rule values): Extend.
3791 * tests/input.at (Default %printer and %destructor redeclared): Extend.
3792 (Unused values with default %destructor): Extend.
3793
f91b1629
JD
37942006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3795
3796 Don't apply the default %destructor/%printer to an unreferenced midrule
3797 value. Mentioned at
3798 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
3799 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
3800 like $@n instead of just @n so that the default %destructor/%printer
3801 logic doesn't see them as user-defined symbols.
3802 (symbol_is_dummy): Check for both forms of the name.
3803 * src/reader.c (packgram): Remove the `$' from each midrule symbol
3804 name for which the midrule value is referenced in any action.
3805 * tests/actions.at (Default %printer and %destructor for mid-rule
3806 values): New test.
3807 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
3808 for change to dummy symbol names.
3809
519d0004
JD
38102006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
3811
3812 Warn about unset midrule $$ if the corresponding $n is used.
3813 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
3814 $n usage.
3815 (packgram): Before invoking grammar_rule_check on any rule, make sure
3816 all actions have already been scanned in order to set `used' flags.
3817 Otherwise, checking that a midrule's $$ is set will not always work
3818 properly because the midrule check must forward-reference the midrule's
3819 parent rule.
3820 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
3821 warning.
3822
a501eca9
JD
38232006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
3824
3825 More improvements to the documentation of the prologue alternatives:
3826 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
3827 Bison manual.
3828 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
3829 some text to clarify the relative importance of the new directives and
3830 to show how these directives may be viewed as code labels.
3831
2cbe6b7f
JD
38322006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
3833
3834 Similar to the recently removed %before-header, add %code-top as the
3835 alternative to the pre-prologue. Mentioned at
3836 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
3837 Also, let the prologue alternatives appear in the grammar section.
3838 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
3839 (prologue_declaration): Move the existing prologue alternatives to...
3840 (grammar_declaration): ... here and add %code-top.
3841 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
3842
3843 Clean up and extend documentation for the prologue alternatives.
3844 * NEWS (2.3a+): Describe prologue alternatives.
3845 * doc/bison.texinfo (Prologue): Move discussion of prologue
3846 alternatives to...
3847 (Prologue Alternatives): ... this new section, and extend it to discuss
3848 all 4 directives in detail.
148d66d8
JD
3849 (Table of Symbols): Clean up discussion of prologue alternatives and
3850 add %code-top.
2cbe6b7f 3851
e557d3ea
JMG
38522006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3853
3854 DJGPP specific issues.
3855
3856 * djgpp/config.bat: config.hin has been moved to lib. Adjust
3857 config.bat accordingly.
3858 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
3859 * djgpp/config.site: Likewise.
3860
136a0f76
PB
38612006-10-16 Paolo Bonzini <bonzini@gnu.org>
3862
27bd5d67
PB
3863 Replace %*-header with %provides, %requires, %code. See discussion at
3864 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
3865
136a0f76
PB
3866 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
3867 (b4_user_start_header): Remove.
3868 * data/glr.c: Use new macros instead of b4_*start_header
3869 and b4_*end_header.
3870 * data/glr.cc: Likewise.
3871 * data/lalr1.cc: Likewise.
3872 * data/push.c: Likewise.
3873 * data/yacc.c: Likewise.
3874
3875 * doc/bison.texinfo: Remove %before-header, rename
3876 %{start,end,after}-header to %requires, %provides, %code.
3877
3878 * src/parse-gram.y: Likewise (also rename token names accordingly).
3879 * src/scan-gram.l: Likewise.
3880 * tests/actions.at: Likewise.
3881
10f429ef
PE
38822006-10-14 Paul Eggert <eggert@cs.ucla.edu>
3883
3884 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
3885 Problem reported by Joel E. Denny.
3886
38872006-10-14 Jim Meyering <jim@meyering.net>
3888
3889 (Sync from coreutils.)
3890 Work also when the working directory (with e.g. coreutils sources)
3891 is version controlled with git, rather than CVS.
3892 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
3893 rather than CVS.
3894 In messages and comments, say e.g., "checked-out sources",
3895 rather than "CVS sources".
3896 (version_controlled_file): New function. Work for git as well as
3897 for CVS. Don't use grep's -q option.
3898 (slurp): Call it here, in place of CVS-specific code.
3899
c4bd5bf7
JD
39002006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
3901
3902 Fix testsuite for ./configure --enable-gcc-warnings:
3903 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
3904 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
3905 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
3906 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
3907 * test/regression.at (Diagnostic that expects two alternatives):
3908 Likewise.
3909
46356ea4
PE
39102006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3911
231ed89a
PE
3912 * bootstrap.conf (gnulib_modules): Add config-h.
3913 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
3914 worry about HAVE_CONFIG_H.
3915 * lib/abitset.c: Likewise.
3916 * lib/bitset.c: Likewise.
3917 * lib/bitset_stats.c: Likewise.
3918 * lib/bitsetv-print.c: Likewise.
3919 * lib/bitsetv.c: Likewise.
3920 * lib/ebitset.c: Likewise.
3921 * lib/get-errno.c: Likewise.
3922 * lib/lbitset.c: Likewise.
3923 * lib/subpipe.c: Likewise.
3924 * lib/timevar.c: Likewise.
3925 * lib/vbitset.c: Likewise.
3926 * lib/bitset.c: Include "bitset.h" first, to test interface.
3927 * lib/bitset_stats.c: Include "bitset_stats.h" first.
3928 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
3929 * lib/bitsetv.c: Include "bitsetv.h" first.
3930 * lib/get-errno.c: Include "get-errno.h" first.
3931 * m4/.cvsignore: Add config-h.m4.
3932 * tests/actions.at (Default %printer and %destructor for ...):
3933 Adjust expected line numbers in output to reflect removal of #if
3934 HAVE_CONFIG_H lines.
3935 * tests/glr-regression.at (Missed %merge type warnings when ...):
3936 Likewise.
3937 * tests/regression.at (Braced code in declaration in rules section):
3938 Likewise.
3939 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
3940 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
3941 Include <config.h> unconditionally.
3942
46356ea4
PE
3943 * bootstrap: Sync from coreutils, as follows:
3944
3945 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3946
3947 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
3948 variable was sometimes used without being initialized. This
3949 messed up the installation of the INSTALL file in some cases.
3950
3951 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3952
3953 * bootstrap (usage, main program, symlink_to_gnulib): Add option
3954 --copy. Inspired by a suggestion from Bruno Haible.
3955
3956 2006-10-03 Jim Meyering <jim@meyering.net>
3957
3958 * bootstrap: Undo last change to this file, since now gnulib-tool
3959 sticks with the automake default in generating dependencies.
3960
dd4bf078
PE
39612006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3962
cf2a5f7c
PE
3963 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
3964 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
3965
3966 * doc/bison.1: Add copyright notice.
3967
3968 * data/glr.c: Don't include <stdarg.h>; not used.
3969
35fe0834
PE
3970 * NEWS: The -g and --graph options now output graphs in Graphviz
3971 DOT format, not VCG format.
3972 * doc/bison.1: Likewise.
3973 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
3974 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
3975 of this change in
3976 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
3977 * TODO: Remove Graphviz entry.
3978 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
3979 remove vcg.c, vcg.h, vcg_defaults.h.
3980 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
3981 * src/graphviz.c, src/graphviz.h: New files.
3982 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
3983 * src/files.h: Make comment more generic.
3984 * src/main.c (main): Likewise.
3985 * src/print_graph.h: Likewise.
3986 * src/getargs.c (usage): Make usage description more generic.
3987 * src/print_graph.c: Include graphviz.h rather than vcg.h.
3988 (static_graph, fgraph): Remove. All uses changed to pass
3989 arguments instead of sharing a static var.
3990 (print_core, print_actions, print_state, print_graph):
3991 Output graphviz format rather than VCG format.
3992 * tests/.cvsignore: Remove *.vcg; add *.dot.
3993 * tests/output.at: Expect *.dot files, not *.vcg files.
3994
dd4bf078
PE
3995 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
3996 accommodates the 2006-10-08 change.
3997
efdd7421
PE
39982006-10-11 Bob Rossi <bob@brasko.net>
3999
4000 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
4001 (b4_yyssa, b4_yyerror_range): New macros.
4002 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
4003 (yypvarsinit): Remove init of removed fields.
4004 (yypushparse): Remove use of removed fields; use new macros instead.
4005
96a1981a
PE
40062006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4007
4008 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
4009 in a push parser. Reindent slightly to match yacc.c better.
4010
40112006-10-11 Bob Rossi <bob@brasko.net>
4012
46356ea4
PE
4013 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
4014 yymsg_alloc fields.
4015 (yypvarsinit, yypushparse): Remove init of removed fields.
4016 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 4017
c1630a8b
PE
40182006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4019
4020 * THANKS: Add Paolo Bonzini and Bob Rossi.
4021
90b9908d
PB
40222006-10-08 Paolo Bonzini <bonzini@gnu.org>
4023
4024 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
4025 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
4026 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
4027 b4_define_user_cde and uses): Remove.
4028 (b4_comment, b4_prefix, b4_sync_start): New.
4029 * data/bison.m4: New file, with most of the content removed from c.m4.
4030 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
4031 * src/output.c (output_skeleton): Pass bison.m4.
4032 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
4033 only if specified.
4034
cf806753
PE
40352006-10-05 Paul Eggert <eggert@cs.ucla.edu>
4036
4037 Fix test failure reported by Tom Lane in
4038 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
4039 and try to make such failures easier to catch in the future.
4040 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
4041 that's now the caller's responsibility.
4042 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
4043 Set yychar = YYEOF if it's negative.
4044 * tests/actions.at (yylex): Abort if asked to read past EOF.
4045 * tests/conflicts.at (yylex): Likewise.
4046 * tests/cxx-type.at (yylex): Likewise.
4047 * tests/glr-regression.at (yylex): Likewise.
4048 * tests/input.at (yylex): Likewise.
4049 * tests/regression.at (yylex): Likewise.
4050 * tests/torture.at (yylex): Likewise.
4051
0e2f006a
PE
40522006-10-01 Paul Eggert <eggert@cs.ucla.edu>
4053
4054 Fix problems with translating English-language diagnostics.
4055 * bootstrap: Fix bug introduced in recent bootstrap changes, with
4056 respect to bison-runtime pot generation. The YY_ stuff
4057 wasn't being captured.
4058 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
4059 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
4060 * runtime-po/POTFILES.in: Add data/push.c.
4061
e3ddc1e3
PE
40622006-09-29 Paul Eggert <eggert@cs.ucla.edu>
4063
4064 Merge bootstrap changes from coreutils.
4065
4066 2006-09-28 Jim Meyering <jim@meyering.net>
4067
4068 Automatically generated dependencies are important even
4069 when all of the sources in a directory come from gnulib.
4070 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
4071 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
4072
4073 2006-09-23 Jim Meyering <jim@meyering.net>
4074
4075 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
4076
4077 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4078
4079 * bootstrap: Add support for --force.
4080 (usage): New function. Describe usage less tersely.
4081 (CVS_only_file): New var.
4082
01e972b3
PE
40832006-09-21 Paul Eggert <eggert@cs.ucla.edu>
4084
4085 * data/push.c (YYPUSH_MORE): Make it an enum instead.
4086 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
4087 Adjust white space and comments to match GNU style better.
4088
c63d3e90
PE
40892006-09-20 Bob Rossi <bob@brasko.net>
4090
4091 * data/push.c (yyresult_get): Remove function.
4092 (YYPUSH_MORE): Add #define.
4093 (yypushparse): Modify return value.
4094
e70f46d1
PE
40952006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4096
4097 * stamp-h.in: Remove; no longer needed.
4098 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
4099 Remove config.h, config.hin, intl (no longer created).
4100 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
4101 stamp-h1.
4102
4103 Sync bootstrap from coreutils, as follows:
4104
4105 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
4106
4107 * bootstrap (symlink_to_gnulib): New function.
4108 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
4109 to copies-of-gnulib.
4110 (cp_mark_as_generated, slurp, gnulib_files):
4111 Avoid making a copy if it's the same as the old version.
4112 (gnulib_files): Add support for this variable (used by Bison).
4113
a92be413
PE
41142006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4115
4116 * src/getargs.c (usage): Rework to use conventions similar to
4117 coreutils, to make translation a bit easier and the code a bit
4118 smaller. Problem reported by Tim Van Holder.
4119
4f82b42a
PE
41202006-09-15 Paul Eggert <eggert@cs.ucla.edu>
4121
3b2942e6
PE
4122 Use some of gnulib's new modules, taken from coreutils.
4123
4124 * bootstrap: Sync from coreutils, except add support for gnulib_files.
4125 * bootstrap.conf: New file.
4126 (gnulib_modules): Add configmake, inttypes, unistd.
4127 (XGETTEXT_OPTIONS): Add complain, complain_at,
4128 fatal, fatal_at, warn, warn_at, unexpected_end.
4129 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
4130 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
4131 (gl_EARLY): Add.
4132 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
4133 (gl_INIT): Add
4134 (GNULIB_AUTOCONF_SNIPPET): Remove.
4135 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
4136 the pickiest.
4137 * lib/.cvsignore: Add inttypes_.h.
4138 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
4139 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
4140 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
4141 no-longer-necessary initializations.
4142 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
4143 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
4144 use the unistd module.
4145 * src/system.h: Likewise.
4146 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
4147 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
4148 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
4149 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
4150 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
4151 * src/system.h: Include inttypes.h unconditionally, now that we
4152 use the inttypes module. Don't bother to include stdint.h, since
4153 inttypes.h now does that for us.
4154 (LOCALEDIR): Remove, now that we use the configmake module.
4155 * src/getargs.c: Include configmake.h.
4156 * src/main.c: Likewise.
4157 * src/output.c: Likewise.
4158 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
4159 not from $abs_top_builddir, since config.h moved.
4160
4161
4f82b42a
PE
4162 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
4163 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
4164
4165 * src/parse-gram.y (symbol_declaration): Don't put statements
4166 before declarations; it's not portable to C89.
4167 * src/scan-code.l (handle_action_at): Likewise.
4168
4169 * src/scan-code.l: Always initialize braces_level; the old code
4170 left it uninitialized and therefore had undefined behavior.
4171
4172 Don't attempt to redefine 'assert', since it runs afoul of
4173 systems where standard headers (mistakenly) include <assert.h>.
4174 Instead, define and use our own alternative, called 'aver'.
4175 * src/reader.c: Don't include assert.h, since we no longer
4176 use assert.
4177 * src/scan-code.l: Likewise.
4178 * src/system.h (assert): Remove, replacing with....
4179 (aver): New function, taking a bool arg. All uses changed.
4180 * src/tables.c (pack_vector): Ensure that aver arg is bool,
4181 not merely an integer.
4182
31c10e38
PE
41832006-09-15 Bob Rossi <bob@brasko.net>
4184
4185 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
4186 * data/c.m4 (YYPUSH): New.
4187 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
4188 * src/getargs.c (push_parser): New var.
4189 * src/getargs.h (push_parser): New declaration.
4190 * src/output.c (prepare): Add macro insertion of `push_flag'.
4191 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
4192 (prologue_declaration): Parse %push-parser.
4193 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
4194 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
4195 list of removed lines from the traces observed.
4196 (AT_CHECK_CALC_LALR): Added push parser tests.
4197
fa7b79c0
PE
41982006-09-13 Paul Eggert <eggert@cs.ucla.edu>
4199
21fe08ca
PE
4200 * NEWS: Version 2.3a.
4201 * configure.ac (AC_INIT): Likewise.
4202
e8ec4d9b
PE
4203 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
4204 "#define YYSTYPE int" that caused "make maintainer-check" to fail
4205 due to header ordering dependencies. I don't know why the #define
4206 was there.
4207
fa7b79c0
PE
4208 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
4209 runtime cost when YYDEBUG is not defined, and so that some tests
4210 that used to fail now work. Problem and initial suggestion by
4211 Paolo Bonzini.
4212 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
4213 * data/glr.cc (b4_parser_class_name):
4214 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
4215 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
4216 (yydebug_) [YYDEBUG]: New member.
4217 (yycdebug_): Now defined only if YYDEBUG.
4218 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
4219 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
4220 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
4221 if YYYDEBUG.
4222 (debug_stream, set_debug_stream, debug_level, set_debug_level):
4223 Define only if YYDEBUG.
4224 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
4225 set_debug_level.
4226 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
4227 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
4228 AT_CHECK_CALC_GLR_CC that are working now.
4229
4ec13d60
PE
42302006-09-12 Paul Eggert <eggert@cs.ucla.edu>
4231
4232 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
4233 We don't need them in glr.cc, and glr.c defines them.
4234 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
4235 assumes that defining it to anything is the same as defining
4236 it to 1. Problem reported by Paolo Bonzini.
4237
8e1687ae
PE
42382006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
4239
4240 * data/c.m4 (b4_null, b4_case): Define.
4241 * src/output.c (prepare_symbols): Use b4_null.
4242 (user_actions_output): Use b4_case.
4243
3dc5e96b
PE
42442006-09-11 Paul Eggert <eggert@cs.ucla.edu>
4245
aef3da86
PE
4246 * data/glr.c (b4_shared_declarations): Put start-header first,
4247 before any #includes that we generate, so that feature-test
4248 macros work. Problem reported by Michael Deutschmann in
4249 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
4250 * data/lalr1.cc: Likewise.
4251 * doc/bison.texinfo (Prologue): Document that feature-test macros
4252 should be defined before any Bison declarations.
4253 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
4254 that depend on location.hh after, not before, Bison decls, since
4255 we now include location.hh after the first user prologue.
4256
3dc5e96b
PE
4257 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
4258 Sander Brandenburg in
4259 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
4260 Also, fix minor white space and comment issues.
aef3da86
PE
4261 (Prologue): Mention that it's better to define feature-test macros
4262 before Bison declarations. Problem reported by Michael Deutschmann.
4263
4264 * README-cvs: Fix typo: "&" should be "&&". Problem reported
4265 by Jim Meyering.
4266 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
4267 This adjusts to recent gnulib changes.
3dc5e96b 4268
b2a0b7ca
JD
42692006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
4270
4271 Finish implementation of per-type %destructor/%printer. Discussed
4272 starting at
4273 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
4274 and
4275 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
4276 * NEWS (2.3+): Add a description of this feature to the default
4277 %destructor/%printer description.
4278 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
4279 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4280 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
4281 list node contains a semantic type.
4282 * src/symtab.c, src/symtab.h: Extend with a table that associates
4283 semantic types with their %destructor's and %printer's.
4284 (semantic_type_from_uniqstr, semantic_type_get,
4285 semantic_type_destructor_set, semantic_type_printer_set): New functions
4286 composing the public interface of that table.
4287 (symbol_destructor_get, symbol_destructor_location_get,
4288 symbol_printer_get, symbol_printer_location_get): If there's no
4289 per-symbol %destructor/%printer, look up the per-type before trying
4290 the default.
4291 * tests/actions.at (Per-type %printer and %destructor): New test case.
4292 * tests/input.at (Default %printer and %destructor redeclared):
4293 Extend to check that multiple occurrences of %symbol-default in a
4294 single %destructor/%printer declaration is an error.
4295 (Per-type %printer and %destructor redeclared, Unused values with
4296 per-type %destructor): New test cases.
4297
3be03b13
JD
42982006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
4299
4300 Require default %destructor/%printer to be declared using
4301 %symbol-default instead of an empty symbol list, and start working on
4302 new per-type %destructor/%printer. Discussed at
4303 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
4304 * NEWS (2.3+): Add %symbol-default to example.
4305 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 4306 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
4307 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
4308 (generic_symlist, generic_symlist_item): New nonterminals for creating
4309 a list in which each item is a symbol, semantic type, or
4310 %symbol-default.
4311 (grammar_declaration): Use generic_symlist in %destructor and %printer
4312 declarations instead of symbols.1 or an empty list.
4313 (symbol_declaration, precedence_declaration, symbols.1): Update actions
4314 for changes to symbol_list.
4315 * src/reader.c: Update for changes to symbol_list.
4316 * src/scan-code.l: Likewise.
4317 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
4318 * src/symlist.c, src/symlist.h: Extend such that a list node may
4319 represent a semantic type or a %symbol-default in addition to just an
4320 ordinary symbol. Add switched functions for setting %destructor's and
4321 %printer's.
4322 * tests/actions.at, tests/input.at: Add %symbol-default to all default
4323 %destructor/%printer declarations.
4324
3508ce36
JD
43252006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
4326
4327 Whether the default %destructor/%printer applies to a particular symbol
4328 isn't a question of whether the user *declares* that symbol (in %token,
4329 for example). It's a question of whether the user by any means
4330 *defines* the symbol at all (by simply using a char token, for
4331 example). $end is defined by Bison whereas any other token with token
4332 number 0 is defined by the user. The error token is always defined by
4333 Bison regardless of whether the user declares it with %token, but we
4334 may one day let the user define error as a nonterminal instead.
4335 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
4336 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
4337 the meaning of "user-defined".
4338 * tests/actions.at (Default %printer and %destructor for user-declared
4339 end token): Rename to...
4340 (Default %printer and %destructor for user-defined end token): ...
4341 this.
4342
4343 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
4344 computation of whether to apply the default, don't maintain a list of
4345 every Bison-defined symbol. Instead, just check for a first character
4346 of '$', which a user symbol cannot have, and check for the error token.
4347
9350499c
JD
43482006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
4349
4350 Don't apply the default %destructor or %printer to the error token,
4351 $undefined, or $accept. This change fits the general rule that the
4352 default %destructor and %printer are only for user-declared symbols,
4353 and it solves several difficulties that are described in the new test
4354 cases listed below.
4355 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
4356 * tests/actions.at (Default %printer and %destructor are not for error
4357 or $undefined, Default %printer and %destructor are not for $accept):
4358 New test cases.
4359
4d7370cb
JD
43602006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
4361
4362 Allow %start after the first rule.
4363 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
4364 when parsing the first rule.
4365 (check_and_convert_grammar): Search for it here after all grammar
4366 declarations have been parsed. Skip midrules, which have dummy LHS
4367 nonterminals.
4368 * src/symtab.c (symbol_is_dummy): New function.
4369 * src/symtab.h (symbol_is_dummy): Declare it.
4370 * tests/input.at (%start after first rule): New test.
4371
6d0ef4ec
JD
43722006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
4373
4374 Redo some of the previous commit: add back the ability to use
4375 non-aliased/undeclared string literals since it might be useful to
4376 those declaring %token-table.
4377 * src/reader.c (check_and_convert_grammar): Undo changes in previous
4378 commit: don't worry about complaints from symbols_pack.
4379 * src/symtab.c (symbol_new, symbol_class_set,
4380 symbol_check_alias_consistency): Undo changes in previous commit: count
4381 each string literal as a new symbol and token, assign it a symbol
4382 number, and don't complain about non-aliased string literals.
4383 (symbols_pack): Since symbol_make_alias still does not decrement symbol
4384 and token counts but does still set aliased tokens to the same number,
4385 symbol_pack_processor now leaves empty slots in the symbols array.
4386 Remove those slots.
4387 * tests/regression.at (Undeclared string literal): Remove test case
4388 added in previous commit since non-aliased string literals are allowed
4389 again.
4390 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
4391 remove unnecessary string literal declarations.
4392 * tests/sets.at (Firsts): Likewise.
4393
965537bc
JD
43942006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
4395
4396 Don't allow an undeclared string literal, but allow a string literal to
4397 be used before its declaration.
4398 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
4399 symbols_pack complained.
4400 * src/symtab.c (symbol_new): Don't count a string literal as a new
4401 symbol.
4402 (symbol_class_set): Don't count a string literal as a new token, and
4403 don't assign it a symbol number since symbol_make_alias does that.
4404 (symbol_make_alias): It's not necessary to decrement the symbol and
4405 token counts anymore. Don't assume that an alias declaration occurs
4406 before any uses of the identifier or string, and thus don't assert that
4407 one of them has the highest symbol number so far.
4408 (symbol_check_alias_consistency): Complain if there's a string literal
4409 that wasn't declared as an alias.
4410 (symbols_pack): Bail if symbol_check_alias_consistency failed since
4411 symbol_pack asserts that every token has been assigned a symbol number
4412 although undeclared string literals have not.
4413 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 4414 string literal): New test cases.
965537bc
JD
4415 (Characters Escapes, Web2c Actions): Declare string literals as
4416 aliases.
4417 * tests/sets.at (Firsts): Likewise.
4418
47aee066
JD
44192006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
4420
4421 In the grammar scanner, STRING_FINISH unclosed constructs and return
4422 them to the parser in order to improve error messages.
4423 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
4424 SC_BRACED_CODE, SC_PROLOGUE): Implement.
4425 * tests/input.at (Unclosed constructs): New test case.
4426 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
4427 seen.
4428
4429 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
4430 unused global.
4431
1f6b3679
JD
44322006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
4433
4434 Handle string aliases for character tokens correctly.
4435 * src/symtab.c (symbol_user_token_number_set): If the token has an
4436 alias, check and set its alias's user token number instead of its own,
4437 which is set to indicate the alias. Previously, every occurrence of
4438 the character token in the grammar overwrote that alias indicator with
4439 the character code.
4440 * tests/input.at (String aliases for character tokens): New test.
4441
219741d8
JD
44422006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
4443
4444 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
4445
11daa4e7
PE
44462006-08-11 Paul Eggert <eggert@cs.ucla.edu>
4447
4448 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
4449 to prevent failures when building on older platforms.
4450 Check for autopoint failure.
4451 Set XGETTEXT_OPTIONS to values that check for C format strings,
4452 so that translators are warned about them (this also helps
4453 prevent core dumps).
4454
4455 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
4456 function, since it simplifies our code a bit.
4457
4458 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
4459 rather than -W, so we don't get bogus warnings about sign comparisons.
4460 Add -Wpointer-arith, since that warning is useful (it reports code
4461 that does not conform to C89 and that some compilers reject).
4462 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
4463 since it's no longer needed.
4464
f9bfc42a
JD
44652006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
4466
4467 Clean up scanners a bit.
4468 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
4469 definitions so gcc won't warn when obstack_for_string is unused.
4470 * src/scan-code.l: config.h and system.h are already #include'd by
4471 scan-code-c.c, so get rid of them here.
4472 * src/scan-gram.l: Likewise.
4473 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
4474 definitions rather than duplicating the rest of it.
4475 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
4476
06e8700a
JD
44772006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
4478
4479 Suppress signed/unsigned comparison warnings for yycheck.
4480 * data/c.m4 (b4_safest_int_type): New macro.
4481 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
4482 a signed int type, cast it to b4_safest_int_type first.
4483 * data/yacc.c: Likewise.
4484 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
4485 also overwritten.
4486
9c437126
PE
44872006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
4488
4489 * doc/bison.texinfo: Fix some typos.
4490
284d8a13
PE
44912006-08-02 Paul Eggert <eggert@cs.ucla.edu>
4492
4493 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
4494 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
4495
4496 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
4497 the latest gnulib does this a different way.
4498 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
4499 translation was patched, so stop omitting it.
4500
ec5479ce
JD
45012006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
4502
4503 Enable declaration of default %printer/%destructor. Make the parser
4504 use these for all user-declared grammar symbols for which the user does
4505 not declare a specific %printer/%destructor. Thus, the parser uses it
4506 for token 0 if the user declares it but not if Bison generates it as
4507 $end. Discussed starting at
4508 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
4509 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
4510 and
4511 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
4512 * NEWS (2.3+): Mention.
4513 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
4514 declare a %destructor for a mid-rule's semantic value. It's just
4515 impossible to declare one specific to it.
4516 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
4517 code. Describe default %destructor form.
4518 * src/parse-gram.y (grammar_declaration): Parse default
4519 %printer/%destructor declarations.
4520 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
4521 and symbol_destructor_location_get rather than accessing the destructor
4522 and destructor_location members of struct symbol.
4523 (symbol_printers_output): Likewise but for %printer's.
4524 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
4525 again.
4526 * src/symtab.c (default_destructor, default_destructor_location,
4527 default_printer, default_printer_location): New static global
4528 variables to record the default %destructor and %printer.
4529 (symbol_destructor_get, symbol_destructor_location_get,
4530 symbol_printer_get, symbol_printer_location_get): New functions to
4531 compute the appropriate %destructor and %printer for a symbol.
4532 (default_destructor_set, default_printer_set): New functions to set the
4533 default %destructor and %printer.
4534 * src/symtab.h: Prototype all those new functions.
4535 * tests/actions.at (Default %printer and %destructor): New test to
4536 check that the right %printer and %destructor are called, that they're
4537 not called for $end, and that $$ and @$ work correctly.
4538 (Default %printer and %destructor for user-declared end token): New
4539 test to check that the default %printer and %destructor are called for
4540 a user-declared end token.
4541 * tests/input.at (Default %printer and %destructor redeclared, Unused
4542 values with default %destructor): New tests to check related grammar
4543 warnings and errors.
4544
868d2d96
JD
45452006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
4546
4547 Clean up handling of %destructor for the end token (token 0).
4548 Discussed starting at
4549 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
4550 and
4551 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
4552
4553 Make the skeletons consistent in how they pop the end token and invoke
4554 its %destructor.
4555 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
4556 state, which has token number 0, since this would invoke the
4557 %destructor for the end token.
4558 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
4559 until after shifting the end token, or else it won't be popped.
4560 * data/yacc.c (yyparse): Likewise.
4561
4562 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
4563 it's the end token. Upon termination, destroy an unshifted lookahead
4564 even when it's the end token.
4565 * data/lalr1.cc (yy::parser::parse): Likewise.
4566 * data/yacc.c (yyparse): Likewise.
4567
4568 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
4569 value warnings for the end token when the user gives the end token a
4570 %destructor.
4571
4572 * tests/actions.at (Printers and Destructors): Test all the above.
4573
62a9592d
PE
45742006-07-24 Paul Eggert <eggert@cs.ucla.edu>
4575
4576 Update to latest gnulib and gettext versions.
4577 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
4578 Add fopen-safer.
4579 (gnulib_files): Add m4/warning.m4. Don't worry about files
4580 overwritten by autopoint.
4581 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
4582 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
4583 rejects them.
4584 Don't use autoreconf; instead, invoke autopoint etc. by hand,
4585 so that we can remove the intl files at a better time.
4586 (intl_files_to_remove): Remove aclocal.m4, since it gets
4587 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
4588 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
4589 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
4590 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
4591 Remove datarootdir hack; no longer needed.
4592 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
4593 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
4594 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
4595 strdup.h.
4596 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
4597 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
4598
10d6970f
PE
45992006-07-20 Paul Eggert <eggert@cs.ucla.edu>
4600
4601 * bootstrap: Adjust to today's change to gnulib-tool by invoking
4602 it with --assume-autoconf='latest-stable'.
4603
50a33993
JD
46042006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
4605
4606 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
4607 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
4608 YYSTYPE' and `{'.
4609 * src/muscle_tab.h (muscle_grow): Replace the header comments with
4610 those from muscle_tab.c since the old ones are misleading.
4611
2ce4ed68
AD
46122006-07-13 Akim Demaille <akim@epita.fr>
4613
4614 Support %define "KEY" {VALUE}.
4615 * src/scan-code.h, src/scan-code.l (translate_action)
4616 (translate_rule_action, translate_symbol_action, translate_code):
4617 Return char *, not const char *.
4618 * src/parse-gram.y (declaration): Rename as...
4619 (prologue_declaration): this.
4620 (string_content): Remove this nonterminal, use STRING.
4621 (braceless, content, content.opt): New nonterminal.
4622 Use them.
4623 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
4624 as value.
4625 * src/scan-gram.l (getargs.h): Don't include it.
4626
db7e5eb5
PE
46272006-07-12 Paul Eggert <eggert@cs.ucla.edu>
4628
4629 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
4630 rather than a for-loop that declares a local bool variable. This
4631 should work around a compatibility problem with a Cray x1e C++
4632 compiler reported by Hung Nguyen in
4633 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
4634 The for-loop was introduced in the 2004-11-17 change but I don't
4635 know why it was needed.
4636
a5d80ba5
AD
46372006-07-12 Akim Demaille <akim@epita.fr>
4638
4639 * data/c.m4: Comment changes.
4640
23eb2a69
AD
46412006-07-10 Akim Demaille <akim@lrde.epita.fr>
4642
4643 * src/complain.c (error_message, ERROR_MESSAGE): New.
4644 To factor...
4645 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
4646 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
4647
ddc8ede1
PE
46482006-07-09 Paul Eggert <eggert@cs.ucla.edu>
4649
4650 * NEWS: Instead of %union, you can define and use your own union type
4651 YYSTYPE if your grammar contains at least one <type> tag.
4652 Your YYSTYPE need not be a macro; it can be a typedef.
4653 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
4654 (Union Decl, Decl Summary): Document this.
4655 * data/glr.c (YYSTYPE): Implement this.
4656 * data/glr.cc (YYSTYPE): Likewise.
4657 * data/lalr1.cc (YYSTYPE): Likewise.
4658 * data/yacc.c (YYSTYPE): Likewise.
4659 * src/output.c (prepare): Output tag_seen_flag.
4660 * src/parse-gram.y (declaration, grammar_declaration):
4661 Use 'union_seen' rather than 'typed' to determine whether
4662 %union has been seen, since grammars can now be typed without
4663 %union.
4664 (symbol_declaration, type.opt, symbol_def):
4665 Keep track of whether a tag has been seen.
4666 * src/reader.c (union_seen, tag_seen): New vars.
4667 (typed): remove.
4668 * src/reader.h (union_seen, tag_seen, typed): Likewise.
4669 * src/scan-code.l (untyped_var_seen): New variable.
4670 (handle_action_dollar): Adjust to above changes.
4671 (handle_action_dollar, handle_action_at):
4672 Improve overflow checking for outlandish numbers.
4673 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
4674 avoid new diagnostics generated by above changes.
4675 * tests/regression.at (YYSTYPE typedef): Add test to check
4676 for type tags without %union.
4677
4678 * src/symlist.c (symbol_list_length): Return int, not unsigned
4679 int, since callers expect int. This may need to get revisited
4680 once we have proper integer overflow checking.
4681
4682 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
4683 object is now static.
4684
4685 * src/getargs.c (flags_argmatch): Return void, not int,
4686 to pacify ./configure --enable-gcc-warnings.
4687
4688 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
4689 since last_string is already defined to FLEX_PREFIX (last_string).
4690
7b42569e
AD
46912006-07-09 Akim Demaille <akim@lrde.epita.fr>
4692
4693 Implement --warnings/-W.
4694 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
4695 replaced by...
4696 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
4697 Adjust callers.
4698 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
4699 (warnings_args, warnings_types): New.
4700 (getargs, short_options, long_options): Accept -W/--warnings.
4701 Sort the options by alphabetical order, upper case letter right
4702 before its lower case.
4703
3b452f4e
JD
47042006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4705
4706 Change %merge result type clash warnings to errors. Discussed at
4707 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
4708 * src/reader.c (record_merge_function_type): Use complain_at.
4709 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4710 declared later): Update test case results.
4711
b8a41559
AD
47122006-07-09 Akim Demaille <akim@lrde.epita.fr>
4713
4714 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
4715 to be in alphabetical order.
4716 (trace_args): Spelling fixes.
4717
cd9e1ba2
PE
47182006-07-09 Paul Eggert <eggert@cs.ucla.edu>
4719
4720 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
4721 so they don't collide with user-defined macros.
4722 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
4723 this was never guaranteed, and now that we're using gnulib stdint,
4724 which defines int_fast16_t to long int, the problem is exposed.
4725
cb48f191
PE
47262006-07-08 Paul Eggert <eggert@cs.ucla.edu>
4727
b8445a15
PE
4728 * data/c.m4 (b4_basename): Simplify a bit, since we don't
4729 need the full POSIX semantics (and weren't implementing them
4730 anyway).
4731
cb48f191
PE
4732 Adjust to Autoconf 2.60 and today's gnulib.
4733 * bootstrap (gnulib_modules): Add stdint.
4734 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
4735 no longer copies it.
4736 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
4737 since stdint needs the former and wcwidth (which is now required
4738 by mbswidth) needs the latter.
4739 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
4740 work around a compatibility glitch between gettext 0.14.6 and
4741 Autoconf 2.60.
4742 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
4743 Do not check for uintptr_t, since new stdint module does the right
4744 thing.
4745 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
4746 Add stdint.h, stdint_.h, wcwidth.h.
4747 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
4748 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
4749 stdint.m4, wchar_t.m4, wcwidth.m4.
4750 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
4751 usual order for ../lib/*.h files.
4752 (file_name_split): Use last_component, not base_name, to adjust
4753 to gnulib changes.
4754 * src/parse-gram.h: Include <strverscmp.h> in the usual order
4755 for ../lib/*.h files.
4756 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
4757 Define unconditionally, since we now assume the stdint module.
4758 * src/scan-skel.l: Include <dirname.h>.
4759 (BASE_QPUTS): Use last_component, not base_name.
4760 * src/system.h: Include <unlocked-io.h> in the usual order
4761 for ../lib/*.h files. Include <stdint.h> unconditionally,
4762 since we now use the stdint module.
4763 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
4764 HAVE_UINTPTR_T, since we now use the stdint module.
4765 (base_name): Remove decl, since files now include <dirname.h>
4766 to get the decl.
4767
cd48d21d
AD
47682006-07-08 Akim Demaille <akim@lrde.epita.fr>
4769
4770 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
4771 New, default to 1.
4772 * data/yacc.c, data/glr.c, data/location.cc: Use them.
4773 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
4774 default.
4775 * tests/calc.at: Adjust.
4776
8ec0a172
AD
47772006-07-08 Akim Demaille <akim@lrde.epita.fr>
4778
b8445a15 4779 * data/c.m4 (b4_basename): New.
8ec0a172
AD
4780 (b4_syncline): Also output the location of its invocation (from
4781 the skeleton).
4782 (b4_user_action, b4_define_user_action, b4_user_actions)
4783 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
4784 (b4_user_stype): New.
4785 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
4786
4a678af8
JD
47872006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
4788
4789 In the grammar file, the first column is 1 not 0 on the first line as
4790 on every other line.
4791 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
4792 * tests/input.at (Torturing the Scanner): Update output.
4793
4794 * src/scan-gram.l (scanner_cursor): Declare it static.
4795
dd60572a
JD
47962006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
4797
4798 In warnings, say "previous declaration" rather than "first
4799 declaration".
4800 * src/symtab.c (redeclaration): Do that here.
4801 * src/reader.c (record_merge_function_type): In the case of a result
4802 type clash, report the previous declaration rather than the very first
4803 one in the grammar file.
4804 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4805 declared later): Add a third declaration to check this behavior.
4806 * tests/input.at (Incompatible Aliases): Update output.
4807
2073e1b6
AD
48082006-06-27 Akim Demaille <akim@epita.fr>
4809
4810 * doc/Doxyfile.in: New.
4811 * doc/Makefile.am: Use it.
4812 * src/lalr.h, src/symtab.h: Initial doxygenation.
4813
8ee5b538
JD
48142006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4815
4816 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
4817 declared after the %merge. This continues the effort of the previous
4818 patch.
8ee5b538
JD
4819 * src/reader.c (get_merge_function): Don't set the merger type yet.
4820 (record_merge_function_type): New function for setting the merger type
4821 and checking for clashes.
4822 (grammar_current_rule_merge_set): Set the location of the %merge for
4823 the current rule.
4824 (packgram): Invoke record_merge_function_type for each rule now that
4825 all symbol type declarations have been parsed.
4826 * src/reader.h (merger_list.type_declaration_location): New member
4827 storing the location of the first %merge from which the type for this
4828 merging function was derived.
4829 * src/symlist.h (symbol_list.merger_declaration_location): New member
4830 storing the location of a rule's %merge, if any.
4831 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4832 declared later): New test to catch the error fixed by the above patch.
4833
ffa4ba3a
JD
48342006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4835
4836 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
4837 declarations appear after the rules. Discussed at
4838 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
4839 and
4840 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
4841 Don't mistake the type of $$ in a midrule to be that of its parent
4842 rule's $$.
ffa4ba3a
JD
4843 * src/reader.c (grammar_current_rule_end): Don't invoke
4844 grammar_rule_check yet since not all symbol declarations may have been
4845 parsed yet.
4846 (grammar_midrule_action): Likewise.
4847 Don't record whether the midrule's $$ has been used yet since actions
4848 haven't been translated yet.
4849 Record the midrule's parent rule and its RHS index within the parent
4850 rule.
4851 (grammar_current_rule_action_append): Don't translate the action yet
4852 since not all symbol declarations may have been parsed yet and, thus,
4853 warnings about types for $$, $n, @$, and @n can't be reported yet.
4854 (packgram): Translate the action and invoke grammar_rule_check now that
4855 all symbol declarations have been parsed.
4856 * src/scan-code.l (handle_action_dollar): Now that this is invoked
4857 after parsing the entire grammar file, the symbol list here in the case
4858 of a midrule is actually the midrule's empty RHS, so reference its
4859 parent rule's RHS where necessary.
4860 On the other hand, now that you can already know it's a midrule, you
4861 aren't forced to think $$ has the same type as its parent rule's $$.
4862 (handle_action_at): In the case of a midrule, reference the parent rule
4863 where necessary.
4864 * src/symlist.c (symbol_list_new): Initialize new midrule-related
4865 members.
4866 (symbol_list_length): Now that this is invoked after all rules have
4867 been parsed, a NULL symbol (rather than a NULL symbol list node)
4868 terminates a rule. symbol_list_print already does this correctly.
4869 * src/symlist.h (symbol_list.midrule_parent_rule,
4870 symbol_list.midrule_parent_rhs_index): New members so that midrules can
4871 remember their relationships with their parents.
4872 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
4873 fixed by the above patch.
4874 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
4875 implementing...
4876 (Unused values): ... this old test case and...
4877 (Unused values before symbol declarations): ... this new test case.
4878 This one is the same as `Unused values' except that all symbol
4879 declarations appear after the rules in order to catch the rest of the
4880 errors fixed by the above patch.
4881
e256e17f
JD
48822006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4883
300a1930
JD
4884 More cleanup.
4885 * src/reader.c (current_rule): Declare it static since it's no longer
4886 used outside this file.
4887 (grammar_current_rule_action_append): Remove redundant arguments from
4888 translate_rule_action invocation.
4889 * src/reader.h (current_rule): Remove this unused extern.
4890 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
4891 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 4892
381ecb06
JD
48932006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
4894
4895 Clean up yesterday's patch.
4896 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
4897 to...
4898 * src/reader.c (grammar_current_rule_action_append): ... here for
4899 consistency with grammar_current_rule_symbol_append.
4900 * tests/regression.at (Braced code in declaration in rules section):
4901 Make yyerror and yylex static as usual.
4902
4210cd0b
JD
49032006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
4904
4905 Fix bug that mistakes braced code in a declaration in the rules section
4906 to be a rule action. Mentioned at
4907 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
4908 * src/scan-gram.l: Move midrule action detection from the start of the
4909 scanning of any braced code to...
4910 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
4911 action. For readability, use $2 and @2 rather than the equivalent
4912 global variables.
4913 * tests/regression.at (Braced code in declaration in rules section):
4914 New test to catch the error fixed by the above patch.
4915
4916 Work on code readability some.
4917 * src/scan-code.l (current_rule): Get rid of this misleading and
4918 redundant declaration: it's actually extern'ed in reader.h.
4919 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
4920 translate_action): Add a rule argument and use it instead of the global
4921 current_rule.
4922 (translate_rule_action): This already receives current_rule through an
4923 argument, so pass it on to translate_action instead of assigning
4924 current_rule to current_rule.
4925 (translate_symbol_action, translate_code): Pass rule = NULL to
4926 translate_action.
4927
34f98f46
JD
49282006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
4929
4930 Rename %before-definitions to %start-header and %after-definitions to
4931 %end-header. Don't use these declarations to separate pre-prologue
4932 blocks from post-prologue blocks. Add new order-independent
4933 declarations %before-header and %after-header as alternatives to the
4934 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
4935 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
4936 * NEWS (2.3+): Update for these changes.
4937 * data/glr.c (b4_before_definitions): Update to...
4938 (b4_start_header): ... this.
4939 (b4_after_definitions): Update to...
4940 (b4_end_header): ... this.
4941 * data/glr.cc: Likewise.
4942 * data/lalr1.cc: Likewise.
4943 * data/yacc.c: Likewise.
4944 * doc/bison.texinfo (The prologue): Update names, and replace remaining
4945 prologue blocks with %*-header declarations.
4946 (Calc++ Parser): Likewise.
91661ebb 4947 (Decl Summary): Update names.
148d66d8 4948 (Table of Symbols): Update description.
34f98f46
JD
4949 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
4950 (PERCENT_END_HEADER): ... this.
4951 (PERCENT_BEFORE_DEFINITIONS): Update to...
4952 (PERCENT_START_HEADER): ... this.
4953 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4954 (declaration): Update token names and m4 macro names.
4955 When parsing %end-header and %start-header, invoke translate_code
4956 before muscle_code_grow, and no longer set global booleans to remember
4957 whether these declarations have been seen.
4958 Parse new %after-header and %before-header.
4959 * src/reader.c (before_definitions, after_definitions): Remove.
4960 (prologue_augment): Accept a new bool argument to specify whether to
4961 augment the pre-prologue or post-prologue.
4962 * src/reader.h (before_definitions, after_definitions): Remove these
4963 extern's.
4964 (prologue_augment): Add new bool argument.
4965 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
4966 (PERCENT_END_HEADER): ... this.
4967 (PERCENT_BEFORE_DEFINITIONS): Update to...
4968 (PERCENT_START_HEADER): ... this.
4969 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4970 * tests/actions.at (Printers and Destructors): Update names.
4971
31b2b07e
JD
49722006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
4973
4974 Add comparison operators for C++ location classes. Discussed at
4975 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
4976 * data/c++.m4 (b4_define_location_comparison): New boolean %define
4977 declaration indicating whether filename_type has an operator==. If
4978 filename_type is `std::string', it defaults to `1', `0' otherwise.
4979 * data/location.cc: Iff b4_define_location_comparison is `1', add
4980 operator== and operator!= for class position and for class location.
4981
4982 Some minor fixes.
4983 * src/scan-action.l: Remove unused file.
4984 * src/symtab.c (symbol_printer_set): Use printer_location not
4985 destructor_location.
4986 * src/symtab.h (struct symbol): Replace incorrect source comment for
4987 printer members.
4988 * tests/input.at (Incompatible Aliases): Update output with correct
4989 printer location.
4990
9bc0dd67
JD
49912006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
4992
4993 Don't put the pre-prologue in the header file. For the yacc.c code
4994 file and the glr.c header and code files, move the pre-prologue before
4995 the token definitions. Add new %before-definitions and
4996 %after-definitions to declare code that will go in both the header file
4997 and code file. Discussed at
4998 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
4999 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
5000 and
5001 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
5002 * NEWS (2.3+): Describe these changes.
5003 * data/glr.c (b4_pre_prologue): Move from within to before...
5004 (b4_shared_declarations): ... this.
5005 Add new b4_before_definitions before b4_token_enums.
5006 Add new b4_after_definitions at the end.
5007 * data/glr.cc (b4_pre_prologue): Replace with...
5008 (b4_before_definitions): ... this in the header file.
5009 (b4_after_definitions): New near the end of the header file.
5010 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
5011 code file right before including the header file.
5012 (b4_before_definitions): New in the previous position of
5013 b4_pre_prologue in the header file.
5014 (b4_after_definitions): New near the end of the header file.
5015 * data/yacc.c: Clean up some m4 quoting especially in the header file.
5016 (b4_token_enums_defines): In the code file, move to right before
5017 YYSTYPE for consistency with the header file.
5018 (b4_before_definitions): New right before b4_token_enums_defines in
5019 both the header and code file.
5020 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
5021 header and code file.
5022 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
5023 of prologues for %union dependencies.
91661ebb
JD
5024 (Decl Summary): In %defines description, mention the effect of
5025 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
5026 (Calc++ Parser): Forward declare driver in a %before-definitions rather
5027 than in the pre-prologue so that make check succeeds.
148d66d8 5028 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
5029 %after-definitions.
5030 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
5031 %before-definitions.
5032 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
5033 (declaration): Parse those declarations and append to
5034 b4_before_definitions and b4_after_definitions, respectively.
5035 * src/reader.c (before_definitions, after_definitions): New bools to
5036 track whether those declarations have been seen.
5037 (prologue_augment): Add to the post-prologue if %union,
5038 %before-definitions, or %after-definitions has been seen.
5039 * src/reader.h (before_definitions, after_definitions): New extern's.
5040 * src/scan-gram.l: Scan the new declarations.
5041 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
5042 prologue block in a %before-definitions or a %after-definitions based
5043 on whether the %union is declared.
5044 * tests/regression.at (Early token definitions with --yacc, Early token
5045 definitions without --yacc): Move tests for token definitions into the
5046 post-prologue since token names are no longer defined in the
5047 pre-prologue.
5048
203b9274
AD
50492006-06-20 Akim Demaille <akim@epita.fr>
5050
5051 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
5052 (symbol_get): Use it.
5053 * src/parse-gram.y: Use it.
5054
a7ee59cf
JD
50552006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
5056
5057 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
5058 build succeeds when configured with --enable-gcc-warnings.
5059
5a2baae7
PE
50602006-06-19 Paul Eggert <eggert@cs.ucla.edu>
5061
33ad1a9c
PE
5062 * src/parse-gram.y (char_name): New function.
5063 (CHAR, STRING, string_content): For %printer, properly escape.
5064 (ID): Prefer fputs to fprintf.
5065 (id): Reindent to be consistent with other rules.
5066 Properly quote char.
5067
5a2baae7
PE
5068 The Translation Project changed its way of publishing translations
5069 to maintainers. I haven't received any responses to my request
5070 for supporting the old way, or for documenting the new way. I
5071 have modified 'bootstrap' to use screen scraping
5072 (in this case, HTML scraping). This is unreliable and inelegant,
5073 but I don't see any better way. Yuck.
5074 * bootstrap (TP_URL, WGET_COMMAND): New vars.
5075 (get_translations): New function, which uses HTML scraping to
5076 deduce locations of latest translations.
5077 Use this function to grab both bison and bison-runtime .po files.
5078 Don't bother priming the pump for the runtime-po domain any more,
5079 as it's now translated better than bison is.
5080
58d7a1a1
AD
50812006-06-19 Akim Demaille <akim@epita.fr>
5082
5083 * src/scan-gram.l: No longer "parse" things after `%union' until
5084 `{'. Rather, return a single "%union" token.
5085 No longer make symbols: return strings, and leave the conversion
5086 to symbols to the parser.
5087 (SC_PRE_CODE, token_type): Remove.
5088 * src/parse-gram.y (%union): New field `character'.
5089 Sort tokens.
5090 (CHAR): New token.
5091 (ID, ID_COLON): Now that the scanner no longer makes them
5092 identifiers, adjust all uses to invoke symbol_get.
5093 (id_colon): New, wraps the conversion from string to symbol.
5094 (%union): Accept a possible union_name.
5095 (symbol): Now can be a char.
5096 * data/c.m4 (b4_union_name): Leave a default value.
5097 * data/glr.c, data/yacc.c: Use it.
5098
b931235e
JD
50992006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
5100
5101 For associating token numbers with token names for "yacc.c", don't use
5102 #define statements unless `--yacc' is specified; always use enum
5103 yytokentype. Most important discussions start at:
5104 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
5105 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
5106 and
5107 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
5108 * NEWS (2.3+): Mention.
5109 * data/c.m4 (b4_yacc_if): New.
5110 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
5111 token #define's.
5112 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
5113 on token name definitions.
5114 * src/getargs.c (usage): Capitalize `Yacc' in English.
5115 * src/output.c (prepare): Define b4_yacc_flag.
5116 * tests/regression.at (Early token definitions): Test that tokens names
5117 are defined before the pre-prologue not just before the post-prologue.
5118 Remove this test case and copy to...
5119 (Early token definitions with --yacc): ... this to test #define's.
5120 (Early token definitions without --yacc): ... and this to test enums.
5121
9e6e7ed2
PE
51222006-06-11 Paul Eggert <eggert@cs.ucla.edu>
5123
5124 * NEWS: Reword the post-2.3 change to not be so optimistic about
5125 removing the old "look-ahead" spelling.
5126 Update previous look-ahead/lookahead change reports.
5127 * REFERENCES: look-ahead -> lookahead (since that's
5128 what he actually wrote).
5129 * doc/refcard.tex: look ahead -> lookahead,
5130 look-ahead -> lookahead
5131
742e4900
JD
51322006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
5133
5134 For consistency, use `lookahead' instead of `look-ahead' or
5135 `look_ahead'. Discussed starting at
5136 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
5137 and then at
5138 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
5139 * NEWS: For the next release, note the change to `--report'.
5140 * TODO, doc/bison.1: Update English.
5141 * doc/bison.texinfo: Update English.
5142 (Understanding Your Parser, Bison Options): Document as
5143 `--report=lookahead' rather than `--report=look-ahead'.
5144 * src/conflicts.c: Update English in comments.
5145 (lookahead_set): Rename from look_ahead_set.
5146 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
5147 (resolve_sr_conflict): Rename local look_ahead_tokens to
5148 lookahead_tokens, and update other uses.
5149 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
5150 count_rr_conflicts, conflicts_free): Update uses.
5151 * src/getargs.c (report_args): Move "lookahead" before alternate
5152 spellings.
5153 (report_types): Update uses.
5154 (usage): For `--report' usage description, state `lookahead' spelling
5155 rather than `look-ahead'.
5156 * src/getargs.h (report.report_lookahead_tokens): Rename from
5157 report_look_ahead_tokens.
5158 * src/lalr.c: Update English in comments.
5159 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
5160 (state_lookahead_tokens_count): Rename from
5161 state_look_ahead_tokens_count.
5162 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5163 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
5164 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5165 Update other uses.
5166 Update English in output.
5167 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
5168 * src/print.c: Update English in comments.
5169 (lookahead_set): Rename from look_ahead_set.
5170 (print_reduction): Rename argument lookahead_token from
5171 look_ahead_token.
5172 (print_core, state_default_rule, print_reductions, print_results):
5173 Update uses.
5174 * src/print_graph.c: Update English in comments.
5175 (print_core): Update uses.
5176 * src/state.c: Update English in comments.
5177 (reductions_new): Update uses.
5178 (state_rule_lookahead_tokens_print): Rename from
5179 state_rule_look_ahead_tokens_print, and update other uses.
5180 * src/state.h: Update English in comments.
5181 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
5182 (state_rule_lookahead_tokens_print): Rename from
5183 state_rule_look_ahead_tokens_print.
5184 * src/tables.c: Update English in comments.
5185 (conflict_row, action_row): Update uses.
5186 * tests/glr-regression.at
5187 (Incorrect lookahead during deterministic GLR,
5188 Incorrect lookahead during nondeterministic GLR): Rename
5189 print_look_ahead to print_lookahead.
5190 * tests/torture.at: Update English in comments.
5191 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
5192 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
5193 (Many lookahead tokens): Update uses.
5194 * data/glr.c: Update English in comments.
5195 * lalr1.cc: Likewise.
5196 * yacc.c: Likewise.
5197 * src/conflicts.h: Likewise.
5198 * src/lalr.h: Likewise.
5199 * src/main.c: Likewise.
5200 * src/output.c: Likewise.
5201 * src/parse-gram.c: Likewise.
5202 * src/tables.h: Likewise.
5203 * tests/calc.at: Likewise.
5204
3c40d0b5
JD
52052006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
5206
5207 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
5208
5d278082
PE
52092006-06-07 Paul Eggert <eggert@cs.ucla.edu>
5210
5211 * TODO: Add request from Nelson H. F. Beebe to be able to install
5212 Bison without installing the yacc script.
5213
9e668899
JD
52142006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
5215
5216 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
5217 and yytext if they're already #define'd.
5218 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
5219 * src/scan-code-c.c: ... here.
5220 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
5221 <config.h>.
5222
0c8e079f
JD
52232006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
5224
5225 Get Bison to build again when configured with --enable-gcc-warnings.
5226 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
5227 missing #include's.
5228 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
5229 loc argument as it shadows a global.
5230 * src/scan-gram.l: Remove stray comma that prevents boundary_set
5231 invocation.
5232
5233 * src/.cvsignore: Add scan-code.c.
5234
2346344a
AD
52352006-06-07 Akim Demaille <akim@epita.fr>
5236
5237 * src/scan-gram.l: Move the "add a trailing ; to actions" code
5238 to...
5239 * src/scan-code.l: here.
5240 * tests/input.at (Torturing the Scanner): Fix another location
5241 error.
5242
4862bdfd
AD
52432006-06-07 Akim Demaille <akim@epita.fr>
5244
5245 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
5246
e9071366
AD
52472006-06-06 Akim Demaille <akim@epita.fr>
5248
5249 Extract the parsing of user actions from the grammar scanner.
5250 As a consequence, the relation between the grammar scanner and
5251 parser is much simpler. We can also split "composite tokens" back
5252 into simple tokens.
5253 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
5254 * src/scan-gram.l (add_column_width, adjust_location): Move to and
5255 rename as...
5256 * src/location.h, src/location.c (add_column_width)
5257 (location_compute): these.
5258 Fix the column count: the initial column is 0.
5259 (location_print): Be robust to ending column being 0.
5260 * src/location.h (boundary_set): New.
5261 * src/main.c: Adjust to scanner_free being renamed as
5262 gram_scanner_free.
5263 * src/output.c: Include scan-code.h.
5264 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
5265 Use boundary_set.
5266 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
5267 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
5268 which is now, again, a separate token.
5269 Adjust all dependencies.
5270 Whereever actions with $ and @ are used, use translate_code.
5271 (action): Remove this nonterminal which is now useless.
5272 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
5273 (grammar_current_rule_action_append): Use translate_code.
5274 (packgram): Bound check ruleno, itemno, and rule_length.
5275 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
5276 (last_string, last_braced_code_loc, max_left_semantic_context)
5277 (scanner_initialize, scanner_free, scanner_last_string_free)
5278 (gram_out, gram_lineno, YY_DECL_): Move to...
5279 * src/scan-gram.h: this new file.
5280 (YY_DECL): Rename as...
5281 (GRAM_DECL): this.
5282 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
5283 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
5284 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
5285 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
5286 Move these declarations, and...
5287 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
5288 these to...
5289 * src/flex-scanner.h: this new file.
5290 * src/scan-gram.l (rule_length, rule_length_overflow)
5291 (increment_rule_length): Remove.
5292 (last_braced_code_loc): Rename as...
5293 (gram_last_braced_code_loc): this.
5294 Adjust to the changes of the parser.
5295 Move all the handling of $ and @ into...
5296 * src/scan-code.l: here.
5297 * src/scan-gram.l (handle_dollar, handle_at): Remove.
5298 (handle_action_dollar, handle_action_at): Move to...
5299 * src/scan-code.l: here.
5300 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
5301 scan-code.h, scan-code-c.c, scan-gram.h.
5302 (EXTRA_bison_SOURCES): Add scan-code.l.
5303 (BUILT_SOURCES): Add scan-code.c.
5304 (yacc): Be robust to white spaces.
5305
5306 * tests/conflicts.at, tests/input.at, tests/reduce.at,
5307 * tests/regression.at: Adjust the column numbers.
5308 * tests/regression.at: Adjust the error message.
7891a7c4 5309
184e42f0
JD
53102006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
5311
5312 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
5313 Use Akim's wording from
5314 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
5315
7891a7c4
JD
53162006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
5317
5318 Between Bison releases, manually append `+' to the previous Bison
5319 release number, and use that as a signal to automatically print the
5320 ChangeLog's CVS Id keyword from --version. Discussed starting at
5321 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
5322 * ChangeLog: Add Id header.
5323 * configure.ac (AC_INIT): Append `+' to `2.3'.
5324 * src/.cvsignore: Add revision.c.
5325 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
5326 (BUILT_SOURCES): Add revision.c.
5327 (revision.c): New target rule. This file defines a new global variable
5328 named revision. It initializes it with either the Id from ChangeLog
5329 or, if VERSION doesn't contain `+', with the empty string.
5330 * src/getargs.c (version): Print the value of revision.
5331 * src/revision.h: Extern revision.
5332
4ad3ed84
PE
53332006-06-05 Paul Eggert <eggert@cs.ucla.edu>
5334
5335 * NEWS: Version 2.3.
5336 * configure.ac (AC_INIT): Likewise.
5337
02103984
PE
53382006-05-30 Paul Eggert <eggert@cs.ucla.edu>
5339
5340 * data/glr.c (YYRECOVERING): Define to be a function-like macro
5341 with no arguments, not as an object-like macro. This is for
5342 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
5343 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
5344 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
5345 Document this.
5346
2c08afa5
JD
53472006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
5348
5349 * src/getargs.c (usage): Back out yesterday's modification of the
5350 --help output so that we don't have to wait for translation before
5351 releasing 2.3.
5352
6077da58
PE
53532006-05-29 Paul Eggert <eggert@cs.ucla.edu>
5354
5355 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
5356 Problem reported by Akim Demaille.
5357
2a26b6c2
JD
53582006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5359
5360 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
5361
aefef0d6
PE
53622006-05-26 Paul Eggert <eggert@cs.ucla.edu>
5363
5364 * data/yacc.c (yy_reduce_print): Omit trailing white space in
5365 generated source code. Problem reported by Frans Englich in
5366 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
5367
fcd8e201
PE
53682006-05-22 Paul Eggert <eggert@cs.ucla.edu>
5369
5370 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
5371 shell, not within 'make', so that 'make' by an ordinary builder
5372 (using GNU make) does not worry about configuring gzip. This also
5373 works around a bug reported independently by Keith Thompson and by
5374 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
5375 stderr rather than stdout, messing up the build logs.
5376
7b5cdcbd
JD
53772006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
5378
5379 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
5380 to make sure that YYID will never be unused. This fixes a 'make
5381 maintainer-check' failure caused by the recent changes to the 'Trivial
5382 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
5383 not used.
5384 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
5385
5ad0a449
JD
53862006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
5387
5388 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
5389 state before an empty RHS is always resolved here. Only the location
5390 of that state is guaranteed to be resolved, and that's enough. This
5391 fixes the remaining bug reported by Derek M. Jones in
5392 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
5393 * tests/glr-regression.at (Uninitialized location when reporting
5394 ambiguity): Test the above case.
5395 Also, the embedded comments in this test case claim it checks the case
5396 of an empty RHS that has inherited the initial location. However, the
5397 corresponding LHS was already resolved, so yyresolveLocations didn't
5398 actually have reason to modify it. Fix this by forcing
5399 nondeterministic operation at the beginning of the parse.
5400
50cce58e
PE
54012006-05-20 Paul Eggert <eggert@cs.ucla.edu>
5402
5403 * data/c.m4 (b4_yy_symbol_print_generate):
5404 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
5405 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
5406 of the bugs reported today by Derek M Jones in
5407 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
5408 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
5409 defined to be a type name without parens or brackets.
5410 (Location Type): Similarly for YYLTYPE.
5411 * tests/regression.at (Trivial grammars): Put in a test for this
5412 bug that will be caught by 'make maintainer-check' (though not,
5413 alas, by 'make check' unless your compiler is picky).
5414
ab8d9dc5
PE
54152006-05-19 Paul Eggert <eggert@cs.ucla.edu>
5416
0d2c8934 5417 * NEWS: Version 2.2.
ab8d9dc5
PE
5418 * configure.ac (AC_INIT): Likewise.
5419
9138c575
JD
54202006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
5421
5422 * data/glr.c (yyreportTree): Make room in yystates for the state
5423 preceding the RHS. This fixes the segmentation fault reported by Derek
5424 M. Jones in
5425 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
5426 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
5427 to the user. Reported for yyreportTree by Derek M. Jones later in the
5428 same thread.
5429 * THANKS: Add Derek M. Jones.
5430 Update my email address.
5431 Fix typo in Steve Murphy's name.
5432
276f48df
PE
54332006-05-14 Paul Eggert <eggert@cs.ucla.edu>
5434
d6645148
PE
5435 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
5436 checking against YYLAST that caused the parser to miss a potential
5437 alternative in its diagnostic.
5438 Problem reported by Maria Jose Moron Fernandez in
5439 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
5440 * data/lalr1.cc (yysyntax_error_): Likewise.
5441 * data/yacc.c (yysyntax_error): Likewise.
5442 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
5443 tokens, in case we run into an older C compiler.
5444 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
5445 Use them to check for the off-by-one error fixed above.
5446
276f48df
PE
5447 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
5448 YYSIZE_T, not size_t.
5449 * tests/regression.at (Trivial grammars): New test, to catch
5450 the error fixed by the above patch.
5451
cd8b5791
AD
54522006-05-14 Akim Demaille <akim@lrde.epita.fr>
5453
5454 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
5455 scheme.
5456 Reported by Steve Murphy.
5457
34376418
AD
54582006-05-14 Akim Demaille <akim@lrde.epita.fr>
5459
5460 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
5461 * data/glr.cc: b4_location_flag is now b4_locations_flag.
5462
327afc7c
AD
54632006-05-14 Akim Demaille <akim@lrde.epita.fr>
5464
5465 Implement --trace=m4.
5466 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
5467 * src/output.c (output_skeleton): When set, pass -dV to m4.
5468
5469 Factor the handling of flags in m4.
5470 * src/output.c (prepare): Rename the muscle names debug, defines,
5471 error_verbose to debug_flag, defines_flag, error_verbose_flag.
5472 * data/c.m4: Adjust.
5473 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
5474 Use b4_define_flag_if to define other b4_FLAG_if macros.
5475 (b4_location_if): As a consequence, rename as...
5476 (b4_locations_if): this, for consistency.
5477 Adjust all the skeletons.
5478
ba9ecd19
AD
54792006-05-14 Akim Demaille <akim@lrde.epita.fr>
5480
5481 * etc/bench.pm: Shorten bench names.
5482
4e83ea15
AD
54832006-05-14 Akim Demaille <akim@lrde.epita.fr>
5484
5485 * src/output.h, src/output.c (error_verbose): Move to...
5486 * src/getargs.h, src/getargs.c: here.
5487 Sort the flags.
5488 Adjust dependencies.
5489
6e93d810
PE
54902006-05-13 Paul Eggert <eggert@cs.ucla.edu>
5491
5492 * data/c.m4 (b4_copyright): Put the special exception for Bison
5493 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
5494 uses changed. Suggested by Akim Demaille. Also, wrap the
5495 copyright notice, in case it is longer than 80 columns. Replace
5496 comma by newline after title.
6e93d810 5497
eaea13f5
PE
54982006-05-11 Paul Eggert <eggert@cs.ucla.edu>
5499
5500 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
5501 incompatibility, not a bug. Mention that it wasn't fixed as of
5502 flex 2.5.33.
5503
3cf084ec
AD
55042006-05-11 Akim Demaille <akim@lrde.epita.fr>
5505
5506 * examples/extexi: Enforce the precedence of concatenation over
5507 >>.
0a9f1c7d 5508 Reported by Tommy Nordgren.
3cf084ec 5509
32c96bd7
AD
55102006-05-11 Akim Demaille <akim@lrde.epita.fr>
5511
5512 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
5513 with the member "token".
f94705b2 5514 Reported by Martin Nylin.
32c96bd7 5515
eaea13f5
PE
55162006-05-08 Paul Eggert <eggert@cs.ucla.edu>
5517
5518 * data/glr.c: Switch to Bison 2.2 special-exception language in
5519 the copyright notice. Use more-regular format for titles and
5520 copyright notices.
5521 * data/glr.cc: Likewise.
5522 * data/location.cc: Likewise.
5523 * data/yacc.cc: Likewise.
5524 * doc/bison.texinfo (Conditions): Document this.
5525 * NEWS: likewise. Upgrade version to 2.2.
5526
6e2d1146
AD
55272006-04-27 Akim Demaille <akim@lrde.epita.fr>
5528
5529 * data/glr.cc: Remove dead code.
5530
47671055
PE
55312006-04-25 Paul Eggert <eggert@cs.ucla.edu>
5532
5533 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
5534 that variable and the line breaks the bootstrap. Problem reported
5535 by Juan M. Guerrero.
5536
ed2e6384
AD
55372006-04-24 Akim Demaille <akim@lrde.epita.fr>
5538
5539 * doc/bison.texinfo (Multiple start-symbols): New.
5540
3cedc2dc
AD
55412006-04-24 Akim Demaille <akim@lrde.epita.fr>
5542
5543 * etc/README, etc/bench.pl: New.
5544
b2ddc3f3
AD
55452006-04-03 Akim Demaille <akim@lrde.epita.fr>
5546
5547 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
5548 rule.
5549 Reported by Mickael Labau.
5550 * tests/input.at (Torturing the Scanner): Test it.
5551
91e3ac9a
PE
55522006-03-16 Paul Eggert <eggert@cs.ucla.edu>
5553
5554 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
5555 Problem reported by Bob Rossi.
5556
55572006-03-13 Paul Eggert <eggert@cs.ucla.edu>
5558
5559 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
5560 and didn't really work.
5561 For the index, use @ifnotinfo, not @iftex.
5562 Minor cleanups of spacing and terminology.
5563
5cf61e93
AD
55642006-03-12 Akim Demaille <akim@lrde.epita.fr>
5565
5566 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
5567 of AT_NAME_PREFIX when %name-prefix is not used.
5568
aa08666d
AD
55692006-03-12 Akim Demaille <akim@lrde.epita.fr>
5570
5571 Apply --prefix to C++ skeletons too: they change the namespace.
5572 The test suite already exercize these cases.
5573 * data/c++.m4 (b4_namespace): New.
5574 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
5575 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
5576 * data/yacc.c, data/glr.c: Remove a useless `[]'.
5577 * doc/bison.texinfo: Document it.
5578 (Option Cross Key): Use @multitable in all formats. It looks
5579 nicer, even in TeX outputs.
5580 (Rules): Use the same code whatever the output type is.
5581 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
5582 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
5583 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 5584
45567173
AD
55852006-03-10 Akim Demaille <akim@lrde.epita.fr>
5586
5587 * TODO: Remove dead items.
5588
e9d8f881 55892006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
5590
5591 * doc/FAQ: Remove, merged into...
5592 * doc/bison.texinfo (FAQ): this.
5593 * doc/Makefile.am (EXTRA_DIST): Adjust.
5594
c095d689
AD
55952006-03-10 Akim Demaille <akim@lrde.epita.fr>
5596
5597 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
5598 even if empty.
5599 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
5600 * doc/bison.texinfo (Calc++ Scanner): Use it.
5601
6e0f8287
PE
56022006-03-09 Paul Eggert <eggert@cs.ucla.edu>
5603
5604 Fix two nits reported by twlevo, plus one more that I discovered.
5605
5606 * src/assoc.h (assoc_to_string): Give a name to the arg, as
5607 this is the usual Bison style.
5608 * src/location.h (location_print): Likewise.
5609
5610 * src/reader.h (token_name): Likewise.
5611
d6b771c3
PE
56122006-03-08 Paul Eggert <eggert@cs.ucla.edu>
5613
5614 Fix some nits reported by twlevo.
5615 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
5616 and "POSIX". Use more-modern syntax for URLs. Mention C++
5617 and ask for Java. Don't hardwire OS version numbers. Add
5618 copyright notice.
5619 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
5620 * src/conflicts.c (solved_conflicts_obstack): Now static.
5621
1e137b71
JD
56222006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
5623
5624 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
5625 page. Say "you can use it" not "you may use it" as on the web page;
5626 we're describing capabilities not granting permission.
5627
73f2e47e
PE
56282006-03-06 Paul Eggert <eggert@cs.ucla.edu>
5629
6d05403d
PE
5630 * data/glr.c (yyresolveLocations): Rename local variables to avoid
5631 shadowing warnings. Use usual patter for iterating through RHS.
5632 * tests/glr-regression.at
5633 (Uninitialized location when reporting ambiguity):
5634 Modify yylex so that it uses its argument, rather than trying
5635 to rely on ARGSUSED (which doesn't work for gcc with warnings).
5636 const char -> char const.
5637
73f2e47e
PE
5638 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
5639 Don't use tabs inside commands; it messes up 'ps'.
5640 Problem reported by twlevo.
5641
8710fc41
JD
56422006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
5643
5644 * tests/glr-regression.at (Uninitialized location when reporting
5645 ambiguity): New test case.
5646 * data/glr.c (yyresolveLocations): New function, which uses
5647 YYLLOC_DEFAULT.
5648 (yyresolveValue): Invoke yyresolveLocations before reporting an
5649 ambiguity.
5650 * doc/bison.texinfo (Default Action for Locations): Note
5651 YYLLOC_DEFAULT's usage for ambiguity locations.
5652 (GLR Semantic Actions): Cross-reference those notes.
5653
ae952af2
JD
56542006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
5655
5656 * tests/glr-regression.at (Leaked semantic values when reporting
5657 ambiguity): Remove unnecessary union and type declarations.
5658 (Leaked lookahead after nondeterministic parse syntax error): New test
5659 case.
5660 * data/glr.c (yyparse): Check for zero stacks remaining before
5661 attempting to shift the lookahead so that you don't lose it.
5662
35ee866a
JD
56632006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5664
5665 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
5666 * tests/glr-regression.at (Leaked semantic values when reporting
5667 ambiguity): New test case.
5668 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
5669 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
5670 now unnecessary yystackp parameter.
5671 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
5672 destructors can be called.
5673
5674 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
5675 in existing testcases.
5676
520181ab
JD
56772006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5678
5679 Don't leak semantic values for parent RHS when a user action cuts the
5680 parser, and clean up related code a bit.
5681 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
5682 cuts parse): Rename to...
5683 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
5684 for leaked parent RHS values.
5685 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
5686 between an unresolved state (non-empty chain of semantic options) and
5687 an incomplete one (signaled by an empty chain).
ae952af2 5688 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
5689 successfully or unsuccessfully resolved yyGLRState to...
5690 (yyresolveValue): ... here so that yyresolveValue always leaves a
5691 yyGLRState with consistent data and thus is easier to understand.
5692 Remove the yyvalp and yylocp parameters since they are always just
5693 taken from the yys parameter. When reporting a discarded merged value
5694 in debugging output, note that it is incompletely merged. Document the
5695 interface.
5696 (yyresolveAction): If resolving any of the RHS states fails, destroy
5697 them all rather than leaking them. Thus, as long as user actions are
5698 written to clean up the RHS correctly, yyresolveAction always cleans up
5699 the RHS of a semantic option. Document the interface.
5700
18d9185c
PE
57012006-02-27 Paul Eggert <eggert@cs.ucla.edu>
5702
5703 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
5704 led to a segmentation fault in GNU Pascal. Problem reported
5705 by Waldek Hebisch.
5706
841a7737
JD
57072006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
5708
5709 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
5710 mid-rule action inside a nonterminal symbol in order to declare a
5711 destructor for its semantic value.
5712
fc3f467f
PE
57132006-02-16 Paul Eggert <eggert@cs.ucla.edu>
5714
5715 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
5716 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
5717 __cplusplus && ! defined _STDLIB_H && !
5718 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
5719 defined free))]: Include <stdlib.h> rather than rolling our own
5720 declarations of malloc and free, to avoid problems with
5721 incompatible declarations (using 'throw') C++'s stdlib.h. This
5722 should fix Debian bug 340012
5723 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
5724 reported by Guillaume Melquiond.
5725
a3af26dd
PE
57262006-02-13 Paul Eggert <eggert@cs.ucla.edu>
5727
4d7bc38c
PE
5728 * NEWS: Clarify symbols versus types in unused-value warnings.
5729
a3af26dd
PE
5730 * configure.ac (AC_INIT): Bump version number.
5731
4e26c69e
PE
57322006-02-13 Paul Eggert <eggert@cs.ucla.edu>
5733
5734 * NEWS: Version 2.1a.
5735 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
5736 since C99 requires this.
5737
498e897c
PE
57382006-02-11 Paul Eggert <eggert@cs.ucla.edu>
5739
5740 * m4/c-working.m4: New file.
5741 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
5742
57bb17ca
PE
57432006-02-10 Paul Eggert <eggert@cs.ucla.edu>
5744
5745 * Makefile.maint: Merge from coreutils.
5746
0be105dc
PE
57472006-02-09 Paul Eggert <eggert@cs.ucla.edu>
5748
5749 More portability fixes for problems summarized by Nelson H. F. Beebe.
5750
5751 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
5752 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
5753 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
5754 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
5755 messes up because C++ code is compiled in 32-bit mode but linked
5756 in 64-bit mode.
5757
6fc0c024
PE
57582006-02-08 Paul Eggert <eggert@cs.ucla.edu>
5759
5760 More portability fixes for problems summarized by Nelson H. F. Beebe.
5761
7870f699
PE
5762 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
5763 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
5764
6fc0c024
PE
5765 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
5766 nodist_PROGRAMS, since we don't need to actually compile the
5767 example if we're just doing a plain 'make'. This avoids bothering
5768 the installer unnecessarily about problems due to weird C++
5769 compilers.
5770
fe6c2fde
PE
57712006-02-06 Paul Eggert <eggert@cs.ucla.edu>
5772
5773 More portability fixes for problems summarized by Nelson H. F. Beebe.
5774
5775 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
5776 than #include "...", and compile with -I'.'. The old method was
5777 not portable, according to Posix and the C standard, and it does
5778 not work with Sun C 5.7, where previous #line directives affect
5779 the working directory used in later #include "..." directives.
5780
927b425b
JMG
57812006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5782
5783 Various DJGGP specific issues in /djgpp
5784
d9735e9e
PE
57852006-02-02 Paul Eggert <eggert@cs.ucla.edu>
5786
5787 More portability fixes for problems summarized by Nelson H. F. Beebe.
5788
5789 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
5790 '#include <map>' works and that you can apply ++ to iterators.
5791
5a6755af
PE
57922006-02-01 Paul Eggert <eggert@cs.ucla.edu>
5793
67a0dc4f
PE
5794 Work around portability problems summarized by Nelson H. F. Beebe in
5795 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
5796
8c86f0ef
PE
5797 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5798 that '#include <string>' works.
5799
de35dd59
PE
5800 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
5801 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
5802 "warning: sorry: semantics of inline function static data `const
5803 unsigned char translate_table[262]' are wrong (you'll wind up with
5804 multiple copies)".
5805
67a0dc4f
PE
5806 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
5807 or, xor to not_, and_, or_, and xor_, respectively. This works
5808 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
5809 random system header somewhere that includes the equivalent of
5810 <iso646.h>.
5811
5a6755af
PE
5812 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
5813 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 5814 Suite Version 2.0.
5a6755af 5815
3f001415
JD
58162006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
5817
5818 During deterministic GLR operation, user actions should be able to
5819 influence the parse by changing yychar. To make this easier to fix and
5820 to make glr.c easier to evolve in general, don't maintain yytoken in
5821 parallel with yychar; just compute yytoken when needed.
5822 * tests/glr-regression.at (Incorrect lookahead during deterministic
5823 GLR): Check that setting yychar in a user action has the intended
5824 effect.
5825 * data/glr.c (yyGLRStack): Remove yytokenp member.
5826 (yyclearin): Don't set *yytokenp.
5827 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
5828 yychar rather than *yytokenp to determine the current lookahead.
5829 Compute yytoken locally when needed.
5830 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
5831 point to.
5832
5833 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
5834 after `--report' documentation.
5835
e2a8c0f5
PE
58362006-01-30 Paul Eggert <eggert@cs.ucla.edu>
5837
5838 * src/parse-gram.y (grammar_declaration): Location of printer
5839 symbol is @1, not list->location. Bug reported by twlevo.
5840 * tests/input.at (Incompatible Aliases): Adjust to above change.
5841
6b702268
PE
58422006-01-29 Paul Eggert <eggert@cs.ucla.edu>
5843
27622431
PE
5844 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
5845 all the test at once. This makes the output easier to read in the
5846 normal case.
5847
6b702268
PE
5848 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
5849 got from <http://bro-ids.org/download.html>. The bug is that
5850 when two actions appeared in succession, the second one was
5851 scanned before the first one was added to the grammar rule
5852 as a midrule action. Bison then output the incorrect warning
5853 "parse.y:905.17-906.36: warning: unused value: $3".
5854 * src/parse-gram.y (BRACED_CODE, action): These are no longer
5855 associated with a value.
5856 (rhs): Don't invoke grammar_current_rule_action_append.
5857 (action): Invoke it here instead.
5858 * src/reader.c (grammar_midrule_action): Now extern.
5859 (grammar_current_rule_action_append): Don't invoke
5860 grammar_midrule_action; that is now the scanner's job.
5861 * src/reader.h (last_string, last_braced_code_loc):
5862 (grammar_midrule_action): New decls.
5863 * src/scan-gram.l (last_string): Now extern, sigh.
5864 (last_braced_code_loc): New extern variable.
5865 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
5866 rule already has an action.
5867 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
5868 * tests/input.at (AT_CHECK_UNUSED_VALUES):
5869 Add some tests to check that the above changes fixed the bug.
5870
d40ba6c2
PE
58712006-01-27 Paul Eggert <eggert@cs.ucla.edu>
5872
5873 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
5874 All used changed. Check whether the symbol has a destructor,
5875 not whether it is typed.
5876 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
5877 that the values are still reported as unused. All line numbers
5878 adjusted.
5879
401aace6
PE
58802006-01-23 Paul Eggert <eggert@cs.ucla.edu>
5881
5882 Work around a bug in bro 0.8, which underparenthesizes its
5883 definition of YYLLOC_DEFAULT.
5884 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
5885 their arguments.
5886 * data/lalr1.cc: Likewise.
5887 * data/yacc.cc: Likewise.
5888
06f01bc4
PE
58892006-01-22 Paul Eggert <eggert@cs.ucla.edu>
5890
401aace6
PE
5891 Work around a bug in Pike 7.0, and give the Pike folks a
5892 better way to override the usual int widths.
5893 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
5894 user can override the types.
5895 (short): #undef, to work around a bug in Pike 7.0.
5896 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
5897 (union yyalloc.yyss): Use yytype_int16 rather than short.
5898 All uses changed.
5899 (yysigned_char): Remove.
5900 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
5901 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
5902 * tests/regression.at (Web2c Actions): Adjust to above changes.
5903
5904 * src/reader.c (check_and_convert_grammar): New function.
5905 (reader): Close the input file even if something went wrong during
5906 parsing. Minor file descriptor leak reported by twlevo.
5907
06f01bc4
PE
5908 * src/assoc.c (assoc_to_string): Use a default: abort (); case
5909 to pacify gcc -Wswitch-default.
5910 * src/scan-gram.l (adjust_location): Use a default: break; case
5911 to pacify gcc -Wswitch-default.
5912 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
5913 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5914 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5915 Move these decls to scan-skel.l, since they don't need to be
5916 visible elsewhere.
5917 * src/scan-skel.l: Accept the above decls.
5918 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
5919 is used.
5920
02650b7f
PE
59212006-01-21 Paul Eggert <eggert@cs.ucla.edu>
5922
5923 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
5924 since we don't want to insist on a version number at the start
5925 of the changelog every time.
5926 * Makefile.maint: Sync from coreutils a bit better.
5927 (sc_trailing_blank): Renamed from sc_trailing_space.
5928 All uses changed.
5929 (sc_no_if_have_config_h, sc_require_config_h):
5930 (sc_prohibit_assert_without_use): New rules.
5931 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
5932 (sc_dd_max_sym_length): Fix leading spaces in rule.
5933 (sc_system_h_headers): Prefix with @.
5934 (sc_useless_cpp_parens, m4-check): Output line numbers.
5935 (changelog-check): Allow version only in head.
5936 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
5937 satisfy new Makefile.maint rule.
5938 * data/glr.c: Likewise.
5939 * data/glr.cc: Likewise.
5940 * data/lalr1.cc: Likewise.
5941 * data/yacc.c: Likewise.
5942 * lib/ebitsetv.c: Likewise.
5943 * lib/lbitset.c: Likewise.
5944 * lib/subpipe.c: Likewise.
5945 * lib/timevar.c: Likewise.
5946 * src/system.h: Likewise.
5947 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
5948 * djgpp/Makefile.maint: Add copyright notice.
5949 * djgpp/README.in: Likewise.
5950 * djgpp/config.bat: Likewise.
5951 * djgpp/config.site: Likewise.
5952 * djgpp/config_h.sed: Likewise.
5953 * djgpp/djunpack.bat: Likewise.
5954 * djgpp/config.sed: Fix copyright notice to match standard format.
5955 * djgpp/subpipe.h: Likewise.
5956 * lib/bitsetv-print.c: Likewise.
5957 * lib/bitsetv.c: Likewise.
5958 * lib/subpipe.h: Likewise.
5959 * lib/timevar.c: Likewise.
5960 * lib/timevar.h: Likewise.
5961 * djgpp/subpipe.c: Use standard recipe for config.h.
5962 * lib/abitset.c: Likewise.
5963 * lib/bitset.c: Likewise.
5964 * lib/bitset_stats.c: Likewise.
5965 * lib/bitsetv-print.c: Likewise.
5966 * lib/bitsetv.c: Likewise.
5967 * lib/ebitsetv.c: Likewise.
5968 * lib/get-errno.c: Likewise.
5969 * lib/lbitset.c: Likewise.
5970 * lib/subpipe.c: Likewise.
5971 * lib/timevar.c: Likewise.
5972 * lib/vbitset.c: Likewise.
5973 * tests/local.at: Likewise.
5974 * src/scan-gram.l: Don't include verify.h, since system.h does
5975 that for us.
5976 * .x-sc_require_config_h: New file.
5977 * .x-sc_unmarked_diagnostics: New file.
5978
287c78f6
PE
59792006-01-20 Paul Eggert <eggert@cs.ucla.edu>
5980
287c78f6
PE
5981 Be a bit more systematic about using 'abort'.
5982 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
5983 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
5984 Put 'default: abort ();' before some other case, to satisfy older
5985 pedantic compilers.
5986 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5987 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
5988 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
5989 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
5990 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
5991 (get_decision_str, get_orientation_str, get_node_alignment_str):
5992 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
5993 (get_linestyle_str, get_arrowstyle_str): Likewise.
5994 * src/conflicts.c (resolve_sr_conflict):
5995 Use a default case rather than one for the one remaining enum
5996 value, to catch invalid enum values as well.
5997 * src/lalr.c (set_goto_map, map_goto):
5998 Prefer "assert (FOO);" to "if (!FOO) abort ();".
5999 * src/nullable.c (nullable_compute, token_definitions_output):
6000 Likewise.
6001 * src/reader.c (packgram, reader): Likewise.
6002 * src/state.c (transitions_to, state_new, state_reduction_find):
6003 Likewise.
6004 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
6005 (symbol_pack): Likewise.
6006 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
6007 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
6008 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
6009 * src/system.h: Don't include <assert.h>.
6010 (assert): New macro.
6011
6012 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
6013 (Destructor Decl, Parser Function, Pure Calling):
6014 Describe rules for braces inside C code more carefully.
287c78f6 6015
c66dfadd
PE
60162006-01-19 Paul Eggert <eggert@cs.ucla.edu>
6017
c21493b8
PE
6018 Fix some porting glitches found by Nelson H. F. Beebe.
6019 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
6020 compilers that don't understand that abort () does not return.
6021 * src/state.c (transitions_to): Likewise.
6022 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6023 that '#include <cstdlib>' works.
6024 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
6025 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
6026 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
6027 for the benefit of some pre-C99 compilers.
6028
b6e3facf
PE
6029 * bootstrap: Undo changes to gnulib files that autoreconf made.
6030
c66dfadd
PE
6031 Minor fixups to get 'make maintainer-check' to work.
6032 * configure.ac: Don't use -Wnested-externs, as it's incompatible
6033 with the new verify.h implementation.
6034 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
6035 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
6036 * data/yacc.c (YYUSE): Likewise.
6037 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
6038 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
6039 * src/parse-gram.y (declaration): Don't pass a string constant
6040 to a function that expects char *, since GCC might complain
6041 about the constant value.
6042 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
6043 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
6044 before #defining them.
6045 * tests/glr-regression.at
6046 (Incorrectly initialized location for empty right-hand side in GLR):
6047 In yyerror, use the msg arg.
6048 (Corrupted semantic options if user action cuts parse):
6049 (Incorrect lookahead during deterministic GLR):
6050 (Incorrect lookahead during nondeterministic GLR):
6051 Don't name a local var 'index'; it shadows string.h's 'index'.
6052
ed94ef2a
AD
60532006-01-19 Akim Demaille <akim@epita.fr>
6054
6055 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
6056 location, not just parts of it.
6057
e9ad4aec
PE
60582006-01-18 Paul Eggert <eggert@cs.ucla.edu>
6059
d6ca7905
PE
6060 * NEWS: Document the fact that multiple %unions are now allowed.
6061 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
6062 * TODO: This feature is now implemented, so remove it from
6063 the wishlist.
d6ca7905 6064
ef1b70e0
PE
6065 * Makefile.maint: Merge with coreutils Makefile.maint.
6066 (CVS_LIST): Use build-aux version if available.
6067 (VERSION_REGEXP): New macro.
6068 (syntax-check-rules): Add sc_no_if_have_config_h,
6069 sc_prohibit_assert_without_use, sc_require_config_h,
6070 sc_useless_cpp_parens.
6071 (sc_obsolete_symbols): Check for O_NDELAY.
6072 (sc_dd_max_sym_length): Track coreutils.
6073 (sc_unmarked_diagnostics): Look in all files, not just *.c.
6074 (sc_useless_cpp_parens): New rule.
6075 (news-date-check): Look for version or today's date.
6076 (changelog-check): Don't require version number near head.
6077 (copyright-check): Use current year instead of hardwiring 2005.
6078 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
6079 (announcement): Add --gpg-key-ID.
6080
6081 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
6082 with "file system".
6083
2073ce56 6084 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
6085 array. Problem reported by twlevo.
6086 * src/reader.c (packgram): Prepend a new sentinel before ritem.
6087 * src/lalr.c (build_relations): Rely on new sentinel.
6088 * src/gram.c (gram_free): Adjust to new sentinel.
6089
b7691f15
JD
60902006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
6091
6092 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
6093 yylookaheadNeeds. All uses updated.
6094 (yysplitStack): Rename local yynewLookaheadStatuses to
6095 yynewLookaheadNeeds.
6096 * data/glr-regression.at (Incorrect lookahead during nondeterministic
6097 GLR): In comments, change `lookahead status' to `lookahead need'.
6098
ddee1b06
PH
60992006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6100
6101 * data/glr.c (yysplitStack): A little stylistic rewrite.
6102
12f4614d
PH
61032006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6104
6105 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
6106
32c29292
JD
61072006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
6108
6109 * doc/bison.texinfo: Fix some typos.
6110 (GLR Semantic Actions): New subsection discussing special
6111 considerations because GLR semantic actions might be deferred.
6112 (Actions): Mention look-ahead usage of yylval.
6113 (Actions and Locations): Mention look-ahead usage of yylloc.
6114 (Special Features for Use in Actions): Add YYEOF entry and mention it
6115 in the yychar entry.
6116 In the yychar entry, remove mention of the local yychar case (pure
6117 parser) since this is irrelevant information when writing semantic
148d66d8 6118 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
6119 yychar is otherwise described as an external variable.
6120 In the yychar entry, don't call it the `current' look-ahead since it
6121 isn't when semantic actions are deferred.
6122 In the yychar and yyclearin entries, add note about deferred semantic
6123 actions.
6124 Add yylloc and yylval entries discussing look-ahead usage.
6125 (Look-Ahead Tokens): When discussing yychar, don't call it the
6126 `current' look-ahead, and do mention yylval and yylloc.
6127 (Error Recovery): Cross-reference `Action Features' when mentioning
6128 yyclearin.
148d66d8 6129 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
6130 look-ahead.
6131 In the yylloc and yylval entries, mention look-ahead usage.
6132
de366a2f 61332006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
6134
6135 * tests/glr-regression.at: Update copyright year to 2006.
6136
bf70fa87
JD
61372006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6138
6139 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
6140 use during nondeterministic operation to track which stacks have
6141 actually needed the current lookahead.
6142 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
6143 Allocate, deallocate, resize, and otherwise shuffle space for
6144 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
6145 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
6146 appropriately during nondeterministic operation.
6147 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
6148 members to store the current lookahead to be used by the deferred
6149 user action.
6150 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
6151 from which the RHS is taken. Set the lookahead members of the new
6152 yySemanticOption according to the lookahead status for stack yyk.
6153 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
6154 yyaddDeferredAction.
6155 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
6156 members of yySemanticOption before invoking yyuserAction, and then set
6157 them back to their current values afterward.
6158 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
6159 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
6160 * tests/glr-regression.at: Remove `.' from the ends of recent test case
6161 titles for consistency.
6162 (Leaked merged semantic value if user action cuts parse): In order to
6163 suppress lint warnings, use arguments in merge function, and assign
6164 char value < 128 in main.
6165 (Incorrect lookahead during deterministic GLR): New test case.
6166 (Incorrect lookahead during nondeterministic GLR): New test case.
6167
05449a2c
JD
61682006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6169
de366a2f 6170 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
6171 !yyvaluep as signal that no semantic value is available to print.
6172 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
6173 to print a semantic value.
6174
4158e0a1 61752006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 6176
4158e0a1
JD
6177 * tests/glr-regression.at: For consistency with my newer test cases,
6178 don't thank myself.
6179
d659304d
JD
61802006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6181
6182 * data/glr.c (yyresolveValue): When merging semantic options, if at
6183 least one user action succeeds but a later one cuts the parse, then
6184 destroy the semantic value before returning rather than leaking it.
6185 (yyresolveStates): If a user action cuts the parse and thus
6186 yyresolveValue fails, ignore the (unset) semantic value rather than
6187 corrupting the yyGLRState, and empty the semantic options list since
6188 the user actions should have called all necessary destructors.
6189 Simplify code with YYCHK.
6190 * tests/glr-regression.at (Corrupted semantic options if user action
6191 cuts parse): New test case.
6192 (Undesirable destructors if user action cuts parse): New test case.
6193 Before applying any of this patch, this test case never actually failed
6194 for me... but only because the corrupted semantic options usually
6195 masked this bug.
6196 (Leaked merged semantic value if user action cuts parse): New test
6197 case.
6198
6ec2c0f2
AD
61992006-01-05 Akim Demaille <akim@epita.fr>
6200
6201 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
6202
1b9c21fb
PE
62032006-01-04 Paul Eggert <eggert@cs.ucla.edu>
6204
6205 * data/c.m4 (b4_c_modern): New macro, with a new provision for
6206 _MSC_VER. Problem reported by Cenzato Marco.
6207 (b4_c_function_def): Use it.
6208 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
6209 b4_c_modern.
6210 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
6211 than rolling our own.
6212
84866159
AD
62132006-01-04 Akim Demaille <akim@epita.fr>
6214
6215 Also warn about non-used mid-rule values.
6216 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
6217 member.
6218 (symbol_list_new): Adjust.
6219 * src/reader.c (symbol_typed_p): New.
6220 (grammar_rule_check): Use it.
6221 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
6222 Check its rule.
6223 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
6224 Use it.
6225 * tests/actions.at (Exotic Dollars): Adjust.
6226
378f4bd8
AD
62272006-01-04 Akim Demaille <akim@epita.fr>
6228
6229 * src/reader.c (grammar_midrule_action): If $$ is set in a
6230 mid-rule, move the `used' bit to its lhs.
6231 * tests/input.at (Unused values): New.
6232 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
6233
e2a21b6f
PE
62342006-01-03 Paul Eggert <eggert@cs.ucla.edu>
6235
54662697
PE
6236 * doc/bison.texinfo (Bison Options): Say more accurately what
6237 --yacc does.
6238 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
6239 about declarations in the grammar when in Yacc mode, as POSIX does
6240 not require a diagnostic when the grammar uses extensions.
6241
6242 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
6243
073f9288
PE
6244 Warn about dubious constructions like "%token T T".
6245 Reported by twlevo.
6246 * src/symtab.h (struct symbol.declared): New member.
6247 * src/symtab.c (symbol_new): Initialize it to false.
6248 (symbol_class_set): New arg DECLARING, specifying whether
6249 this is a declaration that we want to warn about, if there
6250 is more than one of them. All uses changed.
6251
1221b78a
PE
6252 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
6253 Allow multiple %union directives, whose contents concatenate.
6254 * src/parse-gram.y (grammar_declaration): Likewise.
6255 Use muscle_code_grow, so that we don't need stype_line any more.
6256 All uses changed.
6257
6258 * src/muscle_tab.c (muscle_grow): Fix comment.
6259
e2a21b6f
PE
6260 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
6261 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
6262 Update copyright year to 2006.
6263
8f7e3cf9
AD
62642006-01-03 Akim Demaille <akim@epita.fr>
6265
6266 Have glr.cc pass (some of) the calc.at tests.
6267 * data/glr.cc (b4_parse_param_orig): New.
6268 (b4_parse_param): Improve its definition, and bound it more
6269 clearly in the skeleton.
6270 (b4_epilogue): Append, instead of prepending, in order to keep
6271 #line consistency.
6272 Simplify the generation of auxiliary functions: locations and
6273 purity are mandated.
6274 (b4_global_tokens_and_yystype): Honor it.
6275 * data/location.cc (c++.m4): Don't include it.
6276 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
6277 and AT_SKEL_CC_IF.
6278 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
6279 AT_LALR1_CC_IF.
6280 Be sure to initialize the first position's filename.
6281 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
6282 mandated anyway.
6283 (AT_CHECK_CALC_GLR_CC): New.
6284 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
6285
3953ed88
AD
62862006-01-02 Akim Demaille <akim@epita.fr>
6287
6288 * src/output.c (output_skeleton): Don't hard wire the inclusion of
6289 c.m4.
0a96ba81 6290 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
6291 * data/glr.cc: Do not include stack.hh.
6292
9ecafbbf
AD
62932006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6294
6295 * data/glr.c: Reformat whitespace with tabs.
6296 (b4_lpure_formals): Remove this unused m4 macro.
6297 * tests/cxx-type.at: Reformat whitespace with tabs.
6298 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
6299 since it's a member. Rename type to isNterm for clarity.
6300
c4d497a0
AD
63012005-12-29 Akim <akim@sulaco.local>
6302
6303 Let glr.cc catch up with symbol_value_print.
6304 * data/glr.cc (b4_yysymprint_generate): Replace by...
6305 (b4_yy_symbol_print_generate): this.
6306 (yy_symbol_print, yy_symbol_value_print): Declare them.
6307
4517da37
PE
63082005-12-28 Paul Eggert <eggert@cs.ucla.edu>
6309
6310 * src/location.h (boundary): Note that a line or column equal
6311 to INT_MAX indicates an overflow.
6312 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
6313 (rule_length_overflow, increment_rule_length, add_column_width):
6314 New functions.
6315 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
6316 (<SC_BRACED_CODE>"}"):
6317 Use increment_rule_length rather than incrementing it by hand.
6318 (adjust_location, handle_syncline): Diagnose overflow.
6319 (handle_action_dollar, handle_action_at):
6320 Fix bug with monstrosities like $-2147483648.
6321 Remove now-unnecessary checks.
6322 (scan_integer): Verify assumptions and remove now-unnecessary checks.
6323 (convert_ucn_to_byte): Verify assumptions.
6324 (handle_syncline): New arg LOC. All callers changed.
6325 Don't store through a value derived from char const * pointer.
6326
6327 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
6328 GCC warnings.
6329
e3233bf6
PE
63302005-12-27 Paul Eggert <eggert@cs.ucla.edu>
6331
6332 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
6333 Remove unnecessary forward static decls.
6334
8f3596a6
AD
63352005-12-27 Akim Demaille <akim@epita.fr>
6336
6337 * src/reader.c (grammar_current_rule_check): Also check that $$
6338 is used.
6339 Take the rule to check as argument, hence rename as...
6340 (grammar_rule_check): this.
6341 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
6342 Rename as...
6343 (grammar_rule_begin, grammar_rule_end): these, for consistency.
6344 (grammar_midrule_action, grammar_symbol_append): Now static.
6345 * tests/torture.at (input): Don't rely on the default action
6346 being always performed.
6347 * tests/calc.at: "Set" $$ even when the action is "cut" with
6348 YYERROR or other.
6349 * tests/actions.at (Exotic Dollars): Instead of using unused
6350 values, check that the warning is issued.
6351
721be13c
PE
63522005-12-22 Paul Eggert <eggert@cs.ucla.edu>
6353
6354 * NEWS: Improve wording for unused-value warnings.
6355
a0af42fc
AD
63562005-12-22 Akim Demaille <akim@epita.fr>
6357
6358 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
6359 (b4_yysymprint_generate): Rename as...
6360 (b4_yy_symbol_print_generate): this.
6361 Generate yy_symbol_print instead of yysymprint.
6362 Generate also yy_symbol_value_print, and use it.
6363
affac613
AD
63642005-12-22 Akim Demaille <akim@epita.fr>
6365
721be13c 6366 * NEWS: Warn about unused values.
affac613
AD
6367 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
6368 a `used' member.
6369 (symbol_list_n_get, symbol_list_n_used_set): New.
6370 (symbol_list_n_type_name_get): Use symbol_list_n_get.
6371 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
6372 * src/reader.c (grammar_current_rule_check): Check that values are
6373 used.
6374 * src/symtab.c (symbol_print): Accept 0.
6375 * tests/existing.at: Remove the type information.
6376 Empty the actions.
6377 Remove useless actions (beware of mid-rule actions: perl -000
6378 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
6379 * tests/actions.at (Exotic Dollars): Use unused values.
6380 * tests/calc.at: Likewise.
6381 * tests/glr-regression.at (No users destructors if stack 0 deleted):
6382 Likewise.
6383
6384 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
6385 rule_useful_p.
6386
9d9b8b70
PE
63872005-12-21 Paul Eggert <eggert@cs.ucla.edu>
6388
8bb4c753
PE
6389 Undo 2005-12-01 tentative license wording change. The wording is
6390 still being reviewed by the lawyers, and we don't want to wait for
6391 them before publishing a test release. For now, revert to the
6392 previous wording.
6393 * NEWS: Undo 2005-12-01 change.
6394 * data/glr.c: Revert to previous license wording.
6395 * data/glr.cc: Likewise.
6396 * data/lalr1.cc: Likewise.
6397 * data/location.cc: Likewise.
6398 * data/yacc.c: Likewise.
6399
9d9b8b70
PE
6400 * NEWS: Reword %destructor vs YYABORT etc.
6401 * data/glr.c: Use American spacing, for consistency.
6402 * data/glr.cc: Likewise.
6403 * data/lalr1.cc: Likewise.
6404 * data/yacc.c: Likewise.
6405 * data/yacc.c: Reformat comments slightly.
6406 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
6407 for consistency. Fix some spelling errors and reword recently-included
6408 text slightly.
6409 * tests/cxx-type.at: Cast results of malloc, for C++.
6410
2c3b392a
AD
64112005-12-21 Joel E. Denny <address@hidden>
6412
6413 * tests/cxx-type.at: Construct a tree, count the parents of shared
6414 nodes, and free each node once and only once. Previously, the memory
6415 for semantic values was leaked instead.
6416
d6cff4dc
AD
64172005-12-21 Joel E. Denny <address@hidden>
6418
6419 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
6420 (yylval, yylloc): If pure, #define to yystackp->yyval and
6421 yystackp->yyloc similar to yychar and yynerrs.
6422 (yyparse): If pure, remove local yylval and yylloc. Add local
6423 yystackp to accommodate pure definitions of yylval and yylloc.
6424 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
6425 yylvalp and yyllocp to &yylval and &yylloc.
6426 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
6427 namespace. Previously, nerrs and char were missing, but lval and lloc
6428 weren't necessary.
6429 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
6430 yylvalp and yyllocp parameters since, if pure, these are now always
6431 accessible through yystackp. If not pure, they are still accessible
6432 globally.
6433 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
6434 `if (YYID (N))' to pacify lint.
6435
a85284cf
AD
64362005-12-21 Akim Demaille <akim@epita.fr>
6437
6438 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
6439 destroy the RHS symbols of a rule.
6440 * data/yacc.c (yylen): Initialize to 0.
6441 Keep its value to the number of items to possibly shift.
6442 In particular, a regular successful parse that ends on YYFINAL by
6443 a (internal) YYACCEPT must not have yylen != 0.
6444 (yyerrorlab, yyreturn): Pop the RHS.
6445 Reorder a bit to emphasize the `shifting' bits of code.
6446 (YYPOPSTACK): Now accept a number of items to pop.
6447 * data/lalr1.cc: Likewise.
6448 * data/glr.c: Formatting changes.
6449 Use goto instead of fall through.
6450 * doc/bison.texinfo (Destructor Decl): Complete.
6451
d508c281
JMG
64522005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6453
6454 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
6455 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
6456 * djgpp/config.bat: Replace every occurence of the file name
6457 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
6458 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
6459 * djgpp/config.sed: Replace every occurence of the file name
6460 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
6461 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
6462 * djgpp/djunpack.bat: DJGPP specific file.
6463 * djgpp/fnchange.lst: DJGPP specific file.
6464 * djgpp/README.in: Add new information about how to unpack the bison
6465 source on MSDOS and other systems which have 8.3 file name restrictions
6466 using djunpack.bat and fnchange.lst.
6467
3e7a2cd9
PE
64682005-12-12 Paul Eggert <eggert@cs.ucla.edu>
6469
6470 * bootstrap (build_cvs_prefix): Remove; unused.
6471 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
6472 when getting gnulib.
6473
64742005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
6475
6476 * data/glr.c: Reorder typedef declarations for structs to match order
6477 of struct declarations.
6478 Rename yystack everywhere to yystackp except in yyparse where it's not
6479 a pointer.
6480 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
6481 consistency.
6482 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
6483 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
6484 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
6485 lint.
6486
877519f8
PE
64872005-12-09 Paul Eggert <eggert@cs.ucla.edu>
6488
0eca5a39
PE
6489 * tests/sets.at (Accept): Fix typos in regular expression used to
6490 sed out the final state number.
6491
2cec9080
PE
6492 Work around portability problem on Solaris 10: flex-generated
6493 files include <stdio.h> before <config.h>, which messes up
6494 because the latter defines __EXTENSIONS__. Address the problem
6495 by creating two new little files that include <config.h> first,
6496 then include the flex-generated files. Rewrite everyone else
6497 to include <config.h> first, as well.
6498 * lib/timevar.c: Always include "config.h".
6499 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
6500 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
6501 (EXTRA_bison_SOURCES): New macro.
6502 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
6503 * src/system.h: Don't include config.h.
6504 * src/LR0.c: Include <config.h> first.
6505 * src/assoc.c: Likewise.
6506 * src/closure.c: Likewise.
6507 * src/complain.c: Likewise.
6508 * src/conflicts.c: Likewise.
6509 * src/derives.c: Likewise.
6510 * src/files.c: Likewise.
6511 * src/getargs.c: Likewise.
6512 * src/gram.c: Likewise.
6513 * src/lalr.c: Likewise.
6514 * src/location.c: Likewise.
6515 * src/main.c: Likewise.
6516 * src/muscle_tab.c: Likewise.
6517 * src/nullable.c: Likewise.
6518 * src/output.c: Likewise.
6519 * src/parse-gram.y: Likewise.
6520 * src/print.c: Likewise.
6521 * src/print_graph.c: Likewise.
6522 * src/reader.c: Likewise.
6523 * src/reduce.c: Likewise.
6524 * src/relation.c: Likewise.
6525 * src/state.c: Likewise.
6526 * src/symlist.c: Likewise.
6527 * src/symtab.c: Likewise.
6528 * src/tables.c: Likewise.
6529 * src/uniqstr.c: Likewise.
6530 * src/vcg.c: Likewise.
6531
877519f8
PE
6532 * src/parse-gram.y: Fix minor problems uncovered by lint.
6533 (current_lhs, current_lhs_location): Now static.
6534 (current_assoc): Remove unused variable.
6535
6536 Cleanups so that Bison-generated parsers have less lint.
6537 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
6538 Prepend /*ARGSUSED*/, for lint's sake.
6539 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
6540 definition if 'lint' is defined.
6541 (YYID): New macro (or function, if lint).
6542 All uses of /*CONSTCOND*/0 replaced by YYID(0).
6543 * data/yacc.c: Likewise.
6544 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
6545 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
6546 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
6547 is C++ only.
6548 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
6549 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
6550 Use YYID(0) rather than 0, for lint.
6551 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
6552 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
6553
f5228370
PE
65542005-12-07 Paul Eggert <eggert@cs.ucla.edu>
6555
6556 * tests/glr-regression.at
6557 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6558 Close memory leak reported by twlevo.
6559
69ce078b
PE
65602005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
6561
6ff99711
PE
6562 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
6563 all stacks.
6564 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
6565 * tests/glr-regression.at (No users destructors if stack 0 deleted):
6566 New test case.
6567 (Duplicated user destructor for lookahead): This test now is expected
6568 to succeed.
6569
af3412cd
PE
65702005-12-01 Paul Eggert <eggert@cs.ucla.edu>
6571
32b5b719 6572 * NEWS: Document the following change.
af3412cd
PE
6573 * data/yacc.c: Say "parser skeleton" rather than "file", since
6574 it's no longer just a file.
6575 * data/glr.c: Grant a special exception for C GLR parsers, that
6576 reads like the already-existing exception for C LALR(1) parsers.
6577 * data/glr.cc: Likewise.
6578 * data/lalr1.cc: Likewise.
6579 * data/location.cc: Likewise.
6580 * data/yacc.c: Reword the "written by" statement to clarify that
6581 it was the parser skeleton, not the entire output file.
6582 * data/glr.c: Written by Paul Hilfinger.
6583 * data/glr.cc: Written by Akim Demaille.
6584 * data/lalr1.cc: Likewise.
6585
035aa4a0
PE
65862005-11-18 Paul Eggert <eggert@cs.ucla.edu>
6587
d9963c85
PE
6588 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
6589 Fix typos in previous change that broke 'make check'.
6590 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
6591 supported in C.
6592 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
6593 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
6594 We can revert this once things settle down.
6595
035aa4a0
PE
6596 * src/conflicts.c (conflicts_print): Don't print file name twice
6597 when %expect fails because there were no conflicts.
6598 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
6599 change.
6600 * tests/conflicts.at (%expect not enough, %expect too much):
6601 (%expect with reduce conflicts): Adjust to new behavior.
6602
66032005-11-18 Akim Demaille <akim@epita.fr>
6604
6605 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
6606 errors.
6607 * NEWS: Document this.
6608 * doc/bison.texinfo (Expect Decl): Likewise.
6609
d1ff7a7c
AD
66102005-11-16 Akim Demaille <akim@epita.fr>
6611
6612 Generalize the display of semantic values and locations in traces.
6613 * data/glr.c (yy_reduce_print): Fix indices (again).
6614 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
6615 literal integers.
6616 * data/lalr1.cc (yyreduce_print): Rename as...
6617 (yy_reduce_print): this.
6618 Display values and locations.
6619 * data/yacc.c (yy_reduce_print): Likewise.
6620 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
6621 (yysymprint): Move higher to be visible from yy_reduce_print).
6622 (yyparse): Adjust.
6623 * tests/calc.at: Adjust the expected length of the traces.
6624
6de5398d
AD
66252005-11-14 Akim Demaille <akim@epita.fr>
6626
6627 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
6628 from 1 to N, while values and location start at 0.
6629 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
6630
a1373f55
AD
66312005-11-14 Akim Demaille <akim@epita.fr>
6632
6633 * data/glr.c (yy_reduce_print): Fix the $ number.
6634
613d8952
AD
66352005-11-14 Akim Demaille <akim@epita.fr>
6636
6637 "Use" parse parameters.
6638 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
6639 * data/glr.c, data/glr.cc: Use them.
6640 * data/glr.c (YYUSE): Have a C++ definition that supports
6641 non-pointer types.
6642
b2741627
AD
66432005-11-14 Akim Demaille <akim@epita.fr>
6644
6645 * data/glr.c (yyexpandGLRStack): Declare only if defined.
6646
5059b5c8
AD
66472005-11-14 Akim Demaille <akim@epita.fr>
6648
42249483
AD
6649 * data/glr.cc: New.
6650 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 6651
4626a15d
AD
66522005-11-12 Akim Demaille <akim@epita.fr>
6653
6654 Let position and location be PODs.
6655 * data/location.cc (position::initialize, location::initialize): New.
6656 (position::position, location::location): Define only if
6657 b4_location_constructors is defined.
6658 * data/lalr1.cc (b4_location_constructors): Define it for backward
6659 compatibility.
6660 * doc/bison.texinfo (Initial Action Decl): Use initialize.
6661
66622005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
6663
6664 * data/lalr1.cc: Move the body of the ctor and dtor into the
6665 parser file (instead of the header).
6666 Wrap the implementations in a "namespace yy".
6667
66682005-11-12 Akim Demaille <akim@epita.fr>
6669
6670 Have glr.c include its header file when created.
6671 * data/glr.c (b4_shared_declarations): New.
6672 Output them verbatim in the parser if !%defines, otherwise
6673 output then in the header file, and include it instead.
6674
1989d947
AD
66752005-11-11 Akim Demaille <akim@epita.fr>
6676
6677 * data/glr.c: Comment changes.
6678
66792005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
6680
6681 When yydebug, report semantic and location values for reductions.
6682 * data/glr.c (yy_reduce_print): Report the semantic values and the
6683 locations.
6684 (YY_REDUCE_PRINT): Adjust.
6685 (yyglrReduce): Use them.
6686 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
6687 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
6688 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
6689 traces.
6690
02998094
AD
66912005-11-10 Akim Demaille <akim@epita.fr>
6692
6693 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
6694 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
6695 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
6696
5210672f
PE
66972005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
6698
6699 * m4/cxx.m4, examples/Makefile.am: Don't build
6700 examples/calc++ if no C++ compiler is available. (trivial change)
6701
a8991a1d
AD
67022005-11-09 Akim Demaille <akim@epita.fr>
6703
6704 * src/scan-skel.l: Use a couple of asserts.
6705
36b5e963
AD
67062005-11-03 Akim Demaille <akim@epita.fr>
6707
6708 In some (weird) cases, the final state number is incorrect.
6709 Reported by Alexandre Duret-Lutz.
6710 * src/LR0.c (state_list_append): Remove the computation of
6711 final_state.
6712 (save_reductions): Do it here.
6713 (get_state): Alpha conversion.
6714 (generate_states): Use a for loop.
6715 * src/gram.h (item_number_is_rule_number)
6716 (item_number_is_symbol_number): New.
6717 * src/state.c: Use assert.
6718 * src/system.h: Include assert.h.
6719 * tests/sets.at (Accept): New.
6720
44e7ead1
PH
67212005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6722
6723 * data/glr.c (yyfill): Adjust comment.
36b5e963 6724 (yyresolveAction): Initialize default location properly
44e7ead1
PH
6725 for empty right-hand sides.
6726 (yydoAction): Ditto.
6727 Add comment explaining apparently dead code.
36b5e963
AD
6728 * tests/glr-regression.at
6729 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 6730 New test.
36b5e963 6731
e10a80ee
PE
67322005-10-30 Paul Eggert <eggert@cs.ucla.edu>
6733
6734 * bootstrap (cleanup_gnulib): New function. Use it to clean up
6735 gnulib when interrupted. This fixes some race conditions and
6736 works around some portability problems (one noted by Paul
6737 Hilfinger).
6738
067b32ee
AD
67392005-10-22 Akim <akim@epita.fr>
6740
6741 * Makefile.cfg: Adjust to config -> build-aux.
6742 Reported by twledo.
6743
4b367315
AD
67442005-10-21 Akim Demaille <akim@epita.fr>
6745
6746 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
6747 the %parse-params.
6748 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
6749 * data/yacc.c (b4_Pure_if): Rename as...
6750 (b4_yacc_pure_if): this.
6751 (YY_SYMBOL_PRINT, yyparse): Adjust.
6752 * doc/bison.texinfo: Formatting changes.
6753
24cc23d9
AD
67542005-10-21 Akim Demaille <akim@epita.fr>
6755
6756 Finish the transition config -> build-aux.
6757 * configure.ac, Makefile.am: Use build-aux.
6758 * config/prev-version, config/announce-gen, config/Makefile.am:
6759 Move to...
6760 * build-aux/prev-version, build-aux/announce-gen,
6761 * build-aux/Makefile.am: here.
6762
d4476375
AD
67632005-10-14 Akim Demaille <akim@epita.fr>
6764
6765 * examples/calc++/test: Use set -x only when VERBOSE.
6766
302c0aee
PE
67672005-10-13 Paul Eggert <eggert@cs.ucla.edu>
6768
6769 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
6770 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
6771
7625ec2c
AD
67722005-10-13 Akim Demaille <akim@epita.fr>
6773
6774 * src/scan-skel.l: Output the base name parts of the parser and
6775 header file names.
302c0aee 6776 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
6777 additional checks.
6778 Use this to exercise C++ outputs in subdirs.
6779 Reported by Oleg Smolsky.
6780
ba0fe3c7
PE
67812005-10-12 Paul Eggert <eggert@cs.ucla.edu>
6782
6783 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
6784 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
6785 Problem reported by John P. Hartmann.
6786 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
6787 already defined it.
6788
9b8a5ce0
AD
67892005-10-12 Akim Demaille <akim@epita.fr>
6790
6791 * src/parse-gram.y (version_check): Exit 63 to please missing
6792 (stands for "version mismatch).
6793 * tests/input.at, doc/bison.texinfo: Adjust.
6794
4f6e011e
PE
67952005-10-10 Paul Eggert <eggert@cs.ucla.edu>
6796
6797 Work around portability problems with Visual Age C compiler
6798 (xlc and xlC_r) reported by John P. Hartmann.
6799 * data/location.cc (initial_column, initial_line): Remove.
6800 All uses replaced by 0 and 1.
6801 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
6802 that xlc complains about.
6803 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 6804 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 6805 as __STDC__.
4d7aa45e
PE
6806 * data/yacc.c (YYMODERN_C): New macro, which also looks at
6807 __STDC_VERSION__. Use it everywhere instead of looking at
6808 __STDC__ and __cplusplus.
4f6e011e 6809
a1b3bf8c
AD
68102005-10-10 Akim Demaille <akim@epita.fr>
6811
6812 * examples/calc++/test: Be quiet unless VERBOSE.
6813
412e44aa
PE
68142005-10-05 Paul Eggert <eggert@cs.ucla.edu>
6815
2a4647a3
PE
6816 * data/c.m4 (yydestruct, yysymprint):
6817 Use YYUSE instead of casting to void.
6818 * data/glr.c (YYUSE): New macro.
6819 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6820 Use it instead of rolling our own.
6821 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
6822 (YYCHK1):
6823 Use /*CONSTCOND*/ to suppress lint warnings.
6824 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
6825 (YY_STACK_PRINT): Use 'false' not '0'.
6826 (YYUSE): New macro.
6827 (yysymprint_, yydestruct_): Use it instead of rolling our own.
6828 * data/yacc.c (YYUSE): New macro.
6829 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
6830 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
6831 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
6832
6833
412e44aa
PE
6834 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
6835 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
6836
88c6637f
PE
68372005-10-04 Paul Eggert <eggert@cs.ucla.edu>
6838
2f4f028d
PE
6839 Undo the parts of the unlocked-I/O change that substituted
6840 putc or puts for printf. This might hurt performance a bit,
6841 but some people prefer the printf style.
6842 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
6843 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
6844 All uses replaced by YYFPRINTF and YYDPRINTF.
6845 * data/yacc.c: Likewise.
6846 * lib/bitset.c (bitset_print): Likewise.
6847 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
6848 putc and puts.
6849 * lib/lbitset.c (debug_lbitset): Likewise.
6850 * src/closure.c (print_firsts, print_fderives): Likewise.
6851 * src/gram.c (grammar_dump): Likewise.
6852 * src/lalr.c (look_ahead_tokens_print): Likewise.
6853 * src/output.c (escaped_output): Likewise.
6854 (user_actions_output): Break apart two printfs.
6855 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
6856 * src/reduce.c (reduce_print): Likewise.
6857 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
6858 * src/system.h: Include unlocked-io.h rathe than stdio.h.
6859
88c6637f
PE
6860 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6861 Use assignments rather than casts-to-void to suppress
6862 unused-variable warnings. This pacifies 'lint'.
6863 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
6864 unused-variable warnings.
6865
fb32e373
JMG
68662005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6867
6868 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
6869
edb8f44f
PE
68702005-10-02 Paul Eggert <eggert@cs.ucla.edu>
6871
fb9c0b33
PE
6872 Use unlocked I/O for a minor performance improvement on hosts like
6873 GNU/Linux and Solaris that support unlocked I/O. The basic idea
6874 is to use the gnlib unlocked-io module, and to prefer putc and
6875 puts to printf when either will work (since the latter doesn't
6876 come in an unlocked flavor).
6877 * bootstrap (gnulib_modules): Add unlocked-io.
6878 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
6879 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
6880 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
6881 and similarly for puts and putc and printf.
6882 * data/yacc.c: Likewise.
6883 * lib/bitset.c (bitset_print): Likewise.
6884 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
6885 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
6886 to printf.
6887 * lib/lbitset.c (debug_lbitset): Likewise.
6888 * src/closure.c (print_firsts, print_fderives): Likewise.
6889 * src/gram.c (grammar_dump): Likewise.
6890 * src/lalr.c (look_ahead_tokens_print): Likewise.
6891 * src/output.c (escaped_output): Likewise.
6892 (user_actions_output): Coalesce two printfs.
2f4f028d 6893 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
6894 * src/reduce.c (reduce_print): Likewise.
6895 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 6896 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 6897
edb8f44f
PE
6898 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
6899 this confuses xgettext.
6900
b50d2359
AD
69012005-10-02 Akim Demaille <akim@epita.fr>
6902
6903 * bootstrap (gnulib_modules): Add strverscmp.
6904 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
6905 * m4/.cvsignore: Add strverscmp.m4.
6906 * src/parse-gram.y (%require): New token, new rule.
6907 (version_check): New.
6908 * src/scan-gram.l (%require): Adjust.
6909 * tests/input.at (AT_REQUIRE): New.
6910 Use it.
6911 * doc/bison.texinfo (Require Decl): New.
6912 (Calc++ Parser): Use %require.
6913
21667f64
AD
69142005-10-02 Akim Demaille <akim@epita.fr>
6915
6916 * data/location.cc: New.
6917
2b81e969
AD
69182005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
6919 Akim Demaille <akim@epita.fr>
6920
6921 Make sure -odir/foo.cc creates dir/location.hh etc.
6922 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
6923 (spec_file_prefix, spec_verbose_file, spec_graph_file)
6924 (spec_defines_file): Now const.
6925 (dir_prefix): New.
6926 (short_base_name): Remove.
6927 * src/files.c: Adjust.
6928 (dirname.h): Include.
6929 (base_name): Don't prototype it.
6930 (finput): Remove, duplicates gram_in.
6931 (full_base_name, short_base_name): Replace by...
6932 (all_but_ext, all_but_tab_ext): these.
6933 (compute_base_names): Rename as...
6934 (compute_file_name_parts): this.
6935 Update to compute the new variables, including dir_prefix.
6936 Adjust dependencies.
6937 * src/output.c (prepare): Output them.
6938 * src/reader.c: Adjust to use gram_in, not finput.
6939 * src/scan-skel.l (@dir_prefix@): New.
6940
ad6a9b97
JMG
69412005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6942
6943 * lib/subpipe.c: New function end_of_output_subpipe() added
6944 to allow support for non-posix systems. This is a no-op function
6945 for posix systems.
6946
6947 * lib/subpipe.h: New function end_of_output_subpipe() added
6948 to allow support for non-posix systems. This is a no-op function
6949 for posix systems.
6950
6951 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
6952 handle the lack of pipe/fork functionality on non-posix systems.
6953
6954 * djgpp/Makefile.maint: DJGPP specific file.
6955
6956 * djgpp/README.in: DJGPP specific file.
6957
6958 * djgpp/config.bat: DJGPP specific configuration file.
6959
6960 * djgpp/config.sed: DJGPP specific configuration file.
6961
6962 * djgpp/config.site: DJGPP specific configuration file.
6963
6964 * djgpp/config_h.sed: DJGPP specific configuration file.
6965
6966 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
6967
6968 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
6969
fc695704
AD
69702005-10-02 Akim Demaille <akim@epita.fr>
6971
6972 * data/location.cc: New, extract from...
6973 * data/lalr1.cc: here.
6974 (location.hh): Include it after the user prologue, in case the
6975 filename type is defined by the user.
6976 Forward declation location and position before the pre-prologue.
6977 (yyresult_): Rename as...
6978 (yyresult): this, it's a local variable, not an attribute.
6979 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
6980
69812005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
6982
6983 * examples/extexi: Restore the #line generation.
6984
fb9712a9
AD
69852005-09-30 Akim Demaille <akim@epita.fr>,
6986 Alexandre Duret-Lutz <adl@gnu.org>
6987
6988 Move the token type and YYSTYPE in the parser class.
6989 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
6990 (parser::token): New, from the moved free definition of tokens.
6991 (parser::semantic_value): Now a full definition instead of an
6992 indirection to YYSTYPE.
6993 (b4_post_prologue): No longer included in the header file, but
6994 in the implementation file.
6995 * doc/bison.texi (C+ Language Interface): Update.
6996 * src/parse-gram.y: Support unary %define.
6997 * tests/actions.at: Define global_tokens_and_yystype for backward
6998 compatibility until we update the tests.
6999 * tests/calc.at: Idem.
7000 (first_line, first_column, last_line, last_column): Define for lalr1.cc
7001 to simplify the code.
7002
55f0c7b1
PE
70032005-09-29 Paul Eggert <eggert@cs.ucla.edu>
7004
7005 Port to SunOS 4.1.4, which lacks strtoul and strerror.
7006 Ah, the good old days! Problem reported by Peter Klein.
7007 * bootstrap (gnulib_modules): Add strerror, strtoul.
7008 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
7009 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
7010
fb9712a9 70112005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
7012
7013 * data/c.m4 (b4_error_verbose_if): New.
7014 * data/lalr1.cc: Use it.
7015 (YYERROR_VERBOSE_IF): Remove.
7016 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
7017 parser members, replaced by...
7018 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
7019 local variables.
7020 (yysyntax_error_): Takes the state number as argument.
7021 (yyreduce_print_): Use the argument yyrule, not the former
7022 attribute yyn_.
7023
8a6f72f3
PE
70242005-09-26 Paul Eggert <eggert@cs.ucla.edu>
7025
7026 * bootstrap (gnulib_modules): Add verify.
7027 * lib/.cvsignore: Add verify.h.
7028 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
7029 * src/system.h (verify): Remove.
7030 Include verify.h instead.
7031 * src/tables.c (tables_generate): Use new API for 'verify'.
7032
0d50976f
PE
70332005-09-21 Paul Eggert <eggert@cs.ucla.edu>
7034
ebc3737e
PE
7035 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
7036 local variables whose names begin with 'yy'.
7037 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7038 Trivial changes from Joel E. Denny.
7039
0d50976f
PE
7040 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
7041 it itself.
7042 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
7043 don't use alloca any more.
7044
7045 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
7046 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 7047 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
7048 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
7049 to match yacc.c, to test more hosts.
7050
a05b79df
PE
70512005-09-20 Paul Eggert <eggert@cs.ucla.edu>
7052
55289366
PE
7053 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
7054 doesn't affect behavior.
7055 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
7056 Solaris, AIX, MSC.
7057 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
7058 This works a bit better with glibc, if user code has already included
7059 stdlib.h.
7060 * doc/bison.texinfo (Bison Parser): Document that users can't
7061 arbitrarily use malloc and free for other purposes. Document
7062 that <alloca.h> and <malloc.h> might be included.
7063 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
7064 user must declare alloca.
7065
a05b79df
PE
7066 * HACKING (release): Forwarn the Translation Project about
7067 stable releses.
7068
3ab2ca22
AD
70692005-09-20 Akim Demaille <akim@epita.fr>
7070
7071 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
7072
a9739e7c
PE
70732005-09-19 Paul Eggert <eggert@cs.ucla.edu>
7074
a702593e
PE
7075 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
7076 (YYSTACK_ALLOC_MAXIMUM): Use it.
7077 (yysyntax_error): New function.
7078 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
7079 multiple syntax errors are reported, and alloca is being used.
7080 Instead, reallocate buffers twice as big each time, so that
7081 we waste at most half the allocated memory. Start with a small
7082 (128-byte) buffer that will suffice in most cases anyway.
7083 Use yysyntax_error to do most of the work.
7084
7085 * doc/bison.texinfo (Error Reporting, Table of Symbols):
7086 yynerrs is the number of errors reported, not the number of
7087 errors encountered.
7088
a9739e7c
PE
7089 * tests/glr-regression.at (Duplicated user destructor for lookahead):
7090 Mark it as expected to fail.
7091 Cast result of malloc; problem reported by twlevo@xs4all.nl.
7092 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
7093 Don't start user-code symbols with "yy", to avoid name space problems.
7094
f479c6c6
AD
70952005-09-19 Akim Demaille <akim@epita.fr>
7096
7097 Remove the traits, failed experiment.
7098 It never proved useful, and anyway because of the current
7099 definition, it was not possible to have several specialization of
7100 this traits, making it useless.
7101 * data/lalr1.cc (yy:traits): Remove.
7102 Inline its definitions in the parser class.
7103
e2586f82
AD
71042005-09-19 Akim Demaille <akim@epita.fr>
7105
7106 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
7107 least Mac OSX with a /usr/local install of gettext.
7108
2e8cf949
AD
71092005-09-19 Akim Demaille <akim@epita.fr>
7110
7111 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
7112 and yytoken for similarity with the other skeletons.
7113
c7fb0b90
AD
71142005-09-19 Akim Demaille <akim@epita.fr>
7115
4e26c69e 7116 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 7117
1bd0deda
PE
71182005-09-16 Paul Eggert <eggert@cs.ucla.edu>
7119
7120 * NEWS: Version 2.1.
7121
7122 * NEWS: Remove notice of yytname change, since it was never in an
7123 official release.
7124 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
7125 diagnostic.
7126 * src/output.c (prepare): Likewise.
7127 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
7128 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
7129 is not defined. This is an awful hack, but it's enough for now.
7130 All callers changed.
7131 * tests/glr-regression-at (make_value): Args are const pointers now,
7132 to avoid GCC warning.
7133 (Duplicated user destructor for lookahead): New test. Currently
7134 skipped. It fails on my host but I'm not sure it'll always fail.
7135
71362005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
7137
7138 * src/symtab.h (struct symbol): Declare the printer and destructor
7139 as const, to avoid accidental calls to free.
7140 (symbol_destructor_set, symbol_printer_set): Adjust.
7141 * src/symtab.c: Adjust.
7142
1bd0deda 71432005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
7144
7145 * data/c.m4 (b4_token_enums): New.
7146 (b4_token_defines): Rename as...
7147 (b4_token_enums_defines): this.
7148 (b4_token_defines): New, output only the #defines.
7149 * data/yacc.c, data/glr.c: Adjust.
7150 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
7151 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
7152 as default values.
7153
dbcdae2d
AD
71542005-09-16 Akim Demaille <akim@epita.fr>
7155
7156 * data/lalr1.cc (yylex_): Remove, inline its code.
7157 (yyreport_syntax_error_): Remove, replaced by...
7158 (yysyntax_error_): this which returns a string and leaves to the
7159 caller the call to the users' error function.
7160 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
7161 Move from members of the parser object...
7162 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
7163 to local variables of the parse function.
7164
70d8f291
AD
71652005-09-16 Akim Demaille <akim@epita.fr>
7166
7167 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
7168 since it's in Bison's name space.
7169
b47dbebe
PE
71702005-09-15 Paul Eggert <eggert@cs.ucla.edu>
7171
ae199bf1
PE
7172 * data/glr.c (yyresolveValue): Add default case to pacify
7173 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
7174
b47dbebe
PE
7175 * NEWS: Document when yyparse started to return 2.
7176 * doc/bison.texinfo (Parser Function): Document when yyparse
7177 returns 2.
7178
7179 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
7180 (b4_filename_type): Renamed back from b4_file_name_type. All uses
7181 changed.
7182 (class position): file_name -> filename (reverting). All uses changed.
7183
71842005-09-14 Paul Eggert <eggert@cs.ucla.edu>
7185
7186 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
7187 do anything if $@ exists. This reverts part of the 2005-07-07
7188 patch.
7189
00292f66
PE
71902005-09-11 Paul Eggert <eggert@cs.ucla.edu>
7191
7192 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
7193 contains obsolete information and isn't worth distributing as a
7194 separate file anyway.
7195 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
7196 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
7197 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
7198 (yyparse): Abort if user code uses longjmp to throw an unexpected
7199 value.
7200
a420f962
PE
72012005-09-09 Paul Eggert <eggert@cs.ucla.edu>
7202
00292f66
PE
7203 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
7204 Suggested by twlevo@xs4all.nl.
7205
127287e9
PE
7206 * data/glr.c (YYCHK1): Do not assume YYE is in range.
7207 This avoids a diagnostic from gcc -Wswitch-enum.
7208 Problem reported by twlevo@xs4all.nl.
7209
a420f962
PE
7210 * doc/bison.texinfo: Don't use "filename", as per GNU coding
7211 standards. Use "file name" or "file" or "name", depending on
7212 the context.
7213 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
7214 not to hack/foo.tab.c.
7215 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
7216 * data/glr.c: b4_filename -> b4_file_name.
7217 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
7218 All uses changed.
7219 (class position): filename -> file_name. All uses changed.
7220 * data/yacc.c: b4_filename -> b4_file_name.
7221 * lib/bitset.h: filename -> file_name in local vars.
7222 * lib/bitset_stats.c: Likewise.
7223 * src/files.c: Likewise.
7224 * src/scan-skel.l ("@output ".*\n): Likewise.
7225 * src/files.c (file_name_split): Renamed from filename_split.
7226 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
7227
72282005-09-08 Paul Eggert <eggert@cs.ucla.edu>
7229
7230 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
7231 to accommodate latest gnulib.
7232
7233 * tests/glr-regression.at (Duplicate representation of merged trees):
7234 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
7235
7236 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
7237 needed.
7238
42a6501d
PE
72392005-08-26 Paul Eggert <eggert@cs.ucla.edu>
7240
7241 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
7242 All uses changed. Invoke user destructor after an error during a
7243 split parse (trivial change from Joel E. Denny).
7244
7245 * tests/glr-regression.at
7246 (User destructor after an error during a split parse): New test case.
7247 Problem reported by Joel E. Denny in:
7248 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
7249
ef9a1faf
PE
72502005-08-25 Paul Eggert <eggert@cs.ucla.edu>
7251
5b4aaf78
PE
7252 * README-cvs: Give URLs for recommended tools.
7253 Mention Gzip version problem, and bootstrapping issues.
7254 Remove troubleshooting section, as it's somewhat obsolete.
7255
b5240ba5
PE
7256 * bootstrap (no_cache): New var, to accommodate different wget
7257 variants. Use it instead of '-C off'. Problem reported by
7258 twlevo@xs4all.nl.
7259
ef9a1faf
PE
7260 * data/glr.c (yydestroyStackItem): New function.
7261 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
7262 debugging information. Problem reported by Joel E. Denny.
7263
e6efa9da
AD
72642005-08-25 Akim Demaille <akim@epita.fr>
7265
7266 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
7267
adc90f13
PE
72682005-08-24 Paul Eggert <eggert@cs.ucla.edu>
7269
7270 * data/glr.c (yyrecoverSyntaxError, yyreturn):
7271 Don't invoke destructor on unresolved entries.
7272 * tests/glr-regression.at
7273 (User destructor for unresolved GLR semantic value): New test case.
7274 Problem reported by Joel E. Denny in:
7275 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
7276
f9315de5
PE
72772005-08-21 Paul Eggert <eggert@cs.ucla.edu>
7278
15d29c1f
PE
7279 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
7280 Add strnlen.c.
7281 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
7282 lib-prefix.m4, po.m4.
7283
dd5f2af2
PE
7284 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
7285 in yydestruct diagnostic, since it might not be an error.
7286 Problem reported by Joel Denny near end of
7287 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 7288 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
7289 * data/yacc.c (yyreturn): Likewise.
7290 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
7291
7292 * src/files.c: Remove obsolete FIXME comment.
7293
7294 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
7295 with the other templates, and to fix bogus run-on messages such
7296 as the one reported at the end of
7297 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
7298 All callers changed to avoid the newline.
7299 (yyprocessOneStack): Output two lines rather than one, to accommodate
7300 the above change. This changes the debug output format slightly.
7301
f9315de5
PE
7302 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
7303 reported by Joel E. Denny in
7304 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
7305 (trivial change).
7306 * tests/glr-regression.at (Duplicate representation of merged trees):
7307 New test, from Joel E. Denny in:
7308 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
7309 * THANKS: Add Joel E. Denny.
7310
7311 * configure.ac (AC_INIT): Bump to 2.0c.
7312
04098407
PE
73132005-07-24 Paul Eggert <eggert@cs.ucla.edu>
7314
7315 * NEWS: Version 2.0b.
7316
ca5d2013
PE
7317 * Makefile.am (SUBDIRS): Put examples before tests, so that
7318 "make check" doesn't finish with "All 1 tests passed".
7319
3d54b576
PE
7320 * tests/regression.at (Token definitions): Don't rely on
7321 AT_PARSER_CHECK for data that contains backslashes. It currently
7322 uses 'echo', and 'echo' isn't portable if its argument contains
7323 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
7324 that the byte '\0xff' is not printable in the C locale; it is,
7325 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
7326 not printable, so use '\0x81' to test.
7327
d53ae497
PE
7328 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
7329 version of GCC, since the macro is used with non-GCC compilers.
7330
fc01665e
PE
7331 Fix core dump reported by Pablo De Napoli in
7332 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
7333 * tests/regression.at (Invalid inputs with {}): New test.
7334 * src/parse-gram.y (token_name): Translate type before using
7335 it as an index.
7336
04098407
PE
7337 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
7338 the user's name space. All uses changed to __attribute__
7339 ((__unused__)).
7340 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
7341 Add __attribute__ ((__noreturn__)).
7342
7343 * etc/clcommit: Remove. We weren't using it, and it failed
7344 "make maintainer-distcheck".
7345 * Makefile.maint: Merge from coreutils.
7346 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
7347 (syntax-check-rules): Change list of rules as described below.
7348 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
7349 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
7350 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
7351 (sc_trailing_space): New rules.
7352 (sc_xalloc_h_in_src): Remove.
7353 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
7354 (sc_space_tab, sc_error_exit_success, sc_changelog):
7355 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
7356 (makefile-check, po-check, author_mark_check):
7357 (makefile_path_separator_check, copyright-check):
7358 Use grep -n, to make it easier to find violations.
7359 Use CVS_LIST and CVS_LIST_EXCEPT.
7360 (header_regexp, h_re): Remove.
7361 (dd_c): New macro.
7362 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
7363 (my-distcheck): Use more-modern GCC flags.
7364 (signatures, %.asc): Remove.
7365 (rel-files, announcement): Remove signatures.
7366 Restore old updating code, even though we don't use it, so
7367 that we're the same as coreutils.
7368 (alpha, beta, major): Depend on news-date-check.
7369 Make the upload commands.
7370
7371 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
7372 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
7373 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
7374 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
7375 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
7376 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
7377 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
7378 * tests/sets.at: Likewise.
7379
7380 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
7381 we comment out the Autoconf version number.
7382 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
7383 it's error-prone and "make maintainer-distcheck" rejects it.
7384
7385 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
7386 Indent calls to "error" to pacify "make maintainer-distcheck",
7387 when the calls are not intended to be translated.
7388 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
7389
7390 * src/Makefile.am (DEFS): Use +=, to pacify
7391 "make maintainer-distcheck".
7392 (bison_SOURCES): Add scan-skel.h.
7393 (sc_tight_scope): New rule, from coreutils.
7394
7395 * src/files.c (src_extension, header_extension):
7396 Now static, not extern.
7397 * src/getargs.c (short_options): Likewise.
7398 * src/muscle_tab.c (muscle_table): Likewise.
7399 * src/parse-gram.y (current_class, current_type, current_prec):
7400 Likewise.
7401 * src/reader.c (grammar_end, previous_rule_end): Likewise.
7402 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
7403 * src/main.c (main): Cast bindtextdomain and textdomain calls to
7404 void, to avoid warning when NLS is disabled.
7405 * src/output.c: Include scan-skel.h.
7406 (scan_skel): Remove decl, since scan-skel.h does this.
7407 (output_skeleton):
7408 Indent calls to "error" to pacify "make maintainer-distcheck".
7409 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
7410 * src/reader.h (gram_end, gram_lineno): New decls to pacify
7411 "make maintainer-distcheck".
7412 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
7413 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
7414 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
7415 (skel_lex_destroy, scan_skel): Move these decls to...
7416 * src/scan-skel.h: New file.
7417 * src/uniqstr.c (uniqstr_assert):
7418 Indent calls to "error" to pacify "make maintainer-distcheck".
7419
7420 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
7421 not @VAR@.
7422
7423 * tests/torture.at: Revamp to avoid misuse of atoi that
7424 "make maintainer-distcheck" complained about.
7425
7426 * examples/extexi (message): Don't print a message more than once,
7427 and omit line-number decoration that makes Emacs compile think
7428 that informative messages are worth worrying about.
7429
74302005-07-22 Paul Eggert <eggert@cs.ucla.edu>
7431
7432 * configure.ac: Update version number.
7433
7434 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
7435 accidentally.
7436 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
7437 autogenerated by the maintainer.
7438 * examples/calc++/.cvsignore: Add *.yy.
7439
7440 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
7441 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7442 * lib/bitsetv.c (bitsetv_alloc): Likewise.
7443
7444 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
7445
7446 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
7447 from maintainer-distcheck about casting the argument of 'free'.
7448
7449 * NEWS: Mention recent yytname changes.
7450 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
7451
7452 * bootstrap: For translations that have not yet been upgraded to
7453 the new runtime-po domain, prime the pump by extracting the
7454 relevant strings from the obsolete translations. This code can be
7455 removed once the bison-runtime domain has been translated by each
7456 team.
7457
7458 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
7459 now that token names are already quoted.
7460
7461 Fix problem reported by Anthony Heading.
7462 * data/glr.c (YYTOKEN_TABLE): New macro.
7463 (yytname): Define if YYTOKEN_TABLE.
7464 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
7465 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
7466 (YYERROR_VERBOSE): Define the same way the other skeletons do.
7467 * src/output.c (prepare_symbols): Output token_table_flag.
7468
0ffda363
PE
74692005-07-21 Paul Eggert <eggert@cs.ucla.edu>
7470
7471 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
7472 again if the first call fails.
7473
7474 * data/glr.c (yytnamerr): New function.
7475 (yyreportSyntaxError): Use it to dequote most string literals.
7476 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
7477 with other skeletons. All uses changed.
7478 (yytnameerr_): New function.
7479 (yyreport_syntax_error): Use it to dequote most string literals.
7480 * data/yacc.c (yytnamerr): New function.
7481 (yyerrlab): Use it to decode most string literals.
7482 * doc/bison.texinfo (Decl Summary, Calling Convention):
7483 Clarify quoting convention of yytname.
7484 * src/output.c (prepare_symbols): Quote all names. This undoes
7485 the 2005-04-17 change, which is now accomplished (mostly) via
7486 changes in the parsers as described above.
7487 * tests/regression.at (Token definitions, Web2c Actions):
7488 Undo most 2005-04-17 change here, too.
7489
74902005-07-20 Paul Eggert <eggert@cs.ucla.edu>
7491
7492 Fix more problems reported by twlevo@xs4all.nl.
7493 * tests/cxx-type.at: Don't pipe output of ./types through sed to
7494 remove trailing spaces. This loses the exit status of ./types,
7495 and isn't needed since ./types shouldn't be emitting trailing
7496 spaces.
7497 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
7498 as the stack isn't valid in that case.
7499
7500 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7501 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7502 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7503 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
7504 is used.
7505 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
7506 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7507 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7508 Likewise.
7509
7510 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
7511 overly-picky compilers that reject 'char *foo = "bar";'.
7512
7513 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
7514 to FILE * parameter, not to stderr. This fixes a typo introduced
7515 in the 2005-07-12 change.
7516
7517 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
7518 warnings from GCC 4.
7519
7520 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
7521 (yyglrShiftDefer, yysplitStack):
7522 Remove unused parameters b4_pure_formals. All uses changed.
7523 (yyglrShift): Remove unused parameters b4_user_formals.
7524 All uses changed.
7525 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
7526
6100a9aa
PE
75272005-07-18 Paul Eggert <eggert@cs.ucla.edu>
7528
258b75ca
PE
7529 Destructor cleanups and regularization among the three skeletons.
7530 * NEWS: Document the behavior changes.
7531 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
7532 stack before failing, as the cleanup code will do it for us now.
7533 * data/lalr1.cc (yyerrlab): Likewise.
7534 * data/glr.c (yyparse): Pop everything off the stack before
7535 freeing it, so that destructors get called properly.
7536 * data/lalr1.cc (yyreturn): Likewise.
7537 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
7538 This is more consistent.
7539 * doc/bison.texinfo (Destructor Decl): Mention more reasons
7540 why destructors might be called. 1.875 -> 2.1.
7541 (Destructor Decl, Decl Summary, Table of Symbols):
7542 Some English-language cleanups for %destructor.
7543 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7544 Add output line for destructor of start symbol.
7545 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
7546 because of that same extra output line.
7547
1a059451
PE
7548 * NEWS: Document minor wording changes in diagnostics of
7549 Bison-generated parsers.
7550 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
7551 Remove unused formals. All uses changed.
7552 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
7553 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
7554 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
7555 Rename yyoverflowab to yyexhaustedlab.
7556 When memory exhaustion occurs during syntax-error reporting,
7557 report it separately rather than in a single diagnostic; this
7558 eases translation.
7559 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
7560 (Memory Exhausted): Renamed from Parser Stack Overflow.
7561 Revamp wording slightly to prefer "memory exhaustion".
7562 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
7563
97460c78
PE
7564 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
7565
30757c8c
PE
7566 Add i18n support to the GLR skeleton. Partially fix the C++
7567 skeleton; a C++ expert needs to finish this. Remove debugging
7568 msgids; there's little point to having them translated, since they
7569 can be understood only by someone who can read the
7570 (English-language) source code.
7571
7572 Generate runtime-po/bison-runtime.pot automatically, so that we
7573 don't have to worry about garbage getting in that file. We'll
7574 make sure after the next official release that old msgids don't
7575 get lost. See
7576 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
7577
7578 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
7579 Now auto-generated.
7580 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
7581 Fix typos in explanations of the runtime file.
7582 * bootstrap: Change gettext keyword from YYI18N to YY_.
7583 Use standard Makefile.in.in in runtime-po, since we'll arrange
7584 for backward-compatible bison-runtime.po files in a different way.
7585 * data/glr.c (YY_): New macro, from yacc.c.
7586 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
7587 Translate messages intended for users.
7588 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
7589 the wording in the other skeletons. We don't know that the memory
7590 is virtual.
7591 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
7592 Use same method that yacc.c uses.
7593 Don't translate debugging messages.
7594 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
7595 it doesn't work (yet), and requires C++ expertise to fix.
7596 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
7597 Move defn to a more logical place, to be consistent with other
7598 skeletons.
7599 Don't translate debugging messages.
7600 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
7601 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
7602 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
7603 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
7604
ac8c5689
PE
7605 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
7606 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
7607 void, not int.
7608 * tests/glr-regression.at (Badly Collapsed GLR States):
7609 Likewise.
7610 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7611 yylex should return 0 at EOF rather than aborting.
7612
6100a9aa
PE
7613 Improve tests for stack overflow in GLR parser.
7614 Problem reported by twlevo@xs4all.nl.
7615 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
7616 All uses removed.
7617 (yyStackOverflow): Just longjmp, but with value 2 so that caller
7618 can handle the problem.
7619 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
7620 (yyparse): New local variable yyresult to record the result.
7621 Use result of setjmp to set it, rather than storing itinto
7622 struct.
7623 (yyDone): Remove label.
7624 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
7625 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
7626 if YYABORT is used).
7627 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
7628 yyparse status; put status > 1 into diagnostic.
7629 Check that status==2 works.
7630 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
7631 Use exit status 3 for failure to open (which shouldn't happen).
7632
15f40952
PE
76332005-07-17 Paul Eggert <eggert@cs.ucla.edu>
7634
67fd79c4
PE
7635 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
7636 1 on syntax error; just let yyparse do its thing.
7637 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
7638 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
7639 (Exploding the Stack Size with Alloca):
7640 (Exploding the Stack Size with Malloc):
7641 Expect exit status 2, not 1, since the parser is supposed to blow
7642 its stack. Problem reported by twlevo@xs4all.nl.
7643
15f40952
PE
7644 * data/glr.c (yyparse): Don't assume that the initial calls
7645 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
7646 Print a stack-overflow message and fail instead.
7647 Initialize the line-number information before creating the stack,
7648 so that the stack-overflow message can report line zero safely.
7649
f32c66b5
PE
76502005-07-14 Paul Eggert <eggert@cs.ucla.edu>
7651
a22ff96f 7652 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
7653 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
7654 (yyuserMerge): Provide a default case if b4_mergers is empty.
7655 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
7656 * tests/glr-regression.at
7657 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 7658 Add casts to pacify C++ compilers.
1beb0b24
PE
7659 * tests/glr-regression.at (Improper merging of GLR delayed action
7660 sets): Declare yylex before using it.
f32c66b5 7661 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
7662 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
7663 test for valgrind; valgrind is independent of g++.
7664 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
7665 for compatibility with POSIX 1003.1-2001 (if running coreutils).
7666 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
7667 Use a destructor, so that we can expand the stack. Change
7668 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 7669
d741bd1b
PE
76702005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7671
7672 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
7673 a valgrind failure. Problem reported by twlevo@xs4all.nl.
7674
0410a6e0
PE
76752005-07-13 Paul Eggert <eggert@cs.ucla.edu>
7676
7677 * PACKAGING: New file, suggested by Bruno Haible and taken from
7678 similar wording in gettext's PACKAGING file.
7679 * NEWS: Mention PACKAGING.
7680 * Makefile.am (EXTRA_DIST): Add PACKAGING.
7681
f7ab6a50
PE
76822005-07-12 Paul Eggert <eggert@cs.ucla.edu>
7683
baf785db 7684 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
7685 * bootstrap: Get runtime translations into runtime-po.
7686 Create runtime-po files automatically, if possible.
7687 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
7688 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
7689 does not infringe on the user's name space.
7690 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
7691 * doc/bison.texinfo (Internationalization): Revamp the English
7692 and Texinfo syntax a bit, to try to make it clearer.
7693 (Bison Options, Option Cross Key): Mention --print-localedir.
7694 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
7695 YYENABLE_NLS. Quote a bit more.
7696 * runtime-po/.cvsignore: New file.
7697 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
7698 * runtime-po/Rules-quot: Remove; now created by bootstrap.
7699 * runtime-po/quot.sed: Likewise.
7700 * runtime-po/boldquot.sed: Likewise.
7701 * runtime-po/en@quot.header: Likewise.
7702 * runtime-po/en@boldquot.header: Likewise.
7703 * runtime-po/insert-header.sin: Likewise.
7704 * runtime-po/remove-potcdate.sin: Likewise.
7705 * runtime-po/Makevars: Likewise.
7706 * runtime-po/LINGUAS: Likewise.
7707 * runtime-po/de.po: Likewise; we will rely on the translation project
7708 to maintain this, so "bootstrap" should get it.
0410a6e0 7709 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
7710 its value.
7711 * src/main.c (main): Bind the bison-runtime domain, too.
7712
77132005-07-12 Bruno Haible <bruno@clisp.org>
7714
7715 * data/yacc.c: Include <libintl.h> when NLS is enabled.
7716 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
7717 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
7718 * runtime-po: New directory.
7719 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
7720 $(DOMAIN).pot-update rule, so that old messages are never dropped.
7721 * runtime-po/Rules-quot: New file, copied from po/.
7722 * runtime-po/quot.sed: Likewise.
7723 * runtime-po/boldquot.sed: Likewise.
7724 * runtime-po/en@quot.header: Likewise.
7725 * runtime-po/en@boldquot.header: Likewise.
7726 * runtime-po/insert-header.sin: Likewise.
7727 * runtime-po/remove-potcdate.sin: Likewise.
7728 * runtime-po/Makevars: New file.
7729 * runtime-po/POTFILES.in: New file.
7730 * runtime-po/LINGUAS: New file.
7731 * runtime-po/bison-runtime.pot: New file.
7732 * runtime-po/de.po: New file.
7733 * m4/bison.m4: New file.
7734 * Makefile.am (SUBDIRS): Add runtime-po.
7735 (aclocaldir, aclocal_DATA): New variables.
7736 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
7737 Define aclocaldir.
7738 * src/getargs.c (usage): Document --print-localedir option.
7739 (PRINT_LOCALEDIR_OPTION): New enum item.
7740 (long_options): Add --print-localedir option.
7741 (getargs): Handle --print-localedir option.
7742 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
7743 (Internationalization): New section.
7744
22dda0f0
AD
77452005-07-12 Akim Demaille <akim@epita.fr>
7746
7747 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
7748 for consistency with the rest of the code.
7749 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
7750 Add separators.
7751
82b248ad
AD
77522005-07-12 Akim Demaille <akim@epita.fr>
7753
7754 * src/parse-gram.y: Use %printer instead of YYPRINT.
7755
fa0e9314
AD
77562005-07-12 Akim Demaille <akim@epita.fr>
7757
867a3e00
AD
7758 * src/symtab.h, src/symtab.c (symbol_print): New.
7759 * src/symlist.h, src/symlist.c (symbol_list_print): New.
7760 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
7761
77622005-07-12 Akim Demaille <akim@epita.fr>
7763
7764 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
7765 b4_at_dollar and b4_dollar_dollar.
7766
e054b190
PE
77672005-07-11 Paul Eggert <eggert@cs.ucla.edu>
7768
7769 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
7770 and Pennello's paper.
7771
34160ec4
PE
77722005-07-09 Paul Eggert <eggert@cs.ucla.edu>
7773
407d4a75
PE
7774 * data/yacc.c (yyparse): Undo previous patch. Instead,
7775 set yylsp[0] and yyvsp[0] only if the initial action
7776 sets yylloc and yylval, respectively.
7777
34160ec4
PE
7778 * data/yacc.c (yyparse): In the initial action, set
7779 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
7780 This avoids the use of undefined variables if the initial
7781 action does not set yylloc and/or yylval.
7782
c3d5a4a7
PE
77832005-07-07 Paul Eggert <eggert@cs.ucla.edu>
7784
b34d96c1
PE
7785 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
7786 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
7787 Remove from CVS. These files are automatically generated.
7788 * examples/extexi: Clarify that this file is now part of Bison,
7789 not GNU M4, and that it works with any POSIX-compatible Awk.
7790 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
7791 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
7792 so that we also get calc++-parser.yy. Geneate it.
7793 Use $(AWK), not gawk, since any conforming Awk will do.
7794 Put comment before action, since older 'make' can't handle comment
7795 in action.
7796 $(BUILT_SOURCES): List all built sources, not just some of them.
7797 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
7798 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
7799 $($(calc_sources_generated)): Remove unnecessary test for existence
7800 of target. (This had a shell syntax error anyway; a stray "x".)
7801 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
7802 calc++-parser.yy.
7803 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
7804
c3d5a4a7
PE
7805 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
7806 implied by the other modules.
7807
828c373b
AD
78082005-07-06 Akim Demaille <akim@epita.fr>
7809
7810 Bind examples/calc++ to the package.
7811 * examples/calc++/Makefile: Remove, replaced by...
7812 * examples/calc++/Makefile.am: ... this new file.
7813 * examples/calc++/test: Remove input.
7814 * examples/calc++/compile: Remove.
7815 * examples/Makefile.am: New.
7816 * configure.ac, Makefile.am: Adjust.
7817 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
7818
63cb01d6
PE
78192005-07-05 Paul Eggert <eggert@cs.ucla.edu>
7820
fd2df2ed
PE
7821 * data/glr.c (yyFail): Drastically simplify; since the format argument
7822 never had any % directives, we can simply pass it to yyerror.
7823 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
7824 be modified later, as that is the usual style in glr.c.
7825 Problems reported by Paul Hilfinger.
7826
63cb01d6
PE
7827 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
7828 and size overflow errors.
7829 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
7830 in case the user prolog sets feature-test macros like _GNU_SOURCE.
7831 (YYSIZEMAX): New macro.
7832 (yystpcpy): New function, taken from yacc.c.
7833 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
7834 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
7835 so that we don't have to maintain their signatures.
7836 (yyFail): Check for buffer overflow, by using vsnprintf rather
7837 than vsprintf. Allocate a bigger buffer if possible.
7838 Report an error if buffer allocation fails.
7839 (yyStackOverflow): New function.
7840 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
7841 the initialization was successful. It might fail if storage was
7842 exhausted.
7843 (yyexpandGLRStack): Add more checks for storage allocation failure.
7844 Use yyStackOverflow to report failures.
7845 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
7846 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
7847 Don't assume stack number fits in int.
7848 (yysplitStack): Check for storage allocation failure.
7849 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
7850 can print diagnostics on storage allocation failure. All callers
7851 changed.
7852 (yyresolveValue): Use yybool for boolean.
7853 (yyreportSyntaxError): Check for size-calculation overflow.
7854 This code is taken from yacc.c.
7855 (yyparse): Check for storage allocation errors when allocating
7856 the initial stack.
7857
1c59e0a1
AD
78582005-07-05 Akim Demaille <akim@epita.fr>
7859
7860 Extract calc++ from the documentation.
7861 * doc/bison.texinfo (Calc++): Add the extraction marks.
7862 * examples/extexi: New, from the aborted GNU Programming 2E.
7863 Separate the different paragraph of a file with empty lines.
7864 * examples/Makefile: Use it to extract the whole calc++ example.
7865
8a0adb01
AD
78662005-06-24 Akim Demaille <akim@epita.fr>
7867
7868 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
7869 class typedefs.
7870
12545799
AD
78712005-06-22 Akim Demaille <akim@epita.fr>
7872
7873 * doc/bison.texinfo (C++ Language Interface): First stab.
7874 (C++ Parsers): Remove.
7875
99be0235
AD
78762005-06-22 Akim Demaille <akim@epita.fr>
7877
7878 * data/lalr1.cc (yylex_): Honor %lex-param.
7879
0ffd4fd1
AD
78802005-06-22 Akim Demaille <akim@epita.fr>
7881
7882 Start a set of simple examples.
7883 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
7884 * examples/calc++/calc++-driver.hh,
7885 * examples/calc++/calc++-parser.yy,
7886 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
7887 * examples/calc++/compile, examples/calc++/test: New.
7888
0925ebb4
PE
78892005-06-09 Paul Eggert <eggert@cs.ucla.edu>
7890
7891 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
7892 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
7893 which stems from the 2005-05-27 patch.
7894
43d3b664
PH
78952005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7896
7897 * data/glr.c: Modify treatment of unused parameters to permit use
7898 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
7899
3062864d
PE
79002005-05-30 Paul Eggert <eggert@cs.ucla.edu>
7901
7902 Fix infringement on user name space reported by Janos Zoltan Szabo.
7903 * data/yacc.c (yyparse): strlen -> yystrlen.
7904
989b5b8e
AD
79052005-05-30 Akim Demaille <akim@epita.fr>
7906
7907 * data/lalr1.cc (_): New.
7908 Translate the various messages.
7909
bedf57f5
PE
79102005-05-27 Paul Eggert <eggert@cs.ucla.edu>
7911
7912 Fix infringement on user name space reported by Bruno Haible.
7913 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
7914 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
7915 the user's name space.
7916 (alloca): Include <stdlib.h> to get it, if it's not built in.
7917 (YYMALLOC, YYFREE): Define only if needed.
7918 (malloc, free): Declare, but only if needed, as this infringes on
7919 the user name space.
7920
4d1801f1
PE
79212005-05-25 Paul Eggert <eggert@cs.ucla.edu>
7922
7923 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
7924 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
7925 with %d format.
7926 * lib/ebitset.c (min, max): Undef before defining.
7927 * lib/vbitset.c (min, max): Likewise.
7928 * lib/subpipe.c (create_subpipe): Save local variables in case
7929 vfork clobbers them.
7930
79312005-05-24 Bruno Haible <bruno@clisp.org>
7932
7933 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
7934 error message syntax used by gcc-4.0.
7935
b94a9e1e
PE
79362005-05-23 Paul Eggert <eggert@cs.ucla.edu>
7937
85ac3861
PE
7938 * README: Mention m4 1.4.3. Remove obsolete advice about
7939 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
7940
b94a9e1e
PE
7941 * bootstrap: Remove workaround for problem I encountered with
7942 gettext 0.14.1; it seems to be fixed now.
7943
51c30d21
PE
79442005-05-22 Paul Eggert <eggert@cs.ucla.edu>
7945
009ce67d
PE
7946 * NEWS: Version 2.0a.
7947
f2a97c62
PE
7948 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
7949 the previous change.
7950
c8775f93
PE
7951 Various maintainer cleanups.
7952 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
7953 conftest*, for benefit of CVS commands run at the same time as
7954 "configure". Add build-aux, since "bootstrap" now creates it and
7955 its subfiles.
7956 * Makefile.cfg (move_if_change): Remove.
7957 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
7958 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
7959 (po_repo, do-po-update, po-update, wget_files, get-targets):
7960 (config.guess-url_prefix, config.sub-url_prefix):
7961 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
7962 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
7963 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
7964 Remove.
7965 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
7966 this is now the recommended name.
7967 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
7968 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
7969 ylwrap. These files now go into build-aux.
7970 * config/move-if-change: Remove.
7971 * config/prev-version.txt: Bump from 1.75 to 2.0.
7972
3ea5f0ec
PE
7973 * bootstrap: Add stdio-safer, unistd-safer modules.
7974 Remove m4/glibc2.m4 (introduced by latest gnulib, but
7975 we don't need it).
7976 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
7977 fopen-safer.c, stdio-safer.h, unistd-safer.h.
7978 * lib/subpipe.c: Include "unistd-safer.h".
7979 (create_subpipe): Make sure all the newly-created
7980 file descriptors are > 2, so that diagnostics don't
7981 get sent down them (which might cause Bison to hang, in theory).
7982 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
7983 * src/files.c (xfopen): Use fopen_safer, not fopen.
7984
51c30d21
PE
7985 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
7986 yesterday's yacc.c fix.
7987
cea1469d
PE
79882005-05-21 Paul Eggert <eggert@cs.ucla.edu>
7989
3ea5f0ec
PE
7990 * data/glr.c, data/lalr1.cc: Update copyright date.
7991
cea1469d
PE
7992 Fix a destructor bug reported by Wolfgang Spraul in
7993 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
7994 * data/yacc.c (yyabortlab): Don't call destructor, and
7995 don't set yychar to EMPTY.
7996 (yyoverflowlab): Don't call destructor.
7997 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
7998 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
7999 since we no longer output the message "discarding lookahead token
8000 end of input ()".
8001
5e6f62f2
PH
80022005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8003
8004 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
8005 fix a small glitch in debugging output.
8006 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
8007 after YY_SYMBOL_PRINT where needed.
8008
8009 (struct yyGLRState): Add some comments.
8010 (struct yySemanticOption): Add some comments.
8011 (union yyGLRStackItem): Add comment.
8012
8013 (yymergeOptionSets): Correct this to properly perform the union,
8014 avoiding infinite reported by Michael Rosien.
8015 Update comment.
8016
8017 * tests/glr-regression.at: Add test for GLR merging error reported
8018 by M. Rosien.
cea1469d 8019
0fb669f9
PE
80202005-05-13 Paul Eggert <eggert@cs.ucla.edu>
8021
8022 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
8023 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
8024 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
8025 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
8026 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
8027 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
8028 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
8029 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
8030 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
8031 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
8032 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
8033 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
8034 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
8035 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
8036 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
8037 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
8038 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
8039 src/derives.h, src/files.c, src/files.h, src/getargs.c,
8040 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
8041 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
8042 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
8043 src/output.h, src/parse-gram.c, src/parse-gram.h,
8044 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
8045 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
8046 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
8047 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
8048 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
8049 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
8050 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
8051 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
8052 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
8053 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
8054 tests/reduce.at, tests/regression.at, tests/sets.at,
8055 tests/synclines.at, tests/testsuite.at, tests/torture.at:
8056 Update FSF postal mail address.
8057
51f4735e
PE
80582005-05-11 Paul Eggert <eggert@cs.ucla.edu>
8059
8060 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
8061 Problem reported by Ralf Menzel.
8062
80ce3401
PE
80632005-05-01 Paul Eggert <eggert@cs.ucla.edu>
8064
8065 * tests/actions.at: Test that stack overflow invokes destructors.
8066 From Marcus Holland-Moritz.
8067 * data/yacc.c (yyerrlab): Move the code that destroys the stack
8068 from here....
8069 (yyreturn): to here. That way, destructors are called properly
8070 even if the stack overflows, or the user calls YYACCEPT or
8071 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
8072 (yyoverflowlab): Destroy the lookahead.
8073
80742005-04-24 Paul Eggert <eggert@cs.ucla.edu>
8075
8076 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
8077
72f000b0
PE
80782005-04-17 Paul Eggert <eggert@cs.ucla.edu>
8079
8080 * NEWS: Bison-generated C parsers no longer quote literal strings
8081 associated with tokens.
8082 * src/output.c (prepare_symbols): Don't escape strings,
8083 since users don't want to see C escapes.
8084 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
8085 in diagnostics.
c19683bb 8086 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
8087 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
8088
1094323f
PE
80892005-04-16 Paul Eggert <eggert@cs.ucla.edu>
8090
8091 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
8092 the data size is known to be too small and we can't increase it.
8093 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
8094
ca407bdf
PE
80952005-04-15 Paul Eggert <eggert@cs.ucla.edu>
8096
8097 * src/parse-gram.y: Include quotearg.h.
8098 (string_as_id): Quote $1 before using it as a key, since the
8099 lexer no longer quotes it for us.
8100 (string_content): Don't strip quotes, since lexer no longer
8101 quotes it for us.
8102 * src/scan-gram.l: Include quotearg.h.
8103 ("\""): Omit quote.
8104 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
8105 a key, since the rest of the lexer doesn't quote it.
8106 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
8107 * tests/regression.at (Token definitions): Check for backslashes
8108 in token strings.
8109
8110 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
8111 (YYSIZE_T): Define to unsigned long int when using an older compiler.
8112 (yyparse): Revamp code to generate long syntax error message, to
8113 make it easier to translate, and to avoid problems with arithmetic
8114 overflow. Change "virtual memory" to "memory" in diagnostic, since
8115 we don't know whether the memory is virtual.
8116
1ce59070
PE
81172005-04-13 Paul Eggert <eggert@cs.ucla.edu>
8118
8119 * NEWS: Bison-generated C parsers now use the _ macro to
8120 translate strings.
8121 * data/yacc.c (_) [!defined _]: New macro.
8122 All English strings wrapped inside this macro.
8123 * doc/bison.texinfo (Bison Parser): Document _.
8124 * po/POTFILES.in: Include src/parse-gram.c, since it now
8125 includes translateable strings that parse-gram.y doesn't.
8126
a749a695
PE
81272005-04-12 Paul Eggert <eggert@cs.ucla.edu>
8128
8129 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
8130 reverting the 2004-10-11 change to this function.
8131 (symbol_check_alias_consistency): Don't call symbol_type_set
8132 if the type name is already correct.
8133 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
8134
8fb1053b
PE
81352005-03-25 Paul Eggert <eggert@cs.ucla.edu>
8136
8137 * tests/regression.at (Token definitions): Don't use a token named
8138 c, as that generates a "#define c ..." that runs afoul of buggy
8139 stdlib.h that uses the identifier c as a member of struct
8140 drand48_data. Problem reported by Horst Wente.
8141
ff498c4a
PE
81422005-03-21 Paul Eggert <eggert@cs.ucla.edu>
8143
8144 * bootstrap: Change translation URL from
8145 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
8146 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
8147 redirection glitches. Problem reported by twlevo@xs4all.nl.
8148
65211d70
PE
81492005-03-20 Paul Eggert <eggert@cs.ucla.edu>
8150
8151 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
8152 after operands; POSIX says this isn't portable for the c99 command.
8153
9577fb1f
PE
81542005-03-18 Paul Eggert <eggert@cs.ucla.edu>
8155
8156 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
8157 immediately if a data overrun has occurred; this may help us track
8158 down what may be a spurious failure on MacOS.
8159
78b178f7
PE
81602005-03-17 Paul Eggert <eggert@cs.ucla.edu>
8161
a2599d0f
PE
8162 Respond to problems reported by twlevo@xs4all.nl.
8163
8164 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
8165
78b178f7
PE
8166 * src/vcg.h: Comment fix.
8167 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
8168 (G_CMAX): Change to -1 instead of INT_MAX.
8169
8170 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 8171
7296e729
PE
81722005-03-15 Paul Eggert <eggert@cs.ucla.edu>
8173
8174 * src/tables.c (state_number_to_vector_number): Put it inside an
8175 "#if 0", since it's not currently used. Problem reported by
8176 Roland McGrath.
8177
05ac60f3
PE
81782005-03-06 Paul Eggert <eggert@cs.ucla.edu>
8179
8180 * src/output.c (escaped_output): Renamed from
8181 escaped_file_name_output, since we now use it for symbol tags as
8182 well. All uses changed.
8183 (symbol_destructors_output, symbol_printers_output):
8184 Escape symbol tags too.
8185 Problem reported by Matyas Forstner in
8186 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
8187
8188 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
8189 not needed.
8190 * src/output.c (user_actions_output, token_definitions_output,
8191 symbol_destructors_output, symbol_printers_output): Likewise.
8192 * src/reader.c (prologue_augment): Likewise.
8193 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
8194
8195 * src/vcg.c (output_edge): Don't quote linestyle arg.
8196 Problem reported by twlevo@xs4all.nl.
8197
7eb453ac
PE
81982005-02-28 Paul Eggert <eggert@cs.ucla.edu>
8199
8200 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
8201 example, reported by Derek M Jones. Also, make the example even
8202 more outrageous, to better illustrate how bad the problem is.
8203
4c04c52a
PE
82042005-02-24 Paul Eggert <eggert@cs.ucla.edu>
8205
8206 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
8207 putsym. Typo reported by Sebastian Piping.
8208
a61e1620
PE
82092005-02-23 Paul Eggert <eggert@cs.ucla.edu>
8210
8211 * doc/bison.texinfo (Language and Grammar): some -> same
8212 (Epilogue): int he -> in the
8213 Typos reported by Sebastian Piping via Justin Pence.
8214
9ec93868
PE
82152005-02-07 Paul Eggert <eggert@cs.ucla.edu>
8216
8217 * tests/glr-regression.at (Improper handling of embedded actions
8218 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
8219 embedded actions and $-N in GLR parsers", work around an Autoconf bug
8220 with dollar signs in test names.
8221 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
8222 for a similar reason.
8223
73ce7e7e
PE
82242005-01-28 Paul Eggert <eggert@cs.ucla.edu>
8225
8226 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
8227 wants to redefine G_VIEW.
8228
2e72b98e
PE
82292005-01-27 Paul Eggert <eggert@cs.ucla.edu>
8230
8231 * src/vcg.c (get_view_str): Remove case for normal_view.
8232 Problem reported by twlevo@xs4all.nl.
8233
e0d634e5
PE
82342005-01-24 Paul Eggert <eggert@cs.ucla.edu>
8235
ccf830a4
PE
8236 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
8237 Problem reported by twlevo@xs4all.nl.
8238
e0d634e5
PE
8239 * doc/bison.texinfo: Change @dircategory from "GNU programming
8240 tools" to "Software development". Requested by Richard Stallman
8241 via Karl Berry.
8242
7bbc8cb0
PE
82432005-01-23 Paul Eggert <eggert@cs.ucla.edu>
8244
8245 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
8246 Problem reported by twlevo@xs4all.nl.
8247
08b770bc
PE
82482005-01-21 Paul Eggert <eggert@cs.ucla.edu>
8249
8250 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
8251 keyword; it's not needed with modern compilers, and it doesn't
8252 affect correctness with older compilers. Suggested by
8253 twlevo@xs4all.nl.
8254
95f22ad2
PE
82552005-01-17 Paul Eggert <eggert@cs.ucla.edu>
8256
8257 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
8258 gcc -Wswitch-default.
8259 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8260 * data/yacc.c (yyparse): Likewise.
8261
d229d15c
PE
82622005-01-12 Paul Eggert <eggert@cs.ucla.edu>
8263
8264 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
8265 already. Let config.h define any nonstandard values.
8266
ecadd90f
PE
82672005-01-10 Paul Eggert <eggert@cs.ucla.edu>
8268
8269 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
8270 for the benefit of slower hosts. Problem reported by
8271 Nelson H. F. Beebe.
8272
213744b5
PE
82732005-01-07 Paul Eggert <eggert@cs.ucla.edu>
8274
8275 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
8276 being defined and not used.
8277 * data/lalr1.cc (yyparse): Likewise.
8278 Use "if (false)" rather than "if (0)".
8279
249d3236
PE
82802005-01-05 Paul Eggert <eggert@cs.ucla.edu>
8281
8282 * TODO: Mention that we should allow NUL bytes in tokens.
8283
987cc1fb
PE
82842005-01-02 Paul Eggert <eggert@cs.ucla.edu>
8285
8286 * src/scan-skel.l (<<EOF>>): Don't close standard output.
8287 Problem reported by Hans Aberg.
8288
08fe02d9
PE
82892005-01-01 Paul Eggert <eggert@cs.ucla.edu>
8290
8291 * src/getargs.c (version): Happy new year; update overall
8292 program copyright date from 2004 to 2005.
8293
8294 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
8295 Problem reported by Hans Aberg.
8296 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
8297 (Output file names.): Add a test for the case when standard output
8298 is closed.
8299
010c0266
PE
83002004-12-26 Paul Eggert <eggert@cs.ucla.edu>
8301
8302 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
8303 to fix an oversight in the Bison 2.0 manual.
8304
da12206a
PE
83052004-12-25 Paul Eggert <eggert@cs.ucla.edu>
8306
8307 * NEWS: Version 2.0. Reformat the existing news items since
8308 1.875, so that related items are grouped together.
3a4734aa 8309 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
8310 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
8311
c935d934
PE
8312 * tests/torture.at (Exploding the Stack Size with Alloca): Set
8313 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
8314 otherwise, we're not testing alloca. Unfortunately there's no
8315 simple way to consult HAVE_ALLOCA here.
8316
da12206a
PE
8317 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
8318 for yymsg, too.
8319
8320 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
8321 hand. This avoids a warning about comparing int to size_t when
8322 GCC warnings are enabled.
8323
0a2c5137
PE
83242004-12-22 Paul Eggert <eggert@cs.ucla.edu>
8325
d7e14fc0
PE
8326 * NEWS: Bison-generated parsers no longer default to using the
8327 alloca function (when available) to extend the parser stack, due
8328 to widespread problems in unchecked stack-overflow detection.
8329 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
8330 responsibility to set it to a positive value. This lets the user
8331 specify a value that is not a preprocessor constant.
8332 * data/yacc.c (YYMAXDEPTH): Likewise.
8333 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
8334 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
8335 to be a compile-time constant. However, explain the constraints on it.
8336 Also, explain the constraints on YYINITDEPTH.
8337 (Table of Symbols): Explain that alloca is no longer the default.
8338 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
8339 to 1.
8340
0a2c5137
PE
8341 * doc/bison.texinfo (Location Default Action): Mention that n must
8342 be zero when k is zero. Suggested by Frank Heckenbach.
8343
e019c247
AD
83442004-12-22 Akim Demaille <akim@epita.fr>
8345
8346 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
8347 (parser::state_type, parser::semantic_type, parser::location_type):
8348 Private, not public.
8349 (parser::parse): Return ints, not bool.
8350 Returning a bool introduces a problem: 0 corresponds to false, and
8351 it seems weird to return false on success. Returning true changes
8352 the conventions for yyparse.
8353 Alternatively we could return void and send an exception.
8354 There is no clear consensus (yet?).
8355 (state_stack, semantic_stack, location_stack): Rename as...
8356 (state_stack_type, semantic_stack_type, location_stack_type): these.
8357 Private, not public.
8358 * tests/c++.at: New.
8359 * tests/testsuite.at, tests/Makefile.am: Adjust.
8360
72731bb7
AD
83612004-12-21 Akim Demaille <akim@epita.fr>
8362
8363 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
8364
9a0d8bec
AD
83652004-12-21 Akim Demaille <akim@epita.fr>
8366
8367 Don't impose std::string for filenames.
8368
8369 * data/lalr1.cc (b4_filename_type): New.
8370 (position::filename): Use it.
8371 (parser.hh): Move the inclusion of stack.hh and location.hh below
8372 the user code, so that needed headers for the filename type can be
8373 included first.
72731bb7
AD
8374 Forward declare them before the user code.
8375 * tests/Makefile.am (check-local, installcheck-local): Pass
8376 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 8377
99880de5
AD
83782004-12-20 Akim Demaille <akim@epita.fr>
8379
8380 Use more STL like names: my_class instead of MyClass.
8381
8382 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
8383 (SemanticStack, SemanticType, StateStack, StateType)
8384 (TokenNumberType, Stack, Slice, Traits, Parser::location)
8385 (Parser::value): Rename as...
8386 (location_stack, location_type, rhs_number_type, semantic_stack)
8387 (semantic_type, state_stack, state_type, token_number_type, stack)
8388 (slice, traits, parser::yylloc, parser::yylval): these.
8389
8390 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
8391
9bec482e
PE
83922004-12-19 Paul Eggert <eggert@cs.ucla.edu>
8393
8394 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
8395 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8396
f6fbd3da
PE
83972004-12-17 Paul Eggert <eggert@cs.ucla.edu>
8398
8399 Remove uses of 'short int' and 'unsigned short int'. This raises
8400 some arbitrary limits. It uses more memory but nowadays that's
8401 not much of an issue.
8402
8403 This change does not affect the generated parsers; that's a different
8404 task, as some users will want to conserve memory there.
8405
8406 Ideally we should use size_t to represent all object counts, and
8407 something like ptrdiff_t to represent signed differences of object
8408 counts; but that will require more code-cleanup than I have the
8409 time to do right now.
8410
8411 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
8412 Use size_t, not int or short int, to count objects.
8413 * src/closure.c (nritemset, closure): Likewise.
8414 * src/closure.h (nritemset, closure): Likewise.
8415 * src/nullable.c (nullable_compute): Likewise.
8416 * src/print.c (print_core): Likewise.
8417 * src/print_graph.c (print_core): Likewise.
8418 * src/state.c (state_compare, state_hash): Likewise.
8419 * src/state.h (struct state): Likewise.
8420 * src/tables.c (default_goto, goto_actions): Likewise.
8421
8422 * src/gram.h (rule_number, rule): Use int, not short int.
8423 * src/output.c (prepare_rules): Likewise.
8424 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
8425 errs, reductions): Likewise.
8426 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
8427 Likewise.
8428 * src/tables.c (vector_number, tally, action_number,
8429 ACTION_NUMBER_MINIMUM): Likewise.
8430 * src/output.c (muscle_insert_short_int_table): Remove.
8431
efeed023
AD
84322004-12-17 Akim Demaille <akim@epita.fr>
8433
8434 * data/lalr1.cc: Extensive Doxygenation.
8435 (error_): Rename as...
8436 (error): this, since it is visible to the user.
8437 Adjust callers.
8438 (Parser::message): Now an automatic variable from...
8439 (Parser::yyreport_syntax_error_): here.
8440 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
8441 Parser::error.
8442 * tests/input.at: Escape $.
8443
bc82c5a5
PE
84442004-12-16 Paul Eggert <eggert@cs.ucla.edu>
8445
8446 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
8447 Parenthesize rhs to avoid obscure problems with mistakes like
8448 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
8449 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
8450 b4_rhs_location): Likewise.
8451 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
8452 b4_rhs_location): Likewise.
8453
fd19f271
AD
84542004-12-16 Akim Demaille <akim@epita.fr>
8455
8456 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
8457 yacc.c: be sure to stay within yycheck_.
8458 * tests/actions.at: Re-enable C++ tests.
8459
10454ea4
AD
84602004-12-16 Akim Demaille <akim@epita.fr>
8461
8462 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
8463 real.
8464
c5b95ccf
AD
84652004-12-16 Akim Demaille <akim@epita.fr>
8466
8467 Use #define to handle the %name-prefix.
8468
8469 * data/glr.c, data/yacc.c: Comment changes.
8470 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
8471 so that one can refer to yylex in the parser file, and have it
8472 renamed, as is the case with other skeletons.
8473
617a8f12
AD
84742004-12-16 Akim Demaille <akim@epita.fr>
8475
8476 Move lalr1.cc internals into yy*.
8477
8478 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
8479 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
8480 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
8481 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
8482 (empty_, final_, terror_, errcode_, ntokens_)
8483 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
8484 (looka_, ilooka_, error_range_, nerrs_):
8485 Rename as...
8486 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
8487 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
8488 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
8489 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
8490 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
8491 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
8492 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
8493 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
8494 these.
8495
1e547e6e
PE
84962004-12-15 Paul Eggert <eggert@cs.ucla.edu>
8497
8498 Fix some problems reported by twlevo at xs4all.
8499 * src/symtab.c (symbol_new): Report an error if the input grammar
8500 contains too many symbols. This is better than calling abort() later.
8501 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
8502 (struct node, struct graph):
8503 Rename member expand to stretch. All uses changed.
8504 (struct graph): Remove member layoutalgorithm. All uses removed.
8505 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
8506 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
8507 All uses changed.
8508 (N_STRETCH): Rename from N_EXPAND. All uses changed.
8509
735d6bd4
AD
85102004-12-15 Akim Demaille <akim@epita.fr>
8511
8512 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
8513 Add more Doxygen comments.
8514 (symprint_, stack_print_, reduce_print_, destruct_, pop)
8515 (report_syntax_error_, translate_): Rename as...
8516 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
8517 (yypop_, yyreport_syntax_error_, yytranslate_): this.
8518
2e1f5829
AD
85192004-12-15 Akim Demaille <akim@epita.fr>
8520
8521 * data/lalr1.cc (lex_): Rename as...
8522 (yylex_): this.
8523 Move the trace here.
8524 Take the %name-prefix into account.
8525 Reported by Alexandre Duret-Lutz.
8526
a3cb6248
AD
85272004-12-15 Akim Demaille <akim@epita.fr>
8528
8529 Simplify the C++ parser constructor.
8530
8531 * data/lalr1.cc (debug_): Rename as...
8532 (yydebug_): so that the parser's internals are always in the yy*
8533 pseudo namespace.
8534 Adjust uses.
8535 (b4_parse_param_decl): Remove the leading comma as it is now only
8536 called as unique argument list.
8537 (Parser::Parser): Remove the constructor accepting a location and
8538 an initial debugging level.
8539 Remove from the other ctor the argument for the debugging level.
8540 (debug_level_type, debug_level, set_debug_level): New.
8541
8542 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
8543 constructor calls.
8544
07fed891
AD
85452004-12-15 Akim Demaille <akim@epita.fr>
8546
8547 Remove b4_root related material: failure experiment
a3cb6248 8548 (which goal was to allow to derive from a class).
07fed891
AD
8549
8550 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
8551 definitions and uses.
8552
e603eaa5
PE
85532004-12-14 Paul Eggert <eggert@cs.ucla.edu>
8554
8555 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
8556 not 2, since it's not portable to subtract 1 from the start of an
8557 array. The new item 0 is never set or used. All uses changed.
8558
8559 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
8560 the default definition of YYLLOC_DEFAULT. Problem reported
8561 by Frank Heckenbach.
8562
fafb007d
PE
85632004-12-12 Paul Eggert <eggert@cs.ucla.edu>
8564
8565 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
8566 the normal case and one for the error case. Just use the
8567 first one uniformly. Problem reported by Frank Heckenbach.
8568 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
8569 use exactly the same macro in both places.
8570 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
8571 so that the normal-case YYRHSLOC works for the error case too.
8572 All uses changed.
8573 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
8574 (YYLLOC_DEFAULT): Use the same macro as glr.c.
8575 * doc/bison.texinfo (Location Default Action): Don't claim that
8576 we have an array of locations. Use the same macro for both glr
8577 and lalr parsers. Mention YYRHSLOC. Mention what happens when
8578 the index is 0.
8579
48814dcd
PE
85802004-12-10 Paul Eggert <eggert@cs.ucla.edu>
8581
a4e1a53b
PE
8582 * HACKING: Update email addresses to send announcements to.
8583
48814dcd
PE
8584 * configure.ac (AC_INIT): Bump version to 1.875f.
8585
337116ba
PE
85862004-12-10 Paul Eggert <eggert@cs.ucla.edu>
8587
8588 * NEWS: Version 1.875e.
8589 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
8590
8591 * src/scan-skel.l: Include "complain.h", for "fatal".
8592
8593 * src/relation.h (relation_print, relation_digraph):
8594 Relation sizes are of type relation_node, not size_t (this is
8595 merely a doc fix, since the two types are equivalent).
8596 (relation_transpose): Relation sizes are of type relation_node,
8597 not int.
8598 * src/relation.c: Likewise.
8599 (top, infinity): Now of type relation_node, not int.
8600 (traverse, relation_transpose): Use relation_node, not int.
8601
8602 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
8603 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
8604 (yyparse): Remove unused local introduced in 2004-10-25 patch.
8605
8606 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 8607 specifying whether the test should be skipped. Use it tp
337116ba 8608 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 8609 fail on some hosts, and should be skipped.
337116ba 8610
da2a7671
PE
86112004-12-08 Paul Eggert <eggert@cs.ucla.edu>
8612
8613 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
8614 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
8615 unless otherwise specified below.
8616
8617 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
8618 to allocate kernel_base, kernel_items, kernel_size, since
8619 they needn't be initialized to 0.
8620 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
8621 * src/closure.c (new_closure): Likewise, for itemset.
8622 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
8623 * src/lalr.c (set_goto_map): Likewise, for temp_map.
8624 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
8625 (build_relations): Likewise for edge, states1, includes.
8626 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
8627 * src/reader.c (packgram): Likewise, for ritem, rules.
8628 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
8629 * src/relation.c (relation_digraph): Likewise for VERTICES.
8630 (relation_transpose): Likewise for new_R, end_R.
8631 * src/symtab.c (symbols_token_translations_init): Likewise for
8632 token_translations.
8633 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
8634 (token_actions): Likewise for yydefact, actrow, conflrow,
8635 conflict_list.
8636 (save_column): Likewise for froms[symno], tos[symno].
8637 (goto_actions): Likewise for state_count.
8638 (pack_table): Likewise for base, pos, check.
8639 (tables_generate): Likewise for width.
8640
8641 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
8642 for initial core. Just have a separate core, so we needn't worry
8643 about whether kernel_size and kernel_base are initialized.
8644
8645 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
8646 kernel_size, kernel_items): Remove unnecessary initialization.
8647 * src/conflicts.c (conflicts): Likewise.
8648 * src/derives.c (derives): Likewise.
8649 * src/muscle_tablc (muscle_insert): Likewise.
8650 * src/relation.c (relation_digraph): Likewise.
8651 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
8652 conflrow, conflict_table, conflict_list, table, check):
8653 Likewise.
8654
8655 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
8656 This is because all callers pass unsigned int.
8657 * src/closure.h (new_closure): Likewise.
8658
8659 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
8660 (build_relations): Initialize includes[i] in all cases.
8661 * src/reader.c (packgram): Always initialize rules[ruleno].prec
8662 and rules[ruleno].precsym. Initialize members in order.
8663 * src/relation.c (relation_transpose): Always initialize new_R[i]
8664 and end_R[i].
8665 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
8666
8667 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
8668 conflict_list[0] was always 0, but now it isn't initialized.
8669
8670 * src/table.c (table_grow): When conflict_table grew, the grown
8671 area wasn't cleared. Fix this.
8672
8673 * lib/.cvsignore: Add strdup.c, strdup.h.
8674 * m4/.cvsignore: Add strdup.m4.
8675
00baeeac
PE
86762004-12-07 Paul Eggert <eggert@cs.ucla.edu>
8677
8678 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
8679 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
8680 GOTO_NUMBER_MAXIMUM, since we occasionally compute
8681 ngotos + 1 without checking for overflow.
8682 (build_relations): Use END_NODE, not -1, to denote end of edges.
8683 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
8684 build_relations): Use goto_number, not int, for goto numbers.
8685 * src/tables.c (save_column, default_goto): Likewise.
8686
be3d9d42
AD
86872004-11-23 Akim Demaille <akim@epita.fr>
8688
8689 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
8690 of #defining from yystype.
8691 Don't typedef yystype, C++ does not need it.
8692 This lets it possible to forward declare it as union.
8693
78e526d5
PE
86942004-11-23 Paul Eggert <eggert@cs.ucla.edu>
8695
8696 * bootstrap (gnulib_modules): Add extensions.
8697 Problem reported by Jim Meyering.
8698
afbb696d
PE
86992004-11-22 Paul Eggert <eggert@cs.ucla.edu>
8700
8701 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
8702 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
8703 src/system.h, src/tables.c: XFREE -> free, to accommodate
8704 recent change to gnulib xalloc.h.
78e526d5 8705 Problem reported by Jim Meyering.
afbb696d 8706
c1f8f16a
AD
87072004-11-17 Akim Demaille <akim@epita.fr>
8708
8709 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
8710
db7e5eb5 87112004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
8712 Alexandre Duret-Lutz <adl@gnu.org>
8713
8714 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
8715 changes.
8716 (YYCDEBUG): Adjust.
8717 Use it instead of cdebug_.
8718 (Parser::debug_stream, Parser::set_debug_stream): New.
8719 (Parser::symprint_): Define cdebug_ for temporary backward
8720 compatibility.
8721 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
8722 debug_stream ().
8723
68e11668
AD
87242004-11-17 Akim Demaille <akim@epita.fr>
8725
8726 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
8727 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
8728 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
8729 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8730
97cbc73e
PE
87312004-10-27 Paul Eggert <eggert@cs.ucla.edu>
8732
8733 * data/glr.c (yyloc_default): Remove; not used.
8734 Problem reported by Frank Heckenbach.
8735
e342c3be
AD
87362004-10-25 Akim Demaille <akim@epita.fr>
8737
8738 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
8739 Introduce another definition to address simple location arrays.
8740 (yyGLRStack): New member: yyerror_range.
8741 (yyrecoverSyntaxError, yyparse): Update it.
8742 (yyrecoverSyntaxError): Use it when shifting the error token to
8743 have an accurate range, equivalent to the one computed by both
8744 yacc.c and lalr1.cc.
8745 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
8746 that column numbers start at column 0, as per GNU Coding
8747 Standards, the others tests, and the doc.
8748 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
8749 Adjust to the above change (first column is 0).
8750 And adjust the location of the "<error>", now covering the whole
8751 line.
8752
93602feb 87532004-10-22 Akim Demaille <akim@epita.fr>
04098407 8754 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
8755
8756 Remove some arbitrary limits on goto numbers and relations.
8757 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
8758 initial values, since they're never used.
8759 (set_goto_map): ngotos is now unsigned, so test for overflow
8760 by seeing whether it wraps around to zero.
8761 * src/lalr.h (goto_number): Now size_t, not short int.
8762 (GOTO_NUMBER_MAXIMUM): Remove.
8763 * src/relation.c (relation_print, traverse, relation_transpose):
8764 Check for END_NODE rather than looking at sign.
8765 * src/relation.h (END_NODE): New macro.
8766 (relation_node): Now size_t, not short int.
8767
dba08b04
PE
87682004-10-22 Paul Eggert <eggert@cs.ucla.edu>
8769
8770 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
8771 keyword, not an identifier. Problem reported by Baron Schwartz in
8772 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
8773
df09ef2e
AD
87742004-10-11 Akim Demaille <akim@epita.fr>
8775
8776 * src/symtab.c (symbol_check_alias_consistency): Also check
8777 type names, destructors, and printers.
8778 Reported by Alexandre Duret-Lutz.
8779 Recode the handling of associativity and precedence in terms
8780 of symbol_precedence_set.
8781 Accept no redeclaration at all, not even equal to the previous
8782 value.
8783 (redeclaration): New.
8784 Use it to factor redeclaration complaints.
8785 (symbol_make_alias): Don't set the type of the alias, let
8786 symbol_check_alias_consistency do it as for other features.
8787 * src/symtab.h (symbol): Add new member prec_location, and
8788 type_location.
8789 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
8790 * tests/input.at (Incompatible Aliases): New.
8791
146bc99d
PE
87922004-10-09 Paul Eggert <eggert@cs.ucla.edu>
8793
8794 .cvsignore fixes to accommodate gnulib changes,
8795 and the practice of naming build directories "_build".
8796 * .cvsignore: Add "_*". Sort.
8797 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
8798 * m4/.cvsignore: Add "*_gl.m4".
8799
e503aa60
AD
88002004-10-06 Akim Demaille <akim@epita.fr>
8801
8802 * src/parse-gram.y (add_param): Fix the truncation of trailing
8803 spaces.
8804
b4a20338
AD
88052004-10-05 Akim Demaille <akim@epita.fr>
8806
8807 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
8808 whether the reducion was empty or not. This leaves room to
8809 improve the use of YYLLOC_DEFAULT in such a case.
8810 lalr1.cc is still experimental, so changing this is acceptable.
8811 And finally, there are probably not many users who changed the
8812 handling of locations in GLR, so changing is admissible too.
8813
8814 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
8815 empty reduction, set @$ to an empty location ending the previously
8816 stacked symbol.
8817 Adjust uses to make sure the code is triggered on empty
8818 reductions.
8819 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
8820 expected output: empty reductions have empty locations.
8821
f85a5e6f
AD
88222004-09-29 Akim Demaille <akim@epita.fr>
8823
8824 * data/lalr1.cc: Move towards a more standard C++ coding style
8825 for templates: Class < T > -> Class<T>.
8826
b203fc2c
AD
88272004-09-29 Akim Demaille <akim@epita.fr>
8828
8829 * data/lalr1.cc: Reinstall the former ctor, for sake of
8830 compatibility, but warn it will be removed.
8831 Move towards a more standard C++ coding style (i.e., type *var ->
8832 type* var).
8833
5b7e1e73
PE
88342004-09-27 Paul Eggert <eggert@cs.ucla.edu>
8835
3fee967f
PE
8836 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
8837 since it's less likely to work if NULs are involved in the future.
5b7e1e73 8838
0dcca5c2
AD
88392004-09-27 Akim Demaille <akim@epita.fr>
8840
8841 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
8842
6dde1c82
AD
88432004-09-27 Akim Demaille <akim@epita.fr>
8844
8845 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 8846 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
8847 and argument names.
8848 (b4_cc_constructor_call): Likewise.
8849
b233d555
AD
88502004-09-24 Akim Demaille <akim@epita.fr>
8851
8852 * src/parse-gram.y (add_param): Strip the leading and trailing
8853 blanks from a formal argument declaration.
8854 (YY_LOCATION_PRINT): New.
8855
619404e3
AD
88562004-09-24 Akim Demaille <akim@epita.fr>
8857
8858 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
8859 after the location.
8860
dd8d9022
AD
88612004-09-24 Akim Demaille <akim@epita.fr>
8862
8863 * doc/bison.texinfo (Table of Symbols): Sort.
8864
0092f063
AD
88652004-09-21 Akim Demaille <akim@epita.fr>
8866
8867 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
8868 the useless parentheses.
8869 Suggested by Paul Eggert.
8870
451364ed
AD
88712004-09-20 Akim Demaille <akim@epita.fr>
8872
8873 Let the initial-action act on the look-ahead, and use it for the
8874 "initial push" (corresponding to an hypothetical beginning-of-file).
8875 And let lalr1.cc honor %initial-action.
8876
8877 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
8878 example.
8879 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
8880 (Parser::Parser): Remove the ctor that used to initialize it.
8881 (Parser::parse): Like in the other skeletons, issue the "starting
8882 parse" message before any action.
8883 Honor %initial-action.
8884 Initialize the stacks with the lookahead.
8885 * data/yacc.c: Let $$ and @$ in %initial-action designate the
8886 look-ahead.
8887 Push them in the stacks.
8888 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
8889
18d192f0
AD
88902004-09-20 Akim Demaille <akim@epita.fr>
8891
8892 * doc/bison.texinfo (Initial Action Decl): New.
8893
b8458aa5
AD
88942004-09-20 Akim Demaille <akim@epita.fr>
8895
8896 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
8897 clearer criterion to define it.
8898 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
8899 When reducing on an empty RHS, use the latest stacked location as
8900 location.
8901 yylloc is not always available.
8902 * data/glr.c: Likewise.
8903 Also, honor initial-actions.
8904
3fc16193
AD
89052004-09-20 Akim Demaille <akim@epita.fr>
8906
8907 * data/yacc.c (YY_LOCATION_PRINT): New.
8908 Define when we know YYLTYPE's structure, i.e., when the default
8909 YYLLOC_DEFAULT is used.
8910 * data/c.m4 (b4_yysymprint_generate): Use it.
8911 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
8912 value of the result.
8913 (error_start_): Replace with...
8914 (error_range_): this location array.
8915 This allows to replace code relying on the implementation of
8916 locations by portable code.
8917 * data/yacc.c (yylerrsp): Replace with...
8918 (yyerror_range): this.
8919 Every time a token is popped, update yyerror_range[0], to have an
8920 accurate location for the error token.
8921 * data/glr.c (YY_LOCATION_PRINT): New.
8922 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
8923 deference a pointer.
8924 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
8925 report the location in %printers.
8926
8927 * src/scan-skel.l: Instead of abort, report error messages to ease
8928 understanding skeleton scanning failures.
8929
ecfe33e7
AD
89302004-09-16 Akim Demaille <akim@epita.fr>
8931
8932 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
8933 (iterator, const_iterator): these, to be more in the C++ spirit.
8934 Also, return reverse iterators so that when displaying the stack
8935 we display its bottom first.
8936 (Parser::stack_print_, Parser::reduce_print_): Match the messages
8937 from yacc.c.
8938 We should probably use vector here though.
8939
1576d44d
AD
89402004-09-16 Akim Demaille <akim@epita.fr>
8941
8942 Have more complete shift traces.
8943
8944 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
8945 to report Shifts instead of ad hoc YYDPRINTF invocations,
8946 including for the error token.
8947 * data/lalr1.cc (symprint_): Output the location.
8948 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
8949 output the location within the %printer.
8950 Activate GLR tests, at least to make sure they compile properly.
8951 They still don't pass though.
8952 * tests/calc.at: Adjust expect verbose output, since now "Entering
8953 state..." is on a different line than the "Shifting" message.
8954
9c66f418
AD
89552004-09-08 Akim Demaille <akim@epita.fr>
8956
8957 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
8958 Bison directive from the Bison file to the invocation of this
8959 macro, so that these directives are passed to
8960 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
8961 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
8962 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
8963 the extra Bison directives instead of the whole series.
8964 Change the grammar so that there are recoverable errors, and
8965 unrecoverable errors. Now we can have the parser give up before
8966 consuming the whole input. As a result we now can observe that
8967 the lookahead is freed when needed.
8968 Change the parser source to parse argv[1] instead of a hard coded
8969 string.
8970 Simplify yylex, and give a value and location to EOF.
8971 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
8972 passed directives already coded in the file.
8973 Add some tests to check the location of "error".
8974 For some tests, the C++ parser is correct, and not yacc.c.
8975 For other tests, they provide different, but unsatisfying, values,
8976 so keep the C++ value so that at least one parser is "correct"
8977 according to the test suite.
8978 (Actions after errors): Remove, this is subsumed by the
8979 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
8980
52d5733f
AD
89812004-09-06 Akim Demaille <akim@epita.fr>
8982
8983 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 8984 (Parser::pop): New.
52d5733f
AD
8985 Use it.
8986
a0e68930
AD
89872004-09-06 Akim Demaille <akim@epita.fr>
8988
8989 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
8990 argument, an informative message.
8991 Call YY_SYMBOL_PRINT.
8992 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
8993 * data/lalr1.cc (destruct_): Likewise.
8994 In addition, no longer depend on b4_yysymprint_generate and
8995 b4_yydestruct_generate to generate these functions, do it "by
8996 hand".
8997
e757bb10
AD
89982004-09-03 Akim Demaille <akim@epita.fr>
8999
9000 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
9001 invoked, yydestruct the lookahead.
9002 * tests/calc.at (Calculator $1): Update the expected lengths of
9003 traces: there is an added line for the discarded lookahead.
9004 * doc/bison.texinfo (Destructor Decl): Some rewording.
9005 Define "discarded" symbols.
9006
0fe1f06d
AD
90072004-09-02 Akim Demaille <akim@epita.fr>
9008
9009 * data/lalr1.cc (translate_, destruct_): No reason to be static.
9010
284acc8b
AD
90112004-09-02 Akim Demaille <akim@epita.fr>
9012
9013 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
9014 (YYDSYMPRINTF): Rename as...
9015 (YY_SYMBOL_PRINT): this.
9016 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
9017 two.
9018 Use it instead of direct symprint_ calls.
9019 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
9020 one.
9021
a5eb1ed2
AD
90222004-09-02 Akim Demaille <akim@epita.fr>
9023
b7c72fe1
AD
9024 * data/lalr1.cc (b4_yysymprint_generate): New.
9025 (symprint_): New member function, defined when YYDEBUG.
9026 Use it consistently instead of token/nterm debugging output by
9027 hand.
a5eb1ed2
AD
9028 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
9029 %printer calls to use cdebug_ when using lalr1.cc.
9030
417141dd
AD
90312004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
9032
9033 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
9034 with #ifdef YYDEBUG.
9035
2fa09258
AD
90362004-08-26 Akim Demaille <akim@epita.fr>
9037
9038 * doc/bison.texinfo (Implementing Loops): Rename as...
9039 (Implementing Gotos/Loops): this.
9040
9378b508
PE
90412004-08-13 Paul Eggert <eggert@cs.ucla.edu>
9042
9043 Adjust to latest gnulib.
9044 * bootstrap (gnulib_modules): Add xalloc-die.
9045 Set LC_ALL=C so that file names sort consistently.
9046 Prefer the gnulib copies of gettext.m4, glibc21.m4,
9047 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
9048 uintmax_t.m4, ulonglong.m4.
9049 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
9050 po.m4 since we are now using _gl.m4 instead.
9051
87a8ad5c
PE
90522004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
9053
9054 * src/scan-action.l: Remove. Scanning of semantic actions is
9055 handled in scan-gram.l.
9056
dca81a78
PE
90572004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
9058
9059 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
9060
9061 * src/location.h (struct): The file member is a uniqstr.
9062 (equal_boundaries): Use UNIQSTR_EQ for comparison.
9063
c9cbf7c5
PE
90642004-07-22 Paul Eggert <eggert@cs.ucla.edu>
9065
9066 Fix bug with non-%union parsers that have printers or destructors,
9067 which led to a Bison core dump. Reported by Peter Fales in
9068 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 9069
c9cbf7c5
PE
9070 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
9071 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
9072 not to our own type.
9073 * src/output.c (symbol_destructors_output, symbol_printers_output):
9074 Don't assume %union.
9075 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
9076 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
9077 UNION-FLAG. All callers changed.
9078 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
9079 Use type char, not unsigned int, when declaring an array of char;
9080 this lets us remove a cast.
9081 (Printers and Destructors): Add non-%union test cases.
9082
fa7e68c3
PE
90832004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9084
9085 * doc/bison.texinfo: Minor editorial changes, mostly to the new
9086 GLR writeups. E.g., avoid frenchspacing and the future tense,
9087 change "lookahead" to "look-ahead", and change "wrt" to "with
9088 respect to".
2fa09258 9089
fa7e68c3
PE
90902004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9091
9092 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
9093 New sections, split off from the GLR Parsers section. Put the new
9094 Simple GLR Parser near the start of the GLR section, for clarity.
9095 Rewrite connective text.
9096
99a9344e
PE
90972004-06-21 Frank Heckenbach <frank@g-n-u.de>
9098
9099 * doc/bison.texinfo (Simple GLR Parsers): New section.
9100
8dd162d3
PE
91012004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9102
9103 * NEWS, TODO, doc/bison.texinfo:
9104 Use "look-ahead" instead of "lookahead", to be consistent.
9105 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
9106 while we're fixing "look-ahead".
9107 * src/conflicts.c (shift_set): Renamed from shiftset.
9108 (look_ahead_set): Renamed from lookaheadset.
9109 * src/print.c: Likewise.
9110 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
9111 name for "lookahead".
9112 (report_types, usage): Likewise.
9113 * src/getargs.h (report_look_ahead_tokens): Renamed from
9114 report_lookaheads.
9115 * src/lalr.c (compute_look_ahead_tokens): Renamed from
9116 compute_lookaheads.
9117 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
9118 (look_ahead_tokens_print): Renamed from lookaheads_print.
9119 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
9120 state_rule_lookaheads_print.
9121 * src/state.h: Likewise.
9122 (reductions.look_ahead_tokens): Renamed from lookaheads.
9123 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
9124 AT_DATA_LOOKAHEADS_GRAMMAR.
9125
57a90331
PE
91262004-06-03 Paul Eggert <eggert@cs.ucla.edu>
9127
9128 * README: Update location of patched M4 distribution.
9129
8ed3234a
PE
91302004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
9131
9132 Don't assume the C++ compiler takes the same arguments as the C compiler
9133 (trivial change).
9134 * configure.ac (O0CXXFLAGS): New var.
9135 * tests/atlocal.in (CXXFLAGS): Use it.
9136
07971983
PE
91372004-05-29 Paul Eggert <eggert@cs.ucla.edu>
9138
9139 Fix some "make check" problems with C++ reported by
9140 Albert Chin-A-Young for Tru64 C++ in this thread:
9141 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
9142
9143 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
9144 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9145 Output to a .cc file for C++, not to a .c file.
9146 * tests/calc.at (AT_CHECK_CALC): Likewise.
9147 * tests/regression.at (AT_CHECK_DANCER): Likewise.
9148 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
9149
29058652
PE
91502004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
9151
9152 * tests/calc.at, tests/actions.at: Workaround for SGI
9153 C++ compiler. (trivial change)
9154
62cb8a99
PE
91552004-05-27 Paul Eggert <eggert@cs.ucla.edu>
9156
fd418816
PE
9157 Spent a few hours checking out which prerequisite versions the
9158 current sources actually require. I went all the way back to
9159 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
9160 a seemingly endless set of combinations of versions more recent
9161 than that. The bottom line is that the current sources require
9162 fairly recent versions of the build tools, and it'll be some work
9163 to change this.
9164 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
9165 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
9166 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
9167 Add comments explaining why those particular versions are
9168 currently needed.
2fa09258 9169
62cb8a99
PE
9170 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
9171 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 9172 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
9173
9174 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
9175 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
9176
caa52c10
PE
91772004-05-26 Paul Eggert <eggert@cs.ucla.edu>
9178
9179 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
9180 0.11.5. Suggested by Bruno Haible.
9181 * bootstrap: Remove gettext version checking.
9182
9183 * doc/bison.texinfo (Decl Summary): Also mention that %union
9184 can depend on prerequisite types. Problem reported by Tim
9185 Van Holder.
9186
4bfd5e4e
PE
91872004-05-25 Paul Eggert <eggert@cs.ucla.edu>
9188
2cef3017
PE
9189 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
9190 * README-alpha: Don't tell people not to package this.
9191
b9c85d5c
PE
9192 * bootstrap: Don't assume $(...) works; use `...` instead.
9193 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
9194 gettext better.
9195
4bfd5e4e
PE
9196 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
9197 put into the -d output file, and mention what to do if YYSTYPE is
9198 defined as a macro.
9199
6a36ff94
PE
92002004-05-24 Paul Eggert <eggert@cs.ucla.edu>
9201
6712933e
PE
9202 Undo change made earlier today: it caused autopoint to not bring
9203 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
9204 autopoint's.
9205
9206 * bootstrap: Check that gettext version matches what's in
9207 configure.ac. Warn users to ignore robots.txt ERROR 404.
9208 * bootstrap: Undo today's earlier change (logged below).
9209 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 9210
6a36ff94
PE
9211 The gettext version checking is causing more trouble than it's
9212 curing; remove it. Problem reported by Paul Hilfinger.
9213
9214 * bootstrap: Issue a warning that one can expect a message
9215 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
9216 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
9217
209ea708
PE
92182004-05-23 Paul Eggert <eggert@cs.ucla.edu>
9219
9220 Ensure that the C++ compiler used for testing actually works on a
9221 simple test program; if not, skip the C++-related tests. Problem
9222 reported by Vin Shelton in:
161a71f3 9223 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
9224
9225 * m4/cxx.m4: New file.
9226 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
9227 * tests/atlocal.in (BISON_CXX_WORKS): Add.
9228 * tests/local.at (AT_COMPILE_CXX): Use it.
9229
41ca2549
PE
92302004-05-21 Paul Eggert <eggert@cs.ucla.edu>
9231
383e69dc
PE
9232 * data/glr.c (yylloc): Output this macro even if locations are not
9233 being generated, as the GLR parser needs it even in that case.
9234 Problem reported by Troy A. Johnson
9235 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
9236
41ca2549
PE
9237 * configure.ac (AC_INIT): Update to 1.875e.
9238
e476c87d
PE
92392004-05-21 Paul Eggert <eggert@cs.ucla.edu>
9240
9241 * NEWS: Version 1.875d.
9242 * configure.ac (AC_INIT): Likewise.
9243 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
9244
9245 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
9246 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
9247 lalr1.cc runs afoul of the first, and the last two are no longer
9248 supported by GCC 3.4.0.
9249 * README: Mention GNU m4 1.4 or later; mention m4 patches.
9250 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
9251
233a88ad
PE
92522004-05-06 Paul Eggert <eggert@cs.ucla.edu>
9253
9254 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
9255 unsigned int, for compatibility with latest gnulib hash module.
9256 * src/state.c (state_hash, state_hasher): Likewise.
9257 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
9258 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 9259
12ffdd28
PE
92602004-05-03 Paul Eggert <eggert@cs.ucla.edu>
9261
9262 * NEWS: Unescaped newlines are no longer allowed in char & strings.
9263
9264 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
9265 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
9266 character and string literals.
9267 (unexpected_end): New function.
9268 (unexpected_eof): Use it.
9269 (unexpected_newline): New function.
9270 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
9271 actions.
e476c87d 9272
12ffdd28
PE
9273 * NEWS: Document %expect-rr.
9274
9275 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
9276 Fix typo by replacing $1 with $option.
9277 Remove more 'intl'-related files.
9668e2be 9278 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
9279
9280 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
9281 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
9282 strtoul.c.
9283 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
9284 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
9285 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
9286 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
9287 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
9288 * src/.cvsignore: Add *.output.
9289
9290 * src/parse-gram.y: Put copyright notice inside %{ %} so it
9291 gets copied to the output file.
e476c87d 9292
1f65350a
PE
92932004-04-28 Paul Eggert <eggert@twinsun.com>
9294
9295 Get files from the gnulib and po repositories, instead of relying
9296 on them being in our CVS. Upgrade to latest versions of gnulib
9297 and Automake.
9298
9299 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
9300 * bootstrap: Bootstrap from gnulib and po repositories.
9301 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
9302 * README-cvs: Document these changes. Remove version numbers from
9303 mentions of build tools, since they change so often. Mention Flex.
9304
9305 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
9306 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
9307 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
9308 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 9309 does this for us.
12ffdd28
PE
9310 (AC_ISC_POSIX): Remove; we no longer support this
9311 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
9312 (AC_HEADER_STDC): Remove: we now assume C89 or better.
9313 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
9314 Do not check for C89 headers, except for locale.h which is used
9315 by the Yacc library and must port to K&R hosts.
9316 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
9317 Do not check for C89 functions, except for setlocale which is
9318 used by the Yacc library.
9319 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
9320 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
9321 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
9322 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
9323 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
9324 AM_GNU_GETTEXT): Remove; now done by:
9325 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
9326 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
9327 for us.
9328
9329 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
9330 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
9331 Define to empty, as gnulib.mk will do the rest for us.
9332 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
9333 for us.
9334 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
9335 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
9336
9337 * src/files.c: Include gnulib's xstrndup.h.
9338
9339 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
9340 (REALLOC): Use xnrealloc, for likewise.
9341 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
9342 (strnlen, memrchr): Remove decls; functions no longer used.
9343 Include <stpcpy.h>.
9344
9345 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
9346 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9347 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
9348 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
9349 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
9350 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
9351 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
9352 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
9353 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
9354 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
9355 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
9356 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9357 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
9358 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
9359 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
9360 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
9361 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
9362 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
9363 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
9364 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
9365 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
9366 Remove, as these files are now generated automatically
9367 by bootstrap or automake.
9368
9369 * po/ChangeLog: Remove: all but one entry was a duplicate
9370 of this file, and I moved that 2000-11-02 entry here.
9371
9372 * config/.cvsignore: Add Makefile, depcomp, install-sh.
9373 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
9374 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
9375 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
9376 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
9377 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
9378 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
9379 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
9380 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
9381 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
9382 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
9383 xstrndup.h.
9384 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
9385 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
9386 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
9387 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
9388 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
9389 * src/.cvsignore: Remove *_.c.
9390
9391
9392 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
9393 support it. (The latest stable gzip doesn't.)
9394
93952004-04-27 Paul Eggert <eggert@twinsun.com>
9396
9397 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
9398 case, as stos_ is now used by destructors due to the 2004-02-09
9399 change.
9400
9401 Remove more K&R C support.
9402 * lib/libiberty.y (PARAMS): Remove. All uses removed.
9403 * lib/subpipe.c (errno): Remove decl.
9404 Include <stdlib.h> unconditionally.
9405 (EXIT_FAILURE): Remove macro.
9406 * src/complain.c (vfprintf, strerror): Remove.
9407 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
9408 unconditionally.
9409 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
9410 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
9411 (strchr, strspn, memchr): Remove decls.
9412 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
9413 unconditionally. Do not declare perror.
9414 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
9415 unconditionally.
9416
9417 * src/complain.c (_): Remove useless defn, as system.h defines this.
9418
9419 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
9420 with latest obstack.h.
9421 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
9422 to procedure types, as obstack.h now does that for us.
9423 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
9424
9425 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
9426 so that this include file can stand alone.
9427 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
9428 does this now. Include subpipe.h first after config.h, to
9429 test whether it can stand alone.
9430
9431 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
9432 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
9433 unused declaration.
9434
9435 * tests/synclines.at (%union synch line): Put a dummy member in
9436 the union, because empty unions aren't allowed in C. Caught
9437 by GCC 3.4.0.
9438
4f16766c
PE
94392004-04-13 Jim Meyering <jim@meyering.net>
9440
9441 * src/conflicts.c (conflicts_print): Correct format string typo:
9442 use `%%' to produce literal `%'. (trivial change)
9443
779e7ceb
PE
94442004-03-30 Paul Eggert <eggert@twinsun.com>
9445
9446 * src/getargs.c (version): Update copyright year to 2004.
9447
9448 * data/c.m4 (b4_int_type): Use 'short int' rather than
9449 'short', and similarly for 'long', 'unsigned', etc.
9450 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
9451 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
9452 yy_yypstack, yydumpstack): Likewise.
9453 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
9454 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
9455 Likewise.
9456 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
9457 yy_stack_print, yyparse): Likewise.
9458 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
9459 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
9460 * lib/bitset.c (bitset_print): Likewise.
9461 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
9462 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9463 * lib/bitsetv.c (bitsetv_dump): Likewise.
9464 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
9465 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
9466 Likewise.
9467 * src/LR0.c (allocate_itemsets): Likewise.
9468 * src/gram.h (rule_number, rule): Likewise.
9469 * src/lalr.h (goto_number): Likewise.
9470 * src/nullable.c (nullable_compute): Likewise.
9471 * src/output.c (prepare_rules): Likewise.
9472 * src/relation.c (relation_print, relation_digraph): Likewise.
9473 * src/relation.h (relation_node): Likewise.
9474 * src/state.h (state_number, transitions, errs, reductions,
9475 struct state): Likewise.
9476 * src/symtab.h (symbol_number, struct symbol): Likewise.
9477 * src/tables.c (vector_number, tally, action_number,
9478 default_goto, goto_actions): Likewise.
9479 * tests/existing.at (GNU Cim Grammar): Likewise.
9480 * tests/regression.at (Web2c Actions): Likewise.
9481
9482 * src/output.c (muscle_insert_short_int_table): Renamed from
9483 muscle_insert_short_table. All uses changed.
9484
d6328241
PH
94852004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9486
9487 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
9488 (declaration): Replace expected_conflicts with expected_sr_conflicts.
9489 Add %expect-rr rule.
4f16766c 9490
d6328241
PH
9491 * src/scan-gram.l: Recognize %expect-rr.
9492
4f16766c 9493 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 9494 expected_conflicts.
4f16766c 9495 (expected_rr_conflicts): Declare.
d6328241
PH
9496
9497 * src/conflicts.c (expected_sr_conflicts): Rename from
9498 expected_conflicts.
9499 (expected_rr_conflicts): Define.
9500 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
9501 for GLR parsers.
9502 Use expected_sr_conflicts in place of expected_conflicts.
9503 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 9504
d6328241 9505 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 9506
1452af69
PE
95072004-03-08 Paul Eggert <eggert@gnu.org>
9508
9509 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 9510 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
9511
9512 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
9513 in lalr1.cc.
9514 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
9515 * src/scan-gram.l (scan_integer): New function.
9516 ({int}): Use it.
9517 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
9518 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
9519 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
9520 Say "long int", not "long", for uniformity with GNU style.
9521
006d217d
PE
95222004-02-25 Paul Eggert <eggert@twinsun.com>
9523
9524 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
9525 compilers. This fixes a problem with Intel's C++ compiler being
9526 chatty, reported by Guido Trentalancia in
161a71f3 9527 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 9528
c2729758
ADL
95292004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
9530
9531 Support %destructor and merge error locations in lalr1.cc.
9532
9533 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
9534 (Parser::stos_): Define unconditionally.
9535 (Parser::destruct_): New method. Generate its body with
9536 b4_yydestruct_generate.
9537 (Parser::error_start_): New attribute.
9538 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
9539 token which are discarded.
9540 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
9541 error_start_ when erroneous token are discarded.
9542 (Parser::parse) <yyerrlab1>: Compute the location of the error
9543 token so that it covers all the discarded tokens.
9544 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
9545 it can be called with `%skeleton "lalr1.cc"', and do that.
9546
dd0e0635
PE
95472004-02-02 Paul Eggert <eggert@twinsun.com>
9548
9549 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
9550 $(top_srcdir)/lib and ../lib. This fixes a bug reported
9551 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
9552 There's no need to mention top_builddir since Automake does that
9553 for us.
9554 (INCLUDES): Remove, as Automake says it's obsolescent.
9555 Contents migrated into AM_CPPFLAGS as described above.
9556 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
9557
95582004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9559
9560 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
9561 (yyreportSyntaxError): Handle case where lookahead token is
9562 YYEMPTY.
9563
be16239b
PH
95642004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9565
9566 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
9567 resulting parsers are compilable with C++.
9568
5fa90832
PE
95692003-12-23 Paul Eggert <eggert@twinsun.com>
9570
9571 * config/depcomp, config/install-sh: Sync with Automake 1.8.
9572 * src/output.c (output_skeleton): Rename local var.
9573 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
9574 Bison tokens, as this runs afoul of the 2003-10-07 change that
9575 disallowed NUL bytes in character constants or string literals.
9576
9577 * tests/local.at: Require Autoconf 2.59's Autotest.
9578 * tests/testsuite.at: Don't include local.at, since we now assume
9579 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
9580 including it.
9581 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
9582 multiple inclusion warnings.
dd0e0635 9583
b165c324
AD
95842003-12-02 Akim Demaille <akim@epita.fr>
9585
9586 * doc/bison.texinfo (How Can I Reset the Parser): More about start
9587 conditions.
9588 From Bruno Haible.
9589
26e06a21
ADL
95902003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
9591
9592 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
9593
92ac3705
PE
95942003-10-07 Paul Eggert <eggert@twinsun.com>
9595
6a5ecb38
PE
9596 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
9597 if testsuite doesn't exist.
9598
92ac3705
PE
9599 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
9600 literals, unfortunately.
9601 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
9602 Complain about NUL bytes in character constants or string literals.
9603
91d2c560
PE
96042003-10-05 Paul Eggert <eggert@twinsun.com>
9605
9606 * NEWS: Don't document %no-default-prec, as it's still
9607 too experimental.
9608 * doc/bison.texinfo: Document %no-default-prec only if
9609 the defaultprec flag is set. Normally it's not.
9610
0cc3da3a
PE
96112003-10-04 Paul Eggert <eggert@twinsun.com>
9612
9613 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
9614 non-modifiable lvalue, instead of a modifiable one.
9615 * doc/bison.texinfo (Actions): Document that $$ can
9616 be assigned to. Do not claim that $$ and $N are
9617 array element references: user code should not rely on this.
9618
22fccf95
PE
96192003-10-01 Paul Eggert <eggert@twinsun.com>
9620
9621 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
9622 (grammar_declaration): Use it.
9623 * src/scan-gram.l: New token %no-default-prec.
9624 * tests/conflicts.at: Revamp tests to use %no-default-prec.
9625 * NEWS, doc/bison.texinfo: Document the above.
9626
fc8f2965
AD
96272003-10-01 Akim Demaille <akim@epita.fr>
9628
9629 VCG no longer supports long_straight_phase.
9630
9631 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
9632 * src/print_graph.c (print_graph): Adjust.
9633
39a06c25
PE
96342003-09-30 Frank Heckenbach <frank@g-n-u.de>
9635 and Paul Eggert <eggert@twinsun.com>
9636
9637 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
9638 Table of Symbols): Document %default-prec.
9639 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
9640 (grammar_declaration): Set default_prec on %default-prec.
9641 * src/scan-gram.l (%default-prec): New token.
9642 * src/reader.h (default_prec): New flag.
9643 * src/reader.c: Likewise.
9644 (packgram): Handle it.
9645 * tests/conflicts.at (%default-prec without %prec,
9646 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 9647
39a06c25
PE
96482003-09-30 Paul Eggert <eggert@twinsun.com>
9649
9650 * tests/testsuite.at: Include local.at, not input.at, fixing
9651 a typo in the 2003-08-25 patch.
9652
62b6aef9
AD
96532003-08-27 Akim Demaille <akim@epita.fr>
9654
9655 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
9656 GCC warnings.
9657
89e1cc61
AD
96582003-08-26 Akim Demaille <akim@epita.fr>
9659
9660 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
9661 "<\#" to avoid magic from Gnus when posting parts of this script.
9662
a08460b0
AD
96632003-08-26 Akim Demaille <akim@epita.fr>
9664
9665 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
9666 (Parser::parse): here.
9667 Adjust: nerrs and errstatus is now replaced by...
9668 (Parser::nerrs_, Parser::errstatus_): New.
9669
603f1cfd
AD
96702003-08-25 Akim Demaille <akim@epita.fr>
9671
9672 * config/announce-gen, Makefile.cfg: New.
9673 * Makefile.am: Adjust.
9674 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
9675 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
9676
cd3684cf
AD
96772003-08-25 Akim Demaille <akim@epita.fr>
9678
9679 When reducing initial empty rules, Bison parser read an initial
9680 location that is not defined. This results in garbage, and that
9681 affects Bison's own parser. Therefore we need (i) to extend Bison
9682 to support a means to initialize this location, and (ii) to use
9683 this CVS Bison to fix CVS Bison's parser.
9684
9685 * src/reader.h, reader.c (epilogue_augment): Remove, replace
9686 with...
9687 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
9688 * src/parse-gram.y: Adjust.
9689 (%initial-action): New.
9690 (%error-verbose): Since we require CVS Bison, there is no reason
9691 not to use it.
9692 * src/scan-gram.l: Adjust.
9693 * src/Makefile.am (YACC): New, to make sure we use our own parser.
9694 * data/yacc.c (yyparse): Use b4_initial_action.
9695
4e03e201
AD
96962003-08-25 Akim Demaille <akim@epita.fr>
9697
9698 * doc/bison.texinfo: Don't promote stdout for error messages.
9699
8c182d05
AD
97002003-08-25 Akim Demaille <akim@epita.fr>
9701
9702 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
9703 From Alexandre Duret-Lutz.
9704
6a60c4cf
PE
97052003-08-25 Akim Demaille <akim@epita.fr>
9706
9707 Version 1.875c.
9708
25f66e1a
AD
97092003-08-25 Akim Demaille <akim@epita.fr>
9710
9711 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
9712 Use them.
9713
5348bfbe
AD
97142003-08-25 Akim Demaille <akim@epita.fr>
9715
9716 * data/lalr1.cc (Parser::reduce_print_): New.
9717 Use it.
9718
47301314
AD
97192003-08-25 Akim Demaille <akim@epita.fr>
9720
9721 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
9722 error recovery loops. This patch is based on
161a71f3 9723 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
9724 Also, augment the similarity between lalr1.cc and yacc.c.
9725 Note: the locations of error recovery rules are not correct yet.
9726
9727 * data/lalr1.cc: Comment changes to augment the similarity between
9728 lalr1.cc and yacc.c.
9729 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
9730 (yyerrlab1): Remove, but where it used to be (now the bottom part of
9731 yyerrlab), when hitting EOF, pop the whole stack here instead of
9732 merely falling thru the default error handling mechanism.
9733 (yyerrorlab): New label, with the old contents of YYERROR,
9734 plus the following change: pop the stack of rhs corresponding
9735 to the production that invoked YYERROR. That is how Yacc
9736 behaves (required by POSIX).
9737 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
9738 fail.
9739
1f7a61ff
AD
97402003-08-25 Akim Demaille <akim@epita.fr>
9741
9742 Tune local.at so that people can "autom4te -l autotest calc.at -o
9743 calc" for instance, to extract a sub test suite.
9744
9745 * tests/testsuite.at: Move the initialization, Autotest version
9746 requirement, and AT_TESTED invocation into...
9747 * tests/local.at: here.
9748 * tests/testsuite.at: Include it for compatibility with Autoconf
9749 2.57.
9750 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
9751 be ignore.
9752
327b5b56
PE
97532003-08-04 Paul Eggert <eggert@twinsun.com>
9754
9755 Rework code slightly to avoid gcc -Wtraditional warnings.
9756 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
9757 The returned value is now stored in *YY0. All callers changed.
9758 * src/output.c (merge_output): Adjust to the above change.
9759
0051e3ed
PE
97602003-07-26 Paul Eggert <eggert@twinsun.com>
9761
9762 * data/glr.c (YYASSERT): New macro.
9763 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
9764 yyresolveStates, yyprocessOneStack):
9765 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
9766 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 9767
137437c6
PE
97682003-07-25 Paul Eggert <eggert@twinsun.com>
9769
5b620e06
PE
9770 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
9771 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 9772 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
9773 by Frank Heckenbach, though I have omitted the structure-initialization
9774 part of his glr-knr.diff patch since I recall that the Portable
9775 C Compiler didn't require that change.
9776
137437c6
PE
9777 Let the user specify how to allocate and free memory.
9778 Derived from a suggestion by Frank Heckenbach in
161a71f3 9779 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
9780 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
9781 All uses of free, malloc, realloc changed to use these macros,
9782 and unnecessary casts removed.
9783 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
9784
ddb85ca5
PE
97852003-07-06 Matthias Mann <MatthiasMann@gmx.de>
9786
9787 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
9788 use s.empty() rather than s == "" to test for empty string; see
161a71f3 9789 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
9790 (trivial change)
9791
39910e09
AD
97922003-06-25 Akim Demaille <akim@epita.fr>
9793
9794 * config/depcomp, config/install-sh: Update from masters.
9795
0ae99356
PE
97962003-06-20 Paul Eggert <eggert@twinsun.com>
9797
9798 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
9799 and return properly parenthesized result.
9800 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
9801 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9802 Remove unnecessary parentheses from uses.
9803 * doc/bison.texinfo (Location Default Action): Describe the
9804 conventions for parentheses.
9805
cd05d13c
PE
98062003-06-19 Paul Eggert <eggert@twinsun.com>
9807
81fd08ca
PE
9808 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
9809 yyreportTree): Do not assume that size_t is the same width as int,
9810 when printing sizes. Print sizes using an unsigned format.
9811 Problem reported by Frank Heckenbach in
161a71f3 9812 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 9813
cd05d13c
PE
9814 Port to Forte Developer 7 C compiler.
9815 * data/glr.c (struct YYLTYPE): If locations are not being used,
9816 declare a single dummy member, as empty structs do not conform
9817 to the C standard.
9818 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
9819 the Forte Developer 7 C compiler complains that end-of-loop
9820 code is not reached.
9821
4dcf140b
PE
98222003-06-17 Paul Eggert <eggert@twinsun.com>
9823
9824 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
9825 avoid warnings from picky compilers about redefinition of PARAMS.
9826
8dd76bee
PE
98272003-06-17 Paul Eggert <eggert@twinsun.com>
9828
9829 Version 1.875b.
9830
9831 * NEWS: Document 1.875b.
9832
9833 * lib/bbitset.h: Do not include config.h; that's the includer's job.
9834 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
9835 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
9836 Don't use 'index' in comments, as it's a builtin fn on some hosts.
9837 * lib/bitset_stats.c: Include gettext.h unconditionally, as
9838 per recent gettext manual's suggestion.
9839 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
9840 Use prototypes, not old-style definitions.
9841 * lib/lbitset.c (lbitset_unused_clear): Likewise.
9842 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
9843 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
9844 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
9845 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
9846 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
9847 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
9848 vbitset_or_and_cmp, vbitset_copy): Likewise.
9849
9850 * lib/libiberty.h: Do not include config.h; that's the includer's job.
9851 Do not include <stdlib.h>.
9852 (PARAMS): Define unconditionally for C89.
9853 (ATTRIBUTE_NORETURN): Remove.
9854 (ATTRIBUTE_UNUSED): Define unconditionally.
9855
9856 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 9857 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
9858 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
9859 * lib/vbitset.c, lib/vbitset.h: New files.
9860 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9861 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
9862 from libbitset.
9863
9864 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
9865 `How Can I Reset @code{yyparse}', since texinfo does not allow
9866 arbitrary @ in node names.
9867
9868 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
9869 shouldn't be needed according to the gettext 0.12.1 documentation
9870 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 9871 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 9872 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 9873 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 9874
8dd76bee
PE
9875 * lib/.cvsignore: Add stdbool.h.
9876 * m4/.cvsignore: Add nls.m4, po.m4.
9877
9878 Upgrade to CVS gnulib.
9879 * stdbool_.h: File renamed from stdbool.h.in.
9880 * configure.ac (AM_STDBOOL_H): Invoke this instead of
9881 AC_HEADER_STDBOOL.
9882 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
9883 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
9884 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
9885 (MOSTLYCLEANFILES): New var.
9886 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
9887 (stdbool.h): New rule.
9888 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
9889 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
9890 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
9891 m4/quote.m4: Upgrade to today's gnulib.
9892
9893 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
9894 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
9895 the tests right now.
9896 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
9897 yyerror are declared before use; C99 requires this.
9898
25005f6a
PH
98992003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9900
9901 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
9902 first.
9903 (yyrecoverSyntaxError): Correct the logic for setting and testing
9904 yyerrState.
9905 Correct comment on handling EOF.
9906 Allow states with only a default reduction, rather than failing
8dd76bee 9907 (I can't quite reconstruct why these were not allowed before).
25005f6a 9908
137437c6 9909 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 9910 buffer overruns, corrupting state.
8dd76bee
PE
9911
9912 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
9913 definition.
9914 * src/reader.h (max_left_semantic_context): New variable declaration.
9915 * src/scan-gram.l (max_left_semantic_context): Define.
9916 (handle_action_dollar): Update max_left_semantic_context.
9917 * data/glr.c (YYMAXLEFT): New definition.
9918 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
9919 (yyresolveAction): Ditto.
9920
9921 Fixes to problems with location handling in GLR parsers reported by
9922 Frank Heckenbach (2003/06/05).
9923
9924 * data/glr.c (YYLTYPE): Make trivial if locations not used.
9925 (YYRHSLOC): Add parentheses, and define only if locations used.
9926 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
9927 locations not used.
9928 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
9929 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 9930
25005f6a
PH
9931 * tests/cxx-type.at: Exercise location information; update tests
9932 to differentiate output with and without locations.
8dd76bee 9933 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
9934 because default YYLTYPE not yet defined.
9935 Change semantic actions to compute strings, rather than printing
9936 them directly (to test proper passing of semantics values). Change
9937 output to prefix notation and update test data and expected results.
9938 (yylex): Track locations.
9939 (stmtMerge): Return value rather than printing, and include arguments
9940 in value.
8dd76bee 9941
711f40b7
PE
99422003-06-03 Paul Eggert <eggert@twinsun.com>
9943
9944 Avoid warnings generated by GCC 2.95.4 when Bison is
9945 configured with --enable-gcc-warnings.
9946 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
9947 yy::]b4_parser_class_name[::translate_,
9948 yy::Stack::operator[] (unsigned),
9949 yy::Stack::operator[] (unsigned) const,
9950 yy::Slice::operator[] (unsigned),
9951 yy::Slice::operator[] (unsigned) const):
9952 Rename local vars to avoid warnings.
9953 * tests/glr-regression.at (Improper handling of embedded actions
9954 and $-N in GLR parsers): Remove unused local variable from yylex.
9955 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
9956 (void) as arg when not pure, since we now assume C89 when building
9957 Bison. Pacify GCC by using parameter.
9958
ac695f7d
PE
99592003-06-02 Paul Eggert <eggert@twinsun.com>
9960
9961 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
9962 yy::Location::lines, yy::Location::columns): Rename arguments
9963 to avoid shadowing; this removes a warning generated by GCC 3.3.
9964
26ec81e0
PE
99652003-06-01 Paul Eggert <eggert@twinsun.com>
9966
9967 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
9968 to g++, as GCC 3.3 complains if you do it.
9969 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
9970 everything that WARNING_CFLAGS has, except omit warnings
9971 not suitable for C++.
9972 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
9973 * tests/atlocal.in (CXXFLAGS): New var.
9974 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
9975
9976 Fix a GLR parser bug I reported in February; see
161a71f3 9977 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
9978 The problem was that GLR parsers did not conform to the C standard,
9979 because actions like { $1 = $2 + $3; } expanded to expressions
9980 that invoked YYFILL in separate subexpressions, and YYFILL assigned
9981 to a local variable. The C standard says that expressions
9982 like (var = f ()) + (var = f ()) have undefined behavior.
9983 Another problem was that GCC sometimes issues warnings that
9984 yyfill and its parameters are unused.
9985
9986 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
9987 as possibly unused.
9988 (yyfill): New function.
9989 (YYFILL): Use it.
9990 (yyuserAction): Change type of yynormal to bool, so that it matches
9991 the new yyfill signature. Mark it as possibly unused.
9992
9993
9994 Follow up on a bug I reported in February, where a Bison-generated
9995 parser can loop. Provide a test case and a fix for yacc.c. I
9996 don't have a fix for lalr1.cc or for glr.c, unfortunately.
9997 The original bug report is in:
161a71f3 9998 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
9999
10000 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
10001 macro's size was becoming unwieldy.
10002 (yyerrlab): Do not discard an empty lookahead symbol, as this
10003 might destroy garbage.
10004 (yyerrorlab): New label, with the old contents of YYERROR,
10005 plus the following change: pop the stack of rhs corresponding
10006 to the production that invoked YYERROR. That is how Yacc
10007 behaves, and POSIX requires this behavior.
10008 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
10009 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
10010 Define 'alarm' to do nothing if unistd.h is not available.
10011 Add a new rule "exp: '-' error;" to test the above change to
10012 data/yacc.c. Use 'alarm' to abort any test taking longer than
10013 10 seconds, as it's probably looping.
10014 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
10015 Also, the new yacc.c generates two fewer diagnostics for an
10016 existing test.
10017
d0829076
PE
100182003-05-24 Paul Eggert <eggert@twinsun.com>
10019
c6ae27df
PE
10020 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
10021 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
10022 This fixes a problem reported by John Bowman when the Compaq/HP
10023 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
10024 -ansi -Wall -gall).
10025 * data/yacc.c (union yyalloc): Likewise.
10026 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 10027
d0829076
PE
10028 Switch from 'int' to 'bool' where that makes sense.
10029
10030 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
10031 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
10032 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
10033 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
10034 Return or accept bool, not int. All callers changed.
10035 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
10036 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
10037 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
10038 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
10039 bitset_or_and_cmp_): Likewise.
10040 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
10041 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
10042 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
10043 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
10044 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
10045 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
10046 bitset_stats_or_and_cmp): Likewise.
10047 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
10048 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
10049 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
10050 ebitset_xor_cmp): Likewise.
10051 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
10052 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
10053 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
10054 lbitset_xor_cmp): Likewise.
10055 * lib/bbitset.h: Include <stdbool.h>.
10056 (struct bitset_vtable): The following members now return bool, not
10057 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
10058 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
10059 or_and_cmp).
10060 * src/conflicts.c (count_rr_conflicts): Likewise.
10061 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
10062 All uses changed.
10063 * lib/ebitset.c (ebitset_obstack_init): Likewise.
10064 * lib/lbitset.c (lbitset_obstack_init): Likewise.
10065 * src/getargs.c (debug_flag, defines_flag, locations_flag,
10066 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10067 graph_flag): Likewise.
10068 * src/getargs.h (debug_flag, defines_flag, locations_flag,
10069 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10070 graph_flag): Likewise.
10071 * src/output.c (error_verbose): Likewise.
10072 * src/output.h (error_verbose): Likewise.
10073 * src/reader.c (start_flag, typed): Likewise.
10074 * src/reader.h (typed): Likewise.
10075 * src/getargs.c (LOCATIONS_OPTION): New constant.
10076 (long_options, getargs): Use it.
10077 * src/lalr.c (build_relations): Use bool, not int.
10078 * src/nullable.c (nullable_compute): Likewise.
10079 * src/print.c (print_reductions): Likewise.
10080 * src/tables.c (action_row, pack_vector): Likewise.
10081 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
10082 * src/output.c (prepare): Use it.
10083 * src/output.c (token_definitions_output,
10084 symbol_destructors_output, symbol_destructors_output): Use string,
10085 not boolean integer, to keep track of whether to output separator.
10086 * src/print_graph.c (print_core): Likewise.
10087 * src/state.c (state_rule_lookaheads_print): Likewise.
10088
10089 * config/install-sh: Sync from automake 1.7.5.
10090
6b2584b7
PE
100912003-05-14 Paul Eggert <eggert@twinsun.com>
10092
10093 * src/parse-gram.y (rules_or_grammar_declaration): Require a
10094 semicolon after a grammar declaration, in the interest of possible
10095 future changes to the Bison input language.
10096 Do not allow a stray semicolon at the start of the grammar.
10097 (rhses.1): Allow one or more semicolons after any rule, including
10098 just before "|" as required by POSIX.
10099 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
10100 grammar.
10101
caf37a36
ADL
101022003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
10103
10104 %parse-param support for lalr1.cc.
10105
10106 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
10107 b4_cc_constructor_calls, b4_cc_constructor_call,
10108 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
10109 definitions.
10110 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
10111 parse-param arguments.
10112 (yy::b4_parser_class_name): Declare instance variables to
10113 hold parse-param arguments.
10114 * tests/calc.at: s/value/semantic_value/ because value clashes
10115 with a member of yy::b4_parser_class_name. Adjust C++ code
10116 to handle %parse-param. Enable %parse-param test in C++.
10117
3ab37077
PE
101182003-05-12 Paul Eggert <eggert@twinsun.com>
10119
10120 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
10121 English a bit. Fix fclose typo. Change "const char" to "char
10122 const", and use ANSI C rather than K&R for "main". Suggest
10123 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
10124 and suggest yy_switch_to_buffer.
10125
101262003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
10127
10128 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
10129 C89. This avoids a diagnostic on compilers that define __STDC__
10130 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 10131 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 10132
e743727f
PE
101332003-05-03 Paul Eggert <eggert@twinsun.com>
10134
10135 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
10136 Do not overrun array bounds.
10137 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 10138 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 10139
916708d5
AD
101402003-04-29 Akim Demaille <akim@epita.fr>
10141
10142 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
10143 * src/getargs.c, src/getargs.h: here, as bool, not int.
10144 (nondeterministic_parser): New.
10145 * src/parse-gram.y, src/scan-gram.l: Support
10146 %nondeterministic-parser.
10147 * src/output.c (prepare): Use nondeterministic_parser instead
10148 of glr_parser where appropriate.
10149 * src/tables.c (conflict_row, action_row, save_row)
10150 (token_actions, token_actions, pack_vector): Ditto.
10151
a06ea4aa
AD
101522003-04-29 Akim Demaille <akim@epita.fr>
10153
10154 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
10155
211074ca
AD
101562003-04-29 Akim Demaille <akim@epita.fr>
10157
10158 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
10159 with %pure-parser and %locations to exercise the patch from Yakov
10160 Markovitch below.
10161
6175ffe3
PE
101622003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
10163
10164 * data/yacc.c: (b4_lex_param): Corrected for the case where
10165 %lex-param is provided and %pure-parser isn't.
10166
b1e95857
PE
101672003-04-27 Paul Eggert <eggert@twinsun.com>
10168
10169 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 10170 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
10171 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
10172 if it is not defined.
10173 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
10174
acda9df6
PE
101752003-04-26 Paul Eggert <eggert@twinsun.com>
10176
3470c57b
PE
10177 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
10178 Declare to be of type suitable for the ninf value itself, not of
10179 type suitable for the corresponding table, since the latter might
10180 be unsigned but the ninf value might be negative. This fixes a
10181 bug reported by Alexandre Duret-Lutz in
161a71f3 10182 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 10183
acda9df6
PE
10184 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
10185 invokes it. We shouldn't invoke it twice because it will attempt
10186 to put error.o in the archive twice. This fixes a glitch reported
10187 by Martin Mokrejs in
161a71f3 10188 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 10189
b5250f26
PE
101902003-04-21 Paul Eggert <eggert@twinsun.com>
10191
10192 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
10193 to gnulib.
10194
089ac0f1
PE
101952003-04-21 Yakov Markovitch <Markovitch@iso.ru>
10196
10197 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
10198 Fix obvious typo that results in uncompilable GLR parsers
10199 when both %pure-parser and %locations are used. (trivial change)
10200
5ededac6
PE
102012003-04-17 Paul Eggert <eggert@twinsun.com>
10202
1b8f2fff
PE
10203 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
10204 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
10205 Do not insert the expected token via unput, as this runs afoul
10206 of a POSIX-compatibility bug in flex 2.5.31.
10207 All uses changed to BEGIN the parent state,
10208 since we no longer insert the expected token via unput.
10209 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
10210 that is no longer emitted after the above change.
10211
5ededac6
PE
10212 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
10213 the first one. This change is from Paul Hilfinger, and it fixes
10214 regression reported by Werner Lemberg in
161a71f3 10215 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
10216
10217 (resolve_sr_conflict): Don't invoke state_errs_set
10218 unless one or more tokens have been explicitly made errors.
10219 Otherwise, the above change causes Bison to abort.
10220
10221 * tests/existing.at (GNU pic Grammar): New test case, taken from
10222 Lemberg's email.
10223
b8be9132
AD
102242003-03-31 Akim Demaille <akim@epita.fr>
10225
10226 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
10227
d423d460
AD
102282003-03-31 Akim Demaille <akim@epita.fr>
10229
10230 * src/output.c (prepare_symbols): Avoid trailing spaces in the
10231 output.
10232
c7e441b4
AD
102332003-03-31 Akim Demaille <akim@epita.fr>
10234
10235 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
10236 From Paul Hilfinger.
10237
231897ad
AD
102382003-03-29 Akim Demaille <akim@epita.fr>
10239
10240 * m4/error.m4: Do not put under dynamic conditions some code which
10241 expansion is under static control.
10242
5b066063
AD
102432003-03-29 Akim Demaille <akim@epita.fr>
10244
10245 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
10246
22a74fec
AD
102472003-03-29 Akim Demaille <akim@epita.fr>
10248
10249 * doc/bison.texinfo (Strings are Destroyed): New.
10250
0eee27e7
PE
102512003-03-13 Paul Eggert <eggert@twinsun.com>
10252
10253 * .cvsignore: Add configure.lineno.
10254 * src/.cvsignore: Add yacc.
10255 * tests/.cvsignore: Add testsuite.log.
10256 * doc/fdl.texi: Sync with latest FSF version.
10257
f61aad93
PE
102582003-03-12 Paul Eggert <eggert@twinsun.com>
10259
537636c7
PE
10260 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
10261 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
10262 cursor, instead of leaving it undefined. This fixes a bug
10263 reported by Tim Van Holder in
161a71f3 10264 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
10265 * tests/input.at (Torturing the Scanner): Test the scanner on
10266 an empty input file, which was Tim Van Holder's test case.
10267
10268 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
10269 <sys/resource.h> can be included, include sys/time.h and
10270 sys/times.h first, if available. This works around the SunOS
10271 4.1.4 porting bug reported by Bruce Becker in
161a71f3 10272 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
10273
10274 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
10275 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
10276 AC_HEADER_SYS_WAIT.
10277
f61aad93
PE
10278 Merge changes from gnulib. This was prompted because the CVS
10279 snapshot didn't build on Solaris 7 due to strnlen problems.
10280
10281 These changes need to be merged back into gnulib:
10282 * lib/hash.c: Include <stdbool.h> unconditionally.
10283 * m4/onceonly.m4 (m4_quote): New macro.
10284 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
10285 Quote AC_FOREACH variable-expansions properly.
10286 The 2003-01-03 obstack.h change also needs merging.
10287 {end of changes requiring merging}
5b066063 10288
f61aad93
PE
10289 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10290 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
10291 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
10292 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
10293 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
10294 New files, imported from gnulib.
10295 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
10296 above.
10297
10298 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
10299 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
10300 gnulib sources.
10301
10302 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
10303 Add.
10304 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
10305 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
10306 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
10307 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
10308 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
10309 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
10310 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
10311 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
10312 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
10313 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
10314 (jm_PREREQ_ARGMATCH): Remove.
10315 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
10316 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
10317
10318 * src/system.h: Include <stdbool.h> unconditionally.
10319
10320 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
10321 assuming at least C89 in the bitset code for some time now.
10322
d2ffe116
AD
103232003-03-03 Akim Demaille <akim@epita.fr>
10324
10325 * ro.po: New.
10326
052826fd
AD
103272003-03-02 Akim Demaille <akim@epita.fr>
10328
10329 * doc/bison.texinfo (Table of Symbols): Reactivate the
10330 documentation for %lex-param, and %parse-param.
10331
c4749565
AD
103322003-03-02 Akim Demaille <akim@epita.fr>
10333
10334 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
10335 generate verbose error messages.
10336 Use the number of tokens as an upper bound in yytname, as it
10337 cannot be a non terminal.
10338
d5286af1
AD
103392003-03-02 Akim Demaille <akim@epita.fr>
10340
10341 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
10342 message.
10343
22e304a6
AD
103442003-03-02 Akim Demaille <akim@epita.fr>
10345
22e304a6
AD
10346 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
10347 Use them to exercise yycheck overrun.
10348 Based on Andrew Suffield's grammar.
10349
67a25fed
AD
103502003-03-02 Akim Demaille <akim@epita.fr>
10351
10352 Create tests/local.at for Bison generic testing macros.
10353
10354 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
10355 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
10356 This new file.
10357 * tests/calc.at (AT_CHECK_CALC): Adjust.
10358 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
10359 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
10360 * tests/local.at: here.
10361 (AT_COMPILE_CXX): Tags the tests using it as c++.
10362 Ignore the test if CXX is not functional.
10363
9c2b381f
PE
103642003-03-01 Paul Eggert <eggert@twinsun.com>
10365
10366 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
10367 not loc->end, since loc->end might contain garbage and this leads
10368 to undefined behavior on some platforms.
10369 (id_loc, token_start): Use (IF_LINTed) initial values that do not
10370 depend on *loc, so that the reader doesn't give the the false
10371 impression that *loc is initialized.
10372 (<INITIAL>"%%"): Do not bother setting code_start, since its value
10373 does not survive the return.
10374
0433ba88
AD
103752003-03-01 Akim Demaille <akim@epita.fr>
10376
10377 * src/scan-gram.l (code_start): Always initialize it when entering
10378 into yylex, as SC_EPILOGUE is activated *before* the corresponding
10379 yylex invocation. An alternative would be making it static, but
10380 then it starts with the second %%'s beginning, instead of its end.
10381
b305ea69
PE
103822003-02-28 Paul Eggert <eggert@twinsun.com>
10383
10384 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
10385 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 10386 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 10387
c3d25e01
PE
103882003-02-26 Paul Eggert <eggert@twinsun.com>
10389
10390 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
10391 Remove Sequent/Pyramid discussion (nobody uses them any more).
10392 Merge VMS and MS-DOS discussion; these ports may well be dead
10393 but let's keep mentioning them for now. Put <> around email
10394 addresses. Add copyright notice.
10395
c267ffbc
PE
103962003-02-24 Paul Eggert <eggert@twinsun.com>
10397
10398 * data/glr.c (yy_reduce_print): yylineno -> yylno,
10399 to avoid collision with flex use of yylineno.
10400 Problem reported by Bruce Lilly in
161a71f3 10401 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
10402 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10403 * data/yacc.c (yy_reduce_print): Likewise.
10404
10405 * config/depcomp: Sync with Automake 1.7.3.
10406
f939fc12
AD
104072003-02-21 Akim Demaille <akim@epita.fr>
10408
10409 * data/lalr1.cc: Use temporary variables instead of casts to
10410 change integer types.
10411 Suggested by Paul Eggert.
10412
95923bd6
AD
104132003-02-21 Akim Demaille <akim@epita.fr>
10414
10415 * doc/bison.texinfo: Use "location" consistently to refer to @n,
10416 to avoid confusions with lalr1.cc's notion of Position.
10417 Suggested by Paul Eggert.
10418
2cdc240e
AD
104192003-02-20 Akim Demaille <akim@epita.fr>
10420
10421 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
10422 before initial_columns.
10423 (location.hh): Use consistent variable names when defining the
10424 operator<<.
10425 Use "last" so that we subtract from Positions, not from unsigned.
10426
5d003116
AD
104272003-02-20 Akim Demaille <akim@epita.fr>
10428
10429 * data/lalr1.cc (position.hh): New subfile, including the extended
10430 and Doxygen'ed documentation of class Position.
10431 (location.hh): Use it.
10432 Document a` la Doxygen.
ba1ecc07 10433 With the help of Benoit Perrot.
5d003116 10434
d02b25f9
AD
104352003-02-20 Akim Demaille <akim@epita.fr>
10436
10437 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
10438 AT_YACC_IF.
10439 Redefine AT_YYERROR_SEES_LOC_IF using it.
10440 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
10441 not defined.
10442 Don't use the location in yy::Parser::error_ and
10443 yy::Parser::print_ when not %locations.
10444 Activate more lalr1.cc tests.
10445
0d1c3a04
AD
104462003-02-19 Akim Demaille <akim@epita.fr>
10447
10448 * data/lalr1.cc: When displaying a line number, be sure to make it
10449 an int.
10450
60a777aa
AD
104512003-02-19 Akim Demaille <akim@epita.fr>
10452
10453 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
10454 Remove, useless.
10455 (YYABORT, YYACCEPT, YYERROR): New.
10456 * tests/calc.at: Renable the lalr1.cc test.
10457
0b86fc41
AD
104582003-02-19 Akim Demaille <akim@epita.fr>
10459
10460 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
10461 error recovery, mixing with/without pops and discarding of the
10462 lookahead.
10463 Exercise YYERROR.
10464 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
10465
da99a5dc
PE
104662003-02-17 Paul Eggert <eggert@twinsun.com>
10467
10468 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
10469 * tests/testsuite.at (AT_COMPILE): Use them.
10470 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 10471 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 10472
93b8c255
PE
104732003-02-12 Paul Eggert <eggert@twinsun.com>
10474
10475 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
10476 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 10477 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
10478 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
10479 Check for malloc failure, for consistency with yacc.c.
10480 (yytname_size): Remove, for consistency with yacc.c.
10481
10482 The bug still remains in data/lalr1.cc, as I didn't have time
10483 to fix it there.
10484
7548fed2
AD
104852003-02-06 Akim Demaille <akim@epita.fr>
10486
10487 * configure.ac (GXX): Rename as...
10488 (CXX): this, to keep the original Autoconf semantics.
10489 Require 2.57.
10490 * data/lalr1.cc: Fix b4_copyright invocations.
10491 If YYDEBUG is not defined, don't depend upon name_ being defined.
10492 (location.hh): Include string and iostream.
10493 (Position::filename): New member.
10494 (Position::Position ()): New.
10495 (operator<< (Position)): New.
10496 (operator- (Position, int)): New.
10497 (Location::first, Location::last): Rename as...
10498 (Location::begin, Location::end): these, to mock the conventional
10499 iterator names.
10500 (operator<< (Location)): New.
10501 * tests/atlocal.in (CXX): New.
10502 * tests/testsuite.at (AT_COMPILE_CXX): New.
10503 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
10504 locations in a more synthetic way.
10505 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
10506 lalr1.cc is used.
10507 Adjust the C locations to match those from Emacs: first column is
10508 column 0.
10509 Change all the expected results.
10510 Conform to the GCS: simplify the locations when applicable.
10511 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
10512 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
10513 these CPP macros with the m4 macros new defined by...
10514 (AT_CHECK_PUSHDEFS): this, i.e.:
10515 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 10516 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
10517 New macros.
10518 (AT_CHECK_POPDEFS): Undefine them.
10519 (AT_CHECK_CALC_LALR1_CC): New.
10520 Use it for the first lalr1.cc test.
10521
43a176ef
AD
105222003-02-04 Akim Demaille <akim@epita.fr>
10523
10524 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
10525 Location as is defined.
10526
fc049e9c
AD
105272003-02-04 Akim Demaille <akim@epita.fr>
10528
10529 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
10530 name_ being defined.
10531
a737b216
PE
105322003-02-03 Paul Eggert <eggert@twinsun.com>
10533
10534 * src/gram.h (start_symbol): Remove unused decl.
10535
10536 Use more-consistent naming conventions for local vars.
10537
10538 * src/derives.c (derives_compute): Change type of local var from
10539 int to rule_number.
10540 * src/gram.c (grammar_rules_partial_print): Likewise.
10541 * src/print.c (print_core): Likewise.
10542 * src/reduce.c (reduce_grammar_tables): Likewise.
10543
10544 * src/gram.c (grammar_dump): Change name of item_number *
10545 local var from r to rp.
10546 * src/nullable.c (nullable_compute): Likewise.
10547
10548 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
10549
10550 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
10551 for symbol or symbol_number var.
10552 * src/reader.c (grammar_start_symbol_set): Likewise.
10553 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
10554 Likewise.
10555 * src/state.c (transitions_to): Likewise.
10556 * src/state.h: Likewise.
10557 * src/tables.c (symbol_number_to_vector_number): Likewise.
10558
10559 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
10560 char * var.
10561
10562 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
10563 var.
10564
10565 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
10566 var.
10567
10568 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
10569 Use str, not s, for char * var. Use ch, not c, for character var.
10570 Use size for size var.
10571
10572 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
10573 char * var.
10574 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
10575 uniqstr var.
10576 * src/uniqstr.h: Likewise.
10577
10578 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10579 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10580 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
10581 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
10582 param to have same name as that of enum, so that we don't use
10583 "s" to stand for a non-state.
10584
68e93ad5
AD
105852003-02-02 Akim Demaille <akim@epita.fr>
10586
10587 * src/scan-skel.l: Scan more than one inert character per yylex
10588 invocation.
10589
92898986
PE
105902003-02-01 Paul Eggert <eggert@twinsun.com>
10591
10592 Version 1.875a.
10593
1d9d5d71
PE
10594 * po/LINGUAS: Add ms.
10595
0435d061
AD
105962003-01-30 Akim Demaille <akim@epita.fr>
10597
10598 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
10599
6029a57f
PH
106002003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10601
10602 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
10603 of $1.
0435d061
AD
10604
10605 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 10606 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 10607 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 10608
6029a57f
PH
10609 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
10610 (b4_rhs_location): Ditto.
0435d061 10611 (yyfill): New function to copy from stack tree into array
6029a57f 10612 incrementally.
0435d061
AD
10613 (yyuserAction): Modify to allow incremental move of semantic values
10614 to rhs array when in GLR mode.
10615 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
10616 as needed.
10617 Remove dummy use of yystack, as there is now a guaranteed use.
10618 (yydoAction): Modify to allow incremental move of semantic values
10619 to rhs array when in GLR mode.
10620 (yyresolveAction): Ditto.
10621 (yyglrShiftDefer): Update comment.
0435d061 10622 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
10623 (yyglrReduce): Ditto.
10624 (yydoAction): Ditto
0435d061 10625
6029a57f
PH
10626 * tests/glr-regr1.at: Rename to ...
10627 * tests/glr-regression.at: Add new regression test for the problems
10628 described above (adapted from S. Eken).
10629 Update copyright notice.
10630 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
10631 * tests/Makefile.am: Ditto.
10632
6cee6297
PE
106332003-01-28 Paul Eggert <eggert@twinsun.com>
10634
10635 * data/lalr1.cc: Do not use @output_header_name@ unless
10636 b4_defines_flag is set. This fixes two bugs reported by
10637 Tim Van Holder in
161a71f3
PE
10638 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
10639 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 10640
b2a836b5
PE
106412003-01-21 Paul Eggert <eggert@twinsun.com>
10642
10643 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
10644 we don't need to worry about yyerrlab1 being reported as an
10645 "unused label" by non-GCC C compilers. The downside is that if
10646 locations are used then a couple of statements are duplicated each
10647 time YYERROR is invoked, but the upside is that the warnings
10648 should vanish.
10649 (yyerrlab1): Move code to YERROR.
10650 (yyerrlab2): Remove. Change uses back to yyerrlab1.
10651 This reverts some of the 2002-12-27 change.
10652
4196b931
PE
106532003-01-17 Paul Eggert <eggert@twinsun.com>
10654
10655 * src/output.c (symbol_printers_output): Fix typo that led
10656 to core dump. Problem reported by Antonio Rus in
161a71f3 10657 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 10658
3ae831b4
AD
106592003-01-13 Akim Demaille <akim@epita.fr>,
10660 Quoc Peyrot <chojin@lrde.epita.fr>,
10661 Robert Anisko <anisko_r@lrde.epita.fr>
10662
10663 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
10664 when the stacks contain one element, as the loop would otherwise
10665 free the last state, and then use the top state (the one we just
10666 popped). This means that the initial elements will not be freed
10667 explicitly, as is the case in yacc.c; it is not a problem, as
10668 these elements have fake values.
10669
e3aa65c5
PE
106702003-01-11 Paul Eggert <eggert@twinsun.com>
10671
10672 * NEWS: %expect-violations are now just warnings, reverting
10673 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
10674 bootstrapping problem reported by Matthias Klose; see
161a71f3 10675 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
10676 * src/conflicts.c (conflicts_print): Likewise.
10677 * tests/conflicts.at (%expect not enough, %expect too much,
10678 %expect with reduce conflicts): Likewise.
10679 * doc/bison.texinfo (Expect Decl): Document this. Also mention
10680 that the warning is enabled if the number of conflicts changes
10681 (not necessarily increases).
10682
10683 * src/getargs.c (version): Update copyright year.
10684
f0057011
AD
106852003-01-09 Akim Demaille <akim@epita.fr>
10686
10687 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
10688
1ee6d2a0
PE
106892003-01-08 Paul Eggert <eggert@twinsun.com>
10690
10691 * Makefile.maint (WGETFLAGS):
10692 New macro, containing "-C off" to disable proxy caches.
10693 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
10694 (rel-check): Use $(WGET) instead of wget.
10695
d4fd77c4
PE
106962003-01-06 Paul Eggert <eggert@twinsun.com>
10697
10698 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
10699 the GLR paper of Scott, Johnstone and Hussain.
10700
464c6927
PE
107012003-01-04 Paul Eggert <eggert@twinsun.com>
10702
d600ee67
PE
10703 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
10704 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
10705 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
10706 (EXTRA_LIBRARIES): New var, for liby.a.
10707 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
10708 (EXTRA_SCRIPTS): New var, for yacc.
10709
464c6927
PE
10710 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
10711 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
10712 Problem reported by Nelson H. F. Beebe.
10713
107142003-01-03 Paul Eggert <eggert@twinsun.com>
10715
10716 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
10717 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
10718 when compiling Bison 1.875's `bitset bset = obstack_alloc
10719 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
10720
10721 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
10722 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
10723 grow to a huge size with typical invocation.
d600ee67 10724
464c6927
PE
10725 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
10726 Use the pattern recommended by Autoconf 2.57, except also protect
10727 against double-definition.
10728 * src/system.h: Likewise.
10729 Portability issues reported by Nelson H. F. Beebe.
d600ee67 10730
464c6927
PE
10731 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
10732 All uses changed. Provide a definition in both C and C++.
10733 (yytrue, yyfalse): Define even if defined (__cplusplus).
10734
10735 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
10736 Reported by Nelson H. F. Beebe.
d600ee67 10737
464c6927
PE
10738 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
10739
0f42c7d5
PE
107402003-01-02 Paul Eggert <eggert@twinsun.com>
10741
10742 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
10743 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
10744 Bug reported by Nelson H. F. Beebe.
10745
dc546b0f
PE
107462003-01-01 Paul Eggert <eggert@twinsun.com>
10747
10748 * Version 1.875.
10749
2c09b6a7
PE
107502002-12-30 Paul Eggert <eggert@twinsun.com>
10751
10752 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
10753 Moved here from...
10754 (<INITIAL>","): Here. This causes stray "," to be treated
10755 more uniformly.
10756
dc546b0f 10757 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
10758 last brace in braced code when not in Yacc mode, for compatibility
10759 with Bison 1.35. This resurrects the 2001-12-15 patch to
10760 src/reader.c.
10761
10762 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
10763 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
10764
535c0f63
PE
107652002-12-28 Paul Eggert <eggert@twinsun.com>
10766
10767 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
10768 that of SYM's type. This fixes Debian bug 168069, reported by
10769 Thomas Olsson.
d600ee67 10770
963fcc17
PE
107712002-12-28 Paul Eggert <eggert@twinsun.com>
10772
10773 Version 1.75f.
10774
10775 Switch back to the Yacc style of conflict reports, undoing some
10776 of the 2002-07-30 change.
10777 * doc/bison.texinfo (Understanding): Use Yacc style for
10778 conflict reports. Also, use new way of locating rules.
10779 * src/conflicts.c (conflict_report):
10780 Renamed from conflict_report_yacc, removing the old
10781 'conflict_report'. Translate the entire conflict report at once,
10782 so that we don't assume that "," has the same interpretation in
10783 all languages.
10784 (conflicts_output): Use Yacc-style conflict report for each state,
10785 instead of our more-complicated style.
10786 (conflicts_print): Use Yacc-style conflict report, except print
10787 the input file name when not emulating Yacc.
10788 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
10789 Conflicted Reduction, %expect not enough, %expect too much,
10790 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
10791 * tests/existing.at (GNU Cim Grammar): Likewise.
10792 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
10793
10794 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
10795 fatal): Don't invoke fflush; it's not needed and it might even be
10796 harmful for stdout, as stdout might not be open.
10797 * src/reduce.c (reduce_print): Likewise.
10798
b1efe548
PE
107992002-12-27 Paul Eggert <eggert@twinsun.com>
10800
10801 Fix a bug where error locations were not being recorded correctly.
10802 This problem was originally reported by Paul Hilfinger in
161a71f3 10803 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
10804
10805 * data/yacc.c (yyparse): New local var yylerrsp, to record the
10806 top of the location stack's error locations.
10807 (yyerrlab): Set it. When discarding a token, push its location
10808 onto yylerrsp so that we don't lose track of the error's end.
10809 (yyerrlab1): Now is only the target of YYERROR, so that we can
10810 properly record the location of the action that failed. For GCC
10811 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
10812 GCC warning about yyerrlab1 being unused if YYERROR is unused.
10813 (yyerrlab2): New label, which yyerrlab now falls through to.
10814 Compute the error's location by applying YYLLOC_DEFAULT to
10815 the locations of all the symbols that went into the error.
10816 * doc/bison.texinfo (Location Default Action): Mention that
10817 YYLLOC_DEFAULT is also invoked for syntax errors.
10818 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10819 Error locations include the locations of all the tokens that were
10820 discarded, not just the last token.
d600ee67 10821
983c5c2c
PE
108222002-12-26 Paul Eggert <eggert@twinsun.com>
10823
b1efe548
PE
10824 * src/files.c: Include quote.h.
10825 (compute_output_file_names): Warn if we detect conflicting
10826 outputs to the same file. This should catch the misunderstanding
10827 exemplified by Debian Bug 165349, reported by Bruce Stephens..
10828
10829 * src/conflicts.c (conflicts_print): If the user specifies
10830 "%expect N", report an error if there are any reduce/reduce
10831 conflicts. This is what the manual says should happen.
10832 This fixes Debian bug 130890, reported by Anthony DeRobertis.
10833 * tests/conflicts.at (%expect with reduce conflicts): New test.
10834
983c5c2c
PE
10835 Don't use m4_include on relative file names, as it doesn't work as
10836 desired if there happens to be a file with that name under ".".
d600ee67 10837
983c5c2c
PE
10838 * m4sugar/version.m4: Remove; it was included but it wasn't used.
10839 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
10840 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
10841 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
10842 * src/output.c (output_skeleton): Use full path names when
10843 specifying a file to include; don't rely on include path, as
10844 it's unreliable when the working file contains a file with
10845 that name.
d600ee67 10846
983c5c2c
PE
108472002-12-25 Paul Eggert <eggert@twinsun.com>
10848
10849 Remove obsolete references to bison.simple and bison.hairy.
10850 Problem mentioned by Aubin Mahe in
161a71f3 10851 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
10852 * data/glr.c: Comment fix.
10853 * doc/bison.1: Remove references. Also, mention "yacc".
10854
10855 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
10856 with -g option.
10857
10858 * src/parse-gram.y (declaration): Use enum "report_states" rather
10859 than its numeric value 1.
10860
10861 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
10862 opening a new one. This fixes Debian bug 165349, reported by
10863 Bruce Stephens.
10864
23f2d9dc
PE
108652002-12-24 Paul Eggert <eggert@twinsun.com>
10866
10867 Version 1.75e.
10868
10869 * Makefile.maint (cvs-update): Don't assume that the shell
10870 supports $(...), as Solaris sh doesn't.
10871
10872 * src/parse-gram.y (lloc_default): Remove test for empty
10873 nonterminals at the end, since it didn't change the result.
10874
108752002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
10876
10877 If the user does not define YYSTYPE as a macro, Bison now declares it
10878 using typedef instead of defining it as a macro. POSIX requires this.
10879 For consistency, YYLTYPE is also declared instead of defined.
10880
10881 %union directives can now have a tag before the `{', e.g., the
10882 directive `%union foo {...}' now generates the C code
10883 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
10884 The default union tag is `YYSTYPE', for compatibility with Solaris 9
10885 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
10886 instead of `yyltype'.
10887
10888 `yystype' and `yyltype' are now obsolescent macros instead of being
10889 typedefs or tags; they are no longer documented and will be
10890 withdrawn in a future release.
10891
10892 * data/glr.c (b4_location_type): Remove.
10893 (YYSTYPE): Renamed from yystype.
10894 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
10895 (struct YYLTYPE): Renamed from struct yyltype.
10896 (YYLTYPE): Renamed from yyltype.
10897 (yyltype, yystype): New (and obsolescent) macros,
10898 for backward compatibility.
10899 * data/yacc.c: Likewise.
10900
10901 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
10902 does not specify a union tag. This is for compatibility with
10903 Solaris 9 yacc.
10904
10905 * src/parse-gram.y (add_param): 2nd arg is now char * not char
10906 const *, since it is now modified by stripping surrounding { }.
10907 (current_braced_code): Remove.
10908 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
10909 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
10910 trailing " {...}". Now of type <chars>.
10911 (grammar_declaration): Adjust to bundled tokens.
10912 (code_content): Remove; stripping is now done by add_param.
10913 (print_token_value): Print contents of bundled tokens.
10914 (token_name): New function.
10915
10916 * src/reader.h (braced_code, current_braced_code): Remove.
10917 (token_name): New decl.
10918
10919 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
10920 token_type, not braced_code code_kind. All uses changed.
10921 (SC_PRE_CODE): New state, for scanning after a keyword that
10922 has (or usually has) an immediately-following braced code.
10923 (token_type): New local var, to keep track of which token type
10924 to return when scanning braced code.
10925 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 10926 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
10927 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
10928 instead of returning a token type immediately.
10929 (<INITIAL>"{"): Set token type.
10930 (<SC_BRACED_CODE>"}"): Use it.
10931 (handle_action_dollar, handle_action_at): Now returns bool
10932 indicating success. Fail if ! current_rule; this prevents a core dump.
10933 (handle_symbol_code_dollar, handle_symbol_code_at):
10934 Remove; merge body into caller.
10935 (handle_dollar, handle_at): Complain in invalid contexts.
10936
10937 * NEWS, doc/bison.texinfo: Document the above.
10938 * NEWS: Fix years and program names in copyright notice.
10939
879ca4f8
PE
109402002-12-17 Paul Eggert <eggert@twinsun.com>
10941
10942 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
10943 Reporting, Table of Symbols): Omit mentions of %lex-param and
10944 %parse-param from the documentation for now.
10945
1c5fe69d
PE
109462002-12-15 Paul Eggert <eggert@twinsun.com>
10947
10948 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
10949 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
10950 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
10951 disagreed with the Bison documentation. Bug
10952 reported by Andrew Walrond.
d600ee67 10953
1c5fe69d
PE
10954 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
10955 as the caller now does that.
10956 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
10957 (YYEMPTY): Parenthesize right hand side, since others use it.
10958 (yyparse): Don't assume that our generated code is the only code
10959 that sets yychar.
10960
d1de5372
PE
109612002-12-13 Paul Eggert <eggert@twinsun.com>
10962
10963 Version 1.75d.
10964
10965 POSIX requires a "yacc" command.
10966 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
10967 (MOSTLYCLEANFILES): Add yacc.
10968 (yacc): New rule.
1c5fe69d 10969 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
10970 as an alias for bison y.
10971
10972 * po/LINGUAS: Add da.
d600ee67 10973
d1de5372
PE
10974 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
10975 problem with latest <getopt.h>.
10976 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
10977
10978 * doc/fdl.texi: Upgrade to 1.2.
10979 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
10980 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
10981 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
10982 gnulib.
10983 * config/install-sh: Sync with autotools.
10984
10985 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 10986 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
10987 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
10988 locations are requested.
10989 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
10990 locations are requested.
10991
d0f3fe23
PE
109922002-12-12 Paul Eggert <eggert@twinsun.com>
10993
10994 Remove unportable casts and storage allocation tricks.
10995 While we're at it, remove almost all casts, since they
10996 usually aren't needed and are a sign of trouble.
10997
10998 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
10999
11000 * src/derives.c (derives_compute): Do not subtract NTOKENS from
11001 the pointer DSET returned by malloc; this isn't portable.
11002 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
11003 Similarly for DERIVES.
11004 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
11005 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
11006 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
11007
11008 * src/derives.c (derives_compute): Do not bother invoking
11009 int_of_rule_number, since rule numbers are integers.
11010
11011 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
11012 rather than XMALLOC (char, N).
11013
11014 * src/files.c (filename_split): Rewrite to avoid cast.
11015
11016 * src/gram.h (symbol_number_as_item_number,
11017 item_number_as_symbol_number, rule_number_as_item_number,
11018 item_number_as_rule_number):
11019 Now inline functions rather than macros, to avoid casts.
11020 * src/state.h (state_number_as_int): Likewise.
11021 * src/tables.c (state_number_to_vector_number,
11022 symbol_number_to_vector_number): Likewise.
11023
11024 * src/gram.h (int_of_rule_number): Remove; no longer used.
11025
11026 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
11027 since the resulting storage is always stored into.
11028
11029 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
11030 where it's needed.
11031
11032 * src/muscle_tab.c (muscle_m4_output):
11033 Now inline. Return bool, not int.
11034 * src/state.c (state_compare): Likewise.
11035 * src/symtab.c (symbol_check_defined,
11036 symbol_check_alias_consistency, symbol_pack, symbol_translation,
11037 hash_compare_symbol, hash_symbol):
11038 Likewise.
11039 * src/uniqstr.c (uniqstr_print): Likewise.
11040 * src/muscle_tab.c (muscle_m4_output_processor):
11041 New function, to avoid casts.
11042 * src/state.c (state_comparator, stage_hasher): Likewise.
11043 * src/symtab.c (symbol_check_defined_processor,
11044 symbol_check_alias_consistency_processor, symbol_pack_processor,
11045 symbol_translation_processor, hash_symbol_comparator,
11046 hash_symbol_hasher): Likewise.
11047 * src/uniqstr.c (uniqstr_print_processor): Likewise.
11048 * src/muscle_tab.c (muscles_m4_output):
11049 Use new functions instead of casting old functions unportably.
11050 * src/state.c (state_hash_new): Likewise.
11051 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
11052 symbols_token_translations_init):
11053 Likewise.
11054 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
11055
11056 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
11057 var instead of casting to long, to avoid casts.
11058 (prepare_states): Use MALLOC rather than alloca, so that we don't
11059 have to worry about alloca.
11060 * src/state.c (state_hash_lookup): Likewise.
11061
11062 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
11063 local var instead of casting to unsigned char, to avoid casts.
11064
11065 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
11066 STATE_ALLOC): Remove.
11067 (transitions_new, errs_new, reductions_new, state_new): Use malloc
11068 rather than calloc, and use offsetof to avoid allocating slightly
11069 too much storage.
11070 (state_new): Initialize all members.
11071
11072 * src/state.c (state_hash): Use unsigned accumulator, not signed.
11073
11074 * src/symtab.c (symbol_free): Remove; unused.
11075 (symbol_get): Remove cast in lhs of assignment.
11076 (symbols_do): Now static. Accept generic arguments, not
11077 hashing-related ones.
11078
11079 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
11080 (symbol_processor): Remove.
11081 (symbols_do): Remove decl; now static.
11082
11083 * src/system.h (alloca): Remove; decl no longer needed.
11084 (<stddef.h>): Include, for offsetof.
11085 (<inttypes.>, <stdint.h>): Include if available.
11086 (uintptr_t): New type, if system lacks it.
11087 (CALLOC, MALLOC, REALLOC): New macros.
11088 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
11089 new macros.
11090
11091 * src/tables.c (table_size): Now int, to pacify GCC.
11092 (table_grow, table_ninf_remap): Use signed table size.
11093 (save_row): Don't bother initializing locals when not needed.
11094 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
11095 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
11096
11097 * src/vcg.h: Correct misspellings.
11098
11099 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
11100
11101
11102 * src/getargs.c (getargs): Don't assume EOF == -1.
11103
26b4a969
PE
111042002-12-09 Paul Eggert <eggert@twinsun.com>
11105
11106 Change identifier spellings to avoid collisions with names
11107 that are reserved by POSIX.
11108
11109 Don't use names ending in _t, since POSIX reserves them.
11110 For consistency, remove _e and _s endings -- they're weren't
11111 needed to remove ambiguity. All uses changed.
11112 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
11113 turn was just renamed from struniq_t.
11114 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
11115 which in turn was just renamed from struniq_processor_t.
11116 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
11117 in turn was renamed from hash_compare_struniq_t.
11118 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
11119 (state_list): Renamed from state_list_t.
11120 * src/assoc.h (assoc): Renamed from assoc_t.
11121 * src/conflicts.c (enum conflict_resolution): Renamed from
11122 enum conflict_resolution_e.
11123 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
11124 (rule_list): Renamed from rule_list_t.
11125 * src/getargs.h (enum trace): Renamed from enum trace_e.
11126 (enum report): Renamed from enum report_e.
11127 * src/gram.h (item_number): Renamed from item_number_t.
11128 (rule_number): Renamed from rule_number_t.
11129 (struct rule_s): Remove the "rule_s" part; not used.
11130 (rule): Renamed from rule_t.
11131 (rule_filter): Renamed from rule_filter_t.
11132 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
11133 (goto_list): Renamed from goto_list_t.
11134 * src/lalr.h (goto_number): Renamed from goto_number_t.
11135 * src/location.h (location): Renamed from location_t.
11136 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
11137 and moved here from:
11138 * src/muscle_tab.h (muscle_entry_t): here.
11139 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
11140 (rule_list): Renamed from rule_list_t.
11141 * src/print_graph.c (static_graph): Renamed from graph.
11142 * src/reader.h (braced_code): Renamed from braced_code_t.
11143 Remove brace_code_e tag.
11144 * src/relation.h (relation_node): Renamed from relation_node_t.
11145 (relation_nodes): Renamed from relation_nodes_t.
11146 (relation): Renamed from relation_t.
11147 * src/state.h (state_number): Renamed from state_number_t.
11148 (struct state): Renamed from struct state_s.
11149 (state): Renamed from state_t.
11150 (transitions): Renamed from transitions_t. Unused (and
11151 misspelled) transtion_s tag removed.
11152 (errs): Renamed from errs_t. Unused errs_s tag removed.
11153 (reductions): Renamed from reductions_t. Unused tag
11154 reductions_s removed.
11155 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
11156 (struct symbol_list): Renamed from struct symbol_list_s.
11157 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
11158 (struct symbol): Renamed from struct symbol_s.
11159 (symbol): Renamed from symbol_t.
11160 * src/tables.c (vector_number): Renamed from vector_number_t.
11161 (action_number): Renamed from action_t.
11162 * src/tables.h (base_number): Renamed from base_t.
11163 * src/vcg.h (enum color): Renamed from enum color_e.
11164 (enum textmode): Renamed from enum textmode_e.
11165 (enum shape): Renamed from enum shape_e.
11166 (struct colorentry): Renamed from struct colorentry_s.
11167 (struct classname): Renamed from struct classname_s.
11168 (struct infoname): Renamed from struct infoname_s.
11169 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
11170 (enum decision): Renamed from enum decision_e.
11171 (enum orientation): Renamed from enum orientation_e.
11172 (enum alignment): Renamed from enum alignment_e.
11173 (enum arrow_mode): Renamed from enum arrow_mode_e.
11174 (enum crossing_type): Renamed from enum crossing_type_e.
11175 (enum view): Renamed from enum view_e.
11176 (struct node): Renamed from struct node_s.
11177 (node): Renamed from node_t.
11178 (enum linestyle): Renamed from enum linestyle_e.
11179 (enum arrowstyle): Renamed from enum arrowstyle_e.
11180 (struct edge): Renamed from struct edge.
11181 (edge): Renamed from edge_t.
11182 (struct graph): Renamed from struct graph_s.
11183 (graph): Renamed from graph_t.
11184 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
11185 Rename value_t -> value.
11186 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
11187 value_t_as_yystype -> value_as_yystype.
11188
11189 Don't include <errno.h> in the mainstream code, since it
11190 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
11191 * lib/get-errno.c, lib/get-errno.h: New files.
11192 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
11193 get-errno.c.
11194 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
11195 * src/output.c (output_skeleton): Likewise.
11196 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
11197 instead of errno.
11198 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
11199 Likewise.
11200 (handle_action_dollar, handle_action_at): Likewise.
11201 * src/system.h: Do not include <errno.h>.
11202 (TAB_EXT): Renamed from EXT_TAB.
11203 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
11204
11205 Avoid str[a-z]*, since <string.h> reserves that name space.
11206 Change all instances of "struniq" in names to "uniqstr", and
11207 likewise for "STRUNIQ" and "UNIQSTR".
11208 * src/uniqstr.c: Renamed from src/struniq.c.
11209 * src/uniqstr.h: Renamed from src/struniq.h.
11210 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
11211 * src/files.c (strsuffix): Remove; unused.
11212 (concat2): Renamed from stringappend. Now static.
11213 * src/files.h (strsuffix, stringappend): Remove; unused.
11214 * src/parse-gram.y (<chars>): Renamed from <string>.
11215 (<uniqstr>): Renamed from <struniq>.
11216 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
11217 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
11218 (struct graph_s.expand): Renamed from struct graph_s.stretch.
11219 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
11220 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
11221 (N_EXPAND): Renamed from N_STRETCH.
11222
11223 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
11224 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
11225 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
11226 Remove; unused.
11227 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
11228 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
11229 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
11230 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
11231 (BASE_MAXIMUM): Renamed from BASE_MAX.
11232 (BASE_MINIMUM): Renamed from BASE_MIN.
11233 (ACTION_MAX): Remove; unused.
11234 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
11235 Unnecessary casts removed from above defines.
11236
11237
11238 Fix misspelling in names.
11239 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
11240 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
11241 G_NODE_ALIGNEMENT.
11242
11243
11244 * lib/timevar.c (timevar_report): Renamed from time_report,
11245 for consistency with other names.
11246 * lib/timevar.h (timevar_report): New decl.
11247 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
11248
11249
11250 Sort include-file uses.
11251
11252 Reorder all include files under src to be in the order "system.h".
11253 then the ../lib include files in angle brackets (alphabetized),
11254 then the . include files in double-quotes (alphabetized). Fix
11255 dependency breakages encountered in this process, as follows:
11256 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
11257 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
11258 * src/state.h: Include "symtab.h".
11259
996b1c7e
PE
112602002-12-08 Paul Eggert <eggert@twinsun.com>
11261
11262 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
11263 since this causes problems when __file__ contains character
11264 sequences like "@" that are treated specially by src/scan-skel.l.
11265 Instead, just use the file's basename. This fixes the bug
11266 reported by Martin Mokrejs in
161a71f3 11267 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 11268
e19c4e5d
PE
112692002-12-06 Paul Eggert <eggert@twinsun.com>
11270
11271 Add support for rules that do not have trailing semicolons, as
11272 POSIX requires. Improve the quality of locations in Bison
11273 diagnostics.
26b4a969 11274
e19c4e5d
PE
11275 * src/location.c: Include <quotearg.h>.
11276 (empty_location): Now const.
11277 (location_print): New function. Follow the recommendation of the
11278 GNU Coding Standards for locations that span file boundaries.
11279 * src/location.h: Do not include <quotearg.h>; no longer needed.
11280 (boundary): New type.
11281 (location_t): Use it. This allows locations to span file boundaries.
11282 All member uses changed: file -> start.file or end.file (as needed),
11283 first_line -> start.line, first_column -> start.column,
11284 last_line -> end.line, last_column -> end.column.
11285 (equal_boundaries): New function.
11286 (LOCATION_RESET, LOCATION_STEP): Remove.
11287 (LOCATION_PRINT): Remove. All callers changed to use location_print.
11288 (empty_location): Now const.
11289 (location_print): New decl.
11290 * src/parse-gram.y (lloc_default): New function, which handles
11291 empty locations more accurately.
11292 (YYLLOC_DEFAULT): Use it.
11293 (%token COLON): Remove.
11294 (%token ID_COLON): New token.
26b4a969 11295 (rules): Use it.
e19c4e5d
PE
11296 (declarations, rules): Remove trailing semicolon.
11297 (declaration, rules_or_grammar_declaration):
11298 Allow empty (";") declaration.
11299 (symbol_def): Remove empty actions; no longer needed.
11300 (rules_or_grammar_declaration): Remove trailing semicolon.
11301 (semi_colon.opt): Remove.
11302 * src/reader.h: Include location.h.
11303 (scanner_cursor): New decl.
11304 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
11305 rolling our own.
11306 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
11307 of *loc.
11308 (STEP): Remove. No longer needed, now that adjust_location does
11309 the work. All uses removed.
11310 (scanner_cursor): New var.
11311 (adjust_location): Renamed from extend_location. It now sets
11312 *loc and adjusts the scanner cursor. All uses changed.
11313 Don't bother testing for CR.
11314 (handle_syncline): Remove location arg; now updates scanner cursor.
11315 All callers changed.
11316 (unexpected_end_of_file): Now accepts start boundary of token or
11317 comment, not location. All callers changed. Update scanner cursor,
11318 not the location.
11319 (SC_AFTER_IDENTIFIER): New state.
11320 (context_state): Renamed from c_context. All uses changed.
11321 (id_loc, code_start, token_start): New local vars.
11322 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
11323 processing of Yacc white space and equivalents here.
11324 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
11325 instead of returning ID immediately, since we need to search for
11326 a subsequent colon.
11327 (<INITIAL>"'", "\""): Save token_start.
11328 (<INITIAL>"%{", "{", "%%"): Save code_start.
11329 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
11330 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
11331 BEGIN context_state at end, not INITIAL.
11332 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
11333 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
11334 Return correct token start.
11335 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
11336 the start of a character, string or multiline comment is found.
11337 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
11338 Reduction): Adjust reported locations to match the more-precise
11339 results now expected.
11340 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
11341 * tests/reduce.at (Useless Rules, Reduced Automaton,
11342 Underivable Rules): Likewise.
11343 * tests/regression.at (Invalid inputs): No longer `expecting ";"
11344 or "|"' now that so many other tokens are allowed by the new grammar.
11345
11346 * src/complain.h (current_file): Remove duplicate decl;
11347 current_file is now owned by files.h.
11348 * src/complain.c, src/scan-gram.l: Include files.h.
11349
113502002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 11351
e19c4e5d
PE
11352 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
11353 promotes to int; it might be unsigned int.
11354 * data/yacc.c (yy_reduce_print): Likewise.
11355
11356 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
11357 be #defined in the prologue, not in the Bison declarations.
11358 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 11359
b64755e3
PE
113602002-12-02 Paul Eggert <eggert@twinsun.com>
11361
11362 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
11363 * lib/strtoul.c: New file, from gnulib.
11364 This fixes a porting bug reported by Peter Klein in
161a71f3 11365 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 11366
6e746484
PE
113672002-11-30 Paul Eggert <eggert@twinsun.com>
11368
b64755e3
PE
11369 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
11370 and put only a forward declaration in the prologue. This is for
11371 consistency with the other scanner helper functions.
11372
6ba55592
PE
11373 Type clashes now generate warnings, not errors, since it
11374 appears that POSIX may allow some grammars with type clashes.
11375 * src/reader.c (grammar_current_rule_check): Warn about
11376 type clashes instead of complaining.
11377 * tests/input.at (Type Clashes): Expect warnings, not complaints.
11378
6e746484
PE
11379 Add Yacc library, since POSIX requires it.
11380 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
11381 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
11382 * lib/main.c, lib/yyerror.c: New files.
11383
11384 gram_error can be static; it need not be extern.
11385 * src/reader.h (gram_error): Remove decl.
11386 * src/parse-gram.y (gram_error): Now static. Add static decl.
11387 (print_token_value): Omit parameter names from forward decl,
11388 for consistency.
11389
88510f9c
PE
113902002-11-29 Paul Eggert <eggert@twinsun.com>
11391
6e746484
PE
11392 * doc/bison.texinfo: Emphasize that yylex and yyerror must
11393 be declared before being used. E.g., one should typically
11394 declare them in the prologue. Use GNU coding style in examples.
11395 Put "const" consistently after the type it modifies. Mention
11396 that C99 supports "inline". Mention that yyerror traditionally
11397 returns "int".
11398
88510f9c
PE
11399 %parse-param and %lex-param now take just one argument, the
11400 declaration; the argument name is deduced from the declaration.
11401
11402 * doc/bison.texinfo (Parser Function, Pure Calling, Error
11403 Reporting, Table of Symbols): Document this.
11404 * src/parse-gram.y (add_param): New function.
11405 (COMMA): Remove.
11406 (declaration): Implement new rule for %parse-param and %lex-param.
11407 * src/scan-gram.l: "," now elicits a warning, rather than being
11408 a token; this is more compatible with byacc.
11409 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
11410
bb92250c
PE
114112002-11-27 Paul Eggert <eggert@twinsun.com>
11412
11413 Rename identifiers to avoid real and potential collisions.
11414
11415 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
11416 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 11417 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
11418 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11419 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
11420 * src/parse-gram.y (print_token_value): Renamed from yyprint.
11421 All uses changed.
11422 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
11423 The name "yycontrol" violates the name space rules, and this stuff
11424 wasn't being used anyway.
11425 (input): Remove action; this stuff wasn't being used.
11426 (gram_error): Rename local variable yylloc -> loc.
11427 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
11428 (YY_DECL): Don't use "yy" at start of local variables.
11429 All uses changed, e.g., yylloc -> loc.
11430 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
11431 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
11432 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
11433 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
11434
11435 * src/parse-gram.y (gram_error): loc is now const *.
11436 * src/reader.h (gram_error): Likewise.
11437
3af4feb2
PE
114382002-11-24 Paul Eggert <eggert@twinsun.com>
11439
11440 Version 1.75c.
11441
11442 * tests/actions.at (Actions after errors): Use an output format
11443 more similar to that of the Printers and Destructors test.
11444 Test the position of the ';' token too.
11445 (Printers and Destructors): Likewise.
11446 (Printers and Destructors: %glr-parser): Remove for now, to avoid
11447 unnecessarily alarming people when the test fails.
11448
11449 * data/yacc.c (yyerrlab1): Move this label down, so that the
11450 parser does not discard the lookahead token if the user code
11451 invokes YYERROR. This change is required for POSIX conformance.
11452
11453 * lib/error.c: Sync with gnulib.
11454
114552002-11-22 Paul Eggert <eggert@twinsun.com>
11456
11457 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
11458 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
11459 * lib/xmalloc.c: Likewise.
26b4a969 11460
58004308
PE
114612002-11-20 Paul Eggert <eggert@twinsun.com>
11462
11463 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
11464
114652002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 11466
58004308
PE
11467 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
11468 should use `if (! x) abort ();' rather than `assert (x);', and
11469 anyway it's one less thing to worry about configuring.
11470
11471 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
11472 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
11473 and replace all instances of assert with abort.
11474 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11475 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
11476
11477 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
11478 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
11479 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
11480 hash_find_entry, hash_rehash, hash_insert): Likewise.
11481 * src/conflicts.c (resolve_sr_conflict): Likewise.
11482 * src/lalr.c (set_goto_map, map_goto): Likewise.
11483 * src/nullable.c (nullable_compute): Likewise.
11484 * src/output.c (prepare_rules, token_definitions_output): Likewise.
11485 * src/reader.c (packgram, reader): Likewise.
11486 * src/state.c (state_new, state_free, state_transitions_set,
11487 state_reduction_find): Likewise.
11488 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
11489 symbol_pack): Likewise.
11490 * src/tables.c (conflict_row, pack_vector): Likewise.
11491 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11492 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11493 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
11494 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
11495
11496 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
11497 (ARGMATCH_CONSTRAINT): New macro.
11498 (ARGMATCH_ASSERT): Use it.
11499
11500 * src/system.h (verify): New macro.
11501 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
11502 rather than assert.
11503 * src/tables.c (tables_generate): Likewise.
11504
11505 * src/struniq.c (struniq_assert): Now returns void, and aborts
11506 if the assertion is false.
11507 (struniq_assert_p): Remove.
11508 * src/struniq.h: Likewise.
11509
76ae8198
PE
115102002-11-18 Paul Eggert <eggert@twinsun.com>
11511
11512 * data/glr.c (yygetLRActions): Replace `yyindex' with
11513 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
11514 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 11515 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 11516
d3c4e709
AD
115172002-11-18 Akim Demaille <akim@epita.fr>
11518
11519 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
11520 space.
11521 From Tim Van Holder.
11522
8d8a7238
PE
115232002-11-17 Paul Eggert <eggert@twinsun.com>
11524
11525 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
11526 to "SyntaxError" for consistency with my 2002-11-15 change.
11527
11528 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
11529 not define to {}, since this breaks the common use of `YYDPRINTF
11530 ((...));' if a single statement is desired (e.g. before `else').
11531 Work around GCC warnings by surrounding corresponding calls with
11532 {} if needed.
11533 (yyhasResolvedValue): Remove unused function.
11534 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
11535 loop body.
11536 (yyreportSyntaxError): Renamed from yyreportParseError.
11537 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
11538 All uses changed.
11539 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
11540 extern when possible. Remove unused initializations.
11541
b0937b22
AD
115422002-11-16 Akim Demaille <akim@epita.fr>
11543
11544 Augment the similarity between GLR and LALR traces.
11545
11546 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
11547 (YY_REDUCE_PRINT): New.
11548 (yyparse): Use them.
11549 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
11550 YYDPRINT here.
11551 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
11552 state reached after the reduction/recovery, since...
11553 (yyparse, yyprocessOneStack): Report the state we are entering in.
11554
c5e3e510
AD
115552002-11-16 Akim Demaille <akim@epita.fr>
11556
11557 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
11558 Add support for --trace=skeleton.
11559 * src/scan-skel.l: %option debug.
11560 Scan strings of non-@ or \n instead of character by character.
11561 (scan_skel): Handle trace_skeleton.
11562 (QPUTS): New.
11563 (@output_parser_name@, @output_header_name@): ``Restore'' their
11564 support (used to be M4 macros).
11565 * data/yacc.c: Quote larger chunks, a la glr.c.
11566 * data/lalr1.cc: Likewise.
11567 The header guards are no longer available, so use some other
11568 string than `YYLSP_NEEDED'.
11569
4c6cc1db
AD
115702002-11-16 Akim Demaille <akim@epita.fr>
11571
11572 Make the ``Printers and Destructors'' test more verbose, taking
11573 `yacc.c''s behavior as (possibly wrong) reference.
11574
11575 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
11576 instead of fprint on stdout.
11577 Set and report the last_line of the symbols.
11578 Consistently display values and locations.
11579
6d9e8019
PE
115802002-11-16 Paul Eggert <eggert@twinsun.com>
11581
11582 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
11583
6e649e65
PE
115842002-11-15 Paul Eggert <eggert@twinsun.com>
11585
b25d88f6
PE
11586 * tests/actions.at (Actions after errors): New test case.
11587
6e649e65
PE
11588 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
11589 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
11590 tests/action.at, tests/calc.at, tests/conflicts.at,
11591 tests/cxx-type.at, tests/regression.at:
11592 "parse error" -> "syntax error" for POSIX compatibility.
11593 "parsing stack overflow..." -> "parser stack overflow" so
11594 that code matches Bison documentation.
11595
0f39aab9
AD
115962002-11-15 Akim Demaille <akim@epita.fr>
11597
11598 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
11599 take two BRACED_CODE, not two string_content.
11600 Free the scanner's obstack when we are done.
11601 (code_content): New.
11602 * tests/calc.at: Adjust.
11603 * doc/bison.texinfo: Adjust.
11604 Also, make sure to include the `,' for these declarations.
11605
761c1926
AD
116062002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
11607
11608 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
11609 definition; avoids potential autoreconf problems.
11610
b0f98b10
AD
116112002-11-15 Akim Demaille <akim@epita.fr>
11612
11613 Always check the value returned by yyparse.
11614
11615 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
11616 returned by yyparse.
11617 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
11618 Adjust calls.
11619 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
11620 returned by yyparse.
11621
970785f1
PH
116222002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11623
11624 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
11625 on input.at test.
11626
8fcc7db1
PE
116272002-11-14 Paul Eggert <eggert@twinsun.com>
11628
7ec1b48e
PE
11629 * src/output.c (output_skeleton): Call xfopen instead of
11630 duplicating xfopen's body.
11631
cfff7583 11632 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 11633 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 11634
8fcc7db1
PE
11635 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
11636 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
11637 Group compiler. Instead, use "$CC -E bar.c". Include the .h
11638 file twice in the grammar, as an extra check.
11639
11640 * tests/input.at (Torturing the Scanner): Surround the
11641 backslash-newline tests with "#if 0", to make it less likely that
11642 we'll run into compiler bugs. Bring back solitary \ inside
11643 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 11644 test backslash-newline in C character constant.
8fcc7db1 11645
4e8d992c
AD
116462002-11-14 Akim Demaille <akim@epita.fr>
11647
11648 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
11649 status of the compiler.
f32b346d 11650 Calling `exit 1' is no longer needed.
4e8d992c
AD
11651 Reported by Nelson H. F. Beebe.
11652
9501dc6e
AD
116532002-11-14 Akim Demaille <akim@epita.fr>
11654
11655 * tests/atlocal.in (CPPFLAGS): We have config.h.
11656 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
11657 New.
11658 * tests/actions.at, tests/calc.at, tests/conflicts.at,
11659 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
11660 * tests/regression.at, tests/torture.at: Use them for all the
11661 grammars that are to be compiled.
11662 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
11663 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
11664 * doc/bison.texinfo (GLR Parsers): Document `inline'.
11665
18b519c0
AD
116662002-11-14 Akim Demaille <akim@epita.fr>
11667
11668 * doc/bison.texinfo: Various formatting changes (alignments in
11669 samples, additional @group/@end group, GCS in samples.
11670 Use @deffn instead of simple @table to define the directives,
11671 macros, variables etc.
11672
9a86cdb9
PE
116732002-11-13 Paul Eggert <eggert@twinsun.com>
11674
daa33def 11675 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 11676 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 11677
daa33def 11678 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 11679 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
11680 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
11681 * tests/headers.at (export YYLTYPE): Likewise.
11682
11683 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 11684 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 11685
9a86cdb9
PE
11686 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
11687 comments, since they're not portable. Use GNU coding style.
11688
9c1e26bd
AD
116892002-11-13 Akim Demaille <akim@epita.fr>
11690
11691 * data/yacc.c: Leave bigger chunks of quoted text.
11692 (YYDSYMPRINTF): New.
11693 Use it to report symbol activities.
11694 * data/glr.c (YYDSYMPRINTF): New.
11695 Use it.
11696
87f721cc
PE
116972002-11-12 Paul Eggert <eggert@twinsun.com>
11698
11699 Version 1.75b.
11700
11701 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
11702 (yyglrReduce): Return yyok, not 0.
11703 This should avoid the enumerated-type warnings reported
464c6927 11704 by Nelson H. F. Beebe in
161a71f3 11705 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
11706
11707 * lib/bbitset.h (BITSET_INLINE): Remove.
11708 * lib/bitset.h [! BITSET_INLINE]: Remove.
11709 (bitset_set, bitset_reset, bitset_test): Rename local vars
11710 to avoid shadowing warnings by GCC.
11711
11712 * data/glr.c (inline): Remove #define. It's the user's
11713 responsibility to #define it away, just like 'const'.
464c6927 11714 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 11715 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 11716
87f721cc
PE
11717 * Makefile.maint (po-check): Scan .l and .y files instead of the
11718 .c and the .h files that they generate. This fixes the bug
11719 reported by Tim Van Holder in:
161a71f3 11720 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
11721 Look for N_ as well as for _. Try to avoid matching #define for
11722 N_ and _.
11723 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
11724 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
11725 * src/scan-gram.l: Revamp regular expressions so that " and '
11726 do not confuse xgettext.
11727
11728 * src/struniq.h (struniq_new): Do not declare the return type
11729 to be 'const'; this violates the C standard.
11730 * src/struniq.c (struniq_new): Likewise.
11731
be14ade5
AD
117322002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
11733
11734 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
11735 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
11736 linker.
11737
05291fbc
AD
117382002-11-12 Akim Demaille <akim@epita.fr>
11739
11740 * Makefile.maint: Sync with Autoconf:
11741 (local_updates): New.
11742
1f5fd52e
AD
117432002-11-12 Akim Demaille <akim@epita.fr>
11744
11745 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
11746
283f1e64
AD
117472002-11-12 Akim Demaille <akim@epita.fr>
11748
11749 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
11750 locations.
11751
886b69d1
AD
117522002-11-12 Akim Demaille <akim@epita.fr>
11753
11754 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
11755 not yyvalue.
11756
3df37415
AD
117572002-11-12 Akim Demaille <akim@epita.fr>
11758
11759 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
11760 Use it to test the GLR parser.
11761
7bd6c77e
AD
117622002-11-12 Akim Demaille <akim@epita.fr>
11763
11764 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
11765 defines it.
11766 * data/glr.c (yystos): New.
11767 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
11768 (YYDSYMPRINT): New.
11769 (yyval): Don't define it, it is handled via M4.
11770 (yyrecoverParseError): Free verbosely the discarded symbols.
11771 * data/yacc.c (yysymprint): Remove, rather...
11772 (b4_yysymprint_generate): invoke.
11773 * data/c.m4 (b4_yysymprint_generate): New.
11774 Accept pointers as arguments, as opposed to the version from
11775 yacc.c.
11776 (b4_yydestruct_generate): Likewise.
11777 * tests/cations.at (Printers and Destructors): Use Bison directives
11778 instead of CPP macros.
11779 Don't rely on internal details.
11780
b0400cc6
AD
117812002-11-12 Akim Demaille <akim@epita.fr>
11782
11783 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
11784 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
11785 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
11786 it against YYEMPTY and so forth), work on yytoken (i.e., set
11787 it to YYEMPTY etc.).
11788 (yydestruct): Replace with a b4_yydestruct_generate invocation.
11789 (b4_symbol_actions): Remove.
11790 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
11791 for 0, end-of-input.
11792
72f889cc
AD
117932002-11-12 Akim Demaille <akim@epita.fr>
11794
11795 * doc/bison.texinfo (Destructor Decl): New.
11796
b1ae9233
AD
117972002-11-12 Akim Demaille <akim@epita.fr>
11798
11799 * src/tables.c (tables_generate): Use free for pointers that
11800 cannot be NULL, not XFREE.
11801 (pack_vector): Use assert, not fatal, for bound violations.
11802 * src/state.c (state_new): Likewise.
11803 * src/reader.c (reader): Likewise.
11804 * src/lalr.c (set_goto_map): Likewise.
72f889cc 11805 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
11806 the file name.
11807
7ec2d4cd
AD
118082002-11-12 Akim Demaille <akim@epita.fr>
11809
11810 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
11811 Restore.
11812 * src/scan-gram.l (last_string): Is global to the file, not to
11813 yylex.
11814 * src/parse-gram.y (input): Don't append the epilogue here,
11815 (epilogue.opt): do it here, and free the scanner's obstack.
11816 * src/reader.c (epilogue_set): Rename as...
11817 (epilogue_augment): this.
11818 * data/c.m4 (b4_epilogue): Defaults to empty.
11819
573a6cd3
AD
118202002-11-12 Akim Demaille <akim@epita.fr>
11821
11822 * src/getargs.c (long_options): Remove duplicates.
11823 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
11824 Remove.
11825 * doc/bison.rnh: Remove.
11826 * doc/bison.texinfo (VMS Invocation): Remove.
11827
95612cfa
AD
118282002-11-12 Akim Demaille <akim@epita.fr>
11829
11830 * src/struniq.h, src/struniq.c (struniq_t): Is const.
11831 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
11832
11833 Use struniq for symbols.
11834
11835 * src/symtab.h (symbol_t): The tag member is a struniq.
11836 (symbol_type_set): Adjust.
11837 * src/symtab.c (symbol_new): Takes a struniq.
11838 (symbol_free): Don't free the tag member.
11839 (hash_compare_symbol_t, hash_symbol_t): Rename as...
11840 (hash_compare_symbol, hash_symbol): these.
11841 Use the fact that tags as struniqs.
11842 (symbol_get): Use struniq_new.
11843 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
11844 Returns a strniq.
11845 * src/reader.h (merger_list, grammar_currentmerge_set): The name
11846 and type members are struniqs.
11847 * src/reader.c (get_merge_function)
11848 (grammar_current_rule_merge_set): Adjust.
11849 (TYPE, current_type): Are struniq.
11850
11851 Use struniq for file names.
11852
11853 * src/files.h, src/files.c (infile): Split into...
11854 (grammar_file, current_file): these.
11855 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
11856 * src/reduce.c (reduce_print): Likewise.
11857 * src/getargs.c (getargs): Likewise.
11858 * src/complain.h, src/complain.c: Likewise.
11859 * src/main.c (main): Call struniqs_new early enough to use it for
11860 file names.
11861 Don't free the input file name.
11862
3e6656f9
AD
118632002-11-12 Akim Demaille <akim@epita.fr>
11864
11865 * src/symtab.c (symbol_free): Remove dead deactivated code:
11866 type_name are properly removed.
11867 Don't use XFREE to free items that cannot be NULL.
11868 * src/struniq.h, src/struniq.c: New.
11869 * src/main.c (main): Initialize/free struniqs.
11870 * src/parse-gram.y (%union): Add astruniq member.
11871 (yyprint): Adjust.
11872 * src/scan-gram.l (<{tag}>): Return a struniq.
11873 Free the obstack bit that used to store it.
11874 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
11875
7672019c
PE
118762002-11-11 Paul Eggert <eggert@twinsun.com>
11877
11878 Revamp to fix many (but not all) of the C- and M4-related quoting
11879 problems. Among other things, this fixes the Bison bug reported
11880 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 11881 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
11882
11883 Use new @ escapes consistently. Represent brackets with @{ and @}
11884 rather than @<:@ and @:>@, since this works a bit better with dumb
11885 editors like vi. Represent @ with @@, since @ is now consistently
11886 an escape. Use @oline@ and @ofile@ rather than __oline__ and
11887 __ofile__, to avoid unexpected expansions. Similarly, use @output
11888 rather than #output.
11889
11890 * data/c.m4 (b4_copyright): Omit file name from comment, since
11891 the file name could contain "*/".
11892 (b4_synclines_flag): Don't quote the 2nd argument; it should already
11893 be quoted. All uses changed.
11894
11895 * data/glr.c: Use new @ escapes consistently.
11896 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
11897 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
11898 Remove, since they couldn't handle arbitrary characters in file
11899 names.
11900 * data/lalr1.cc: Likewise.
11901 * data/yacc.c: Likewise.
11902
11903 * src/files.c (output_infix): Remove; all uses removed.
11904 * src/files.h: Likewise.
11905
11906 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
11907 mishandled funny characters in file names, and anyway it isn't
11908 needed any more.
11909 * data/yacc.c: Likewise.
11910 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
11911
11912 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
11913 * data/yacc.c: Likewise.
11914
11915 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
11916 strings now.
11917 (muscle_init): Quote filename as a C string.
11918 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
11919 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
11920 * src/output.c (escaped_file_name_output): New function.
11921 (prepare_symbols): Quote tokens for M4.
11922 (prepare): Don't insert output_infix, output_prefix,
11923 output_parser_name, output_header_name; this is now down by scan-skel.
11924 Insert skeleton as a C string.
11925
11926 * src/output.c (user_actions_output, symbol_destructors_output,
11927 symbol_printers_output): Quote filenames for C and M4.
11928 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11929
11930 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
11931 escapes other than \\ and \'; this simplifies the code.
11932 (<SC_STRING>): Likewise, for \\ and \".
11933 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
11934 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
11935 Use new escapes @{ and @} for [ and ].
11936
11937 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
11938 them with auto vars.
11939 Switch to new escape scheme, where @ is the escape character uniformly.
11940 Abort if a stray escape character is found. Avoid unbounded input
11941 buffer when parsing non-escaped text.
11942
11943 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
11944 __oline__, #output, $@, and @{ do not have unintended meanings.
11945
acea4f3b
PE
119462002-11-09 Paul Eggert <eggert@twinsun.com>
11947
11948 Fix the test failure due to GCC warnings described in
161a71f3 11949 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
11950 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
11951 evaluate to 0 if it's impossible for NINF to be in the respective
11952 table.
11953 (yygetLRActions, yyrecoverParseError): Use them.
11954
11955 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
11956 counted in the token inserted at end of file. Now takes
11957 location_t *, not location_t, so that the location can be
11958 adjusted. All uses changed.
11959
11960 * tests/regression.at (Invalid inputs): Adjust wording in
11961 diagnostic to match the new behavior.
11962
11963 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
11964 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
11965 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
11966 abort ();'. This reduces the runtime of the "Many lookaheads"
11967 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
11968 GCC 3.2.
11969
20ef1ad5
PE
119702002-11-07 Paul Eggert <eggert@twinsun.com>
11971
11972 * src/parse-gram.y (CHARACTER): Remove unused token.
11973 All uses removed.
11974
11975 * src/scan-gram.l: Remove stack option. We no longer use the
11976 stack, since the stack was never deeper than 1; instead, use the
11977 new auto var c_context to record the stacked value.
11978
11979 Remove nounput option. At an unexpected end of file, we now unput
11980 the minimal input necessary to end cleanly; this simplifies the
11981 code.
11982
11983 Avoid unbounded token sizes where this is easy.
11984
11985 (unexpected_end_of_file): New function.
11986 Use it to systematize the error message on unexpected EOF.
11987 (last-string): Now auto, not static.
11988 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
11989 (scanner_last_string_free): Remove; not used.
11990 (percent_percent_count): Move decl to just before use.
11991 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
11992 not the (never otherwised-used) CHARACTER.
11993
93724f13
AD
119942002-11-07 Akim Demaille <akim@epita.fr>
11995
11996 Let yyerror always receive the msg as last argument, so that
11997 yyerror can be variadic.
11998
11999 * data/yacc.c (b4_yyerror_args): New.
12000 Use it when calling yyerror.
12001 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
12002 Use it when calling yyerror.
12003 * doc/bison.texinfo (Error Reporting): Adjust.
12004 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
12005 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
12006
6e40b4eb
AD
120072002-11-06 Akim Demaille <akim@epita.fr>
12008
12009 #line should have quoted strings.
12010 Ideally, this should be done by m4_quotearg.
12011
12012 * src/scan-skel.l: Include quotearg.h.
12013 Quote __ofile__.
12014 * src/output.c (symbol_printers_output)
12015 (symbol_destructors_output): Quote the file name.
12016
2dfbfc12
AD
120172002-11-06 Akim Demaille <akim@epita.fr>
12018
12019 * tests/regression.at (Invalid inputs): Adjust to the recent
12020 messages.
12021
437c2d80
AD
120222002-11-06 Akim Demaille <akim@epita.fr>
12023
12024 Restore --no-lines.
12025 Reported by Jim Kent.
12026
12027 * data/c.m4 (b4_syncline): New.
12028 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
12029 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
12030 * src/output.c (user_actions_output): Likewise.
12031 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 12032 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 12033
900c5db5
AD
120342002-11-06 Akim Demaille <akim@epita.fr>
12035
12036 * src/main.c (main): Free `infile'.
12037 * src/scan-gram.l (handle_syncline): New.
12038 Recognize `#line'.
12039 * src/output.c (user_actions_output, symbol_destructors_output)
12040 (symbol_printers_output): Use the location's file name, not
12041 infile.
12042 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12043
e183b123 120442002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 12045
e183b123 12046 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 12047 either has GLR conflict entries.
e183b123 12048
193eb6b7
PE
120492002-11-05 Paul Eggert <eggert@twinsun.com>
12050
e183b123
PE
12051 * src/scan-gram.l: Use more accurate diagnostics, e.g.
12052 "integer out of range" rather than "invalid value".
12053 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
12054 accordingly.
12055
193eb6b7
PE
12056 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
12057 Also, remove one static variable in the scanner.
12058
12059 * src/scan-gram.l (braces_level): Now auto, not static.
12060 Initialize to zero if the compiler is being picky.
12061 (INITIAL): Clear braces_level instead of incrementing it.
12062 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
12063 as POSIX 1003.1-2001 requires.
12064 * src/system.h (IF_LINT): New macro, taken from coreutils.
12065 * configure.ac: Define "lint" if --enable-gcc-warnings.
12066
29c01725
AD
120672002-11-05 Akim Demaille <akim@epita.fr>
12068
12069 * src/scan-gram.l: When it starts with `%', complain about the
12070 whole directive, not just that `invalid character: %'.
12071
8aeac3ca
AD
120722002-11-04 Akim Demaille <akim@epita.fr>
12073
12074 * Makefile.maint: Update from Autoconf.
12075 (update, cvs-update, po-update, do-po-update): New.
12076
793a58bb
AD
120772002-11-04 Akim Demaille <akim@epita.fr>
12078
12079 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
12080 and yyerror.
12081 Have yyerror `use' its arguments.
12082 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
12083 returns true when location & yacc & pure & parse-param.
12084 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
12085
c4d720cd
AD
120862002-11-04 Akim Demaille <akim@epita.fr>
12087
12088 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
12089 clashes.
12090 * src/scan-gram.l: Use [\'] instead of ['] to pacify
12091 font-lock-mode.
12092 Use complain_at.
12093 Use quote, not quote_n since LOCATION_PRINT no longer uses the
12094 slot 0.
12095
613a0dc5
PE
120962002-11-03 Paul Eggert <eggert@twinsun.com>
12097
12098 * src/reader.c (get_merge_function, grammar_current_rule_check):
12099 Use consistent diagnostics for reporting type name clashes.
12100 Quote the types with <>, for consistency with Yacc.
12101 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
12102
2a8d363a
AD
121032002-11-03 Akim Demaille <akim@epita.fr>
12104
12105 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
12106 New.
12107 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
12108 (b4_parse_param): Remove.
12109 Use b4_identification.
12110 Propagate b4_pure_args where needed to pass them to yyerror.
12111 * data/glr.m4 (b4_parse_param): Remove.
12112 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
12113 (b4_lpure_formals): New.
12114 Use b4_identification.
12115 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
12116 b4_user_formals and b4_user_args.
12117 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
12118 (yyreportAmbiguity): When using a pure parser, also need
12119 the location, and the parse-params.
12120 Adjust callers.
12121 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
12122 When using a pure parser, also need the parse-params.
12123 Adjust callers.
12124 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
12125 (%pure-parser + %parse-param) LALR and GLR parsers.
12126 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
12127 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
12128 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
12129 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
12130 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
12131 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
12132 * doc/bison.texinfo: Untabify the whole file.
12133 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
12134 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
12135 (Error Reporting): Adjust to these new directives.
12136 Document %error-verbose, deprecate YYERROR_VERBOSE.
12137
9e32add8
AD
121382002-11-03 Akim Demaille <akim@epita.fr>
12139
12140 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
12141 AT_CHECK_CALC_GLR invocations to use % directives, instead of
12142 command line options.
12143 * tests/cxx-type.at: Formatting changes.
12144
b02d90a5
PE
121452002-11-03 Paul Eggert <eggert@twinsun.com>
12146
12147 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
12148 to count columns correctly, and to check for invalid inputs.
9e32add8 12149
b02d90a5
PE
12150 Use mbsnwidth to count columns correctly. Account for tabs, too.
12151 Include mbswidth.h.
12152 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
12153 (extend_location): New function.
12154 (YY_LINES): Remove.
12155
12156 Handle CRLF in C code rather than in Lex code.
12157 (YY_INPUT): New macro.
12158 (no_cr_read): New function.
12159
12160 Scan UCNs, even though we don't fully handle them yet.
12161 (convert_ucn_to_byte): New function.
12162
12163 Handle backslash-newline correctly in C code.
12164 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
12165 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
12166 all uses changed.
12167 (tag, splice): New EREs. Do not allow NUL or newline in tags.
12168 Use {splice} wherever C allows backslash-newline.
12169 YY_STEP after space, newline, vertical-tab.
12170 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 12171
b02d90a5
PE
12172 (letter, id): Don't assume ASCII; e.g., spell out a-z.
12173
12174 ({int}, handle_action_dollar, handle_action_at): Check for integer
12175 overflow.
9e32add8 12176
b02d90a5
PE
12177 (YY_STEP): Omit trailing semicolon, so that it's more like C.
12178
12179 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
12180 as well as \000. Check for UCHAR_MAX, not 255.
12181 Allow \x with an arbitrary positive number of digits, as in C.
12182 Check for overflow here.
12183 Allow \? and UCNs, for compatibility with C.
12184
12185 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
12186 with quote slot used by complain_at.
12187
12188 * tests/input.at: Add tests for backslash-newline, m4 quotes
12189 in symbols, long literals, and funny escapes in strings.
12190
12191 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
12192 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
12193 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
12194 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
12195 * m4/mbswidth.m4: New file, from GNU coreutils.
12196
12197 * doc/bison.texinfo (Grammar Outline): Document // comments.
12198 (Symbols): Document that trigraphs have no special meaning in Bison,
12199 nor is backslash-newline allowed.
12200 (Actions): Document that trigraphs have no special meaning.
12201
12202 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
12203 no longer used.
12204
122052002-11-02 Paul Eggert <eggert@twinsun.com>
12206
12207 * src/reader.c: Don't include quote.h; not needed.
12208 (get_merge_function): Reword warning to be consistent with
12209 type clash diagnostic in grammar_current_rule_check.
12210
12211 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
12212 bug in trigraph handling.
12213
12214 * src/output.c (prepare_symbols): When printing token names,
12215 escape "[" as "@<:@" and likewise for "]".
12216
12217 * src/system.h (errno): Remove declaration, as we are now
12218 assuming C89 or better, and C89 guarantees errno.
12219
762b212b
PE
122202002-10-30 Paul Eggert <eggert@twinsun.com>
12221
12222 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
12223 Check for close failures.
12224 * src/files.h (xfclose): Return void, not int, since it always
12225 returned zero.
12226 * src/files.c (xfclose): Likewise. Report I/O error if ferror
12227 indicates one.
12228 * src/output.c (output_skeleton): Use xfclose rather than fclose
12229 and ferror. xfclose now checks ferror.
12230
12231 * data/glr.c (YYLEFTMOST_STATE): Remove.
12232 (yyreportTree): Use a stack-based leftmost state. This avoids
12233 our continuing battles with bogus warnings about initializers.
12234
56100c60
AD
122352002-10-30 Akim Demaille <akim@epita.fr>
12236
12237 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
12238 #if.
12239
51b4a04c
PH
122402002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12241
12242 * tests/glr-regr1.at: New test for reported regressions.
12243 * tests/testsuite.at: Add glr-regr1.at test.
12244 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 12245
bf1ebda2
PE
122462002-10-24 Paul Eggert <eggert@twinsun.com>
12247
5c16c6b1
PE
12248 Version 1.75a.
12249
bf1ebda2
PE
12250 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
12251 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
12252 we use malloc. Don't assume 'A' through 'Z' are contiguous.
12253 Don't assume strdup exists; POSIX says its an XSI extension.
12254 Check for buffer overflow on input.
12255
b526ee61
AD
122562002-10-24 Akim Demaille <akim@epita.fr>
12257
12258 * src/output.c (output_skeleton): Don't disable M4sugar comments
12259 too soon: it results in comments being expanded.
12260 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
12261 first output.
12262
f1886bb2
AD
122632002-10-24 Akim Demaille <akim@epita.fr>
12264
12265 * data/yacc.c (m4_int_type): New.
12266 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
12267 char' as only yacc.c wants K&R portability.
12268 * data/glr.c (yysigned_char): Remove.
12269 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
12270 Reported by Quoc Peyrot.
12271
c5576256
PE
122722002-10-23 Paul Eggert <eggert@twinsun.com>
12273
12274 * src/main.c (main): With --trace=time, report times even if a
12275 non-fatal error occurs. Formerly, the times were reported in some
12276 such cases but not in others.
12277 * src/reader.c (reader): Just return if a complaint has been issued,
12278 instead of exiting, so that 'main' can report times.
12279
27b0ffea
AD
122802002-10-22 Akim Demaille <akim@epita.fr>
12281
12282 * src/system.h: Include sys/types.
12283 Reported by Bert Deknuydt.
12284
223a7883
PE
122852002-10-23 Paul Eggert <eggert@twinsun.com>
12286
12287 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
12288 Suggested by Art Haas.
12289
122902002-10-22 Paul Eggert <eggert@twinsun.com>
12291
12292 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
12293 decl; not needed any more.
12294 * src/main.c (main): Use return to exit, undoing yesterday's change.
12295 The last OS that we could find where this wouldn't work is
12296 SunOS 3.5, and that's too old to worry about now.
12297
12298 * data/glr.c (struct yyltype): Define members even when not
12299 doing locations. This is more consistent with yacc.c, and it
12300 works around the following bug reports:
161a71f3
PE
12301 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
12302 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 12303
223a7883
PE
12304 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
12305 @acronym consistently. Standardize on "Yacc" instead of "YACC",
12306 "Algol" instead of "ALGOL". Give a bit more history about BNF.
12307
8b76775a
AD
123082002-10-22 Akim Demaille <akim@epita.fr>
12309
12310 * data/README: New.
12311
6db10d14
PE
123122002-10-21 Paul Eggert <eggert@twinsun.com>
12313
12314 Be consistent about 'bool'; the old code used an enum in one
12315 module and an int in another, and this violates the C standard.
12316 * m4/stdbool.m4: New file, from coreutils 4.5.3.
12317 * configure.ac (AC_HEADER_STDBOOL): Add.
12318 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
12319 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
12320 * src/symtab.c (hash_compare_symbol_t): Likewise.
12321 * src/system.h (bool, false, true): Use a definition consistent
12322 with ../lib/hash.c. All uses changed.
12323
12324 * src/complain.c (warning_issued): Renamed from warn_message_count,
12325 so that we needn't worry about integer overflow (!).
12326 Now of type bool. All uses changed.
12327 (complaint_issued): Renamed from complain_message_count; likewise.
12328
12329 * src/main.c (main): Use exit to exit with failure.
27b0ffea 12330
6db10d14
PE
12331 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
12332 rather than 1 and 0.
12333 * src/main.c (main): Likewise.
12334 * src/getargs.c (getargs): Likewise.
12335 * src/reader.c (reader): Likewise.
12336
12337 * src/getarg.c (getargs): Remove duplicate code for
12338 "Try `bison --help'".
12339
12340 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
12341 What was that "2" for?
12342
12343 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
12344 * src/getargs.c (usage): Likewise.
12345
12346 * src/getargs.c (getargs): When there are too few operands, report
12347 the last one. When there are too many, report the first extra
12348 one. This is how diffutils does it.
12349
92a060fd
PE
123502002-10-20 Paul Eggert <eggert@twinsun.com>
12351
12352 Remove K&R vestiges.
12353 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
12354 * src/complain.c (VA_START): Remove. Assume prototypes.
12355 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
12356 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
12357 fatal): Assume prototypes.
12358 * src/complain.h: Assume prototypes.
12359 * src/system.h (PARAMS): Remove.
12360 Include <limits.h> unconditionally, since it's guaranteeed even
12361 for a freestanding C89 compiler.
12362 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
12363 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 12364
e7cb57c0
AD
123652002-10-20 Akim Demaille <akim@epita.fr>
12366
12367 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
12368 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
12369 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
12370 (yyresolveStates, yyresolveAction, yyresolveStack)
12371 (yyprocessOneStack): Use them.
12372 (yy_reduce_print): New.
12373 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
12374
0245f82d
AD
123752002-10-20 Akim Demaille <akim@epita.fr>
12376
12377 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
12378 arguments and output `void'.
12379 (b4_c_function): Rename as...
12380 (b4_c_function_def): this.
12381 (b4_c_function_decl, b4_c_ansi_function_def)
12382 (b4_c_ansi_function_decl): New.
12383 Change the interpretation of the arguments: before `int, foo', now
12384 `int foo, foo'.
12385 * data/yacc.c (yyparse): Prototype and define thanks to these.
12386 Adjust b4_c_function_def uses.
12387 * data/glr.c (yyparse): Likewise, but ANSI only.
12388
39912f52
AD
123892002-10-20 Akim Demaille <akim@epita.fr>
12390
12391 * src/output.c (prepare): Move the definition of `tokens_number',
12392 `nterms_number', `undef_token_number', `user_token_number_max'
12393 to...
12394 (prepare_tokens): Here.
12395 (prepare_tokens): Rename as...
12396 (prepare_symbols): this.
12397 (prepare): Move the definition of `rules_number' to...
12398 (prepare_rules): here.
12399 (prepare): Move the definition of `last', `final_state_number',
12400 `states_number' to...
12401 (prepare_states): here.
12402 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
12403
20c1e2ad
AD
124042002-10-20 Akim Demaille <akim@epita.fr>
12405
12406 * src/tables.h, src/tables.c, src/output.c: Comment changes.
12407
21964f43
AD
124082002-10-20 Akim Demaille <akim@epita.fr>
12409
12410 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
12411 * data/c.m4: here.
12412
66d30cd4
AD
124132002-10-20 Akim Demaille <akim@epita.fr>
12414
12415 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
12416 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
12417 `pair'.
12418 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
12419 `name' to...
12420 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
12421 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
12422 These.
12423
95f2c9fe
PE
124242002-10-19 Paul Eggert <eggert@twinsun.com>
12425
12426 Do not create a temporary file, as that involves security and
12427 cleanup headaches. Instead, use a pair of pipes.
12428 Derived from a suggestion by Florian Krohm.
12429 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
12430 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
12431 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
12432 (BISON_PREREQ_SUBPIPE): Add.
12433 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
12434 Add subpipe.h, subpipe.c.
12435 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
12436 * po/POTFILES.in: Add lib/subpipe.c.
12437 * src/output.c: Include "subpipe.h".
12438 (m4_invoke): Remove decl.
12439 (scan_skel): New decl.
12440 (output_skeleton): Use pipe rather than temporary file for m4 input.
12441 Check that m4sugar.m4 is readable, to avoid deadlock.
12442 Check for pipe I/O error.
12443 * src/scan-skel.l (readpipe): Remove decl.
12444 (scan_skel): New function, to be used in place of m4_invoke.
12445 Read from stream rather than file.
66d30cd4 12446
95f2c9fe
PE
12447 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
12448 float, as this generates a warning on Solaris 8 + GCC 3.2 with
12449 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
12450 this generates a more-accurate value anyway.
12451
12452 * lib/timevar.c (timervar_accumulate): Rename locals to
12453 avoid confusion with similarly-named more-global.
12454 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
12455
12456 * src/output.c (prepare): Use xstrdup to convert char const *
12457 to char *, to avoid GCC warning.
12458
c19988b7
AD
124592002-10-19 Akim Demaille <akim@epita.fr>
12460
12461 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
12462 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
12463 Use them to have `calc.y' ready for %pure-parser.
12464 * data/yacc.c (YYLEX): Pass a yylex return type to
12465 b4_c_function_call.
12466
ae7453f2
AD
124672002-10-19 Akim Demaille <akim@epita.fr>
12468
12469 Prototype support of %lex-param and %parse-param.
12470
12471 * src/parse-gram.y: Add the definition of the %lex-param and
12472 %parse-param tokens, plus their rules.
12473 Drop the `_' version of %glr-parser.
12474 Add the "," token.
12475 * src/scan-gram.l (INITIAL): Scan them.
12476 * src/muscle_tab.c: Comment changes.
12477 (muscle_insert, muscle_find): Rename `pair' as `probe'.
12478 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
12479 (muscle_entry_s): The `value' member is no longer const.
12480 Adjust all dependencies.
12481 * src/muscle_tab.c (muscle_init): Adjust: use
12482 MUSCLE_INSERT_STRING.
12483 Initialize the obstack earlier.
12484 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
12485 (muscle_pair_list_grow): New.
12486 * data/c.m4 (b4_c_function_call, b4_c_args): New.
12487 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
12488 * tests/calc.at: Use %locations, not --locations.
12489 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
12490
0e575721
AD
124912002-10-19 Akim Demaille <akim@epita.fr>
12492
12493 * src/getargs.c (usage): Take status as argument and exit
12494 accordingly.
12495 Report the traditional `Try ... --help' message when status != 0.
12496 (usage, version): Don't take a FILE * as arg, it is pointless.
12497 (getargs): When there is an incorrect number of arguments, make it
12498 an error, and report it GNUlically thanks to `usage ()'.
12499
724ce7f5
PE
125002002-10-18 Paul Eggert <eggert@twinsun.com>
12501
3a781eb2
PE
12502 * data/glr.c (yyreportParseError): Don't assume that sprintf
12503 yields the length of the printed string, as this is not true
12504 on SunOS 4.1.4. Reported by Peter Klein.
12505
724ce7f5
PE
12506 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
12507 * tests/conflicts.at (%nonassoc and eof): Likewise.
12508 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
12509
473d0a75
AD
125102002-10-17 Akim Demaille <akim@epita.fr>
12511
12512 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
12513 * src/getargs.c (trace_types, trace_args): Adjust.
12514 * src/reader.c (grammar_current_rule_prec_set)
12515 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
12516 Standardize error messages.
12517 And s/@prec/%prec/!
12518 (reader): Use trace_flag to enable scanner/parser debugging,
12519 instead of an adhoc scheme.
12520 * src/scan-gram.l: Remove trailing debugging code.
12521
e76d2469
PE
125222002-10-16 Paul Eggert <eggert@twinsun.com>
12523
93e2236a
PE
12524 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
12525 MUSCLE_TAB_H.
12526
e76d2469
PE
12527 * NEWS: Officially drop support for building Bison with K&R C,
12528 since it didn't work anyway and it's not worth worrying about.
12529 * Makefile.maint (wget_files): Remove ansi2knr.c.
12530 (ansi2knr.c-url_prefix): Remove.
12531 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
12532 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12533 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12534
5bd1c419
PE
125352002-10-15 Paul Eggert <eggert@twinsun.com>
12536
12537 Stop using the "enum_" trick for K&R-style function definitions;
12538 it confused me, and I was the author! Instead, assume that people
12539 who want to use K&R C compilers (when using these modules in GCC,
12540 perhaps?) will run ansi2knr.
12541
12542 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
12543 All uses of "enum_" changed to "enum ".
12544 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
12545 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 12546
5bd1c419
PE
12547 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
12548 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
12549 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
12550 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
12551 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
12552 abitset_not, abitset_ones, abitset_or, abitset_or_and,
12553 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
12554 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
12555 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
12556 Use function prototypes; this removes the need for declaring
12557 static functions simply to provide their prototypes.
12558 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
12559 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
12560 bitset_count_, bitset_create, bitset_dump, bitset_first,
12561 bitset_free, bitset_init, bitset_last, bitset_next,
12562 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
12563 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
12564 bitset_print, bitset_release_memory, bitset_toggle_,
12565 bitset_type_choose, bitset_type_get, bitset_type_name_get,
12566 debug_bitset): Likewise.
12567 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
12568 * lib/bitset_stats.c (bitset_log_histogram_print,
12569 bitset_percent_histogram_print, bitset_stats_and,
12570 bitset_stats_and_cmp, bitset_stats_and_or,
12571 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
12572 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
12573 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
12574 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
12575 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
12576 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
12577 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
12578 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
12579 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
12580 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
12581 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
12582 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
12583 bitset_stats_zero): Likewise.
12584 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12585 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12586 bitsetv_dump, debug_bitsetv): Likewise.
12587 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
12588 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
12589 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
12590 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
12591 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
12592 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
12593 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
12594 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
12595 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
12596 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
12597 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
12598 Likewise.
12599 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
12600 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
12601 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
12602 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
12603 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
12604 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
12605 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
12606 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
12607 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
12608 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
12609 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 12610
ae26e1f0
AD
126112002-10-14 Akim Demaille <akim@epita.fr>
12612
12613 Version 1.75.
12614
d43baf71
AD
126152002-10-14 Akim Demaille <akim@epita.fr>
12616
12617 * tests/Makefile.am (maintainer-check-posix): New.
12618
7ebc83e3
AD
126192002-10-14 Akim Demaille <akim@epita.fr>
12620
12621 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
12622 member.
12623
05846dae
AD
126242002-10-14 Akim Demaille <akim@epita.fr>
12625
12626 * src/tables.c (table_ninf_remap): base -> tab.
12627 Reported by Matt Rosing.
12628
1318e37d
PE
126292002-10-14 Paul Eggert <eggert@twinsun.com>
12630
447fbb17
PE
12631 * tests/action.at, tests/calc.at, tests/conflicts.at,
12632 tests/cxx-type.at, tests/headers.at, tests/input.at,
12633 tests/regression.at, tests/synclines.at, tests/torture.at:
12634 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
12635 so that the tests still work even if POSIXLY_CORRECT is set.
12636 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 12637
1318e37d
PE
12638 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
12639 for portability to K&R hosts. Fix typo: signed char is guaranteed
12640 only to 127, not to 128.
12641 * data/glr.c (yysigned_char): New type.
12642 * data/yacc.c (yysigned_char): Likewise.
12643 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
12644
cc0f0794
PE
126452002-10-13 Paul Eggert <eggert@twinsun.com>
12646
5038f418
PE
12647 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
12648 true due to limited range of data type" warning from GCC.
12649
cc0f0794
PE
12650 * data/c.m4 (b4_token_defines): Protect against double-inclusion
12651 by wrapping enum yytokentype's definition inside #ifndef
12652 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
12653
6fed0802
AD
126542002-10-13 Akim Demaille <akim@epita.fr>
12655
12656 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
12657 Un yy- yyrhs to avoid the name clash with the global YYRHS.
12658
32f0598d
AD
126592002-10-13 Akim Demaille <akim@epita.fr>
12660
12661 * Makefile.maint: Update from Autoconf 2.54.
12662 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
12663
7ea9a33f
AD
126642002-10-13 Akim Demaille <akim@epita.fr>
12665
12666 * src/print.c (print_state): Separate the list of solved conflicts
12667 from the other items.
12668 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
12669
ea99527d
AD
126702002-10-13 Akim Demaille <akim@epita.fr>
12671
12672 Let nondeterministic skeletons be usable with deterministic
12673 tables.
12674
12675 With the patch, GAWK compiled by GCC without -O2 passes its test
12676 suite using a GLR parser driven by LALR tables. It fails with -O2
12677 because `struct stat' gives two different answers on my machine:
12678 88 (definition of an auto var) and later 96 (memset on this var).
12679 Hence the stack is badly corrumpted. The headers inclusion is to
12680 blame: if I move the awk.h inclusion before GLR's system header
12681 inclusion, the two struct stat have the same size.
12682
12683 * src/tables.c (pack_table): Always create conflict_table.
12684 (token_actions): Always create conflict_list.
12685 * data/glr.c (YYFLAG): Remove, unused.
12686
f377f69f
AD
126872002-10-13 Akim Demaille <akim@epita.fr>
12688
12689 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
12690 (O0FLAGS): New.
12691 (VALGRIND, GXX): New.
12692 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
12693 * tests/bison.in: Run $PREBISON a pre-command.
12694 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
12695 (maintainer-check-g++): New.
12696 * Makefile.am (maintainer-check): New.
12697
2a1fe6ed
AD
126982002-10-13 Akim Demaille <akim@epita.fr>
12699
12700 * data/glr.c: Formatting changes.
12701 Tweak some trace messages to match yacc.c's.
12702
f50adbbd
AD
127032002-10-13 Akim Demaille <akim@epita.fr>
12704
12705 GLR parsers sometimes raise parse errors instead of performing the
12706 default reduction.
12707 Reported by Charles-Henry de Boysson.
12708
12709 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 12710 check the length of the traces when %glr.
f50adbbd
AD
12711 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
12712 GLR's traces.
12713 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
12714 Test GLR parsers.
12715 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
12716 (yyltype): Remove the yy prefix from the member names.
12717 (yytable): Complete its comment.
12718 (yygetLRActions): Map error action number from YYTABLE from
12719 YYTABLE_NINF to 0.
12720 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
12721 (which was a bug: it should have been YYTABEL_NINF, and yet it was
12722 not satisfying as we could compare an YYACTION computed from
12723 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
12724 only value for error actions.
12725 (yyreportParseError): In verbose parse error messages, don't issue
12726 `error' in the list of expected tokens.
12727 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
12728 next action to perform to match glr.c's decoding.
12729 (yytable): Complete its comment.
12730
bcbad5b9
PE
127312002-10-13 Paul Eggert <eggert@twinsun.com>
12732
12733 Fix problem reported by Henrik Grubbstroem in
161a71f3 12734 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
12735 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
12736 because the Bison parser reads the second action before reducing
12737 the first one.
12738 * src/scan-gram.l (rule_length): New static var.
12739 Use it to keep track of the rule length in the scanner, since
12740 we can't expect the parser to be in lock-step sync with the scanner.
12741 (handle_action_dollar, handle_action_at): Use this var.
12742 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 12743
14904b89
PE
127442002-10-12 Paul Eggert <eggert@twinsun.com>
12745
1fe611e5
PE
12746 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
12747 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
12748 Include <sys/time.h> when checking for clock_t and struct tms.
12749 Use same include order as source.
12750 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 12751 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 12752
1fe611e5
PE
12753 * lib/timevar.c: Update copyright date and clarify comments.
12754 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 12755
1fe611e5
PE
12756 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
12757 GCC version as of today, then merge Bison's changes.
12758 Change "GCC" to "Bison" in copyright notice. timevar.def's
12759 author is Akim, so change that too.
12760
98194095
PE
12761 * src/reader.c (grammar_current_rule_check):
12762 Don't worry about the default action if $$ is untyped.
12763 Prevents bogus warnings reported by Jim Gifford in
161a71f3 12764 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 12765
14904b89
PE
12766 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
12767 * data/glr.c, data/lalr1.cc, data/yacc.c:
12768 Output token definitions before the first part of user declarations.
12769 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 12770 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 12771
ff6dca18
PE
127722002-10-11 Paul Eggert <eggert@twinsun.com>
12773
12774 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
12775 (yyparse): here. This undoes some of the 2002-07-25 change.
12776 Compatibility problem reported by Ralf S. Engelschall with
12777 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
12778
eb714592
AD
127792002-10-11 Akim Demaille <akim@epita.fr>
12780
12781 * tests/regression.at Characters Escapes): New.
12782 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
12783 characters.
12784 Reported by Jan Nieuwenhuizen.
12785
b7195100
AD
127862002-10-11 Akim Demaille <akim@epita.fr>
12787
12788 * po/id.po: New.
12789
f28a0f2d
PE
127902002-10-10 Paul Eggert <eggert@twinsun.com>
12791
12792 Portability fixes for bitsets; this also avoids several GCC
12793 warnings.
12794
12795 * lib/abitset.c: Include <stddef.h>, for offsetof.
12796 * lib/lbitset.c: Likewise.
12797
12798 * lib/abitset.c (abitset_bytes): Return a size that is aligned
12799 properly for vectors of objects. Do not assume that adding a
12800 header size to a multiple of a word size yields a value that is
12801 properly aligned for the whole union.
12802 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12803
12804 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
12805 unique names for structures.
12806 * lib/ebitset.c (ebitset_bytes): Likewise.
12807 * lib/lbitset.c (lbitset_bytes): Likewise.
12808
12809 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
12810 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
12811 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
12812 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
12813 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
12814 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
12815 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
12816 to improve the type-checking that GCC can do.
12817 * lib/bitset.c (bitset_op4_cmp): Likewise.
12818 * lib/bitset_stats.c (bitset_stats_count,
12819 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
12820 bitset_stats_copy, bitset_stats_disjoint_p,
12821 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
12822 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
12823 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
12824 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
12825 bitset_stats_and_or_cmp, bitset_stats_andn_or,
12826 bitset_stats_andn_or_cmp, bitset_stats_or_and,
12827 bitset_stats_or_and_cmp): Likewise.
12828 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
12829 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
12830 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
12831 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
12832
12833 * lib/abitset.h: Include bitset.h, not bbitset.h.
12834 * lib/ebitset.h: Likewise.
12835 * lib/lbitset.h: Likewise.
12836
12837 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
12838 All instances of parameters of type enum bitset_opts are now of
12839 type enum_bitset_opts, to conform to the C Standard, and similarly
12840 for enum_bitset_type.
12841 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
12842 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
12843
12844 Do not use "struct bitset_struct" to mean different things in
12845 different modules. Not only is this confusing, it violates
12846 the C Standard, which requires that structure types in different
12847 modules must be compatible if one is to be passed to the other.
12848 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
12849 All instances of "struct bitset_struct *" replaced with "bitset".
12850 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
12851 (union bitset_union, struct abitset_struct, struct ebitset_struct,
12852 struct lbitset_struct, struct bitset_stats_struct): New types.
12853 All uses of struct bitset_struct changed to union bitset_union,
12854 etc.
ba0fe3c7 12855 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
12856 struct bitset_struct): Remove.
12857 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
12858 struct bitset_struct): Remove.
12859 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
12860 bitset_struct): Remove.
12861 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
12862 Likewise.
12863
12864 Do not call a function of type T using a call that assumes the
12865 function is of a different type U. Standard C requires that a
12866 function must be called with a type that is compatible with its
12867 definition.
12868 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12869 New decls.
12870 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12871 New functions.
12872 * lib/ebitset.c (PFV): Remove.
12873 * lib/lbitset.c (PFV): Likewise.
12874 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
12875 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
12876 decls.
12877 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
12878 (ebitset_vtable): Use them.
12879 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
12880 lbitset_xor): New functions.
12881 (lbitset_vtable): Use them.
12882
12883 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
12884 Declare.
12885
12886 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
12887 GCC warning.
12888 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
12889 Use offsetof, for simplicity.
12890
6fbe4984
PE
128912002-10-06 Paul Eggert <eggert@twinsun.com>
12892
12893 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
12894 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 12895 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
12896 which was inadvertently undone by the 2002-09-30 patch.
12897 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
12898 the same width as int.
12899
420f93c8
PE
129002002-10-04 Paul Eggert <eggert@twinsun.com>
12901
12902 Version 1.50.
12903
12904 * configure.ac (AC_INIT), NEWS: Increment version number.
12905
12906 * doc/bison.texinfo: Minor spelling, grammar, and white space
12907 fixes.
12908 (Symbols): Mention that any negative value returned from yylex
12909 signifies end-of-input. Warn about negative chars. Mention
12910 the portable Standard C character set.
12911
12912 The GNU coding standard says CFLAGS and YFLAGS are reserved
12913 for the installer to set.
12914 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
12915 * src/Makefile.am (AM_CFLAGS): Likewise.
12916 (AM_YFLAGS): Renamed from YFLAGS.
12917
12918 Fix some MAX and MIN problems.
12919 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
12920 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
12921 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
12922 * src/reader.c (reader): Use it.
12923
12924 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
12925 POSIX 1003.1-2001 has removed fgrep.
12926
129272002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
12928
12929 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
12930 interpreted as signed.
12931 * lib/ebitset.c (ebitset_list): Fix bug.
12932
ff68026d
PE
129332002-10-01 Paul Eggert <eggert@twinsun.com>
12934
12935 More fixes for 64-bit hosts and large bitsets.
12936
12937 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
12938 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
12939 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
12940 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
12941 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
12942 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
12943 bitset_count_): Likewise.
12944 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
12945 bitset_first, bitset_last): Likewise.
12946 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
12947 bitset_stats_list_reverse, bitset_stats_size,
12948 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
12949 Likewise.
12950 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12951 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12952 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12953 bitsetv_reflexive_transitive_closure): Likewise.
12954 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
12955 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
12956 Likewise.
12957 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
12958 Likewise.
420f93c8 12959
ff68026d
PE
12960 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
12961 Use size_t, not unsigned int, to count bytes.
12962 * lib/abitset.h (abitset_bytes): Likewise.
12963 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
12964 Likewise.
12965 * lib/bitset.h (bitset_bytes): Likewise.
12966 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
12967 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
12968 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12969 * lib/ebitset.c (ebitset_bytes): Likewise.
12970 * lib/ebitset.h (ebitset_bytes): Likewise.
12971 * lib/lbitset.c (lbitset_bytes): Likewise.
12972 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 12973
ff68026d
PE
12974 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
12975 abitset_subset_p, abitset_disjoint_p, abitset_and,
12976 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
12977 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
12978 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
12979 abitset_or_and, abitset_or_and_cmp):
12980 Use bitset_windex instead of unsigned int.
12981 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12982 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
12983 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
12984 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
12985 Likewise.
12986 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 12987
ff68026d
PE
12988 * lib/bitset.c (bitset_print):
12989 Use proper printf formats for widths of integer types.
12990 * lib/bitset_stats.c (bitset_percent_histogram_print,
12991 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
12992 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12993 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12994 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 12995
ff68026d
PE
12996 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
12997 BITSET_SIZE_MAX): New macros.
12998 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
12999 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
13000 to BITSET_WINDEX_MAX.
13001
13002 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
13003 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
13004 since we now return the bitset_bindex type (not int).
13005
13006 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
13007 when computing sizes.
13008 * lib/ebitset.c (ebitset_elts_grow): Likewise.
13009
13010 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
13011 and avoid cast to unsigned.
13012
6aa452a6
AD
130132002-09-30 Akim Demaille <akim@epita.fr>
13014
13015 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13016 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
13017 Updates from Michael Hayes.
13018
927f7817
AD
130192002-09-30 Art Haas <ahaas@neosoft.com>
13020
13021 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
13022 invocations.
13023 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
13024 defined.
13025
9738f41e
AD
130262002-09-27 Akim Demaille <akim@epita.fr>
13027
13028 Version 1.49c.
13029
a5c75d7f
AD
130302002-09-27 Akim Demaille <akim@epita.fr>
13031
13032 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
13033 (Because of AC_LIBSOURCE).
13034
8280e179
AD
130352002-09-27 Akim Demaille <akim@epita.fr>
13036
13037 Playing with Autoscan.
13038
13039 * configure.ac: Remove the old LIBOBJ tweaks.
13040 (AC_REPLACE_FUNCS): Add strrchr and strtol.
13041 * lib/strrchr.c: New.
13042 * lib/strtol.c: New, from the Coreutils 4.5.1.
13043
ae64af35
AD
130442002-09-27 Akim Demaille <akim@epita.fr>
13045
13046 Playing with Autoscan.
13047
13048 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
13049 * lib/Makefile.am (libbison_a_SOURCES): No longer include
13050 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
13051 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
13052 Coreutils 4.5.1.
13053
d1a1114f
AD
130542002-09-24 Akim Demaille <akim@epita.fr>
13055
13056 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
13057 (Frequently Asked Questions, Parser Stack Overflow): New.
13058
b906441c
AD
130592002-09-13 Akim Demaille <akim@epita.fr>
13060
13061 Playing with autoscan.
13062
13063 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
13064 * src/files.c (skeleton_find): Remove, unused.
13065 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
13066 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
13067
bd701811
AD
130682002-09-13 Akim Demaille <akim@epita.fr>
13069
13070 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
13071 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
13072
e0a13e7b
AD
130732002-09-13 Akim Demaille <akim@epita.fr>
13074
13075 * configure.ac: Require 2.54.
13076 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
13077 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
13078 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
13079 Remove, provided by Autoconf macros.
13080
c97011bf
AD
130812002-09-12 Akim Demaille <akim@epita.fr>
13082
13083 * m4/prereq.m4: Update, from Coreutils 4.5.1.
13084
d862b1be
AD
130852002-09-12 Akim Demaille <akim@epita.fr>
13086
13087 * m4/prereq.m4: Update, from Fileutils 4.1.5.
13088 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
13089 Reported by Martin Mokrejs.
13090
3d38c03a
AD
130912002-09-10 Akim Demaille <akim@epita.fr>
13092
13093 * src/parse-gram.y: Associate a human readable string to each
13094 token type.
13095 * tests/regression.at (Invalid inputs): Adjust.
13096
b6347355
AD
130972002-09-10 Gary V. Vaughan <gary@gnu.org>
13098
13099 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
13100 with an Autoconf-2.5x style configure.ac.
13101
09ba4ab2
PE
131022002-09-06 Paul Eggert <eggert@twinsun.com>
13103
13104 * doc/bison.texinfo (Conditions): Make explicit that the GPL
13105 exception applies only to yacc.c. This is a modification of a
13106 patch originally suggested by Akim Demaille.
13107
21846f69
AD
131082002-09-06 Akim Demaille <akim@epita.fr>
13109
09ba4ab2
PE
13110 * data/c.m4 (b4_copyright): Move the GPL exception comment from
13111 here to...
13112 * data/yacc.c: here.
13113
21846f69
AD
13114 * data/lalr1.cc (struct yyltype): Don't define it, since we use
13115 LocationType.
13116 (b4_ltype): Default to yy::Location from location.hh.
13117
c0ad8bf3
AD
131182002-09-04 Jim Meyering <jim@meyering.net>
13119
13120 * data/yacc.c: Guard the declaration of yytoknum also with
13121 `#ifdef YYPRINT', so it is declared only when used.
13122
3a93251e
AD
131232002-09-04 Akim Demaille <akim@epita.fr>
13124
13125 * configure.in: Rename as...
13126 * configure.ac: this.
13127 Bump to 1.49c.
13128
427c0dda
AD
131292002-09-04 Akim Demaille <akim@epita.fr>
13130
13131 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
13132 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
13133 translate maintainer only messages.
13134
6a254321
PE
131352002-08-12 Paul Eggert <eggert@twinsun.com>
13136
645e30d1
PE
13137 Version 1.49b.
13138
6a254321
PE
13139 * Makefile.am (SUBDIRS): Remove intl.
13140 (DISTCLEANFILES): Remove.
13141 * NEWS: Mention that GNU M4 is now required. Clarify what is
13142 meant by "larger grammars". Mention the pt_BR translation.
13143 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
13144 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
13145 Bump version from 0.11.2 to 0.11.5.
13146 (BISON_PREREQ_STAGE): Remove.
13147 (AM_GNU_GETTEXT): Use external gettext.
13148 (AC_OUTPUT): Remove intl/Makefile.
13149
13150 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
13151
13152 * data/glr.c: Include string.h, for strlen.
13153 (yyreportParseError): Use size_t for yysize.
13154 (yy_yypstack): No longer nested inside yypstates, as nested
13155 functions are not portable. Do not assume size_t is the
13156 same width as int.
13157 (yypstates): Do not assume that ptrdiff_t is the same width
13158 as int, and similarly for yyposn and YYINDEX.
13159
13160 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
13161
13162 * lib/Makefile.am (INCLUDES): Do not include from the intl
13163 directory, which has been removed.
13164 * src/Makefile.am (INCLUDES): Likewise.
13165
13166 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
13167 (bitsets_sources, additional_bitsets_sources, timevars_sources):
13168 New vars.
13169
13170 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
13171 * tests/Makefile.am (EXTRA_DIST): Likewise.
13172
13173 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
13174 Do not assume that bitset_windex is the same width as unsigned.
13175
13176 * lib/abitset.c (abitset_unused_clear): Do not assume that
13177 bitset_word is the same width as int.
13178 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
13179 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
13180 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
13181 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
13182 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
13183
13184 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
13185 portability to one's complement hosts!).
13186 * lib/ebitset.c (ebitset_op1): Likewise.
13187 * lib/lbitset.c (lbitset_op1): Likewise.
13188
13189 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
13190 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13191 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
13192 Sync with fileutils.
13193 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
13194 lib/gettext.h: Sync with diffutils.
13195
13196 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
13197 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
13198
13199 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
13200 PROTOTYPES to check for prototypes, and "defined __STDC__" to
13201 check for void *.
13202
13203 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
13204 size_t; the old version tried to do this but casted improperly.
13205 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
13206 (bitset_test): Now returns int, not unsigned long.
13207
13208 * lib/bitset_stats.c: Include "gettext.h".
13209 (_): New macro.
13210 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
13211 name locals "index", as it generates unnecessary warnings on some
13212 hosts that have an "index" function.
13213
13214 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
13215 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
13216 they need translation.
13217 * src/LR0.c (state_list_append, new_itemsets, get_state,
13218 append_states, generate_states): Likewise.
13219 * src/assoc.c (assoc_to_string): Likewise.
13220 * src/closure.c (print_closure, set_firsts, closure): Likewise.
13221 * src/gram.c (grammar_dump): Likewise.
13222 * src/injections.c (injections_compute): Likewise.
13223 * src/lalr.c (lookaheads_print): Likewise.
13224 * src/relation.c (relation_transpose): Likewise.
13225 * src/scan-gram.l: Likewise.
13226 * src/tables.c (table_grow, pack_vector): Likewise.
13227
13228 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
13229 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
13230 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
13231 * m4/mbstate_t.m4: Sync with fileutils.
13232 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
13233
13234 * po/LINGUAS: Add pt_BR.
13235 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
13236 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
13237 lib/timevar.c.
13238 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
13239 manual recommends.
13240 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
13241
13242 * src/complain.c (strerror_r): Remove decl; not needed.
13243 (strerror): Use same pattern as ../lib/error.c.
13244
13245 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
13246
13247 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
13248
13249 * src/main.c (main): Cast result of bindtextdomain and textdomain
13250 to void, to avoid a GCC warning when --disable-nls is in effect.
13251
13252 * src/scan-gram.l: Use strings rather than escapes when possible,
13253 to minimize the number of warnings from xgettext.
13254 (handle_action_dollar, handle_action_at): Don't use isdigit,
13255 as it mishandles negative chars and it may not work as expected
13256 outside the C locale.
13257
13258 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
13259 this is a GCC extension and is not portable to other compilers.
13260
13261 * src/system.h (alloca): Use same pattern as ../lib/error.c.
13262 Do not include <ctype.h>; no longer needed.
13263 Do not include <malloc.h>; no longer needed (and generates
13264 warnings on OpenBSD 3.0).
13265
13266 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
13267 it's not portable.
13268
13269 * tests/regression.at: Do not use 'cc -c input.c -o input';
13270 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
13271
13272 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
13273 exit status as failure, not just exit status 1. Sun C exits
13274 with status 2 sometimes.
13275
13276 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
13277 Use it for the two large tests.
13278
c8f002c7
AD
132792002-08-02 Akim Demaille <akim@epita.fr>
13280
13281 * src/conflicts.c (conflicts_output): Don't output rules never
13282 reduced here, since anyway that computation doesn't work.
13283 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
13284 (rule_useless_p, rule_never_reduced_p): New.
13285 (grammar_rules_partial_print): Use a filter instead of a range.
13286 Display the title only if needed.
13287 (grammar_rules_print): Adjust.
13288 (grammar_rules_never_reduced_report): New.
13289 * src/tables.c (action_row): Move the computation of rules never
13290 reduced to...
13291 (token_actions): here.
13292 * src/main.c (main): Make the parser before making the report, so
13293 that rules never reduced are computed.
13294 Call grammar_rules_never_reduced_report.
13295 * src/print.c (print_results): Report rules never reduced.
13296 * tests/conflicts.at, tests/reduce.at: Adjust.
13297
cd08e51e
AD
132982002-08-01 Akim Demaille <akim@epita.fr>
13299
13300 Instead of attaching lookaheads and duplicating the rules being
13301 reduced by a state, attach the lookaheads to the reductions.
13302
13303 * src/state.h (state_t): Remove the `lookaheads',
13304 `lookaheads_rule' member.
13305 (reductions_t): Add a `lookaheads' member.
13306 Use a regular array for the `rules'.
13307 * src/state.c (reductions_new): Initialize the lookaheads member
13308 to 0.
13309 (state_rule_lookaheads_print): Adjust.
13310 * src/state.h, src/state.c (state_reductions_find): New.
13311 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
13312 (count_rr_conflicts): Adjust.
13313 * src/lalr.c (LArule): Remove.
13314 (add_lookback_edge): Adjust.
13315 (state_lookaheads_count): New.
13316 (states_lookaheads_initialize): Merge into...
13317 (initialize_LA): this.
13318 (lalr_free): Adjust.
13319 * src/main.c (main): Don't free nullable and derives too early: it
13320 is used by --verbose.
13321 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
13322
bb0027a9
AD
133232002-08-01 Akim Demaille <akim@epita.fr>
13324
13325 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
13326 `rule_number_t**'.
13327 (set_derives, free_derives): Rename as...
13328 (derives_compute, derives_free): this.
13329 Adjust all dependencies.
13330 * src/nullable.c (set_nullable, free_nullable): Rename as...
13331 (nullable_compute, nullable_free): these.
13332 (rule_list_t): Store rule_t *, not rule_number_t.
13333 * src/state.c (state_rule_lookaheads_print): Directly compare rule
13334 pointers, instead of their numbers.
13335 * src/main.c (main): Call nullable_free, and derives_free earlier,
13336 as they were lo longer used.
13337
3325ddc4
AD
133382002-08-01 Akim Demaille <akim@epita.fr>
13339
13340 * lib/timevar.c (get_time): Include children time.
13341 * src/lalr.h (LA, LArule): Don't export them: used with the
13342 state_t.
13343 * src/lalr.c (LA, LArule): Static.
13344 * src/lalr.h, src/lalr.c (lalr_free): New.
13345 * src/main.c (main): Call it.
13346 * src/tables.c (pack_vector): Check whether loc is >= to the
13347 table_size, not >.
13348 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
13349 (tables_generate): do it, since that's also it which allocates
13350 them.
13351 Don't free LA and LArule, main does.
13352
c6f1a33c
AD
133532002-07-31 Akim Demaille <akim@epita.fr>
13354
13355 Separate parser tables computation and output.
13356
13357 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
13358 (conflict_list, conflict_list_cnt, table, check, table_ninf)
13359 (yydefgoto, yydefact, high): Move to...
13360 * src/tables.h, src/tables.c: here.
13361 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
13362 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
13363 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
13364 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
13365 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
13366 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
13367 (action_row, save_row, token_actions, save_column, default_goto)
13368 (goto_actions, sort_actions, matching_state, pack_vector)
13369 (table_ninf_remap, pack_table, prepare_actions): Move to...
13370 * src/tables.c: here.
13371 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
13372 * src/output.c (token_actions, output_base, output_conflicts)
13373 (output_check): Merge into...
13374 (prepare_actions): this.
13375 (actions_output): Rename as...
13376 (user_actions_output): this.
13377 * src/main.c (main): Call tables_generate and tables_free.
13378
1509d42f
AD
133792002-07-31 Akim Demaille <akim@epita.fr>
13380
13381 Steal GCC's --time-report support.
13382
13383 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
13384 stolen/adjusted from GCC.
13385 * m4/stage.m4: Remove time related checks.
13386 * m4/timevar.m4: New.
13387 * configure.in: Adjust.
13388 * src/system.h: Adjust to using timevar.h.
13389 * src/getargs.h, src/getargs.c: Support trace_time for
13390 --trace=time.
13391 * src/main.c (stage): Remove.
13392 (main): Replace `stage' invocations with timevar calls.
13393 * src/output.c: Insert pertinent timevar calls.
13394
273a74fa
AD
133952002-07-31 Akim Demaille <akim@epita.fr>
13396
13397 Let --trace have arguments.
13398
13399 * src/getargs.h (enum trace_e): New.
13400 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
13401 (long_options, short_options): --trace/-T takes an optional
13402 argument.
13403 Change all the uses of trace_flag to reflect the new flags.
13404 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
13405
13406 Strengthen `stage' portability.
13407
13408 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
13409 * configure.in: Use it.
13410 Don't check for malloc.h and sys/times.h.
13411 * src/system.h: Include them when appropriate.
13412 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
13413 times and struct tms are available.
13414
217598da
AD
134152002-07-30 Akim Demaille <akim@epita.fr>
13416
13417 In verbose parse error message, don't report `error' as an
13418 expected token.
13419 * tests/actions.at (Printers and Destructors): Adjust.
13420 * tests/calc.at (Calculator $1): Adjust.
13421 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
13422 error message, do not report the parser accepts the error token in
13423 that state.
13424
52489d44
AD
134252002-07-30 Akim Demaille <akim@epita.fr>
13426
13427 Normalize conflict related messages.
13428
13429 * src/complain.h, src/complain.c (warn, complain): New.
13430 * src/conflicts.c (conflicts_print): Use them.
13431 (conflict_report_yacc): New, extracted from...
13432 (conflicts_print): here.
13433 * tests/conflicts.at, tests/existing.at: Adjust.
13434
e8832397
AD
134352002-07-30 Akim Demaille <akim@epita.fr>
13436
13437 Report rules which are never reduced by the parser: those hidden
13438 by conflicts.
13439
13440 * src/LR0.c (save_reductions): Don't make the final state too
13441 different: save its reduction (accept) instead of having a state
13442 without any action (no shift or goto, no reduce).
13443 Note: the final state is now a ``regular'' state, i.e., the
13444 parsers now contain `reduce 0' as default reduction.
13445 Nevertheless, since they decide to `accept' when yystate =
13446 final_state, they still will not reduce rule 0.
13447 * src/print.c (print_actions, print_reduction): Adjust.
13448 * src/output.c (action_row): Track reduced rules.
13449 (token_actions): Report rules never reduced.
13450 * tests/conflicts.at, tests/regression.at: Adjust.
13451
caf23d24
AD
134522002-07-30 Akim Demaille <akim@epita.fr>
13453
13454 `stage' was accidently included in a previous patch.
13455 Initiate its autoconfiscation.
13456
13457 * configure.in: Look for malloc.h and sys/times.h.
13458 * src/main.c (stage): Adjust.
13459 Report only when trace_flag.
13460
640748ee
AD
134612002-07-29 Akim Demaille <akim@epita.fr>
13462
13463 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
13464 state_number_t.
13465 (errs_t): symbol_t*, not symbol_number_t.
13466 (reductions_t): rule_t*, not rule_number_t.
13467 (FOR_EACH_SHIFT): New.
13468 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
13469 * src/print.c, src/print_graph.c: Adjust.
13470
88bce5a2
AD
134712002-07-29 Akim Demaille <akim@epita.fr>
13472
13473 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
13474
13475 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
13476 (endtoken, accept): these.
13477 * src/reader.c (reader): Set endtoken's default tag to "$end".
13478 Set undeftoken's tag to "$undefined" instead of "$undefined.".
13479 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
13480 Adjust.
13481
1bfb97db
AD
134822002-07-29 Akim Demaille <akim@epita.fr>
13483
13484 * src/reduce.c (reduce_grammar): When the language is empty,
13485 complain about the start symbol, not the axiom.
13486 Use its location.
13487 * tests/reduce.at (Empty Language): New.
13488
fc5734fe
AD
134892002-07-26 Akim Demaille <akim@epita.fr>
13490
13491 * src/reader.h, src/reader.c (gram_error): ... can't get
13492 yycontrol without making too strong assumptions on the parser
13493 itself.
13494 * src/output.c (prepare_tokens): Use the real 0th value of
13495 token_translations instead of `0'.
13496 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
13497 visible here.
13498 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
13499 for the time being: %locations ought to provide it to yyerror.
13500
3650b4b8
AD
135012002-07-25 Akim Demaille <akim@epita.fr>
13502
13503 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
13504 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
13505 * tests/regression.at (Web2c Actions): Adjust.
13506
4b3d3a8e
AD
135072002-07-25 Akim Demaille <akim@epita.fr>
13508
13509 Stop storing rules from 1 to nrules + 1.
13510
13511 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
13512 * src/nullable.c, src/output.c, src/print.c, src/reader.c
13513 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
13514 Iterate from 0 to nrules.
13515 Use rule_number_as_item_number and item_number_as_rule_number.
13516 Adjust to `derive' now containing possibly 0.
13517 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
13518 Handle the `- 1' part in rule numbers from/to item numbers.
13519 * src/conflicts.c (log_resolution): Fix the message which reversed
13520 shift and reduce.
13521 * src/output.c (action_row): Initialize default_rule to -1.
13522 (token_actions): Adjust.
13523 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
13524 expected output.
13525 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
13526
4a2a22f4
AD
135272002-07-25 Akim Demaille <akim@epita.fr>
13528
13529 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
13530 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
13531 (b4_c_knr_arg_decl): New.
13532 * data/yacc.c: Use it to define yysymprint, yydestruct, and
13533 yyreport_parse_error.
13534
b8df3223
AD
135352002-07-25 Akim Demaille <akim@epita.fr>
13536
13537 * data/yacc.c (yyreport_parse_error): New, extracted from...
13538 (yyparse): here.
13539 (yydestruct, yysymprint): Move above yyparse.
13540 Be K&R compliant.
13541
a762e609
AD
135422002-07-25 Akim Demaille <akim@epita.fr>
13543
13544 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
13545 replace...
13546 (b4_sint_type, b4_uint_type): these.
13547 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
13548 * tests/regression.at (Web2c Actions): Adjust.
13549
12b0043a
AD
135502002-07-25 Akim Demaille <akim@epita.fr>
13551
13552 * src/gram.h (TIEM_NUMBER_MAX): New.
13553 (item_number_of_rule_number, rule_number_of_item_number): Rename
13554 as...
13555 (rule_number_as_item_number, item_number_as_rule_number): these.
13556 Adjust dependencies.
13557 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
13558 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
13559 (symbol_number_to_vector_number): New.
13560 (order): Of vector_number_t* type.
13561 (base_t, BASE_MAX, BASE_MIN): New.
13562 (froms, tos, width, pos, check): Of base_t type.
13563 (action_number_t, ACTION_MIN, ACTION_MAX): New.
13564 (actrow): Of action_number_t type.
13565 (conflrow): Of unsigned int type.
13566 (table_ninf, base_ninf): New.
13567 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
13568 (muscle_insert_int_table, muscle_insert_base_table)
13569 (muscle_insert_rule_number_table): New.
13570 (prepare_tokens): Output `toknum' as int_table.
13571 (action_row): Returns a rule_number_t.
13572 Use ACTION_MIN, not SHRT_MIN.
13573 (token_actions): yydefact is rule_number_t*.
13574 (table_ninf_remap): New.
13575 (pack_table): Use it for `base' and `table'.
13576 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
13577 replaced with...
13578 (YYPACT_NINF, YYTABLE_NINF): these.
13579 (yypact, yytable): Compute their types instead of hard-coded
13580 `short'.
13581 * tests/regression.at (Web2c Actions): Adjust.
13582
5dde258a
AD
135832002-07-19 Akim Demaille <akim@epita.fr>
13584
13585 * src/scan-gram.l (id): Can start with an underscore.
13586
a945ec39
AD
135872002-07-16 Akim Demaille <akim@epita.fr>
13588
13589 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
13590 Adjust all former `associativity' dependencies.
13591 * src/symtab.c (symbol_new): Default associativity is `undef', not
13592 `right'.
13593 (symbol_check_alias_consistence): Adjust.
13594
fae437e8
AD
135952002-07-09 Akim Demaille <akim@epita.fr>
13596
13597 * doc/bison.texinfo: Properly set the ``header'' part.
13598 Use @dircategory ``GNU programming tools'' as per Texinfo's
13599 documentation.
13600 Use @copying.
13601
1a715ef2
AD
136022002-07-09 Akim Demaille <akim@epita.fr>
13603
13604 * lib/quotearg.h: Protect against multiple inclusions.
13605 * src/location.h (location_t): Add a `file' member.
13606 (LOCATION_RESET, LOCATION_PRINT): Adjust.
13607 * src/complain.c (warn_at, complain_at, fatal_at): Drop
13608 `error_one_per_line' support.
13609
a5d50994
AD
136102002-07-09 Akim Demaille <akim@epita.fr>
13611
13612 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
13613 * src/reader.c (lineno): Remove.
13614 Adjust all dependencies.
13615 (get_merge_function): Take a location and use complain_at.
13616 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
13617 * tests/regression.at (Invalid inputs, Mixing %token styles):
13618 Adjust.
13619
b275314e
AD
136202002-07-09 Akim Demaille <akim@epita.fr>
13621
13622 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
13623 recovery rule, and forbid extensions when --yacc.
13624 (gram_error): Use complain_at.
13625 * src/reader.c (reader): Exit if there were parse errors.
13626
865b9df1
AD
136272002-07-09 Akim Demaille <akim@epita.fr>
13628
13629 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
13630 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
13631 Reported by R Blake <blakers@mac.com>.
13632
c76e14da
AD
136332002-07-09 Akim Demaille <akim@epita.fr>
13634
13635 * data/yacc.c: Output the copyright notive in the header.
13636
7db2ed2d
AD
136372002-07-03 Akim Demaille <akim@epita.fr>
13638
13639 * src/output.c (froms, tos): Are state_number_t.
13640 (save_column): sp, sp1, and sp2 are state_number_t.
13641 (prepare): Rename `final' as `final_state_number', `nnts' as
13642 `nterms_number', `nrules' as `rules_number', `nstates' as
13643 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
13644 unused.
13645 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
13646 * data/lalr1.cc (nsym_): Remove, unused.
13647
e68e0410
AD
136482002-07-03 Akim Demaille <akim@epita.fr>
13649
13650 * src/lalr.h, src/lalr.c (goto_number_t): New.
13651 * src/lalr.c (goto_list_t): New.
13652 Propagate them.
13653 * src/nullable.c (rule_list_t): New.
13654 Propagate.
13655 * src/types.h: Remove.
13656
e1a4f3a4
AD
136572002-07-03 Akim Demaille <akim@epita.fr>
13658
13659 * src/closure.c (print_fderives): Use rule_rhs_print.
13660 * src/derives.c (print_derives): Use rule_rhs_print.
13661 (rule_list_t): New, replaces `shorts'.
13662 (set_derives): Add comments.
13663 * tests/sets.at (Nullable, Firsts): Adjust.
13664
536545f3
AD
136652002-07-03 Akim Demaille <akim@epita.fr>
13666
13667 * src/output.c (prepare_actions): Free `tally' and `width'.
13668 (prepare_actions): Allocate and free `order'.
13669 * src/symtab.c (symbols_free): Free `symbols'.
13670 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
13671 * src/output.c (m4_invoke): Move to...
13672 * src/scan-skel.l: here.
13673 (<<EOF>>): Close yyout, and free its name.
13674
8b752b00
AD
136752002-07-03 Akim Demaille <akim@epita.fr>
13676
13677 Fix some memory leaks, and fix a bug: state 0 was examined twice.
13678
13679 * src/LR0.c (new_state): Merge into...
13680 (state_list_append): this.
13681 (new_states): Merge into...
13682 (generate_states): here.
13683 (set_states): Don't ensure a proper `errs' state member here, do it...
13684 * src/conflicts.c (conflicts_solve): here.
13685 * src/state.h, src/state.c: Comment changes.
13686 (state_t): Rename member `shifts' as `transitions'.
13687 Adjust all dependencies.
13688 (errs_new): For consistency, also take the values as argument.
13689 (errs_dup): Remove.
13690 (state_errs_set): New.
13691 (state_reductions_set, state_transitions_set): Assert that no
13692 previous value was assigned.
13693 (state_free): New.
13694 (states_free): Use it.
13695 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
13696 temporary storage: use `errs' and `nerrs' as elsewhere.
13697 (set_conflicts): Allocate and free this `errs'.
13698
613f5e1a
AD
136992002-07-02 Akim Demaille <akim@epita.fr>
13700
13701 * lib/libiberty.h: New.
13702 * lib: Update the bitset implementation from upstream.
13703 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
13704 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
13705 * src/main.c: Adjust bitset stats calls.
13706
26e0cadc
PE
137072002-07-01 Paul Eggert <eggert@twinsun.com>
13708
13709 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
13710 char, so that negative chars don't collide with $.
13711
1154cced
AD
137122002-06-30 Akim Demaille <akim@epita.fr>
13713
13714 Have the GLR tests be `warning' checked, and fix the warnings.
13715
13716 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
13717 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
13718 (yyremoveDeletes): `yyi' and `yyj' are size_t.
13719 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
13720 (yyaddDeferredAction): static.
13721 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
13722 (yyreportParseError): yyprefix is const.
13723 yytokenp is used only when verbose.
13724 (yy__GNUC__): Replace with __GNUC__.
13725 (yypdumpstack): yyi is size_t.
13726 (yypreference): Un-yy local variables and arguments, to avoid
13727 clashes with `yyr1'. Anyway, we are not in the user name space.
13728 (yytname_size): be an int, as is compared with ints.
13729 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
13730 Use them.
13731 * tests/cxx-gram.at: Use quotation to protect $1.
13732 Use AT_COMPILE to enable warnings hunts.
13733 Prototype yylex and yyerror.
13734 `Use' argc.
13735 Include `string.h', not `strings.h'.
13736 Produce and prototype stmtMerge only when used.
13737 yylex takes a location.
13738
97650f4e
AD
137392002-06-30 Akim Demaille <akim@epita.fr>
13740
13741 We spend a lot of time in quotearg, in particular when --verbose.
13742
13743 * src/symtab.c (symbol_get): Store a quoted version of the key.
13744 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
13745 Adjust all callers.
13746
d2576365
AD
137472002-06-30 Akim Demaille <akim@epita.fr>
13748
13749 * src/state.h (reductions_t): Rename member `nreds' as num.
13750 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
13751 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
13752
ccaf65bc
AD
137532002-06-30 Akim Demaille <akim@epita.fr>
13754
13755 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
13756 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
13757 (shifts_to): Rename as...
13758 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
13759 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
13760 (TRANSITION_IS_DISABLED, transitions_to): these.
13761
87675353
AD
137622002-06-30 Akim Demaille <akim@epita.fr>
13763
13764 * src/print.c (print_shifts, print_gotos): Merge into...
13765 (print_transitions): this.
13766 (print_transitions, print_errs, print_reductions): Align the
13767 lookaheads columns.
13768 (print_core, print_transitions, print_errs, print_state,
13769 print_grammar): Output empty lines separator before, not after.
13770 (state_default_rule_compute): Rename as...
13771 (state_default_rule): this.
13772 * tests/conflicts.at (Defaulted Conflicted Reduction),
13773 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
13774 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
13775
ce4ccb4b
AD
137762002-06-30 Akim Demaille <akim@epita.fr>
13777
13778 Display items as we display rules.
13779
13780 * src/gram.h, src/gram.c (rule_lhs_print): New.
13781 * src/gram.c (grammar_rules_partial_print): Use it.
13782 * src/print.c (print_core): Likewise.
13783 * tests/conflicts.at (Defaulted Conflicted Reduction),
13784 (Unresolved SR Conflicts): Adjust.
13785 (Unresolved SR Conflicts): Adjust and rename as...
13786 (Resolved SR Conflicts): this, as was meant.
13787 * tests/regression.at (Web2c Report): Adjust.
13788
bc933ef1
AD
137892002-06-30 Akim Demaille <akim@epita.fr>
13790
13791 * src/print.c (state_default_rule_compute): New, extracted from...
13792 (print_reductions): here.
13793 Pessimize, but clarify the code.
13794 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
13795
53d4308d
AD
137962002-06-30 Akim Demaille <akim@epita.fr>
13797
13798 * src/output.c (action_row): Let default_rule be always a rule
13799 number.
13800
574fb2d5
AD
138012002-06-30 Akim Demaille <akim@epita.fr>
13802
13803 * src/closure.c (print_firsts, print_fderives, closure):
13804 Use BITSET_EXECUTE.
13805 * src/lalr.c (lookaheads_print): Likewise.
13806 * src/state.c (state_rule_lookaheads_print): Likewise.
13807 * src/print_graph.c (print_core): Likewise.
13808 * src/print.c (print_reductions): Likewise.
13809 * src/output.c (action_row): Likewise.
13810 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
13811
05811fd7
AD
138122002-06-30 Akim Demaille <akim@epita.fr>
13813
13814 * src/print_graph.c: Use report_flag.
13815
0e4d5753
AD
138162002-06-30 Akim Demaille <akim@epita.fr>
13817
13818 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
13819 to...
13820 * src/relation.h, src/relation.c (traverse, relation_digraph)
13821 (relation_print, relation_transpose): New.
13822
24c7d800
AD
138232002-06-30 Akim Demaille <akim@epita.fr>
13824
13825 * src/state.h, src/state.c (shifts_to): New.
13826 * src/lalr.c (build_relations): Use it.
13827
9222837b
AD
138282002-06-30 Akim Demaille <akim@epita.fr>
13829
13830 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
13831 (item_number_of_rule_number, rule_number_of_item_number): New.
13832 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
13833 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
13834 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
13835 Propagate their use.
13836 Much remains to be done, in particular wrt `shorts' from types.h.
13837
260008e5
AD
138382002-06-30 Akim Demaille <akim@epita.fr>
13839
13840 * src/symtab.c (symbol_new): Initialize the `printer' member.
13841
8a731ca8
AD
138422002-06-30 Akim Demaille <akim@epita.fr>
13843
13844 * src/LR0.c (save_reductions): Remove, replaced by...
13845 * src/state.h, src/state.c (state_reductions_set): New.
13846 (reductions, errs): Rename as...
13847 (reductions_t, errs_t): these.
13848 Adjust all dependencies.
13849
32e1e0a4
AD
138502002-06-30 Akim Demaille <akim@epita.fr>
13851
13852 * src/LR0.c (state_list_t, state_list_append): New.
13853 (first_state, last_state): Now symbol_list_t.
13854 (this_state): Remove.
13855 (new_itemsets, append_states, save_reductions): Take a state_t as
13856 argument.
13857 (set_states, generate_states): Adjust.
13858 (save_shifts): Remove, replaced by...
13859 * src/state.h, src/state.c (state_shifts_set): New.
13860 (shifts): Rename as...
13861 (shifts_t): this.
13862 Adjust all dependencies.
13863 * src/state.h (state_t): Remove the `next' member.
13864
e5fb6710
AD
138652002-06-30 Akim Demaille <akim@epita.fr>
13866
13867 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
13868 escaped in slot 0.
13869
c7ca99d4
AD
138702002-06-30 Akim Demaille <akim@epita.fr>
13871
13872 Use hash.h for the state hash table.
13873
13874 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
13875 (allocate_storage): Use state_hash_new.
13876 (free_storage): Use state_hash_free.
13877 (new_state, get_state): Adjust.
13878 * src/lalr.h, src/lalr.c (states): Move to...
13879 * src/states.h (state_t): Remove the `link' member, no longer
13880 used.
13881 * src/states.h, src/states.c: here.
13882 (state_hash_new, state_hash_free, state_hash_lookup)
13883 (state_hash_insert, states_free): New.
13884 * src/states.c (state_table, state_compare, state_hash): New.
13885 * src/output.c (output_actions): Do not free states now, since we
13886 still need to know the final_state number in `prepare', called
13887 afterwards. Do it...
13888 * src/main.c (main): here: call states_free after `output'.
13889
df0e7316
AD
138902002-06-30 Akim Demaille <akim@epita.fr>
13891
13892 * src/state.h, src/state.c (state_new): New, extracted from...
13893 * src/LR0.c (new_state): here.
13894 * src/state.h (STATE_ALLOC): Move to...
13895 * src/state.c: here.
13896 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
13897 * src/state.h, src/state.c: here.
13898
39f41916
AD
138992002-06-30 Akim Demaille <akim@epita.fr>
13900
13901 * src/reader.c (gensym): Rename as...
13902 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
13903 (getsym): Rename as...
13904 (symbol_get): this.
13905
d57650a5
AD
139062002-06-30 Akim Demaille <akim@epita.fr>
13907
13908 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
13909 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
13910 * src/output.c, src/print.c, src/print_graph.c: Propagate.
13911 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
13912
5a08f1ce
AD
139132002-06-30 Akim Demaille <akim@epita.fr>
13914
13915 Make the test suite pass with warnings checked.
13916
13917 * tests/actions.at (Printers and Destructors): Improve.
13918 Avoid unsigned vs. signed issues.
13919 * tests/calc.at: Don't exercise the scanner here, do it...
13920 * tests/input.at (Torturing the Scanner): here.
13921
720623af
PH
139222002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13923
88e7e941 13924 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
13925 reorganize first lines parallel to yacc.c.
13926
fb8135fa
AD
139272002-06-28 Akim Demaille <akim@epita.fr>
13928
13929 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
13930 (b4_token_enum, b4_token_defines): New, factored from...
13931 * data/lalr1.cc, data/yacc.c, glr.c: here.
13932
41442480
AD
139332002-06-28 Akim Demaille <akim@epita.fr>
13934
13935 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
13936 unused variables.
13937 * src/output.c (merger_output): static.
13938
e0e5bf84
AD
139392002-06-28 Akim Demaille <akim@epita.fr>
13940
ba0fe3c7 13941 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
13942 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
13943 pacify GCC.
13944 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 13945
676385e2
PH
139462002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13947
13948 Accumulated changelog for new GLR parsing features.
13949
6a254321 13950 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
13951 conflicts_total_count.
13952 * src/conflicts.h: Ditto.
13953 * src/output.c (token_actions): Use the new name.
13954 (output_conflicts): Change conflp => conflict_list_heads, and
13955 confl => conflict_list for better readability.
13956 * data/glr.c: Use the new names.
13957 * NEWS: Add self to GLR announcement.
e0e5bf84 13958
676385e2
PH
13959 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
13960
13961 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
13962 Akim Demaille.
13963
13964 * data/bison.glr: Change name to glr.c
13965 * data/glr.c: Renamed from bison.glr.
13966 * data/Makefile.am: Add glr.c
e0e5bf84
AD
13967
13968 * src/getargs.c:
13969
676385e2 13970 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 13971 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 13972
676385e2
PH
13973 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13974
13975 * data/bison.glr: Be sure to restore the
13976 current #line when returning to the skeleton contents after having
13977 exposed the input file's #line.
13978
13979 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13980
13981 * data/bison.glr: Bring up to date with changes to bison.simple.
13982
13983 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13984
13985 * data/bison.glr: Correct definitions that use b4_prefix.
13986 Various reformatting.
13987 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
13988 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
13989 yytokenp argument; now part of stack.
13990 (yychar): Define to behave as documented.
13991 (yyclearin): Ditto.
e0e5bf84 13992
676385e2
PH
13993 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13994
13995 * src/reader.h: Add declaration for free_merger_functions.
13996
13997 * src/reader.c (merge_functions): New variable.
13998 (get_merge_function): New function.
13999 (free_merger_functions): New function.
14000 (readgram): Check for %prec that is not followed by a symbol.
14001 Handle %dprec and %merge declarations.
14002 (packgram): Initialize dprec and merger fields in rules array.
14003
14004 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
14005 conflict_list_cnt, conflict_list_free): New variables.
14006 (table_grow): Also grow conflict_table.
e0e5bf84 14007 (prepare_rules): Output dprec and merger tables.
676385e2 14008 (conflict_row): New function.
e0e5bf84 14009 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
14010 default reduction in conflicted states for GLR parser so that there
14011 are spaces for the conflict lists.
14012 (save_row): Also save conflict information.
14013 (token_actions): Allocate conflict list.
14014 (merger_output): New function.
14015 (pack_vector): Pack conflict table, too.
14016 (output_conflicts): New function to output yyconflp and yyconfl.
14017 (output_check): Allocate conflict_tos.
14018 (output_actions): Output conflict tables, also.
14019 (output_skeleton): Output b4_mergers definition.
14020 (prepare): Output b4_max_rhs_length definition.
14021 Use 'bison.glr' as default skeleton for GLR parsers.
14022
14023 * src/gram.c (glr_parser): New flag.
14024 (grammar_free): Call free_merger_functions.
14025
14026 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
14027 all pairs of conflicting reductions, rather than just all tokens
14028 causing conflicts. Needed to size conflict tables.
e0e5bf84 14029 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
14030 interface.
14031 (conflicts_print): Ditto.
14032 (count_total_conflicts): New function.
14033
14034 * src/reader.h (merger_list): New type.
14035 (merge_functions): New variable.
14036
14037 * src/lex.h (tok_dprec, tok_merge): New token types.
14038
14039 * src/gram.h (rule_s): Add dprec and merger fields.
14040 (glr_parser): New flag.
14041
14042 * src/conflicts.h (count_total_conflicts): New function.
14043
14044 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
14045
14046 * doc/bison.texinfo (Generalized LR Parsing): New section.
14047 (GLR Parsers): New section.
14048 (Language and Grammar): Mention GLR parsing.
14049 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
14050 Correct typo ("tge" -> "the").
14051
14052 * data/bison.glr: New skeleton for GLR parsing.
14053
14054 * tests/cxx-gram.at: New tests for GLR parsing.
14055
14056 * tests/testsuite.at: Include cxx-gram.at.
14057
14058 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 14059
676385e2
PH
14060 * src/parse-gram.y:
14061
14062 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
14063
14064 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 14065
b5480d74 140662002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
14067
14068 * src/options.h, src/options.c: Remove.
14069 * src/getargs.c (short_options, long_options): New.
14070
60491a94
AD
140712002-06-27 Akim Demaille <akim@epita.fr>
14072
14073 * data/bison.simple, data/bison.c++: Rename as...
14074 * data/yacc.c, data/lalr1.cc: these.
14075 * doc/bison.texinfo (Environment Variables): Remove.
14076
9be0c25b
AD
140772002-06-25 Raja R Harinath <harinath@cs.umn.edu>
14078
14079 * src/getargs.c (report_argmatch): Initialize strtok().
14080
1ae72863
AD
140812002-06-20 Akim Demaille <akim@epita.fr>
14082
14083 * data/bison.simple (b4_symbol_actions): New, replaces...
14084 (b4_symbol_destructor, b4_symbol_printer): these.
14085 (yysymprint): Be sure to call YYPRINT only for tokens, and using
14086 user token numbers.
14087
87542d29
AD
140882002-06-20 Akim Demaille <akim@epita.fr>
14089
14090 * data/bison.simple (yydestructor): Rename as...
14091 (yydestruct): this.
14092
1a31ed21
AD
140932002-06-20 Akim Demaille <akim@epita.fr>
14094
14095 * src/symtab.h, src/symtab.c (symbol_type_set)
14096 (symbol_destructor_set, symbol_precedence_set): The location is
14097 the last argument.
14098 Adjust all callers.
14099
e776192e
AD
141002002-06-20 Akim Demaille <akim@epita.fr>
14101
14102 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
14103 internals.
14104 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
14105 Takes a location.
14106 * src/symtab.h, src/symtab.c (symbol_class_set)
14107 (symbol_user_token_number_set): Likewise.
14108 Adjust all callers.
14109 Promote complain_at.
14110 * tests/input.at (Type Clashes): Adjust.
14111
5c1180b3
AD
141122002-06-20 Akim Demaille <akim@epita.fr>
14113
14114 * data/bison.simple (YYLEX): Fix the declaration when
14115 %pure-parser.
14116
e3170060
AD
141172002-06-20 Akim Demaille <akim@epita.fr>
14118
14119 * data/bison.simple (yysymprint): Don't print the token number,
14120 just its name.
14121 * tests/actions.at (Destructors): Rename as...
14122 (Printers and Destructors): this.
14123 Also exercise %printer.
14124
253862fd
AD
141252002-06-20 Akim Demaille <akim@epita.fr>
14126
14127 * data/bison.simple (YYDSYMPRINT): New.
14128 Use it to remove many of the #if YYDEBUG/if (yydebug).
14129
366eea36
AD
141302002-06-20 Akim Demaille <akim@epita.fr>
14131
14132 * src/symtab.h, src/symtab.c (symbol_t): printer and
14133 printer_location are new members.
14134 (symbol_printer_set): New.
14135 * src/parse-gram.y (PERCENT_PRINTER): New token.
14136 Handle its associated rule.
14137 * src/scan-gram.l: Adjust.
14138 (handle_destructor_at, handle_destructor_dollar): Rename as...
14139 (handle_symbol_code_at, handle_symbol_code_dollar): these.
14140 * src/output.c (symbol_printers_output): New.
14141 (output_skeleton): Call it.
14142 * data/bison.simple (yysymprint): New. Cannot be named yyprint
14143 since there are already many grammar files with a user `yyprint'.
14144 Replace the calls to YYPRINT to calls to yysymprint.
14145 * tests/calc.at: Adjust.
14146 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
14147 taking advantage of parser very internal details (stack size!).
14148
4f25ebb0
AD
141492002-06-20 Akim Demaille <akim@epita.fr>
14150
14151 * src/scan-gram.l: Complete the scanner with the missing patterns
14152 to pacify Flex.
14153 Use `quote' and `symbol_tag_get' where appropriate.
14154
93b68a0e
AD
141552002-06-19 Akim Demaille <akim@epita.fr>
14156
14157 * tests/actions.at (Destructors): Augment to test locations.
14158 * data/bison.simple (yydestructor): Pass it the current location
14159 if locations are enabled.
14160 Prototype only when __STDC__ or C++.
14161 Change the argument names to move into the yy name space: there is
14162 user code here.
14163
58612f1d
AD
141642002-06-19 Akim Demaille <akim@epita.fr>
14165
74310291
AD
14166 * data/bison.simple (b4_pure_if): New.
14167 Use it instead of #ifdef YYPURE.
14168
141692002-06-19 Akim Demaille <akim@epita.fr>
14170
14171 * data/bison.simple (b4_location_if): New.
58612f1d
AD
14172 Use it instead of #ifdef YYLSP_NEEDED.
14173
f25bfb75
AD
141742002-06-19 Akim Demaille <akim@epita.fr>
14175
14176 Prepare @$ in %destructor, but currently don't bind it in the
14177 skeleton, as %location use is not cleaned up yet.
14178
14179 * src/scan-gram.l (handle_dollar, handle_destructor_at)
14180 (handle_action_at): New.
14181 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
14182 a braced_code_t and a location as additional arguments.
14183 (handle_destructor_dollar): Instead of requiring `b4_eval', just
14184 unquote one when outputting `b4_dollar_dollar'.
14185 Adjust callers.
14186 * data/bison.simple (b4_eval): Remove.
14187 (b4_symbol_destructor): Adjust.
14188 * tests/input.at (Invalid @n): Adjust.
14189
c732d2c6
AD
141902002-06-19 Zack Weinberg <zack@codesourcery.com>
14191
14192 * doc/bison.texinfo: Document ability to have multiple
14193 prologue sections.
14194
8c165d89
AD
141952002-06-18 Akim Demaille <akim@epita.fr>
14196
14197 * src/files.c (compute_base_names): When computing the output file
14198 names from the input file name, strip the directory part.
14199
ca98bf57
AD
142002002-06-18 Akim Demaille <akim@epita.fr>
14201
14202 * data/bison.simple.new: Comment changes.
14203 Reported by Andreas Schwab.
14204
0bfb02ff
AD
142052002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
14206
14207 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
14208 there are no `label `yyoverflowlab' defined but not used' warnings
14209 when yyoverflow is defined.
14210
24c0aad7
AD
142112002-06-18 Akim Demaille <akim@epita.fr>
14212
14213 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
14214 new member.
14215 (symbol_destructor_set): Adjust.
14216 * src/output.c (symbol_destructors_output): Output the destructor
14217 locations.
14218 Output the symbol name.
14219 * data/bison.simple (b4_symbol_destructor): Adjust.
14220
5719c109
AD
142212002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
14222 and Akim Demaille <akim@epita.fr>
14223
14224 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
14225 what's left on the stack when the error recovery hits EOF.
14226 * tests/actions.at (Destructors): Complete to exercise this case.
14227
9280d3ef
AD
142282002-06-17 Akim Demaille <akim@epita.fr>
14229
14230 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
14231 arguments is really empty, not only equal to `[]'.
14232 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
14233 member.
14234 (symbol_destructor_set): New.
14235 * src/output.c (symbol_destructors_output): New.
14236 * src/reader.h (brace_code_t, current_braced_code): New.
14237 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
14238 (handle_dollar): Rename as...
14239 (handle_action_dollar): this.
14240 (handle_destructor_dollar): New.
14241 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
14242 (grammar_declaration): Use it.
14243 * data/bison.simple (yystos): Is always defined.
14244 (yydestructor): New.
14245 * tests/actions.at (Destructors): New.
14246 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
14247
dafdc66f
AD
142482002-06-17 Akim Demaille <akim@epita.fr>
14249
14250 * src/symlist.h, src/symlist.c (symbol_list_length): New.
14251 * src/scan-gram.l (handle_dollar, handle_at): Compute the
14252 rule_length only when needed.
14253 * src/output.c (actions_output, token_definitions_output): Output
14254 the full M4 block.
14255 * src/symtab.c: Don't access directly to the symbol tag, use
14256 symbol_tag_get.
14257 * src/parse-gram.y: Use symbol_list_free.
14258
56c47203
AD
142592002-06-17 Akim Demaille <akim@epita.fr>
14260
14261 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
14262 (symbol_list_prepend, get_type_name): Move to...
14263 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
14264 (symbol_list_prepend, symbol_list_n_type_name_get): here.
14265 Adjust all callers.
14266 (symbol_list_free): New.
14267 * src/scan-gram.l (handle_dollar): Takes a location.
14268 * tests/input.at (Invalid $n): Adjust.
14269
1e0bab92
AD
142702002-06-17 Akim Demaille <akim@epita.fr>
14271
14272 * src/reader.h, src/reader.c (symbol_list_new): Export it.
14273 (symbol_list_prepend): New.
14274 * src/parse-gram.y (%union): `list' is a new member.
14275 (symbols.1): New, replaces...
14276 (terms_to_prec.1, nterms_to_type.1): these.
14277 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
14278 Take a location as additional argument.
14279 Adjust all callers.
14280
04e60654
AD
142812002-06-15 Akim Demaille <akim@epita.fr>
14282
14283 * src/parse-gram.y: Move %token in the declaration section so that
14284 we don't depend upon CVS Bison.
14285
10e5b8bd
AD
142862002-06-15 Akim Demaille <akim@epita.fr>
14287
14288 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
14289 * src/print.c (print_core): Use it.
14290
9801d40c
AD
142912002-06-15 Akim Demaille <akim@epita.fr>
14292
14293 * src/conflicts.c (log_resolution): Accept the rule involved in
14294 the sr conflicts instead of the lookahead number that points to
14295 that rule.
14296 (flush_reduce): Accept the current lookahead vector as argument,
14297 instead of the index in LA.
14298 (resolve_sr_conflict): Accept the current number of lookahead
14299 bitset to consider for the STATE, instead of the index in LA.
14300 (set_conflicts): Adjust.
14301 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
14302
c0263492
AD
143032002-06-15 Akim Demaille <akim@epita.fr>
14304
14305 * src/state.h (state_t): Replace the `lookaheadsp' member, a
14306 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
14307 Adjust all dependencies.
14308 * src/lalr.c (initialize_lookaheads): Split into...
14309 (states_lookaheads_count, states_lookaheads_initialize): these.
14310 (lalr): Adjust.
14311
9757c359
AD
143122002-06-15 Akim Demaille <akim@epita.fr>
14313
14314 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
14315 out of...
14316 (grammar_rules_print): here.
14317 * src/reduce.c (reduce_output): Use it.
14318 * tests/reduce.at (Useless Rules, Reduced Automaton)
14319 (Underivable Rules): Adjust.
14320
6b98e4b5
AD
143212002-06-15 Akim Demaille <akim@epita.fr>
14322
14323 Copy BYacc's nice way to report the grammar.
14324
14325 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
14326 New.
14327 Don't print the rules' location, it is confusing and useless.
14328 (rule_print): Use grammar_rhs_print.
14329 * src/print.c (print_grammar): Use grammar_rules_print.
14330
6b98e4b5
AD
143312002-06-15 Akim Demaille <akim@epita.fr>
14332
14333 Complete and rationalize `useless thing' warnings.
14334
14335 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
14336 (symbol_tag_print): New.
14337 Use them everywhere in place of accessing directly the tag member.
14338 * src/gram.h, src/gram.c (rule_print): New.
14339 Use it where a rule used to be printed `by hand'.
14340 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
14341 (reduce_grammar_tables): Report the useless rules.
14342 (reduce_print): Useless things are a warning, not an error.
14343 Report it as such.
14344 * tests/reduce.at (Useless Nonterminals, Useless Rules):
14345 (Reduced Automaton, Underivable Rules): Adjust.
14346 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
14347 * tests/conflicts.at (Unresolved SR Conflicts)
14348 (Solved SR Conflicts): Adjust.
14349
ee000ba4
AD
143502002-06-15 Akim Demaille <akim@epita.fr>
14351
14352 Let symbols have a location.
14353
14354 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
14355 (getsym): Adjust.
14356 Adjust all callers.
14357 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
14358 Use location_t, not int.
14359 * src/symtab.c (symbol_check_defined): Take advantage of the
14360 location.
14361 * tests/regression.at (Invalid inputs): Adjust.
14362
8efe435c
AD
143632002-06-15 Akim Demaille <akim@epita.fr>
14364
14365 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
14366 (input): Don't try to initialize yylloc here, do it in the
14367 scanner.
14368 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
14369 * src/gram.h (rule_t): Change line and action_line into location
14370 and action_location, of location_t type.
14371 Adjust all dependencies.
14372 * src/location.h, src/location.c (empty_location): New.
14373 * src/reader.h, src/reader.c (grammar_start_symbol_set)
14374 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
14375 (grammar_current_rule_symbol_append)
14376 (grammar_current_rule_action_append): Expect a location as argument.
14377 * src/reader.c (grammar_midrule_action): Adjust to attach an
14378 action's location as dummy symbol location.
14379 * src/symtab.h, src/symtab.c (startsymbol_location): New.
14380 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
14381 the line numbers.
14382
1921f1d7
AD
143832002-06-14 Akim Demaille <akim@epita.fr>
14384
14385 Grammar declarations may be found in the grammar section.
14386
14387 * src/parse-gram.y (rules_or_grammar_declaration): New.
14388 (declarations): Each declaration may end with a semicolon, not
14389 just...
14390 (grammar_declaration): `"%union"'.
14391 (grammar): Branch to rules_or_grammar_declaration.
14392
4515534c
AD
143932002-06-14 Akim Demaille <akim@epita.fr>
14394
14395 * src/main.c (main): Invoke scanner_free.
14396
f958596b
AD
143972002-06-14 Akim Demaille <akim@epita.fr>
14398
14399 * src/output.c (m4_invoke): Extracted from...
14400 (output_skeleton): here.
14401 Free tempfile.
14402
2c569025
AD
144032002-06-14 Akim Demaille <akim@epita.fr>
14404
14405 * src/parse-gram.y (directives, directive, gram)
14406 (grammar_directives, precedence_directives, precedence_directive):
14407 Rename as...
14408 (declarations, declaration, grammar, grammar_declaration)
14409 (precedence_declaration, precedence_declarator): these.
14410 (symbol_declaration): New.
14411
592e8d4d
AD
144122002-06-14 Akim Demaille <akim@epita.fr>
14413
14414 * src/files.c (action_obstack): Remove, unused.
14415 (output_obstack): Remove it, and all its dependencies, as it is no
14416 longer needed.
14417 * src/reader.c (epilogue_set): Build the epilogue in the
14418 muscle_obstack.
14419 * src/output.h, src/output.c (muscle_obstack): Move to...
14420 * src/muscle_tab.h, src/muscle_tab.h: here.
14421 (muscle_init): Initialize muscle_obstack.
14422 (muscle_free): New.
14423 * src/main.c (main): Call it.
14424
0c15323d
AD
144252002-06-14 Akim Demaille <akim@epita.fr>
14426
14427 * src/location.h: New, extracted from...
14428 * src/reader.h: here.
14429 * src/Makefile.am (noinst_HEADERS): Merge into
14430 (bison_SOURCES): this.
14431 Add location.h.
14432 * src/parse-gram.y: Use location_t instead of Bison's.
14433 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
14434 Use location_t instead of ints.
14435
e96c9728
AD
144362002-06-14 Akim Demaille <akim@epita.fr>
14437
14438 * data/bison.simple, data/bison.c++: Be sure to restore the
14439 current #line when returning to the skeleton contents after having
14440 exposed the input file's #line.
14441
75d1fe16
AD
144422002-06-12 Akim Demaille <akim@epita.fr>
14443
14444 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
14445 eager.
14446 * tests/actions.at (Exotic Dollars): New.
14447
6c35d22c
AD
144482002-06-12 Akim Demaille <akim@epita.fr>
14449
14450 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
14451 ['"/] too eagerly.
14452 * tests/input.at (Torturing the Scanner): New.
14453
1d6412ad
AD
144542002-06-11 Akim Demaille <akim@epita.fr>
14455
14456 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
14457 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
14458 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
14459 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
14460 * src/reader.c (reader): Use it.
14461
4cdb01db
AD
144622002-06-11 Akim Demaille <akim@epita.fr>
14463
14464 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
14465 Adjust all callers.
14466 (scanner_last_string_free): New.
14467
44995b2e
AD
144682002-06-11 Akim Demaille <akim@epita.fr>
14469
14470 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
14471 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
14472 (last_string, YY_OBS_FREE): New.
14473 Use them when returning an ID.
14474
e9955c83
AD
144752002-06-11 Akim Demaille <akim@epita.fr>
14476
14477 Have Bison grammars parsed by a Bison grammar.
14478
14479 * src/reader.c, src/reader.h (prologue_augment): New.
14480 * src/reader.c (copy_definition): Remove.
14481
14482 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
14483 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
14484 (grammar_current_rule_prec_set, grammar_current_rule_check)
14485 (grammar_current_rule_symbol_append)
14486 (grammar_current_rule_action_append): Export.
14487 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
14488 (symbol_list_action_append): Remove.
14489 Hook the routines from reader.
14490 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
14491 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
14492
14493 * src/reader.c (read_declarations): Remove, unused.
14494
14495 * src/parse-gram.y: Handle the epilogue.
14496 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
14497 (grammar_start_symbol_set): this.
14498 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
14499 * src/reader.c (readgram): Remove, unused.
14500 (reader): Adjust to insert eoftoken and axiom where appropriate.
14501
14502 * src/reader.c (copy_dollar): Replace with...
14503 * src/scan-gram.h (handle_dollar): this.
14504 * src/parse-gram.y: Remove `%thong'.
14505
14506 * src/reader.c (copy_at): Replace with...
14507 * src/scan-gram.h (handle_at): this.
14508
14509 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
14510 New.
14511
14512 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
14513 time being.
14514
14515 * src/reader.h, src/reader.c (grammar_rule_end): New.
14516
14517 * src/parse.y (current_type, current_class): New.
14518 Implement `%nterm', `%token' support.
14519 Merge `%term' into `%token'.
14520 (string_as_id): New.
14521 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
14522 type name.
14523
14524 * src/parse-gram.y: Be sure to handle properly the beginning of
14525 rules.
14526
14527 * src/parse-gram.y: Handle %type.
14528 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
14529
14530 * src/parse-gram.y: More directives support.
14531 * src/options.c: No longer handle source directives.
14532
14533 * src/parse-gram.y: Fix %output.
14534
14535 * src/parse-gram.y: Handle %union.
14536 Use the prologue locations.
14537 * src/reader.c (parse_union_decl): Remove.
14538
14539 * src/reader.h, src/reader.c (epilogue_set): New.
14540 * src/parse-gram.y: Use it.
14541
14542 * data/bison.simple, data/bison.c++: b4_stype is now either not
14543 defined, then default to int, or to the contents of %union,
14544 without `union' itself.
14545 Adjust.
14546 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
14547
14548 * src/output.c (actions_output): Don't output braces, as they are
14549 already handled by the scanner.
14550
14551 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
14552 characters to themselves.
14553
14554 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
14555 that the epilogue has a proper #line.
14556
14557 * src/parse-gram.y: Handle precedence/associativity.
14558
14559 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
14560 a terminal.
14561 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
14562 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
14563 at all to define terminals that cannot be emitted.
14564
14565 * src/scan-gram.l: Escape M4 characters.
14566
14567 * src/scan-gram.l: Working properly with escapes in user
14568 strings/characters.
14569
14570 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
14571 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
14572 grammar.
14573 Use more modest sizes, as for the time being the parser does not
14574 release memory, and therefore the process swallows a huge amount
14575 of memory.
14576
14577 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
14578 stricter %token grammar.
14579
14580 * src/symtab.h (associativity): Add `undef_assoc'.
14581 (symbol_precedence_set): Do nothing when passed an undef_assoc.
14582 * src/symtab.c (symbol_check_alias_consistence): Adjust.
14583
14584 * tests/regression.at (Invalid %directive): Remove, as it is now
14585 meaningless.
14586 (Invalid inputs): Adjust to the new error messages.
14587 (Token definitions): The new grammar doesn't allow too many
14588 eccentricities.
14589
14590 * src/lex.h, src/lex.c: Remove.
14591 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
14592 (copy_character, copy_string2, copy_string, copy_identifier)
14593 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
14594 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
14595 (parse_action): Remove.
14596 * po/POTFILES.in: Adjust.
14597
2e047461
AD
145982002-06-11 Akim Demaille <akim@epita.fr>
14599
cd05d13c 14600 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
14601 rule's action member: return the action as a string.
14602 Don't require `rule_length' as an argument: compute it.
14603 (grammar_current_rule_symbol_append)
14604 (grammar_current_rule_action_append): New, eved out from
14605 (readgram): here.
14606 Remove `action_flag', `rulelength', unused now.
14607
9af3fbce
AD
146082002-06-11 Akim Demaille <akim@epita.fr>
14609
14610 * src/reader.c (grammar_current_rule_prec_set).
14611 (grammar_current_rule_check): New, eved out from...
14612 (readgram): here.
14613 Remove `xaction', `first_rhs': useless.
14614 * tests/input.at (Type clashes): New.
14615 * tests/existing.at (GNU Cim Grammar): Adjust.
14616
1485e106
AD
146172002-06-11 Akim Demaille <akim@epita.fr>
14618
14619 * src/reader.c (grammar_midrule_action): New, Eved out from
14620 (readgram): here.
14621
da4160c3
AD
146222002-06-11 Akim Demaille <akim@epita.fr>
14623
14624 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
14625 New.
14626 (readgram): Use them as replacement of inlined code, crule and
14627 crule1.
14628
f6d0f937
AD
146292002-06-11 Akim Demaille <akim@epita.fr>
14630
14631 * src/reader.c (grammar_end, grammar_symbol_append): New.
14632 (readgram): Use them.
14633 Make the use of `p' as local as possible.
14634
69078d4b
AD
146352002-06-10 Akim Demaille <akim@epita.fr>
14636
14637 GCJ's parser requires the tokens to be defined before the prologue.
14638
14639 * data/bison.simple: Output the token definition before the user's
14640 prologue.
14641 * tests/regression.at (Braces parsing, Duplicate string)
14642 (Mixing %token styles): Check the output from bison.
14643 (Early token definitions): New.
14644
5e424082
AD
146452002-06-10 Akim Demaille <akim@epita.fr>
14646
14647 * src/symtab.c (symbol_user_token_number_set): Don't complain when
14648 assigning twice the same user number to a token, so that we can
14649 use it in...
14650 * src/lex.c (lex): here.
14651 Also use `symbol_class_set' instead of hand written code.
14652 * src/reader.c (parse_assoc_decl): Likewise.
14653
44536b35
AD
146542002-06-10 Akim Demaille <akim@epita.fr>
14655
14656 * src/symtab.c, src/symtab.c (symbol_class_set)
14657 (symbol_user_token_number_set): New.
14658 * src/reader.c (parse_token_decl): Use them.
14659 Use a switch instead of ifs.
14660 Use a single argument.
14661
8b9f2372
AD
146622002-06-10 Akim Demaille <akim@epita.fr>
14663
14664 Remove `%thong' support as it is undocumented, unused, duplicates
14665 `%token's job, and creates useless e-mail traffic with people who
14666 want to know what it is, why it is undocumented, unused, and
14667 duplicates `%token's job.
14668
14669 * src/reader.c (parse_thong_decl): Remove.
14670 * src/options.c (option_table): Remove "thong".
14671 * src/lex.h (tok_thong): Remove.
14672
3ae2b51f
AD
146732002-06-10 Akim Demaille <akim@epita.fr>
14674
14675 * src/symtab.c, src/symtab.c (symbol_type_set)
14676 (symbol_precedence_set): New.
14677 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
14678 (value_components_used): Remove, unused.
14679
2f1afb73
AD
146802002-06-09 Akim Demaille <akim@epita.fr>
14681
14682 Move symbols handling code out of the reader.
14683
14684 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
14685 (axiom): Move to...
14686 * src/symtab.h, src/symtab.c: here.
14687
14688 * src/gram.c (start_symbol): Remove: use startsymbol->number.
14689 * src/reader.c (startval): Rename as...
14690 * src/symtab.h, src/symtab.c (startsymbol): this.
14691 * src/reader.c: Adjust.
14692
14693 * src/reader.c (symbol_check_defined, symbol_make_alias)
14694 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14695 (token_translations_init)
14696 Move to...
14697 * src/symtab.c: here.
14698 * src/reader.c (packsymbols): Move to...
14699 * src/symtab.h, src/symtab.c (symbols_pack): here.
14700 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
14701 argument.
14702
e9bca3ad
AD
147032002-06-03 Akim Demaille <akim@epita.fr>
14704
14705 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
14706 then statements.
14707
86eff183
AD
147082002-06-03 Akim Demaille <akim@epita.fr>
14709
14710 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
14711 structs with non literals.
14712 * src/scan-skel.l: never-interactive.
14713 * src/conflicts.c (enum conflict_resolution_e): No trailing
14714 comma.
14715 * src/getargs.c (usage): Split long literal strings.
14716 Reported by Hans Aberg.
14717
717be197
AD
147182002-05-28 Akim Demaille <akim@epita.fr>
14719
14720 * data/bison.c++: Use C++ ostreams.
14721 (cdebug_): New member.
14722
670ddffd
AD
147232002-05-28 Akim Demaille <akim@epita.fr>
14724
14725 * src/output.c (output_skeleton): Be sure to allocate enough room
14726 for `/' _and_ for `\0' in full_skeleton.
14727
769b430f
AD
147282002-05-28 Akim Demaille <akim@epita.fr>
14729
14730 * data/bison.c++: Catch up with bison.simple:
14731 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14732 and Paul Eggert <eggert@twinsun.com>: `error' handing.
14733 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
14734 and popping traces.
14735
7067cb36
PH
147362002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14737
14738 * src/output.c (output_skeleton): Put an explicit path in front of
14739 the skeleton file name, rather than relying on the -I directory,
14740 to partially alleviate effects of having a skeleton file lying around
14741 in the current directory.
769b430f 14742
4a713ec2
PH
147432002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14744
769b430f 14745 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
14746 obstack_printf should be obstack_fgrow1.
14747
b408954b
AD
147482002-05-26 Akim Demaille <akim@epita.fr>
14749
14750 * src/state.h (state_t): `solved_conflicts' is a new member.
14751 * src/LR0.c (new_state): Set it to 0.
14752 * src/conflicts.h, src/conflicts.c (print_conflicts)
14753 (free_conflicts, solve_conflicts): Rename as...
14754 (conflicts_print, conflicts_free, conflicts_solve): these.
14755 Adjust callers.
14756 * src/conflicts.c (enum conflict_resolution_e)
14757 (solved_conflicts_obstack): New, used by...
14758 (log_resolution): this.
14759 Adjust to attach the conflict resolution to each state.
14760 Complete the description with the precedence/associativity
14761 information.
14762 (resolve_sr_conflict): Adjust.
14763 * src/print.c (print_state): Output its solved_conflicts.
14764 * tests/conflicts.at (Unresolved SR Conflicts)
14765 (Solved SR Conflicts): Exercise --report=all.
14766
a49aecd5
AD
147672002-05-26 Akim Demaille <akim@epita.fr>
14768
14769 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14770 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14771 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
14772 (token_number_t, item_number_as_token_number)
14773 (token_number_as_item_number, muscle_insert_token_number_table):
14774 Rename as...
14775 (symbol_number_t, item_number_as_symbol_number)
14776 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
14777 these, since it is more appropriate.
14778
5504898e
AD
147792002-05-26 Akim Demaille <akim@epita.fr>
14780
14781 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
14782 `Error:' lines.
14783 * data/bison.simple (yystos) [YYDEBUG]: New.
14784 (yyparse) [YYDEBUG]: Display the symbols which are popped during
14785 error recovery.
14786 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
14787
ec3bc396
AD
147882002-05-25 Akim Demaille <akim@epita.fr>
14789
14790 * doc/bison.texinfo (Debugging): Split into...
14791 (Tracing): this new section, its former contents, and...
14792 (Understanding): this new section.
14793 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
14794 by...
14795 (report_flag): this.
14796 Adjust all dependencies.
14797 (report_args, report_types, report_argmatch): New.
14798 (usage, getargs): Report/support -r, --report.
14799 * src/options.h
14800 (struct option_table_struct): Rename as..,
14801 (struct option_table_s): this.
14802 Rename the `set_flag' member to `flag' to match with getopt_long's
14803 struct.
14804 * src/options.c (option_table): Split verbose into an entry for
14805 %verbose, and another for --verbose.
14806 Support --report/-r, so remove -r from the obsolete --raw.
14807 * src/print.c: Attach full item sets and lookaheads reports to
14808 report_flag instead of trace_flag.
14809 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
14810
78df8250
PE
148112002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14812 and Paul Eggert <eggert@twinsun.com>
769b430f 14813
78df8250
PE
14814 * data/bison.simple (yyparse): Correct error handling to conform to
14815 POSIX and yacc. Specifically, after syntax error is discovered,
14816 do not reduce further before shifting the error token.
14817 Clean up the code a bit by removing the labels yyerrdefault,
14818 yyerrhandle, yyerrpop.
14819 * NEWS: Document the above.
14820
c0c9ea05
PH
148212002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14822
14823 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
14824 type; it isn't always big enough, since it doesn't necessarily
14825 include non-terminals.
769b430f 14826 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
14827 the latter can be removed.
14828 (yy_token_number_type): Remove, only one use.
14829 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
14830 don't use TokenNumberType as element type.
769b430f 14831
c0c9ea05
PH
14832 * tests/regression.at: Modify expected output to agree with change
14833 to yyr1 and yytranslate.
769b430f 14834
6390a83f
FK
148352002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
14836
14837 * src/reader.c (parse_action): Use copy_character instead of
14838 obstack_1grow.
14839
db7c8e9a
AD
148402002-05-13 Akim Demaille <akim@epita.fr>
14841
14842 * tests/regression.at (Token definitions): Prototype yylex and
14843 yyerror.
14844
fcc61800
PH
148452002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14846
158c687b 14847 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
14848 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
14849 32-bit arithmetic.
14850 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
14851
5683e9b2
AD
148522002-05-07 Akim Demaille <akim@epita.fr>
14853
14854 * tests/synclines.at: Be sure to prototype yylex and yyerror to
14855 avoid GCC warnings.
14856
0c2d3f4c
AD
148572002-05-07 Akim Demaille <akim@epita.fr>
14858
14859 Kill GCC warnings.
14860
14861 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
14862 over the RHS of each rule.
14863 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
14864 * src/state.h (state_t): Member `nitems' is unsigned short.
14865 * src/LR0.c (get_state): Adjust.
14866 * src/reader.c (packgram): Likewise.
14867 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
14868 `Type'.
14869 (muscle_insert_int_table): Remove, unused.
14870 (prepare_rules): Remove `max'.
14871
1565b720
AD
148722002-05-06 Akim Demaille <akim@epita.fr>
14873
14874 * src/closure.c (print_firsts): Display of the symbol tags.
14875 (bitmatrix_print): Move to...
14876 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
14877 here.
14878 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
14879
cfaee611
AD
148802002-05-06 Akim Demaille <akim@epita.fr>
14881
14882 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
14883 hash_do_for_each.
14884
458be8e0
AD
148852002-05-06 Akim Demaille <akim@epita.fr>
14886
14887 * src/LR0.c (new_state, get_state): Instead of using the global
14888 `kernel_size' and `kernel_base', have two new arguments:
14889 `core_size' and `core'.
14890 Adjust callers.
14891
a900a624
AD
148922002-05-06 Akim Demaille <akim@epita.fr>
14893
14894 * src/reader.c (packgram): No longer end `ritem' with a 0
14895 sentinel: it is not used.
14896
d4e7d3a1
AD
148972002-05-05 Akim Demaille <akim@epita.fr>
14898
14899 New experimental feature: display the lookaheads in the report and
14900 graph.
14901
14902 * src/print (print_core): When --trace-flag, display the rules
14903 lookaheads.
14904 * src/print_graph.c (print_core): Likewise.
14905 Swap the arguments.
14906 Adjust caller.
14907
39ceb25b
AD
149082002-05-05 Akim Demaille <akim@epita.fr>
14909
14910 * tests/torture.at (Many lookaheads): New test.
14911
5372019f
AD
149122002-05-05 Akim Demaille <akim@epita.fr>
14913
14914 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
14915 (GENERATE_MUSCLE_INSERT_TABLE): this.
14916 (output_int_table, output_unsigned_int_table, output_short_table)
14917 (output_token_number_table, output_item_number_table): Replace with...
14918 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
14919 (muscle_insert_short_table, muscle_insert_token_number_table)
14920 (muscle_insert_item_number_table): these.
14921 Adjust all callers.
14922 (prepare_tokens): Don't free `translations', since...
14923 * src/reader.h, src/reader.c (grammar_free): do it.
14924 Move to...
14925 * src/gram.h, src/gram.c (grammar_free): here.
14926 * data/bison.simple, data/bison.c++: b4_token_number_max is now
14927 b4_translate_max.
14928
5df5f6d5
AD
149292002-05-05 Akim Demaille <akim@epita.fr>
14930
14931 * src/output.c (output_unsigned_int_table): New.
14932 (prepare_rules): `i' is unsigned.
14933 `prhs', `rline', `r2' are unsigned int.
14934 Rename muscle `rhs_number_max' as `rhs_max'.
14935 Output muscles `prhs_max', `rline_max', and `r2_max'.
14936 Free rline and r1.
14937 * data/bison.simple, data/bison.c++: Adjust to use these muscles
14938 to compute types instead of constant types.
14939 * tests/regression.at (Web2c Actions): Adjust.
14940
b87f8b21
AD
149412002-05-04 Akim Demaille <akim@epita.fr>
14942
14943 * src/symtab.h (SALIAS, SUNDEF): Rename as...
14944 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
14945 Adjust dependencies.
14946 * src/output.c (token_definitions_output): Be sure not to output a
14947 `#define 'a'' when fed with `%token 'a' "a"'.
14948 * tests/regression.at (Token definitions): New.
14949
8bb936e4
PE
149502002-05-03 Paul Eggert <eggert@twinsun.com>
14951
14952 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
14953 for K&R C.
14954
149552002-05-03 gettextize <bug-gnu-gettext@gnu.org>
14956
14957 * Makefile.am (SUBDIRS): Remove intl.
14958 (EXTRA_DIST): Add config/config.rpath.
14959
53c71a12
AD
149602002-05-03 Akim Demaille <akim@epita.fr>
14961
14962 * data/bison.simple (m4_if): Don't output empty enums.
14963 And actually, output valid enum definitions :(.
14964
289dd0cf
AD
149652002-05-03 Akim Demaille <akim@epita.fr>
14966
14967 * configure.bat: Remove, completely obsolete.
14968 * Makefile.am (EXTRA_DIST): Adjust.
14969 Don't distribute config.rpath...
14970 * config/Makefile.am (EXTRA_DIST): Do it.
14971
db85e524
AD
149722002-05-03 Akim Demaille <akim@epita.fr>
14973
14974 * configure.in (GETTEXT_VERSION): New.
14975 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
14976
83ccf991
AD
149772002-05-03 Akim Demaille <akim@epita.fr>
14978
14979 * data/bison.simple (b4_token_enum): New.
14980 (b4_token_defines): Use it to output tokens both as #define and
14981 enums.
14982 Suggested by Paul Eggert.
14983 * src/output.c (token_definitions_output): Don't output spurious
14984 white spaces.
14985
1f418995
AD
149862002-05-03 Akim Demaille <akim@epita.fr>
14987
14988 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14989
45119f04
RA
149902002-05-02 Robert Anisko <robert@lrde.epita.fr>
14991
14992 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
14993 Update the stack class, give a try to deque as the default container.
14994
b2d52318
AD
149952002-05-02 Akim Demaille <akim@epita.fr>
14996
14997 * data/bison.simple (yyparse): Do not implement @$ = @1.
14998 (YYLLOC_DEFAULT): Adjust to do it.
14999 * doc/bison.texinfo (Location Default Action): Fix.
15000
3a8b4109
AD
150012002-05-02 Akim Demaille <akim@epita.fr>
15002
15003 * src/reader.c (parse_braces): Merge into...
15004 (parse_action): this.
15005
84614e13
AD
150062002-05-02 Akim Demaille <akim@epita.fr>
15007
15008 * configure.in (ALL_LINGUAS): Remove.
15009 * po/LINGUAS, hr.po: New.
15010
fdbcd8e2
AD
150112002-05-02 Akim Demaille <akim@epita.fr>
15012
15013 Remove the so called hairy (semantic) parsers.
15014
15015 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
15016 * src/gram.h, src/gram.c (semantic_parser): Remove.
15017 (rule_t): Remove the guard and guard_line members.
15018 * src/lex.h (token_t): remove tok_guard.
15019 * src/options.c (option_table): Remove %guard and %semantic_parser
15020 support.
15021 * src/output.c, src/output.h (guards_output): Remove.
15022 (prepare): Adjust.
15023 (token_definitions_output): Don't output the `T'
15024 tokens (???).
15025 (output_skeleton): Don't output the guards.
15026 * src/files.c, src/files.c (attrsfile): Remove.
15027 * src/reader.c (symbol_list): Remove the guard and guard_line
15028 members.
15029 Adjust dependencies.
15030 (parse_guard): Remove.
15031 * data/bison.hairy: Remove.
15032 * doc/bison.texinfo (Environment Variables): Remove occurrences of
15033 BISON_HAIRY.
15034
82b6cb3f
AD
150352002-05-02 Akim Demaille <akim@epita.fr>
15036
15037 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
15038 (parse_guard): Rename the formal argument `stack_offset' as
15039 `rule_length', which is more readable.
15040 Adjust callers.
15041 (copy_at, copy_dollar): Instead of outputting the hard coded
15042 values of $$, $n and so forth, output invocation to b4_lhs_value,
15043 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
15044 Note: this patch partially drops `semantic-parser' support: it
15045 always does `rule_length - n', where semantic parsers ought to
15046 always use `-n'.
82b6cb3f
AD
15047 * data/bison.simple, data/bison.c++ (b4_lhs_value)
15048 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
15049
6cbfbcc5
AD
150502002-05-02 Akim Demaille <akim@epita.fr>
15051
15052 * configure.in (AC_INIT): Bump to 1.49b.
15053 (AM_INIT_AUTOMAKE): Short invocation.
15054
b8548114
AD
150552002-05-02 Akim Demaille <akim@epita.fr>
15056
15057 Version 1.49a.
15058
c20cd1fa
AD
150592002-05-01 Akim Demaille <akim@epita.fr>
15060
15061 * src/skeleton.h: Remove.
15062
8a9566d4
AD
150632002-05-01 Akim Demaille <akim@epita.fr>
15064
15065 * src/skeleton.h: Fix the #endif.
15066 Reported by Magnus Fromreide.
15067
8c6d399a
PE
150682002-04-26 Paul Eggert <eggert@twinsun.com>
15069
15070 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
15071 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 15072 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 15073
2b7ed18a
RA
150742002-04-25 Robert Anisko <robert@lrde.epita.fr>
15075
15076 * src/scan-skel.l: Postprocess quadrigraphs.
15077
15078 * src/reader.c (copy_character): New function, used to output
15079 single characters while replacing `[' and `]' with quadrigraphs, to
15080 avoid troubles with M4 quotes.
15081 (copy_comment): Output characters with copy_character.
15082 (read_additionnal_code): Likewise.
15083 (copy_string2): Likewise.
15084 (copy_definition): Likewise.
15085
15086 * tests/calc.at: Exercise M4 quoting.
15087
34a89c50
AD
150882002-04-25 Akim Demaille <akim@epita.fr>
15089
15090 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
15091 between `!' and the command.
15092 Reported by Paul Eggert.
15093
0dd1580a
RA
150942002-04-24 Robert Anisko <robert@lrde.epita.fr>
15095
15096 * tests/calc.at: Exercise prologue splitting.
15097
15098 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
15099 `b4_post_prologue' instead of `b4_prologue'.
15100
15101 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
15102 muscles.
15103 (output): Free pre_prologue_obstack and post_prologue_obstack.
15104 * src/files.h, src/files.c (attrs_obstack): Remove.
15105 (pre_prologue_obstack, post_prologue_obstack): New.
15106 * src/reader.c (copy_definition): Add a parameter to specify the
15107 obstack to fill, instead of using attrs_obstack unconditionally.
15108 (read_declarations): Pass pre_prologue_obstack to copy_definition if
15109 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
15110
83c1796f
PE
151112002-04-23 Paul Eggert <eggert@twinsun.com>
15112
15113 * data/bison.simple: Remove unnecessary commentary and white
15114 space differences from 1_29-branch.
15115 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
15116
15117 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
15118 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
15119 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
15120 constructors or destructors.
15121
15122 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
15123
1207eeac
AD
151242002-04-23 Akim Demaille <akim@epita.fr>
15125
15126 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
15127 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
15128 location with columns.
15129 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
15130 All reported by Paul Eggert.
15131
78ab8f67
AD
151322002-04-22 Akim Demaille <akim@epita.fr>
15133
15134 * src/reduce.c (dump_grammar): Move to...
15135 * src/gram.h, src/gram.c (grammar_dump): here.
15136 Be sure to separate long item numbers.
15137 Don't read the members of a rule's prec if its nil.
15138
133c20e2
AD
151392002-04-22 Akim Demaille <akim@epita.fr>
15140
15141 * src/output.c (table_size, table_grow): New.
15142 (MAXTABLE): Remove, replace uses with table_size.
15143 (pack_vector): Instead of dying when the table is too big, grow it.
15144
9515e8a7
AD
151452002-04-22 Akim Demaille <akim@epita.fr>
15146
15147 * data/bison.simple (yyr1): Its type is that of a token number.
15148 * data/bison.c++ (r1_): Likewise.
15149 * tests/regression.at (Web2c Actions): Adjust.
15150
23c5a174
AD
151512002-04-22 Akim Demaille <akim@epita.fr>
15152
15153 * src/reader.c (token_translations_init): 256 is now the default
15154 value for the error token, i.e., it will be assigned another
15155 number if the user assigned 256 to one of her tokens.
15156 (reader): Don't force 256 to error.
15157 * doc/bison.texinfo (Symbols): Adjust.
15158 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
15159 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
15160 etc. instead of 10, 20, 30 (which was used to `jump' over error
15161 (256) and undefined (2)).
15162
5fbb0954
AD
151632002-04-22 Akim Demaille <akim@epita.fr>
15164
15165 Propagate more token_number_t.
15166
15167 * src/gram.h (token_number_as_item_number)
15168 (item_number_as_token_number): New.
15169 * src/output.c (GENERATE_OUTPUT_TABLE): New.
15170 Use it to create output_item_number_table and
15171 output_token_number_table.
15172 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15173 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
15174 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
15175 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
15176
4f940944
AD
151772002-04-22 Akim Demaille <akim@epita.fr>
15178
15179 * src/output.h, src/output.c (get_lines_number): Remove.
15180
3ded9a63
AD
151812002-04-19 Akim Demaille <akim@epita.fr>
15182
15183 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
15184 as Lex/Flex'.
15185 (Debugging): More details about enabling the debugging features.
15186 (Table of Symbols): Describe $$, $n, @$, and @n.
15187 Suggested by Tim Josling.
15188
e0c471a9
AD
151892002-04-19 Akim Demaille <akim@epita.fr>
15190
15191 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
15192
fecc10cd
AD
151932002-04-10 Akim Demaille <akim@epita.fr>
15194
15195 * src/system.h: Rely on HAVE_LIMITS_H.
15196 Suggested by Paul Eggert.
15197
51dec47b
AD
151982002-04-09 Akim Demaille <akim@epita.fr>
15199
15200 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
15201 full stderr, and strip it according to the bison options, instead
15202 of composing the error message from different bits.
15203 This makes it easier to check for several error messages.
15204 Adjust all the invocations.
15205 Add an invocation exercising the error token.
15206 Add an invocation demonstrating a stupid error message.
15207 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
15208 Adjust the tests.
15209 Error message are for stderr, not stdout.
15210
007a50a4
AD
152112002-04-09 Akim Demaille <akim@epita.fr>
15212
15213 * src/gram.h, src/gram.c (error_token_number): Remove, use
15214 errtoken->number.
15215 * src/reader.c (reader): Don't specify the user token number (2)
15216 for $undefined, as it uselessly prevents using it.
15217 * src/gram.h (token_number_t): Move to...
15218 * src/symtab.h: here.
15219 (state_t.number): Is a token_number_t.
15220 * src/print.c, src/reader.c: Use undeftoken->number instead of
15221 hard coded 2.
15222 (Even though this 2 is not the same as above: the number of the
15223 undeftoken remains being 2, it is its user token number which
15224 might not be 2).
15225 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
15226 `user_token_number_max'.
15227 Output `undef_token_number'.
15228 * data/bison.simple, data/bison.c++: Use them.
15229 Be sure to map invalid yylex return values to
15230 `undef_token_number'. This saves us from gratuitous SEGV.
15231
15232 * tests/conflicts.at (Solved SR Conflicts)
15233 (Unresolved SR Conflicts): Adjust.
15234 * tests/regression.at (Web2c Actions): Adjust.
15235
06446ccf
AD
152362002-04-08 Akim Demaille <akim@epita.fr>
15237
15238 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
15239 Adding #line.
15240 Remove the duplicate `typedefs'.
15241 (RhsNumberType): Fix the declaration and various other typos.
15242 Use __ofile__.
15243 * data/bison.simple: Use __ofile__.
15244 * src/scan-skel.l: Handle __ofile__.
15245
62a3e4f0
AD
152462002-04-08 Akim Demaille <akim@epita.fr>
15247
15248 * src/gram.h (item_number_t): New, the type of item numbers in
15249 RITEM. Note that it must be able to code symbol numbers as
15250 positive number, and the negation of rule numbers as negative
15251 numbers.
15252 Adjust all dependencies (pretty many).
15253 * src/reduce.c (rule): Remove this `short *' pointer: use
15254 item_number_t.
15255 * src/system.h (MINSHORT, MAXSHORT): Remove.
15256 Include `limits.h'.
15257 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
15258 (shortcpy): Remove.
15259 (MAXTABLE): Move to...
15260 * src/output.c (MAXTABLE): here.
15261 (prepare_rules): Use output_int_table to output rhs.
15262 * data/bison.simple, data/bison.c++: Adjust.
15263 * tests/torture.at (Big triangle): Move the limit from 254 to
15264 500.
15265 * tests/regression.at (Web2c Actions): Ajust.
15266
15267 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
15268 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
15269 passes, but produces negative #line number, once fixed, GCC is
15270 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
15271 C), it passes.
15272 * src/state.h (state_h): Code input lines on ints, not shorts.
15273
bb88b0fc
AD
152742002-04-08 Akim Demaille <akim@epita.fr>
15275
15276 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
15277 and then the grammar.
15278
9a636f47
AD
152792002-04-08 Akim Demaille <akim@epita.fr>
15280
15281 * src/system.h: No longer using strndup.
15282
680e8701
AD
152832002-04-07 Akim Demaille <akim@epita.fr>
15284
15285 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
15286 * src/output.c (output_table_data): Return the longest number.
15287 (prepare_tokens): Output `token_number_max').
15288 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
15289 New.
15290 Use them to define yy_token_number_type/TokenNumberType.
15291 Use this type for yytranslate.
15292 * tests/torture.at (Big triangle): Push the limit from 124 to
15293 253.
15294 * tests/regression.at (Web2c Actions): Adjust.
15295
817e9f41
AD
152962002-04-07 Akim Demaille <akim@epita.fr>
15297
15298 * tests/torture.at (Big triangle): New.
15299 (GNU AWK Grammar, GNU Cim Grammar): Move to...
15300 * tests/existing.at: here.
15301
5123689b
AD
153022002-04-07 Akim Demaille <akim@epita.fr>
15303
15304 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
15305 nritems.
15306 Adjust dependencies.
15307
f3849179
AD
153082002-04-07 Akim Demaille <akim@epita.fr>
15309
15310 * src/reader.c: Normalize increments to prefix form.
15311
bd02036a
AD
153122002-04-07 Akim Demaille <akim@epita.fr>
15313
15314 * src/reader.c, symtab.c: Remove debugging code.
15315
db8837cb
AD
153162002-04-07 Akim Demaille <akim@epita.fr>
15317
15318 Rename all the `bucket's as `symbol_t'.
15319
15320 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
15321 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
15322 * src/symtab.c, src/symtab.h (bucket): Rename as...
15323 (symbol_t): this.
15324 (symbol_list_new, bucket_check_defined, bucket_make_alias)
15325 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
15326 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
15327 (buckets_new, buckets_free, buckets_do): Rename as...
15328 (symbol_list_new, symbol_check_defined, symbol_make_alias)
15329 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15330 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
15331 (symbols_new, symbols_free, symbols_do): these.
15332
72a23c97
AD
153332002-04-07 Akim Demaille <akim@epita.fr>
15334
15335 Use lib/hash for the symbol table.
15336
15337 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
15338 EOF.
15339 * src/lex.c (lex): Set the `number' member of new terminals.
15340 * src/reader.c (bucket_check_defined, bucket_make_alias)
15341 (bucket_check_alias_consistence, bucket_translation): New.
15342 (reader, grammar_free, readgram, token_translations_init)
15343 (packsymbols): Adjust.
15344 (reader): Number the predefined tokens.
15345 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
15346 for predefined tokens.
15347 * src/symtab.h (bucket): Remove all the hash table related
15348 members.
15349 * src/symtab.c (symtab): Replace by...
15350 (bucket_table): this.
15351 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
15352 (buckets_new, buckets_do): New.
15353
280a38c3
AD
153542002-04-07 Akim Demaille <akim@epita.fr>
15355
15356 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
15357 (start_symbol, max_user_token_number, semantic_parser)
15358 (error_token_number): Initialize.
15359 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
15360 Initialize.
15361 (reader): Don't.
15362 (errtoken, eoftoken, undeftoken, axiom): Extern.
15363
03b31c0c
AD
153642002-04-07 Akim Demaille <akim@epita.fr>
15365
15366 * src/gram.h (rule_s): prec and precsym are now pointers
15367 to the bucket giving the priority/associativity.
15368 Member `associativity' removed: useless.
15369 * src/reduce.c, src/conflicts.c: Adjust.
15370
8b3df748
AD
153712002-04-07 Akim Demaille <akim@epita.fr>
15372
15373 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
15374 Properly escape the symbols' TAG when outputting them.
15375
e601aa1d
AD
153762002-04-07 Akim Demaille <akim@epita.fr>
15377
15378 * src/lalr.h (LA): Is a bitsetv, not bitset*.
15379
b0299a2e
AD
153802002-04-07 Akim Demaille <akim@epita.fr>
15381
15382 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
15383 (LArule): this, which is an array to rule_t*.
15384 * src/print.c, src/conflicts.c: Adjust.
15385
d7e1f00c
AD
153862002-04-07 Akim Demaille <akim@epita.fr>
15387
15388 * src/gram.h (rule_t): Rename `number' as `user_number'.
15389 `number' is a new member.
15390 Adjust dependencies.
15391 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
15392
cc9305dd
AD
153932002-04-07 Akim Demaille <akim@epita.fr>
15394
15395 As a result of the previous patch, it is no longer needed
15396 to reorder ritem itself.
15397
15398 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
15399
b0940840
AD
154002002-04-07 Akim Demaille <akim@epita.fr>
15401
15402 Be sure never to walk through RITEMS, but use only data related to
15403 the rules themselves. RITEMS should be banished.
15404
15405 * src/output.c (output_token_translations): Rename as...
15406 (prepare_tokens): this.
15407 In addition to `translate', prepare the muscles `tname' and
15408 `toknum', which were handled by...
15409 (output_rule_data): this.
15410 Remove, and move the remainder of its outputs into...
15411 (prepare_rules): this new routines, which also merges content from
15412 (output_gram): this.
15413 (prepare_rules): Be sure never to walk through RITEMS.
15414 (output_stos): Rename as...
15415 (prepare_stos): this.
15416 (output): Always invoke prepare_states, after all, just don't use it
15417 in the output if you don't need it.
15418
643a5994
AD
154192002-04-07 Akim Demaille <akim@epita.fr>
15420
15421 * src/LR0.c (new_state): Display `nstates' as the name of the
15422 newly created state.
15423 Adjust to initialize first_state and last_state if needed.
15424 Be sure to distinguish the initial from the final state.
15425 (new_states): Create the itemset of the initial state, and use
15426 new_state.
15427 * src/closure.c (closure): Now that the initial state has its
15428 items properly set, there is no need for a special case when
15429 creating `ruleset'.
15430
15431 As a result, now the rule 0, reducing to $axiom, is visible in the
15432 outputs. Adjust the test suite.
15433
15434 * tests/conflicts.at (Solved SR Conflicts)
15435 (Unresolved SR Conflicts): Adjust.
15436 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
15437 * tests/conflicts.at (S/R in initial): New.
15438
b4c4ccc2
AD
154392002-04-07 Akim Demaille <akim@epita.fr>
15440
15441 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
15442 the RHS of the rules.
15443 * src/output.c (output_gram): Likewise.
15444
bba97eb2
AD
154452002-04-07 Akim Demaille <akim@epita.fr>
15446
15447 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
15448 bucket.
15449 Adjust all dependencies.
15450 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
15451 `number' of the buckets too.
15452 * src/gram.h: Include `symtab.h'.
15453 (associativity): Move to...
15454 * src/symtab.h: here.
15455 No longer include `gram.h'.
15456
c3b407f4
AD
154572002-04-07 Akim Demaille <akim@epita.fr>
15458
15459 * src/gram.h, src/gram.c (rules_rhs_length): New.
15460 (ritem_longest_rhs): Use it.
15461 * src/gram.h (rule_t): `number' is a new member.
15462 * src/reader.c (packgram): Set it.
15463 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
15464 the end of `rules', and count them out of `nrules'.
15465 (reduce_output, dump_grammar): Adjust.
15466 * src/print.c (print_grammar): It is no longer needed to check for
15467 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
15468 * tests/reduce.at (Reduced Automaton): New test.
15469
11652ab3
AD
154702002-04-07 Akim Demaille <akim@epita.fr>
15471
15472 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
15473 lacking `+ 1' to nrules, Bison reported as useless a token if it
15474 was used solely to set the precedence of the last rule...
15475
26b23c1a
AD
154762002-04-07 Akim Demaille <akim@epita.fr>
15477
15478 * data/bison.c++, data/bison.simple: Don't output the current file
15479 name in #line, to avoid useless diffs between two identical
15480 outputs under different names.
15481
18bcecb0
AD
154822002-04-07 Akim Demaille <akim@epita.fr>
15483
15484 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
15485 Normalize loops to using `< nrules + 1', not `<= nrules'.
15486
fa770c86
AD
154872002-04-07 Akim Demaille <akim@epita.fr>
15488
15489 * TODO: Update.
15490
d9b739c3
AD
154912002-04-07 Akim Demaille <akim@epita.fr>
15492
15493 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
15494 bucket.value as bucket.number.
15495
99013900
AD
154962002-04-07 Akim Demaille <akim@epita.fr>
15497
15498 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
15499 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15500 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
15501 RHS, instead of being an index in RITEMS.
15502
e966383b
PE
155032002-04-04 Paul Eggert <eggert@twinsun.com>
15504
15505 * doc/bison.texinfo: Update copyright date.
15506 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
15507 (Symbols): Warn about running Bison in one character set,
15508 but compiling and/or running in an incompatible one.
15509 Warn about character code 256, too.
15510
155112002-04-03 Paul Eggert <eggert@twinsun.com>
15512
15513 * src/bison.data (YYSTACK_ALLOC): Depend on whether
15514 YYERROR_VERBOSE is nonzero, not whether it is defined.
15515
15516 Merge changes from bison-1_29-branch.
c307773e 15517
8d6c48b9
PE
155182002-03-20 Paul Eggert <eggert@twinsun.com>
15519
15520 Merge fixes from Debian bison_1.34-1.diff.
15521
15522 * configure.in (AC_PREREQ): 2.53.
15523
e53c6322
AD
155242002-03-20 Akim Demaille <akim@epita.fr>
15525
15526 * src/conflicts.c (log_resolution): Argument `resolution' is const.
15527
9ffbeca7
PE
155282002-03-19 Paul Eggert <eggert@twinsun.com>
15529
21db0b2a
PE
15530 * src/bison.simple (YYCOPY): New macro.
15531 (YYSTACK_RELOCATE): Use it.
15532 Remove Type arg; no longer needed. All callers changed.
15533 (yymemcpy): Remove; no longer needed.
15534
9ffbeca7
PE
15535 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
15536 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15537
642cb8f8
AD
155382002-03-19 Akim Demaille <akim@epita.fr>
15539
15540 Test and fix the #line outputs.
15541
15542 * tests/atlocal.at (GCC): New.
15543 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 15544 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
15545 (Action synch line, Epilogue synch line): New tests.
15546 * src/reader.c (parse_union_decl): Define the muscle stype_line.
15547 * data/bison.simple, data/bison.c++: Use it.
15548
3c31a486
AD
155492002-03-19 Akim Demaille <akim@epita.fr>
15550
15551 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
15552 (Solved SR Conflicts, %expect not enough, %expect right)
15553 (%expect too much): Move to...
15554 * tests/conflicts.at: this new file.
15555
0d8bed56
AD
155562002-03-19 Akim Demaille <akim@epita.fr>
15557
15558 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15559 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
15560 that we can move to enums for instance.
15561 * src/output.c (token_definitions_output): Output a list of
15562 `token-name, token-number' instead of the #define.
15563 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
15564
9208d17f
AD
155652002-03-14 Akim Demaille <akim@epita.fr>
15566
15567 Use Gettext 0.11.1.
15568
af27eacb
RA
155692002-03-09 Robert Anisko <robert@lrde.epita.fr>
15570
15571 * data/bison.c++: Make the user able to add members to the generated
15572 parser by subclassing.
15573
9101a310
RA
155742002-03-05 Robert Anisko <robert@lrde.epita.fr>
15575
15576 * src/reader.c (read_additionnal_code): `c' should be an integer, not
15577 a character.
15578 Reported by Nicolas Tisserand and Nicolas Burrus.
15579
fff9bf0b
RA
155802002-03-04 Robert Anisko <robert@lrde.epita.fr>
15581
15582 * src/reader.c: Warn about lacking semi-colons, do not complain.
15583
64dba31e
RA
155842002-03-04 Robert Anisko <robert@lrde.epita.fr>
15585
15586 * data/bison.c++: Remove a debug line.
15587
374f5a14
RA
155882002-03-04 Robert Anisko <robert@lrde.epita.fr>
15589
15590 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
15591 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
15592 provide a default implementation.
15593
bfcf1f3a
AD
155942002-03-04 Akim Demaille <akim@epita.fr>
15595
15596 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
15597 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
15598 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
15599 * tests/semantic.at (Parsing Guards): Similarly.
15600 * src/reader.at (readgram): Complain if the last rule is not ended
15601 with a semi-colon.
15602
65ccf9fc
AD
156032002-03-04 Akim Demaille <akim@epita.fr>
15604
15605 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
15606 * src/closure.c: here.
15607 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
15608 RTC.
15609 * src/warshall.h, src/warshall.c: Remove.
15610 * tests/sets.at (Broken Closure): Adjust.
15611
d0039cbc
AD
156122002-03-04 Akim Demaille <akim@epita.fr>
15613
15614 * src/output.c (output_skeleton): tempdir is const.
15615 bytes_read is unused.
15616
345cea78
AD
156172002-03-04 Akim Demaille <akim@epita.fr>
15618
15619 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
15620 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
15621 Update.
15622 From Michael Hayes.
15623
564801f7
AD
156242002-03-04 Akim Demaille <akim@epita.fr>
15625
15626 * src/closure.c (closure): `r' is unused.
15627
e5352bc7
AD
156282002-03-04 Akim Demaille <akim@epita.fr>
15629
15630 * tests/sets.at (Broken Closure): Add the ending `;'.
15631 * src/reader.at (readgram): Complain if a rule is not ended with a
15632 semi-colon.
15633
914feea9
AD
156342002-03-04 Akim Demaille <akim@epita.fr>
15635
15636 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
15637 (count_sr_conflicts): Use bitset_count.
15638 * src/reduce.c (inaccessable_symbols): Ditto.
15639 (bits_size): Remove.
15640 * src/warshall.h, src/warshall.c: Convert to bitsetv.
15641
f0250de6
AD
156422002-03-04 Akim Demaille <akim@epita.fr>
15643
15644 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
15645 * src/reduce.c: Remove the `bitset_zero's following the
15646 `bitset_create's, as now it is performed by the latter.
15647
ef017502
AD
156482002-03-04 Akim Demaille <akim@epita.fr>
15649
15650 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
15651 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
15652 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
15653 latest sources from Michael.
15654
76514394
AD
156552002-03-04 Akim Demaille <akim@epita.fr>
15656
15657 * src/output.c (output): Don't free the grammar.
15658 * src/reader.c (grammar_free): New.
15659 * src/main.c (main): Call it and don't free symtab here.
15660
55024580
AD
156612002-03-04 Akim Demaille <akim@epita.fr>
15662
15663 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
15664 before returning.
15665 Reported by Benoit Perrot.
15666
f9abaa2c
AD
156672002-03-04 Akim Demaille <akim@epita.fr>
15668
15669 Use bitset operations when possible, not loops over bits.
15670
15671 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
15672 bitset_or.
15673 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
15674 * src/reduce.c (useless_nonterminals): Formatting changes.
15675 * src/warshall.c (TC): Use bitset_or.
15676
0e721e75
AD
156772002-03-04 Akim Demaille <akim@epita.fr>
15678
15679 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
15680 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
15681 Ditto.
15682
0fb1ffb1
AD
156832002-03-04 Akim Demaille <akim@epita.fr>
15684
15685 * src/lalr.c (F): Now a bitset*.
15686 Adjust all dependencies.
15687
b86796bf
AD
156882002-03-04 Akim Demaille <akim@epita.fr>
15689
15690 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
15691 Adjust all dependencies.
15692
602bbf31
AD
156932002-03-04 Akim Demaille <akim@epita.fr>
15694
15695 * src/L0.c, src/LR0.h (nstates): Be size_t.
15696 Adjust comparisons (signed vs unsigned).
15697 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
15698 bitset*.
15699 Adjust all dependencies.
15700
d8a0245c
AD
157012002-03-04 Akim Demaille <akim@epita.fr>
15702
15703 * src/closure.c (firsts): Now, also a bitset.
15704 Adjust all dependencies.
15705 (varsetsize): Remove, now unused.
15706 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
15707
34ba9743
AD
157082002-03-04 Akim Demaille <akim@epita.fr>
15709
15710 * src/print.c: Convert to use bitset.h, not hand coded iterations
15711 over ints.
15712
ed86e78c
AD
157132002-03-04 Akim Demaille <akim@epita.fr>
15714
15715 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
15716
dfdb1797
AD
157172002-03-04 Akim Demaille <akim@epita.fr>
15718
15719 * src/closure.c (ruleset): Be a bitset.
15720 (rulesetsize): Remove.
15721
7086e707
AD
157222002-03-04 Akim Demaille <akim@epita.fr>
15723
15724 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
15725 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
15726 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
15727 * src/closure.c (fderives): Be an array of bitsets.
15728
98254360
RA
157292002-02-28 Robert Anisko <robert@lrde.epita.fr>
15730
15731 * data/bison.c++: Merge the two generated headers. Insert a copyright
15732 notice in each output file.
15733
a75c057f
AD
157342002-02-28 Akim Demaille <akim@epita.fr>
15735
15736 * data/bison.c++: Copy the prologue of bison.simple to fetch
15737 useful M4 definitions, such as b4_header_guard.
15738
06b00abc
AD
157392002-02-25 Akim Demaille <akim@epita.fr>
15740
15741 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
15742 translator friendly scheme for the bgr
15743 copyright notice.
06b00abc 15744
70e7d534
AD
157452002-02-25 Akim Demaille <akim@epita.fr>
15746
15747 * src/output.c (header_output): Remove, now handled completely via
15748 M4.
15749
abe017f6
AD
157502002-02-25 Akim Demaille <akim@epita.fr>
15751
15752 * m4/m4.m4: New, from CVS Autoconf.
15753 * configure.in: Invoke it.
15754 * src/output.c (output_skeleton): Use its result instead of the
15755 hard coded name.
15756
381fb12e
AD
157572002-02-25 Akim Demaille <akim@epita.fr>
15758
15759 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
15760 Fileutils 4.1.5.
15761 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
15762 * src/output.c (output_skeleton): Use mkstemp to create a real
15763 temporary file.
15764 Move the filling of `skeleton' and its muscle to...
15765 (prepare): here.
15766 (output): Move the definition of the prologue muscle to...
15767 (prepare): here.
15768 * src/system.h (DEFAULT_TMPDIR): New.
15769
6f38107f
PE
157702002-02-14 Paul Eggert <eggert@twinsun.com>
15771
15772 Remove the support for C++ namespace cleanliness; it was
15773 causing more problems than it was curing, since it didn't work
15774 properly on some nonstandard C++ compilers. This can wait
15775 for a proper C++ parser.
15776
15777 * NEWS: Document this.
15778 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
15779 of C++, as it's treated like C now.
15780 * src/bison.simple (YYSTD): Remove.
15781 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
15782 Treat C++ just like Standard C instead of trying to support
15783 namespace cleanliness.
15784
80cce3da
AD
157852002-02-14 Akim Demaille <akim@epita.fr>
15786
15787 * tests/regression.at (else): Adjust to Andreas' change.
15788
842e8679
AD
157892002-02-14 Akim Demaille <akim@epita.fr>
15790
15791 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
15792
4bda3f10
AD
157932002-02-13 Andreas Schwab <schwab@suse.de>
15794
15795 * src/output.c (output_rule_data): Don't output NULL, it might
15796 not be defined yet.
15797
4162fa07 157982002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 15799
4162fa07
RA
15800 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
15801 (Copyright notice): Update.
b418ecd8 15802
bd16a5dc
AD
158032002-02-11 Akim Demaille <akim@epita.fr>
15804
15805 * tests/regression.at (%nonassoc and eof): Don't include
15806 nonportable headers.
15807
8d69a1a3
RA
158082002-02-08 Robert Anisko <robert@lrde.epita.fr>
15809
15810 * data/bison.c++: Correct error recovery. Make the user able to
15811 initialize the starting location.
15812
9b2d0677
AD
158132002-02-07 Akim Demaille <akim@epita.fr>
15814
15815 * tests/input.at: New.
15816
69e2658b
RA
158172002-02-07 Robert Anisko <robert@lrde.epita.fr>
15818
15819 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 15820 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
15821 directives around tables only needed for debugging.
15822
4aacc3a7
RA
158232002-02-07 Robert Anisko <robert@lrde.epita.fr>
15824
15825 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
15826 C++ parsers.
15827 (yy::b4_name::parse): Use print_.
15828
762a801e
RA
158292002-02-07 Robert Anisko <robert@lrde.epita.fr>
15830
15831 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
15832
4bb2bc3f
RA
158332002-02-07 Robert Anisko <robert@lrde.epita.fr>
15834
15835 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
15836 C++ parsers.
15837 (yy::b4_name::parse): Build verbose error messages, and use error_.
15838
6b45a3ca
RA
158392002-02-06 Robert Anisko <robert@lrde.epita.fr>
15840
15841 * data/bison.c++: Fix m4 quoting in comments.
15842
50997c6e
RA
158432002-02-06 Robert Anisko <robert@lrde.epita.fr>
15844
15845 * data/bison.c++: Adjust the parser code. Fix some muscles that were
15846 not expanded by m4.
15847
3f3eed27
AD
158482002-02-05 Akim Demaille <akim@epita.fr>
15849
15850 * data/bison.c++: Adjust to the M4 back end.
15851 More is certainly needed.
15852
be2a1a68
AD
158532002-02-05 Akim Demaille <akim@epita.fr>
15854
15855 Give a try to M4 as a back end.
15856
15857 * lib/readpipe.c: New, from wdiff.
15858 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
15859 BISON_HAIRY.
15860 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
15861 specific values. Now it is m4 that performs the lookup.
15862 * src/parse-skel.y: Remove.
15863 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
15864 * src/output.c (actions_output, guards_output)
15865 (token_definitions_output): No longer keeps track of the output
15866 line number, hence remove the second argument.
15867 (guards_output): Check against the guard member of a rule, not the
15868 action member.
15869 Adjust callers.
15870 (output_skeleton): Don't look for the skeleton location, let m4 do
15871 that.
15872 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
15873 file will be used.
15874 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
15875 (prepare): Given that for the time being changesyntax is not
15876 usable in M4, rename the muscles using `-' to `_'.
15877 Define `defines_flag', `output_parser_name' and `output_header_name'.
15878 * src/output.h (actions_output, guards_output)
15879 (token_definitions_output): Adjust prototypes.
15880 * src/scan-skel.l: Instead of scanning the skeletons, it now
15881 processes the output of m4: `__oline__' and `#output'.
15882 * data/bison.simple: Adjust to be used by M4(sugar).
15883 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
15884 to date.
15885 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
15886 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
15887 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
15888 shamelessly stolen from CVS Autoconf.
15889
beda758b
AD
158902002-02-05 Akim Demaille <akim@epita.fr>
15891
15892 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
15893 * configure.in: Check for the declarations of free and malloc.
15894 * src/muscle_tab.c: Adjust.
15895
5ece6d43
AD
158962002-02-05 Akim Demaille <akim@epita.fr>
15897
15898 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
15899 which have no values.
15900
5bb18f9a
AD
159012002-02-05 Akim Demaille <akim@epita.fr>
15902
15903 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
15904 * data/: here.
15905
894dd62e
PE
159062002-01-29 Paul Eggert <eggert@twinsun.com>
15907
15908 * src/bison.simple (YYSIZE_T): Do not define merely because
15909 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
15910 On some platforms, <alloca.h> does not declare YYSTD (size_t).
15911
82841af7
AD
159122002-01-27 Akim Demaille <akim@epita.fr>
15913
15914 Fix `%nonassoc and eof'.
15915
15916 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
15917 which were not properly copied! Replace
15918 memcpy (res->errs, src->errs, src->nerrs);
15919 with
15920 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
15921 !!!
15922 * tests/regression.at (%nonassoc and eof): Adjust to newest
15923 Autotest: `.' is not in the PATH.
15924
318b76e9
AD
159252002-01-27 Akim Demaille <akim@epita.fr>
15926
15927 * tests/sets.at (AT_EXTRACT_SETS): New.
15928 (Nullable): Use it.
15929 (Firsts): New.
15930
30d2f3d5
AD
159312002-01-26 Akim Demaille <akim@epita.fr>
15932
15933 * tests/actions.at, tests/calc.at, tests/headers.at,
15934 * tests/torture.at: Adjust to the newest Autotest which no longer
15935 forces `.' in the PATH.
15936
30f8c395
AD
159372002-01-25 Akim Demaille <akim@epita.fr>
15938
15939 * tests/regression.at (%nonassoc and eof): New.
15940 Suggested by Robert Anisko.
15941
29ae55f1
AD
159422002-01-24 Akim Demaille <akim@epita.fr>
15943
15944 Bison dumps core when trying to complain about broken input files.
15945 Reported by Cris van Pelt.
15946
15947 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
15948 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
15949 into...
15950 (Invalid inputs): Strengthen: exercise parse_percent_token.
15951
2b548aa6
RA
159522002-01-24 Robert Anisko <robert.anisko@epita.fr>
15953
15954 * src/Makefile.am: Add bison.c++.
15955 * src/bison.c++: New skeleton.
15956
bb0146c2
AD
159572002-01-21 Paolo Bonzini <bonzini@gnu.org>
15958
15959 * po/it.po: New.
15960
bec30531
AD
159612002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
15962
15963 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
15964
fc6edc45
MA
159652002-01-20 Marc Autret <marc@gnu.org>
15966
15967 * src/files.c (compute_output_file_names): Fix
15968
5e5d5415
MA
159692002-01-20 Marc Autret <marc@gnu.org>
15970
15971 * tests/output.at: New test.
15972 * src/files.c (compute_base_names): Don't map extensions when
15973 the YACC flag is set, use defaults.
15974 Reported by Evgeny Stambulchik.
15975
44ea3fbd
MA
159762002-01-20 Marc Autret <marc@gnu.org>
15977
ba0fe3c7
PE
15978 * src/system.h: Need to define __attribute__ away for non-GCC
15979 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
15980 Suggested by Albert Chin-A-Young.
15981
338963d1
TVH
159822002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
15983
15984 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
15985 canonical definition.
15986 * src/system.h: Use the canonical definition for PARAMS (avoids
15987 a conflict with the macro from lib/hash.h).
15988
c57b2479
AD
159892002-01-11 Akim Demaille <akim@epita.fr>
15990
15991 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 15992 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 15993
b85810ae
AD
159942002-01-09 Akim Demaille <akim@epita.fr>
15995
15996 * src/files.c, src/files.h (output_infix): New.
15997 (tab_extension): Remove.
15998 (compute_base_names): Compute the former, drop the latter.
15999 * src/output.c (prepare): Insert the muscles `output-infix', and
16000 `output-suffix'.
16001 * src/parse-skel.y (string, string.1): New.
16002 (section.header): Use it.
16003 (section.yacc): Remove.
16004 (prefix): Remove too.
16005 * src/scan-skel.l: Adjust.
16006 * src/bison.simple, src/bison.hairy: Adjust.
16007
cae60122
AD
160082002-01-09 Akim Demaille <akim@epita.fr>
16009
16010 * configure.in (WERROR_CFLAGS): Compute it.
16011 * src/Makefile.am (CFLAGS): Pass it.
16012 * tests/atlocal.in (CFLAGS): Idem.
16013 * src/files.c: Fix a few warnings.
16014 (get_extension_index): Remove, unused.
16015
ae404801
AD
160162002-01-08 Akim Demaille <akim@epita.fr>
16017
16018 * src/getargs.c (AS_FILE_NAME): New.
16019 (getargs): Use it to convert DOSish file names.
16020 * src/files.c (base_name): Rename as full_base_name to avoid
16021 clashes with `base_name ()'.
16022 (filename_split): New.
16023 (compute_base_names): N-th rewrite, using filename_split.
16024
22312b71
AD
160252002-01-08 Akim Demaille <akim@epita.fr>
16026
16027 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
16028 New, stolen from the Fileutils 4.1.
16029 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16030 * configure.in: Check for the presence of memrchr, and of its
16031 prototype.
16032
a67cef01
TVH
160332002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
16034
16035 * lib/hash.h (__P): Added definition for this macro.
16036 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
16037 BUILT_SOURCES, to ensure they are generated first.
16038 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
16039 %error-verbose to allow bootstrapping with bison 1.30x.
16040
2b25d624
AD
160412002-01-06 Akim Demaille <akim@epita.fr>
16042
16043 * src/reader.c (parse_braces): Don't fetch the next char, the
16044 convention is to fetch on entry.
16045 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
16046 'switch' without a following semicolon.
16047 * tests/regression.at (braces parsing): New.
16048
3460813b
AD
160492002-01-06 Akim Demaille <akim@epita.fr>
16050
16051 Bison is dead wrong in its RR conflict reports.
16052
16053 * tests/torture.at (GNU Cim Grammar): New.
16054 * src/conflicts.c (count_rr_conflicts): Fix.
16055
73784c64
AD
160562002-01-06 Akim Demaille <akim@epita.fr>
16057
16058 Creating package.m4 from configure.ac causes too many problems.
16059
16060 * tests/Makefile.am (package.m4): Create it by hand,
16061 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
16062
25d81090
AD
160632002-01-06 Akim Demaille <akim@epita.fr>
16064
16065 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
16066 skeleton.h.
16067
a9b8959e
PE
160682002-01-04 Paul Eggert <eggert@twinsun.com>
16069
16070 * doc/bison.texinfo (Debugging):
16071 Remove YYSTDERR; it's no longer defined or used.
16072 Also, s/cstdio.h/cstdio/.
16073
25d81090
AD
160742002-01-03 Akim Demaille <akim@epita.fr>
16075
16076 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
16077
1109455c
AD
160782002-01-03 Akim Demaille <akim@epita.fr>
16079
16080 * src/parse-skel.y (process_skeleton): Don't bind the parser's
16081 tracing code to --trace, wait for a better --trace option, with
16082 args.
16083
7ea5e977
AD
160842002-01-03 Akim Demaille <akim@epita.fr>
16085
16086 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
16087 The ISO C++ standard is extremely clear about it: stderr is
16088 considered a macro, not a regular symbol (see table 94 `Header
16089 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
16090 Therefore std:: does not apply to it. It still does with fprintf.
16091 Also, s/cstdio.h/cstdio/.
16092
fab5b110
AD
160932002-01-03 Akim Demaille <akim@epita.fr>
16094
16095 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
16096 for non system headers.
16097
aed7fd9b
AD
160982002-01-02 Akim Demaille <akim@epita.fr>
16099
16100 Equip the skeleton chain with location tracking, runtime trace,
16101 pure parser and scanner.
16102
16103 * src/parse-skel.y: Request a pure parser, locations, and prefix
16104 renaming.
16105 (%union): Having several members with the same type does not help
16106 type mismatches, simplify.
16107 (YYPRINT, yyprint): New.
16108 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
16109 (skel_error): this.
16110 Handle locations.
16111 * src/scan-skel.l: Adjust to these changes.
16112 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
16113 (LOCATION_PRINT, skel_control_t): New.
16114
24fad99e
AD
161152001-12-30 Akim Demaille <akim@epita.fr>
16116
16117 * src/parse-skel.y: Get rid of the shift/reduce conflict:
16118 replace `gb' with BLANKS.
16119 * src/scan-skel.l: Adjust.
16120
a4b36db4
AD
161212001-12-30 Akim Demaille <akim@epita.fr>
16122
16123 * src/system.h: We don't need nor want bcopy.
16124 Throw away MS-DOS crap: we don't need getpid.
16125 * configure.in: We don't need strndup. It was even causing
16126 problems: because Flex includes the headers *before* us,
16127 _GNU_SOURCE is not defined by config.h, and therefore strndup was
16128 not visible.
16129 * lib/xstrndup.c: New.
16130 * src/scan-skel.l: Use it.
16131 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
16132 * src/parse-skel.y: Use %directives instead of #defines.
16133
1239777d
AD
161342001-12-30 Akim Demaille <akim@epita.fr>
16135
16136 * src/skeleton.h: New.
16137 * src/output.c (output_parser, output_master_parser): Remove, dead
16138 code.
16139 * src/output.h (get_lines_number, actions_output, guards_output)
16140 (token_definitions_output): Prototype them.
16141 * src/parse-skel.y: Add the license notice.
16142 Include output.h and skeleton.h.
16143 (process_skeleton): Returns void, and takes a single parameter.
16144 * src/scan-skel.l: Add the license notice.
16145 Include skeleton.h.
16146 Don't use %option yylineno: it seems that then Flex imagines
16147 REJECT has been used, and therefore it won't reallocate its
16148 buffers (which makes no other sense to me than a bug). It results
16149 in warnings for `unused: yy_flex_realloc'.
16150
9b3add5b
RA
161512001-12-30 Robert Anisko <robert.anisko@epita.fr>
16152
16153 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16154 (MUSCLE_INSERT_PREFIX): ...to there.
16155 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16156 (MUSCLE_INSERT_PREFIX): Move from here...
16157
16158 * src/bison.hairy: Add a section directive. Put braces around muscle
16159 names. This parser skeleton is still broken, but Bison should not
16160 choke on a bad muscle 'syntax'.
16161 * src/bison.simple: Add a section directive. Put braces around muscle
16162 names.
16163
16164 * src/files.h (strsuffix, stringappend): Add declarations.
16165 (tab_extension): Add declaration.
16166 (short_base_name): Add declaration.
16167
16168 * src/files.c (strsuffix, stringappend): No longer static. These
16169 functions are used in the skeleton parser.
16170 (tab_extension): New.
16171 (compute_base_names): Use the computations done in this function
fab5b110 16172 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
16173 names.
16174 (short_base_name): No longer static.
16175
16176 * src/output.c (output_skeleton): New.
16177 (output): Disable call to output_master_parser, and give a try to
16178 a new skeleton handling system.
16179 (guards_output, actions_output): No longer static.
16180 (token_definitions_output, get_lines_number): No longer static.
16181
16182 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
16183
fab5b110 16184 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
16185 parse-skel.y.
16186
16187 * src/parse-skel.y: New file.
16188 * src/scan-skel.l: New file.
16189
b5b61c61
AD
161902001-12-29 Akim Demaille <akim@epita.fr>
16191
16192 %name-prefix is broken.
16193
16194 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
16195 Adjust all dependencies.
16196 * tests/headers.at (export YYLTYPE): Strengthen this test: use
16197 %name-prefix.
16198
16199 Renaming yylval but not yylloc is not consistent. Now we do.
16200
16201 * src/bison.simple: Prefix yylloc if used.
16202 * doc/bison.texinfo (Decl Summary): Document that.
16203
8c9a50be
AD
162042001-12-29 Akim Demaille <akim@epita.fr>
16205
16206 * doc/bison.texinfo: Promote `%long-directive' over
16207 `%long_directive'.
16208 Remove all references to fixed-output-files, yacc is enough.
16209
d99361e6
AD
162102001-12-29 Akim Demaille <akim@epita.fr>
16211
16212 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
16213 user prologue. These are defaults.
16214 * tests/actions.at (Mid-rule actions): Make sure the user can
16215 define YYDEBUG and YYERROR_VERBOSE.
16216
b9cecb91
AD
162172001-12-29 Akim Demaille <akim@epita.fr>
16218
16219 * src/output.c (header_output): Don't forget to export YYLTYPE and
16220 yylloc.
16221 * tests/headers.at (export YYLTYPE): New, make sure it does.
16222 * tests/regression.at (%union and --defines, Invalid CPP headers):
16223 Move to...
16224 * tests/headers.at: here.
16225
aea13e97
AD
162262001-12-29 Akim Demaille <akim@epita.fr>
16227
16228 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
16229
931394cb
AD
162302001-12-29 Akim Demaille <akim@epita.fr>
16231
16232 * tests/actions.at (Mid-rule actions): Output on a single line
16233 instead of several.
16234
704a47c4
AD
162352001-12-29 Akim Demaille <akim@epita.fr>
16236
16237 * doc/bison.texinfo: Formatting changes.
16238
091e20bb
AD
162392001-12-29 Akim Demaille <akim@epita.fr>
16240
16241 Don't store the token defs in a muscle, just be ready to output it
16242 on command. Now possible via `symbols'. Fixes a memory leak.
16243
16244 * src/output.c (token_definitions_output): New.
16245 (output_parser, header_output): Use it.
16246 * src/reader.c (symbols_save): Remove.
16247
cce71710
AD
162482001-12-29 Akim Demaille <akim@epita.fr>
16249
16250 * src/bison.simple: Do not provide a default for YYSTYPE and
16251 YYLTYPE before the user's prologue. Otherwise it's hardly... a
16252 default.
16253
82c035a8
AD
162542001-12-29 Akim Demaille <akim@epita.fr>
16255
16256 Mid-rule actions are simply... ignored!
16257
16258 * src/reader.c (readgram): Be sure to attach mid-rule actions to
16259 the empty-rule associated to the dummy symbol, not to the host
16260 rule.
16261 * tests/actions.at (Mid-rule actions): New.
16262
8419d367
AD
162632001-12-29 Akim Demaille <akim@epita.fr>
16264
16265 Memory leak.
16266
16267 * src/reader.c (reader): Free grammar.
16268
375d5806
AD
162692001-12-29 Akim Demaille <akim@epita.fr>
16270
16271 Memory leak.
16272
16273 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
16274 since it allocates it for each state, although only one is needed.
16275 (allocate_storage): Do it here.
16276
f51cb8ff
AD
162772001-12-29 Akim Demaille <akim@epita.fr>
16278
16279 * src/options.h, src/options.c (create_long_option_table): Rename
16280 as...
16281 (long_option_table_new): this, with a clearer prototype.
16282 (percent_table): Remove, unused,
16283 * src/getargs.c (getargs): Adjust.
16284
29e88316
AD
162852001-12-29 Akim Demaille <akim@epita.fr>
16286
16287 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
16288 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
16289 as states.
16290
b9f71f19
AD
162912001-12-29 Akim Demaille <akim@epita.fr>
16292
16293 * src/lalr.c (build_relations): Rename `states' as `states1'.
16294 Sorry, I don't understand exactly what it is, no better name...
16295
1a2b5d37
AD
162962001-12-29 Akim Demaille <akim@epita.fr>
16297
16298 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
16299 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
16300 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
16301 as rules.
16302
1cca533e
AD
163032001-12-29 Akim Demaille <akim@epita.fr>
16304
16305 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
16306 ago.
16307
c03ae966
AD
163082001-12-29 Akim Demaille <akim@epita.fr>
16309
16310 * src/reader.c, src/reader.h (user_toknums): Remove.
16311 Adjust all users to use symbols[i]->user_token_number.
16312
5a670b1e
AD
163132001-12-29 Akim Demaille <akim@epita.fr>
16314
16315 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
16316 Adjust all users to use symbols[i]->prec or ->assoc.
16317
ad949da9
AD
163182001-12-29 Akim Demaille <akim@epita.fr>
16319
16320 * src/reader.c, src/reader.h (tags): Remove.
16321 Adjust all users to use symbols[i]->tag.
16322
0e78e603
AD
163232001-12-29 Akim Demaille <akim@epita.fr>
16324
16325 * src/gram.h, src/gram.c (symbols): New, similar to state_table
16326 and rule_table.
16327 * src/reader.c (packsymbols): Fill this table.
16328 Drop sprec.
16329 * src/conflicts.c (resolve_sr_conflict): Adjust.
16330 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
16331 single table.
16332 Use symbols[i]->tag instead of tags[i].
16333
213e640e
AD
163342001-12-29 Akim Demaille <akim@epita.fr>
16335
16336 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
16337 In addition, put a comment in there, to replace...
16338 * tests/regression.at (%union and C comments): Remove.
16339
e7b8bef1
AD
163402001-12-29 Akim Demaille <akim@epita.fr>
16341
16342 * tests/regression.at (Web2c Actions): Blindly move the actual
16343 output as expected output. The contents *seem* right to me, but I
16344 can't pretend reading perfectly parser tables... Nonetheless, all
16345 the other tests pass correctly, the table look OK, even though the
16346 presence of `$axiom' is to be noted: AFAICS it is useless (but
16347 harmless).
16348
b68e7744
AD
163492001-12-29 Akim Demaille <akim@epita.fr>
16350
16351 * src/reader.c (readgram): Don't add the rule 0 if there were no
16352 rules read. In other words, add it _after_ having performed
16353 grammar sanity checks.
16354 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
16355
78d5bae9
AD
163562001-12-29 Akim Demaille <akim@epita.fr>
16357
16358 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
16359 visible, and some states have now a different number.
16360
ff442794
AD
163612001-12-29 Akim Demaille <akim@epita.fr>
16362
16363 * src/reader.c (readgram): Bind the initial rule's lineno to that
16364 of the first rule.
16365 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
16366 (Solved SR Conflicts): Adjust rule 0's line number.
16367
610ab194
AD
163682001-12-29 Akim Demaille <akim@epita.fr>
16369
16370 Fix the `GAWK Grammar' failure.
16371
16372 * src/LR0.c (final_state): Initialize to -1 so that we do compute
16373 the reductions of the first state which was mistakenly confused
16374 with the final state because precisely final_state was initialized
16375 to 0.
16376 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
16377 now noticed by Bison.
16378 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
16379 have a reduction on $default.
16380
29d29c8f
AD
163812001-12-29 Akim Demaille <akim@epita.fr>
16382
16383 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
16384 rule line numbers.
16385 * src/closure.c (print_closure): Likewise.
16386 * src/derives.c (print_derives): Likewise.
16387 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
16388 now.
16389
7c6b64d0
AD
163902001-12-29 Akim Demaille <akim@epita.fr>
16391
16392 * src/lalr.c (lookaheads_print): New.
16393 (lalr): Call it when --trace-flag.
16394 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
16395 are dumped.
16396
3d4daee3
AD
163972001-12-29 Akim Demaille <akim@epita.fr>
16398
16399 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
16400 when walking through ritem, even via rule->rhs.
16401 * src/reduce.c (dump_grammar, useful_production, reduce_output)
16402 (useful_production, useless_nonterminals): Likewise.
16403 (reduce_grammar_tables): Likewise, plus update nritems.
16404 * src/nullable.c (set_nullable): Likewise.
16405 * src/lalr.c (build_relations): Likewise.
16406 * tests/sets.at (Nullable): Adjust.
16407 Fortunately, now, the $axiom is no longer nullable.
16408
9e7f6bbd
AD
164092001-12-29 Akim Demaille <akim@epita.fr>
16410
16411 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
16412 the 0-sentinel.
16413 * src/gram.c (ritem_longest_rhs): Likewise.
16414 * src/reduce.c (nonterminals_reduce): Likewise.
16415 * src/print_graph.c (print_graph): Likewise.
16416 * src/output.c (output_rule_data): Likewise.
16417 * src/nullable.c (set_nullable): Likewise.
16418
255ef638
AD
164192001-12-29 Akim Demaille <akim@epita.fr>
16420
16421 * src/output.c: Comment changes.
16422
0d8a7363
AD
164232001-12-27 Paul Eggert <eggert@twinsun.com>
16424
16425 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
16426 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
16427 Sparc, as they were causing more porting problems than the
16428 (minor) performance improvement was worth.
16429
16430 Also, catch up with 1.31's YYSTD.
16431
3db472b9
AD
164322001-12-27 Akim Demaille <akim@epita.fr>
16433
16434 * src/output.c (output_gram): Rely on nritems, not the
16435 0-sentinel. See below.
16436 Use -1 as separator, not 0.
16437 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
16438 Rely on -1 as separator in yyrhs, instead of 0.
16439 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
16440 twice `Now at end of input', therefore there are two lines less to
16441 expect.
16442
b365aa05
AD
164432001-12-27 Akim Demaille <akim@epita.fr>
16444
16445 * tests/regression.at (Unresolved SR Conflicts):
16446 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
16447 below.
16448
30171f79
AD
164492001-12-27 Akim Demaille <akim@epita.fr>
16450
16451 * src/LR0.c (new_state): Recognize the final state by the fact it
16452 is reached by eoftoken.
16453 (insert_start_shifting_state, insert_eof_shifting_state)
16454 (insert_accepting_state, augment_automaton): Remove, since now
16455 these states are automatically computed from the initial state.
16456 (generate_states): Adjust.
16457 * src/print.c: When reporting a rule number to the user, substract
16458 1, so that the axiom rule is rule 0, and the first user rule is 1.
16459 * src/reduce.c: Likewise.
16460 * src/print_graph.c (print_core): For the time being, just as for
16461 the report, depend upon --trace-flags to dump the full set of
16462 items.
16463 * src/reader.c (readgram): Once the grammar read, insert the rule
16464 0: `$axiom: START-SYMBOL $'.
16465 * tests/set.at: Adjust: rule 0 is now displayed, and since the
16466 number of the states has changed (the final state is no longer
16467 necessarily the last), catch up.
16468
75142d45
AD
164692001-12-27 Akim Demaille <akim@epita.fr>
16470
16471 Try to make the use of the eoftoken valid. Given that its value
16472 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
16473 is used instead of > 0 where appropriate, (ii), depend upon nritems
16474 instead of the 0-sentinel.
16475
16476 * src/gram.h, src/gram.c (nritems): New.
16477 Expected to be duplication of nitems, but for the time being...
16478 * src/reader.c (packgram): Assert nritems and nitems are equal.
16479 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
16480 * src/closure.c (print_closure, print_fderives): Likewise.
16481 * src/gram.c (ritem_print): Likewise.
16482 * src/print.c (print_core, print_grammar): Likewise.
16483 * src/print_graph.c: Likewise.
16484
b7c49edf
AD
164852001-12-27 Akim Demaille <akim@epita.fr>
16486
16487 * src/main.c (main): If there are complains after grammar
16488 reductions, then output the report anyway if requested, then die.
16489 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
16490 * src/reader.c (eoftoken): New.
16491 (parse_token_decl): If the token being defined has value `0', it
16492 is the eoftoken.
16493 (packsymbols): No longer hack `tags' to insert `$' by hand.
16494 Be sure to preserve the value of the eoftoken.
16495 (reader): Make sure eoftoken is defined.
16496 Initialize nsyms to 0: now eoftoken is created just like the others.
16497 * src/print.c (print_grammar): Don't special case the eof token.
16498 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
16499 lie anyway, albeit pleasant.
16500 * tests/calc.at: Exercise error messages with eoftoken.
16501 Change the grammar so that empty input is invalid.
16502 Adjust expectations.
16503 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
16504
ec2da99f
AD
165052001-12-27 Akim Demaille <akim@epita.fr>
16506
16507 * configure.in: Check the protos of strchr ans strspn.
16508 Replace strchr if needed.
16509 * src/system.h: Provide the protos of strchr, strspn and memchr if
16510 missing.
16511 * lib/strchr.c: New.
16512 * src/reader.c (symbols_save): Use strchr.
16513
8adfa272
AD
165142001-12-27 Akim Demaille <akim@epita.fr>
16515
16516 * src/print.c, src/print_graph.c (escape): New.
16517 Use it to quote the TAGS outputs.
16518 * src/print_graph.c (print_state): Now errors are in red, and
16519 reductions in green.
16520 Prefer high to wide: output the state number on a line of its own.
16521
80dac38c
AD
165222001-12-27 Akim Demaille <akim@epita.fr>
16523
16524 * src/state.h, src/state.c (reductions_new): New.
16525 * src/LR0.c (set_state_table): Let all the states have a
16526 `reductions', even if reduced to 0.
16527 (save_reductions): Adjust.
16528 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
16529 * src/print.c (print_reductions, print_actions): Adjust.
16530 * src/output.c (action_row): Adjust.
16531
2cec70b9
AD
165322001-12-27 Akim Demaille <akim@epita.fr>
16533
16534 * src/state.h, src/state.c (errs_new, errs_dup): New.
16535 * src/LR0.c (set_state_table): Let all the states have an errs,
16536 even if reduced to 0.
16537 * src/print.c (print_errs, print_reductions): Adjust.
16538 * src/output.c (output_actions, action_row): Adjust.
16539 * src/conflicts.c (resolve_sr_conflict): Adjust.
16540
13ca549a
AD
165412001-12-27 Akim Demaille <akim@epita.fr>
16542
16543 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
16544
5092aba5
AD
165452001-12-27 Akim Demaille <akim@epita.fr>
16546
16547 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
16548 * src/print.c: here.
16549 (lookaheadset, shiftset): New, used as additional storage by
16550 print_reductions.
16551 (print_results): Adjust.
16552 (print_shifts, print_gotos, print_errs): New, extracted from...
16553 (print_actions): here.
16554 * src/print_graph.c (print_actions): Remove dead code.
16555
11e2beca
AD
165562001-12-27 Akim Demaille <akim@epita.fr>
16557
16558 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
16559 `$n' and `@n'.
16560
dac3c910
AD
165612001-12-27 Akim Demaille <akim@epita.fr>
16562
16563 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
16564 (build_relations): Adjust.
16565
d0b0fefa
AD
165662001-12-27 Akim Demaille <akim@epita.fr>
16567
16568 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
16569 duplication.
16570
adc8c848
AD
165712001-12-27 Akim Demaille <akim@epita.fr>
16572
16573 * src/reader.c (packgram): Catch nitems overflows.
16574
14d293ac
AD
165752001-12-27 Akim Demaille <akim@epita.fr>
16576
16577 * src/files.c, src/files.h (guard_obstack): Remove.
16578 * src/output.c (output): Adjust.
16579 * src/reader.c (parse_braces): New, factoring...
16580 (copy_action, copy_guard): these two which are renamed as...
16581 (parse_action, parse_guard): these.
16582 As a voluntary consequence, using braces around guards is now
16583 mandatory.
16584
f499b062
AD
165852001-12-27 Akim Demaille <akim@epita.fr>
16586
16587 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
16588 * src/reader.c (symbol_list): `guard' and `guard_line' are new
16589 members.
16590 (symbol_list_new): Adjust.
16591 (copy_action): action_line is the first line, not the last.
16592 (copy_guard): Just as for actions, store the `action' only, not
16593 the switch/case/break flesh.
16594 Don't parse the user action that might follow the guard, let...
16595 (readgram): do it, i.e., now, there can be an action after a
16596 guard.
16597 In other words the guard is just explicitly optional.
16598 (packgram): Adjust.
16599 * src/output.c (guards_output): New.
16600 (output_parser): Call it when needed.
16601 (output): Also free the guard and attrs obstacks.
16602 * src/files.c, src/files.h (obstack_save): Remove.
16603 (output_files): Remove.
16604 As a result, if one needs the former `.act' file, using an
16605 appropriate skeleton which requires actions and guards is now
16606 required.
16607 * src/main.c (main): Adjust.
16608 * tests/semantic.at: New.
16609 * tests/regression.at: Use `input.y' as input file name.
16610 Avoid 8+3 problems by requiring input.c when the test needs the
16611 parser.
16612
d945f5cd
AD
166132001-12-27 Akim Demaille <akim@epita.fr>
16614
16615 * src/reader.c (symbol_list_new): Be sure to initialize all the
16616 fields.
16617
d200e455
AD
166182001-12-27 Akim Demaille <akim@epita.fr>
16619
16620 All the hacks using a final pseudo state are now useless.
16621
16622 * src/LR0.c (set_state_table): state_table holds exactly nstates.
16623 * src/lalr.c (nLA): New.
16624 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
16625 instead of lookaheadsp from the pseudo state (nstate + 1).
16626
f9507c28
AD
166272001-12-27 Akim Demaille <akim@epita.fr>
16628
16629 * src/output.c (action_row, token_actions): Use a state_t instead
16630 of a integer, and nlookaheads instead of the following state's
16631 lookaheadsp.
16632
065fbd27
AD
166332001-12-27 Akim Demaille <akim@epita.fr>
16634
16635 * src/conflicts.c (log_resolution, flush_shift)
16636 (resolve_sr_conflict, set_conflicts, solve_conflicts)
16637 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
16638 (conflicts_print, print_reductions): Use a state_t instead of an
16639 integer when referring to a state.
16640 As much as possible, depend upon nlookaheads, instead of the
16641 `lookaheadsp' member of the following state (since lookaheads of
16642 successive states are successive, the difference between state n + 1
16643 and n served as the number of lookaheads for state n).
16644 * src/lalr.c (add_lookback_edge): Likewise.
16645 * src/print.c (print_core, print_actions, print_state)
16646 (print_results): Likewise.
16647 * src/print_graph.c (print_core, print_actions, print_state)
16648 (print_graph): Likewise.
16649 * src/conflicts.h: Adjust.
16650
1b177bd7
AD
166512001-12-27 Akim Demaille <akim@epita.fr>
16652
16653 * src/bison.hairy: Formatting/comment changes.
16654 ANSIfy.
16655 Remove `register' indications.
16656 Add plenty of `static'.
16657
7742ddeb
AD
166582001-12-27 Akim Demaille <akim@epita.fr>
16659
16660 * src/output.c (prepare): Drop the muscle `ntbase' which
16661 duplicates ntokens.
16662 * src/bison.simple: Formatting/comment changes.
16663 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
16664 is an undocumented synonym.
16665
1fa14068
AD
166662001-12-22 Akim Demaille <akim@epita.fr>
16667
16668 * src/output.c (output_table_data): Change the prototype to use
16669 `int' for array ranges: some invocations do pass an int, not a
16670 short.
16671 Reported by Wayne Green.
16672
b9752825
AD
166732001-12-22 Akim Demaille <akim@epita.fr>
16674
16675 Some actions of web2c.y are improperly triggered.
16676 Reported by Mike Castle.
16677
16678 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
16679 * tests/regression.at (Web2c): Rename as...
16680 (Web2c Report): this.
16681 (Web2c Actions): New.
16682
776209d6
AD
166832001-12-22 Akim Demaille <akim@epita.fr>
16684
16685 Reductions in web2c.y are improperly reported.
16686 Reported by Mike Castle.
16687
16688 * src/conflicts.c (print_reductions): Fix.
16689 * tests/regression.at (Web2c): New.
16690
275fc3ad
AD
166912001-12-18 Akim Demaille <akim@epita.fr>
16692
16693 Some host fail on `assert (!"foo")', which expands to
16694 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
16695 Reported by Nelson Beebee.
16696
16697 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
16698 `#define it_succeeded 0' and `assert (it_succeeded)'.
16699
897668ee
MA
167002001-12-17 Marc Autret <autret_m@epita.fr>
16701
16702 * src/bison.simple: Don't hard code the skeleton line and filename.
16703 * src/output.c (output_parser): Rename 'line' as 'output_line'.
16704 New line counter 'skeleton_line' (skeleton-line muscle).
16705
ab3399e0
PE
167062001-12-17 Paul Eggert <eggert@twinsun.com>
16707
16708 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
16709 YYDEBUG must be defined to a nonzero value.
16710
16711 * src/bison.simple (yytname): Do not assume that the user defines
16712 YYDEBUG to a properly parenthesized expression.
16713
3877f72b
AD
167142001-12-17 Akim Demaille <akim@epita.fr>
16715
16716 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
16717 nlookaheads is a new member.
16718 Adjust all users.
16719 * src/lalr.h (nlookaheads): Remove this orphan declaration.
16720 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
16721 state.
776209d6 16722
331dbc1b
AD
167232001-12-17 Akim Demaille <akim@epita.fr>
16724
16725 * src/files.h, src/files.c (open_files, close_files): Remove.
16726 * src/main.c (main): Don't open/close files, nor invoke lex_free,
16727 let...
16728 * src/reader.c (reader): Do it.
776209d6 16729
be750e4c
AD
167302001-12-17 Akim Demaille <akim@epita.fr>
16731
16732 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 16733
709ae8c6
AD
167342001-12-17 Akim Demaille <akim@epita.fr>
16735
16736 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
16737 (flush_reduce): New.
16738 (resolve_sr_conflict): Adjust.
776209d6 16739
f87685c3
AD
167402001-12-17 Akim Demaille <akim@epita.fr>
16741
16742 * src/output.c (output_obstack): Be static and rename as...
16743 (format_obstack): this, to avoid any confusion with files.c's
16744 output_obstack.
16745 * src/reader.h (muscle_obstack): Move to...
16746 * src/output.h: here, since it's defined in output.c.
16747
837491d8
AD
167482001-12-17 Akim Demaille <akim@epita.fr>
16749
16750 * src/output.c (action_row, save_column, default_goto)
16751 (sort_actions, matching_state, pack_vector): Better variable
16752 locality.
16753
796d61fb
AD
167542001-12-17 Akim Demaille <akim@epita.fr>
16755
16756 * src/output.c: Various formatting changes.
776209d6 16757
64d15509
AD
167582001-12-17 Akim Demaille <akim@epita.fr>
16759
16760 * src/files.c (output_files): Free the output_obstack.
16761 * src/main.c (main): Call print and print_graph conditionally.
16762 * src/print.c (print): Work unconditionally.
16763 * src/print_graph.c (print_graph): Work unconditionally.
16764 * src/conflicts.c (log_resolution): Output only if verbose_flag.
16765
fbc8ecb7
MA
167662001-12-16 Marc Autret <autret_m@epita.fr>
16767
16768 * src/output.c (actions_output): Fix. When we use %no-lines,
16769 there is one less line per action.
16770
f0440388
MA
167712001-12-16 Marc Autret <autret_m@epita.fr>
16772
16773 * src/bison.simple: Remove a useless #line directive.
16774 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
16775 * src/output.c (get_lines_number): New.
776209d6 16776 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
16777 output muscles.
16778 Fix line numbering.
16779 (actions_output): Computes the number of lines taken by actions.
16780 (output_master_parser): Insert new skeleton which is the name of
16781 the output parser file name.
16782
a79986b8
MA
167832001-12-15 Marc Autret <autret_m@epita.fr>
16784
16785 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
16786
4ec8e00f
MA
167872001-12-15 Marc Autret <autret_m@epita.fr>
16788
16789 * src/output.c (output_gram): Keep track of the hairy one.
16790
1a4648ff
AD
167912001-12-15 Akim Demaille <akim@epita.fr>
16792
16793 Make `make distcheck' work.
16794
16795 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
16796 system.h which uses libgettext.h.
16797
9c2c67e6
AD
167982001-12-15 Akim Demaille <akim@epita.fr>
16799
16800 * src/nullable.c (set_nullable): Useless rules must be skipped,
16801 otherwise, since we range over their symbols, we might look at a
16802 nonterminal which no longer ``exists'', i.e., it is not counted in
16803 `nvars', hence we overflow our arrays.
16804
93ede233
AD
168052001-12-15 Akim Demaille <akim@epita.fr>
16806
16807 The header can also be produced directly, without any obstack!
16808 Yahoo!
16809
16810 * src/files.c, src/files.h (defines_obstack): Remove.
16811 (compute_header_macro): Global.
16812 (defines_obstack_save): Remove.
16813 * src/reader.c (parse_union_decl): No longer output to
16814 defines_obstack: its content can be found in the `stype' muscle
16815 anyway.
16816 (output_token_translations): Merge into...
16817 (symbols_output): this.
16818 Rename as...
16819 (symbols_save): this.
16820 (reader): Adjust.
16821 * src/output.c (header_output): New.
16822 (output): Call it.
16823
2666f928
AD
168242001-12-15 Akim Demaille <akim@epita.fr>
16825
16826 * src/reader.c (parse_union_decl): Instead of handling two obstack
16827 simultaneously, use one to define the `stype' muscle, and use the
16828 value of the latter to fill defines_obstack.
16829 (copy_comment): Remove.
16830 (copy_comment2): Work for a single obstack.
16831 Rename as...
16832 (copy_comment): this.
16833
428046f8
AD
168342001-12-15 Akim Demaille <akim@epita.fr>
16835
16836 * src/lex.c, src/lex.h (xgetc): No longer static.
16837 * src/reader.c (parse_union_decl): Revamp.
16838
ea52d706
AD
168392001-12-15 Akim Demaille <akim@epita.fr>
16840
16841 Still making progress in separating Bison into (i) input, (ii)
16842 process, (iii) output: now we can directly output the parser file
16843 without using table_obstack at all.
16844
16845 * src/files.c, src/files.h (table_obstack): Bye bye.
16846 (parser_file_name): New.
16847 * src/files.c (compute_output_file_names): Compute it.
16848 * src/output.c (actions_output, output_parser)
16849 (output_master_parser): To a file instead of an obstack.
16850
3f96f4dc
AD
168512001-12-15 Akim Demaille <akim@epita.fr>
16852
16853 Attach actions to rules, instead of pre-outputting them to
16854 actions_obstack.
16855
16856 * src/gram.h (rule_t): action and action_line are new members.
16857 * src/reader.c (symbol_list): Likewise.
16858 (copy_action): Save the actions within the rule.
16859 (packgram): Save them in rule_table.
16860 * src/output.c (actions_output): New.
16861 (output_parser): Use it on `%%actions'.
16862 (output_rule_data): Don't free rule_table.
16863 (output): Do it.
16864 (prepare): Don't save the `action' muscle.
16865 * src/bison.simple: s/%%action/%%actions/.
16866
51576fb3
AD
168672001-12-15 Akim Demaille <akim@epita.fr>
16868
16869 * src/reader.c (copy_action): When --yacc, don't append a `;'
16870 to the user action: let it fail if lacking.
dee049eb 16871 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 16872
2648a72d
AD
168732001-12-14 Akim Demaille <akim@epita.fr>
16874
16875 * src/lex.c (literalchar): Simply return the char you decoded, non
16876 longer mess around with obstacks and int pointers.
16877 Adjust all callers.
16878
92790e5b
AD
168792001-12-14 Akim Demaille <akim@epita.fr>
16880
16881 * src/lex.c (literalchar): Don't escape the special characters,
16882 just decode them, and keep them as char (before, eol was output as
16883 the 2 char string `\n' etc.).
16884 * src/output.c (output_rule_data): Use quotearg to output the
16885 token strings.
16886
927c1557
PE
168872001-12-13 Paul Eggert <eggert@twinsun.com>
16888
16889 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
16890 Do not infringe on the global user namespace when using C++.
16891 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
16892 All uses of `fprintf' and `stderr' changed.
16893
16894 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
16895
ed8e1f68
AD
168962001-12-13 Akim Demaille <akim@epita.fr>
16897
16898 The computation of nullable is broken: it doesn't handle empty
16899 RHS's properly.
16900
16901 * tests/torture.at (GNU AWK Grammar): New.
16902 * tests/sets.at (Nullable): New.
16903 * src/nullable.c (set_nullable): Instead of blindly looping over
16904 `ritems', loop over the rules, and then over their rhs's.
16905
16906 Work around Autotest bugs.
16907
16908 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
16909 frame, because Autotest understand lines starting with a `+' as
16910 traces from the shell. Then, they are not processed properly.
16911 Admittedly an Autotest bug, but we don't have time to wait for
16912 Autotest to catch up.
16913 * tests/regression.at (Broken Closure): Adjust to the new table
16914 frames.
16915 Move to...
16916 * tests/sets.at: here.
16917
cb581495
AD
169182001-12-13 Akim Demaille <akim@epita.fr>
16919
16920 * src/closure.c (closure): Use nrules instead of playing tricks
16921 with BITS_PER_WORD.
16922
2e729273
AD
169232001-12-13 Akim Demaille <akim@epita.fr>
16924
16925 * src/print.c (print_actions): Output the handling of `$' as the
16926 traces do: shifting the token EOF. Before EOF was treated as a
16927 nonterminal.
16928 * tests/regression.at: Adjust some tests.
16929 * src/print_graph.c (print_core): Complete the set of items via
16930 closure. The next-to-final and final states are still unsatisfying,
16931 but that's to be addressed elsewhere.
16932 No longer output the rule numbers, but do output the state number.
16933 A single loop for the shifts + gotos is enough, but picked a
16934 distinct color for each.
16935 (print_graph): Initialize and finalize closure.
16936
107f7dfb
AD
169372001-12-13 Akim Demaille <akim@epita.fr>
16938
16939 * src/reader.c (readgram): Remove dead code, an strip useless
16940 braces.
16941 (get_type): Remove, unused.
16942
9b53a24f
AD
169432001-12-12 Akim Demaille <akim@epita.fr>
16944
16945 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
16946 on that of lib/error.c.
16947
dbfb6dcd
AD
169482001-12-12 Akim Demaille <akim@epita.fr>
16949
16950 Some hosts don't like `/' in includes.
16951
16952 * src/system.h: Include libgettext.h without qualifying the path.
16953 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
16954 $(top_srcdir).
16955
c25fb648
MA
169562001-12-11 Marc Autret <autret_m@epita.fr>
16957
16958 * src/output.c (output_parser): Remove useless muscle.
16959
710ddc4f
MA
169602001-12-11 Marc Autret <autret_m@epita.fr>
16961
16962 * src/bison.simple: Remove #line just before %%epilogue. It
16963 is now handled in ...
16964 * src/reader.c (read_additionnal_code): Add the output of a
16965 #line for the epilogue.
16966
e83d80b8
MA
169672001-12-10 Marc Autret <autret_m@epita.fr>
16968
927c1557 16969 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
16970 replace precedent remove.
16971 * src/bison.simple: Remove #line before %%prologue because
16972 %%input-line is wrong at this time.
16973
971d5158
MA
169742001-12-10 Marc Autret <autret_m@epita.fr>
16975
16976 * src/reader.c (symbols_output): Clean up.
927c1557 16977 * src/output.c (output_gram, output): Clean up.
971d5158 16978
5edafffd
AD
169792001-12-10 Akim Demaille <akim@epita.fr>
16980
16981 * src/lalr.c (initialize_lookaheads): New. Extracted from...
16982 * src/LR0.c (set_state_table): here.
16983 * src/lalr.c (lalr): Call it.
16984
0279f8e9
AD
169852001-12-10 Akim Demaille <akim@epita.fr>
16986
16987 * src/state.h (shifts): Remove the `number' member: shifts are
16988 attached to state, hence no longer need to be labelled with a
16989 state number.
16990
190c4f5f
AD
169912001-12-10 Akim Demaille <akim@epita.fr>
16992
16993 Now that states have a complete set of members, the linked list of
16994 shifts is useless: just fill directly the state's shifts member.
16995
16996 * src/state.h (shifts): Remove the `next' member.
16997 * src/LR0.c (first_state, last_state): Remove.
16998 Adjust the callers.
16999 (augment_automaton): Don't look for the shifts that must be added
17000 a shift on EOF: it is those of the state we looked for! But now,
17001 since shifts are attached, it is no longer needed to looking
17002 merely by its id: its number.
17003
2a73b93d
AD
170042001-12-10 Akim Demaille <akim@epita.fr>
17005
17006 * src/LR0.c (augment_automaton): Better variable locality.
17007 Remove an impossible branch: if there is a state corresponding to
17008 the start symbol being shifted, then there is shift for the start
17009 symbol from the initial state.
17010
74392f6a
AD
170112001-12-10 Akim Demaille <akim@epita.fr>
17012
17013 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
17014 only when appropriate: when insert_start_shifting_state' is not
17015 invoked.
17016 * tests/regression.at (Rule Line Numbers): Adjust.
17017
37c82725
AD
170182001-12-10 Akim Demaille <akim@epita.fr>
17019
17020 * src/LR0.c (augment_automaton): Now that all states have shifts,
17021 merge the two cases addition shifts to the initial state.
17022
6a164e0c
AD
170232001-12-10 Akim Demaille <akim@epita.fr>
17024
17025 * src/lalr.c (set_state_table): Move to...
17026 * src/LR0.c: here.
17027 * src/lalr.c (lalr): Don't call it...
17028 * src/LR0.c (generate_states): do it.
17029 * src/LR0.h (first_state): Remove, only the table is used.
17030
7215de24
AD
170312001-12-10 Akim Demaille <akim@epita.fr>
17032
17033 * src/LR0.h (first_shift, first_reduction): Remove.
17034 * src/lalr.c: Don't use first_shift: find shifts through the
17035 states.
17036
80e25d4d
AD
170372001-12-10 Akim Demaille <akim@epita.fr>
17038
17039 * src/LR0.c: Attach shifts to states as soon as they are
17040 computed.
17041 * src/lalr.c (set_state_table): Instead of assigning shifts to
17042 state, just assert that the mapping was properly done.
17043
0ab3728b
AD
170442001-12-10 Akim Demaille <akim@epita.fr>
17045
17046 * src/LR0.c (insert_start_shift): Rename as...
17047 (insert_start_shifting_state): this.
17048 (insert_eof_shifting_state, insert_accepting_state): New.
17049 (augment_automaton): Adjust.
17050 Better locality of the variables.
17051 When looking if the start_symbol is shifted from the initial
17052 state, using `while (... symbol != start_symbol ...)' sounds
17053 better than `while (... symbol < start_symbol ...)': If fail
17054 to see how the order between symbols could be relevant!
17055
78af9bbc
AD
170562001-12-10 Akim Demaille <akim@epita.fr>
17057
17058 * src/getargs.h: Don't declare `spec_name_prefix' and
17059 `spec_file_prefix', declared by src/files.h.
17060 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
17061 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
17062 * src/output.c (prepare): Adjust.
17063 * src/reader.c (symbols_output): Likewise.
17064 * src/vmsgetargs.c: Vaguely adjust, but who cares?
17065
bdef2a41
AD
170662001-12-10 Akim Demaille <akim@epita.fr>
17067
17068 * src/muscle_tab.c (muscle_init): NULL is a better default than
17069 `"0"'.
17070
3735969c
AD
170712001-12-10 Akim Demaille <akim@epita.fr>
17072
17073 * src/reader.c (reader): Calling symbols_output once is enough.
17074
49701457
AD
170752001-12-10 Akim Demaille <akim@epita.fr>
17076
17077 Now that states have a complete set of members, the linked list of
17078 reductions is useless: just fill directly the state's reductions
17079 member.
17080
17081 * src/state.h (struct reductions): Remove member `number' and
17082 `next'.
17083 * src/LR0.c (first_reduction, last_reduction): Remove.
17084 (save_reductions): Don't link the new reductions, store them in
17085 this_state.
17086 * src/lalr.c (set_state_table): No need to attach reductions to
17087 states, it's already done.
17088 * src/output.c (output_actions): No longer free the shifts, then
17089 the reductions, then the states: free all the states and their
17090 members.
17091
0edad749
AD
170922001-12-10 Akim Demaille <akim@epita.fr>
17093
17094 * src/options.c (OPTN, DRTV, BOTH): New.
17095 (option_table): Use them.
17096
0edad749
AD
17097 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
17098 the job of system.h.
17099 * src/options.c: Don't include stdio.h and xalloc.h for the same
17100 reasons.
17101
5449dd0f
AD
171022001-12-10 Akim Demaille <akim@epita.fr>
17103
17104 * src/output.c (output, prepare): Make sure the values of the
17105 muscles `action' and `prologue' are 0-terminated.
17106
a870c567
AD
171072001-12-10 Akim Demaille <akim@epita.fr>
17108
17109 Clean up GCC warnings.
17110
17111 * src/reader.c (copy_action): `buf' is not used.
17112 (parse_skel_decl): Be static.
17113 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
17114 * src/options.h (create_long_option_table): Have a real prototype.
17115 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
17116 (hash_delete_at): Return const void *.
17117 Adjust casts to preserve the const.
17118
80df8768
AD
171192001-12-10 Akim Demaille <akim@epita.fr>
17120
17121 * configure.in: Require 2.52g.
17122 M4 is not needed, but AUTOM4TE is.
17123 * m4/m4.m4: Remove.
17124 * tests/Makefile.am: Adjust.
17125
f693ad14
AD
171262001-12-10 Akim Demaille <akim@epita.fr>
17127
17128 One structure for states is enough, even though theoretically
17129 there are LR(0) states and LALR(1) states.
17130
17131 * src/lalr.h (state_t): Remove.
17132 (state_table): Be state_t **, not state_t *.
17133 * src/state.h (core, CORE_ALLOC): Rename as...
17134 (state_t, STATE_ALLOC): this.
17135 Add the LALR(1) members: shifts, reductions, errs.
17136 * src/LR0.c (state_table): Rename as...
17137 (state_hash): this, to avoid name clashes with the global
17138 `state_table'.
17139 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
17140 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
17141
74ffbcb6
AD
171422001-12-10 Akim Demaille <akim@epita.fr>
17143
17144 Bison dumps core on bash.y.
17145 Reported by Pascal Bart.
17146
17147 * src/warshall.c (bitmatrix_print): New.
17148 (TC): Use it.
ba0fe3c7 17149 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
17150 j must be the outer loop.
17151 * tests/regression.at (Broken Closure): New.
17152
07708e19
AD
171532001-12-05 Akim Demaille <akim@epita.fr>
17154
17155 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
17156 its argument.
ba1ecc07 17157 Reported by Peter Hamorsky.
07708e19 17158
92b16366
AD
171592001-12-05 Akim Demaille <akim@epita.fr>
17160
17161 * src/conflicts.c (err_table): Remove.
17162 (resolve_sr_conflict): Adjust.
17163 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
17164 Rename as...
17165 (state_t.reductions, state_t.shifts): this.
17166
076ab033
AD
171672001-12-05 Akim Demaille <akim@epita.fr>
17168
17169 * src/reduce.c (reduce_grammar_tables): No longer disable the
17170 removal of useless rules via CPP but via `if (0)', so that the
17171 compiler still check the code is valid.
17172 For instance, it should have noticed `rline' no longer exists: use
17173 the `line' member of rule_t.
17174 * src/gram.c (dummy, rline): Remove, unused.
17175
3843c413
AD
171762001-12-05 Akim Demaille <akim@epita.fr>
17177
17178 * src/output.c (pack_vector): Use assert, not berror.
17179 * src/main.c (berror): Remove, unused.
17180
43168960
AD
171812001-12-05 Akim Demaille <akim@epita.fr>
17182
17183 New experimental feature: if --verbose --trace output all the
17184 items of a state, not only its kernel.
17185
17186 * src/print.c (print_core): If `trace_flag', then invoke closure
17187 before outputting the items of the state (print_core is no longer
17188 a correct name them).
17189 (print_results): Invoke new_closure/free_closure if needed.
17190
b2872512
AD
171912001-12-05 Akim Demaille <akim@epita.fr>
17192
17193 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
17194 * src/closure.c, src/closure.h (itemsetsize): Rename as...
17195 (nitemset): for consistency with the rest of the project.
17196
23cbcc6c
AD
171972001-12-05 Akim Demaille <akim@epita.fr>
17198
17199 * src/closure.c (print_closure): Improve.
17200 (closure): Use it for printing input and output.
17201
03ec521c
AD
172022001-12-05 Akim Demaille <akim@epita.fr>
17203
17204 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
17205 indexed by nonterminals.
17206
3a7456dd
AD
172072001-12-05 Akim Demaille <akim@epita.fr>
17208
17209 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
17210 what it was!).
17211 * src/warshall.h: Remove accidental duplication of the content.
17212
1cbcf2e7
AD
172132001-12-05 Akim Demaille <akim@epita.fr>
17214
17215 * src/closure.c (set_fderives): De-obfuscate.
17216
84182270
AD
172172001-12-05 Akim Demaille <akim@epita.fr>
17218
17219 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
17220
3f6f053c
AD
172212001-12-05 Akim Demaille <akim@epita.fr>
17222
17223 * src/closure.c (set_firsts): De-obfuscate.
17224
7a5350ba
AD
172252001-12-05 Akim Demaille <akim@epita.fr>
17226
17227 * src/output.c (action_row): De-obfuscate
17228 using the good o' techniques: arrays not pointers, variable
17229 locality, BITISSET, RESETBIT etc.
17230
d954473d
AD
172312001-12-05 Akim Demaille <akim@epita.fr>
17232
17233 Pessimize the code to simplify it: from now on, all the states
17234 have a valid SHIFTS, which NSHIFTS is possibly 0.
17235
17236 * src/LR0.c (shifts_new): Be global and move to..
17237 * src/state.c, src/state.h: here.
17238 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
17239 * src/print_graph: Adjust.
17240
9839bbe5
AD
172412001-12-05 Akim Demaille <akim@epita.fr>
17242
17243 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
17244 * src/conflicts.c: Use it.
17245 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
17246 incorrectly ``simplified''.
17247
9f136c07
AD
172482001-12-05 Akim Demaille <akim@epita.fr>
17249
17250 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
17251 using the good o' techniques: arrays not pointers, variable
17252 locality, BITISSET, RESETBIT etc.
17253
b608206e
AD
172542001-12-05 Akim Demaille <akim@epita.fr>
17255
17256 * src/state.h (SHIFT_SYMBOL): New.
17257 * src/conflicts.c: Use it to deobfuscate.
17258
52afa962
AD
172592001-12-05 Akim Demaille <akim@epita.fr>
17260
17261 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
17262 (print_reductions): De-obfuscate using the good o' techniques:
17263 arrays not pointers, variable locality, BITISSET.
17264
e74dc321
AD
172652001-12-05 Akim Demaille <akim@epita.fr>
17266
17267 * src/conflicts.c (print_reductions): Arrays, not pointers.
17268 Use BITISSET.
17269
768fca83
AD
172702001-12-05 Akim Demaille <akim@epita.fr>
17271
17272 * src/conflicts.c (print_reductions): Pessimize, but clarify.
17273
a17e599f
AD
172742001-12-05 Akim Demaille <akim@epita.fr>
17275
17276 * src/conflicts.c (print_reductions): Improve variable locality.
17277
a04bc341
AD
172782001-12-05 Akim Demaille <akim@epita.fr>
17279
17280 * src/conflicts.c (print_reductions): Pessimize, but clarify.
17281
c8ea038e
AD
172822001-12-05 Akim Demaille <akim@epita.fr>
17283
17284 * src/conflicts.c (print_reductions): Improve variable locality.
17285
aa2aab3c
AD
172862001-12-05 Akim Demaille <akim@epita.fr>
17287
17288 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
17289 * src/lalr.c: Use them.
17290
b178c8cc
AD
172912001-12-05 Akim Demaille <akim@epita.fr>
17292
17293 * src/LR0.c (augment_automaton): Formatting changes.
17294 Better variable locality.
17295
f67d13aa
AD
172962001-12-05 Akim Demaille <akim@epita.fr>
17297
17298 * src/lalr.c (matrix_print): New.
17299 (transpose): Use it.
17300 Use arrays instead of pointers.
17301
c2713865
AD
173022001-12-05 Akim Demaille <akim@epita.fr>
17303
17304 * src/lalr.c (maxrhs): Move to...
17305 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
17306 * src/lalr.c (build_relations): Adjust.
17307
9887c18a
AD
173082001-12-05 Akim Demaille <akim@epita.fr>
17309
17310 * src/lalr.c (transpose): Free the memory allocated to the
17311 argument, as it is replaced by the results by the unique caller.
17312 (build_relations): Merely invoke transpose: it handles the memory
17313 deallocation.
17314 Improve variable locality.
17315 Avoid variables used as mere abbreviations.
17316 (compute_lookaheads): Use arrays instead of pointers.
17317
4d4f699c
AD
173182001-12-05 Akim Demaille <akim@epita.fr>
17319
17320 * src/lalr.c (initialize_F): Improve variable locality.
17321 Avoid variables used as mere abbreviations.
17322
80a69750
AD
173232001-12-05 Akim Demaille <akim@epita.fr>
17324
17325 * src/derives.c (print_derives): Display the ruleno.
17326 * src/lalr.c (initialize_F, transpose): Better variable locality
17327 to improve readability.
17328 Avoid variables used as mere abbreviations.
17329
fe961097
AD
173302001-12-05 Akim Demaille <akim@epita.fr>
17331
17332 * src/lalr.c (traverse): Use arrays instead of pointers.
17333
e3e4e814
AD
173342001-12-05 Akim Demaille <akim@epita.fr>
17335
17336 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
17337 the handling of squeue.
17338 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
17339
630e182b
AD
173402001-12-05 Akim Demaille <akim@epita.fr>
17341
17342 Because useless nonterminals are now kept alive (instead of being
17343 `destroyed'), we now sometimes examine them, and store information
17344 related to them. Hence we need to know their number, and adjust
17345 memory allocations.
17346
17347 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
17348 static.
17349 * src/LR0.c (allocate_itemsets): The memory allocated to
17350 `symbol_count' was used for two different purpose: once to count
17351 the number of occurrences of each symbol, and later reassigned to
17352 `shift_symbol', containing the symbol that can be shifted from a
17353 given state.
17354 Deobfuscate, i.e., allocate, use and free `symbol_count' here
17355 only, and...
17356 (new_itemsets): Allocate `shift_symbol' here.
17357 (allocate_itemsets): symbol_count includes useless nonterminals.
17358 Make room for them.
17359 (free_storage): Use `free', not `XFREE', for pointers that cannot
17360 be null.
17361
81b51460
AD
173622001-12-05 Akim Demaille <akim@epita.fr>
17363
17364 * src/nullable.c (set_nullable): Deobfuscate the handling of
17365 ritem.
17366 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
17367
3067fbef
AD
173682001-12-05 Akim Demaille <akim@epita.fr>
17369
17370 * src/gram.c, src/gram.h (ritem_print): New.
17371 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
17372 (This useless function was defined only to work around VMS linkers
17373 that can't handle compilation units with variables only).
17374 * src/reduce.c (dump_grammar): Use it to trace the construction of
17375 ritem.
17376
c2bea5f9
PE
173772001-12-04 Paul Eggert <eggert@twinsun.com>
17378
7d27c823
PE
17379 * src/bison.simple (union yyalloc): Change member names
17380 to be the same as the stack names.
17381 (yyparse): yyptr is now union yyalloc *, not char *.
17382 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
17383 and may generate better code on some machines.
c2bea5f9
PE
17384 (yystpcpy): Use prototype if __STDC__ is defined, not just
17385 if __cplusplus is defined.
35687a9d 17386
2c8a9dfa
AD
173872001-11-30 Akim Demaille <akim@epita.fr>
17388
17389 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
17390 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
17391 Gettext doesn't compile cleanly, and dies with -Werror.
17392 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
17393 Include WARNING_CFLAGS here.
17394 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
17395 before being defined.
17396
f4e421e6
AD
173972001-11-27 Paul Eggert <eggert@twinsun.com>
17398
17399 * lib/quotearg.h (quotearg_n, quotearg_n_style):
17400 First arg is int, not unsigned.
17401 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
17402 (SIZE_MAX, UINT_MAX): New macros.
17403 (quotearg_n_options): Abort if N is negative.
17404 Avoid overflow check on hosts where size_t is 64 bits and int
17405 is 32 bits, as overflow is impossible there.
17406 Fix off-by-one typo that caused unnecessary reallocation.
17407
7093d0f5
AD
174082001-11-29 Paul Eggert <eggert@twinsun.com>
17409
17410 Name space cleanup in generated parser.
17411
17412 * doc/bison.texinfo (Bison Parser): Discuss system headers
17413 and their effect on the user name space.
17414
17415 * src/bison.simple:
17416 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
17417 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
17418 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
17419
17420 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
17421 on user names when possible.
17422
17423 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
17424 Simplify test for whather <alloca.h> exists.
17425
17426 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
17427
17428 (<stdio.h>): Include if YYDEBUG.
17429
17430 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
17431 ! defined (yyoverflow) && ! defined (yymemcpy).
17432
17433 (yymemcpy, yyparse): Rename local variables as needed so that
17434 they all begin with 'yy'.
17435
17436 (yystrlen, yystpcpy): New functions.
17437
17438 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
17439 All uses changed.
17440
17441 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
17442 instead of relying on string.h functions. Use YYSTACK_ALLOC
17443 and YYSTACK_FREE instead of malloc and free.
17444
fd51e5ff
AD
174452001-11-30 Akim Demaille <akim@epita.fr>
17446
17447 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
17448 before their first uses.
17449 (YYBISON, YYPURE): Move to the top of the output.
17450
7d13ff5f
AD
174512001-11-30 Akim Demaille <akim@epita.fr>
17452
17453 * tests/reduce.at (Useless Nonterminals): Fix.
17454
892a3995
AD
174552001-11-30 Akim Demaille <akim@epita.fr>
17456
17457 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
17458 if body instead of `;' to pacify GCC's warnings.
17459
68f1e3ed
AD
174602001-11-30 Akim Demaille <akim@epita.fr>
17461
17462 Instead of mapping the LHS of unused rules to -1, keep the LHS
17463 valid, but flag the rules as invalid.
17464
17465 * src/gram.h (rule_t): `useful' is a new member.
17466 * src/print.c (print_grammar): Adjust.
17467 * src/derives.c (set_derives): Likewise.
17468 * src/reader.c (packgram, reduce_output): Likewise.
17469 * src/reduce.c (reduce_grammar_tables): Likewise.
17470 * tests/reduce.at (Underivable Rules, Useless Rules): New.
17471
d2d1b42b
AD
174722001-11-30 Akim Demaille <akim@epita.fr>
17473
17474 * src/reduce.c (reduce_output): Formatting changes.
17475 * src/print.c (print_results, print_grammar): Likewise.
17476 * tests/regression.at (Rule Line Numbers)
17477 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
17478
760b53a8
AD
174792001-11-30 Akim Demaille <akim@epita.fr>
17480
17481 * src/reduce.c (nonterminals_reduce): Instead of throwing away
17482 useless nonterminals, move them at the end of the symbol arrays.
17483 (reduce_output): Adjust.
17484 * tests/reduce.at (Useless Nonterminals): Adjust.
17485
00238958
AD
174862001-11-30 Akim Demaille <akim@epita.fr>
17487
17488 * src/reduce.c: Various comment/formatting changes.
17489 (nonterminals_reduce): New, extracted from...
17490 (reduce_grammar_tables): here.
17491 (reduce_grammar): Call nonterminals_reduce.
17492
396452de
PE
174932001-11-29 Paul Eggert <eggert@twinsun.com>
17494
17495 * src/bison.simple (YYSTACK_REALLOC): Remove.
17496 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
17497 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
17498 New macros.
17499 (union yyalloc): New type.
17500 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
17501 an arbitrary restriction on hosts where size_t is wider than int.
17502
17503 (yyparse): Don't dump core if alloca or malloc fails; instead, report
17504 a parser stack overflow. Allocate just one block of memory for all
17505 three stacks, instead of allocating three blocks; this typically is
17506 faster and reduces fragmentation.
17507
17508 Do not limit the number of items in the stack to a value that fits
17509 in 'int', as this is an arbitrary limit on hosts with 64-bit
17510 size_t and 32-bit int.
17511
147e184c
MA
175122001-11-29 Marc Autret <autret_m@epita.fr>
17513
17514 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
17515 of defining YYERROR_VERBOSE.
17516 [AT_DATA]: $4 is now out of C declarations in the prologue.
17517
426cf563
MA
175182001-11-28 Marc Autret <autret_m@epita.fr>
17519
17520 * src/reader.c (parse_dquoted_param): New.
17521 (parse_skel_decl): Use it.
17522 * src/lex.h: Add its prototype.
17523 * src/lex.c (literalchar): Become not static.
17524
c7925b99
MA
175252001-11-28 Marc Autret <autret_m@epita.fr>
17526
17527 * src/output.h: And put its extern declaration here.
17528 * src/output.c (error_verbose): Define here.
17529 (prepare): Echo name modification.
17530 * src/getargs.h: Clean its extern declaration.
17531 * src/getargs.c (error_verbose_flag): Remove.
17532 (getargs): Remove case 'e'.
17533 * src/options.c (option_table): 'error-verbose' is now seen as simple
17534 percent option.
17535 Include output.h.
17536
17537 * src/reader.c (read_declarations): Remove case tok_include.
17538 (parse_include_decl): Remove.
17539 * src/lex.h (token_t): Remove tok_include.
17540 * src/options.c (option_table): 'include' is now a simple command line
17541 option.
17542
5b5d1929
MA
175432001-11-28 Marc Autret <autret_m@epita.fr>
17544
17545 * src/bison.simple: Adjust muscle names.
17546 * src/muscle_tab.c (muscle_init): Also rename the muscles.
17547 * src/output.c (prepare): s/_/-/ for the muscles names.
17548 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
17549
8850be4b
MA
175502001-11-28 Marc Autret <autret_m@epita.fr>
17551
17552 * src/bison.simple: Fix debug.
17553 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
17554
4a38e613
AD
175552001-11-28 Akim Demaille <akim@epita.fr>
17556
17557 * src/LR0.c (shifts_new): New.
17558 (save_shifts, insert_start_shift, augment_automaton): Use it.
17559
4b35e1c1
AD
175602001-11-28 Akim Demaille <akim@epita.fr>
17561
17562 * src/closure.c (closure): `b' and `ruleno' denote the same value:
17563 keep ruleno only.
17564
d2b04478
AD
175652001-11-28 Akim Demaille <akim@epita.fr>
17566
17567 * src/closure.c (closure): Instead of looping over word in array
17568 then bits in words, loop over bits in array.
17569
2c4c30aa
AD
175702001-11-28 Akim Demaille <akim@epita.fr>
17571
17572 * src/closure.c (closure): No longer optimize the special case
17573 where all the bits of `ruleset[r]' are set to 0, to make the code
17574 clearer.
17575
576890b7
AD
175762001-11-28 Akim Demaille <akim@epita.fr>
17577
17578 * src/closure.c (closure): `r' and `c' are new variables, used to
17579 de-obfuscate accesses to RULESET and CORE.
17580
cb487d7d
AD
175812001-11-28 Akim Demaille <akim@epita.fr>
17582
17583 * src/reduce.c (reduce_print): Use ngettext.
17584 (dump_grammar): Improve the trace accuracy.
17585
6013d43f
AD
175862001-11-28 Akim Demaille <akim@epita.fr>
17587
17588 * src/reduce.c (dump_grammar): Don't translate trace messages.
17589
cb4956ee
AD
175902001-11-28 Akim Demaille <akim@epita.fr>
17591
17592 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
17593 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
17594 as all tags are free'ed afterwards.
17595 From Enrico Scholz.
17596
648185ab
PE
175972001-11-27 Paul Eggert <eggert@twinsun.com>
17598
17599 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
17600 use alloca when we didn't want to, and vice versa.
17601
68254a03
MA
176022001-11-27 Marc Autret <autret_m@epita.fr>
17603
9113b58f
AD
17604 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
17605 initialization.
68254a03
MA
17606 * src/output.c (prepare): Remove its update.
17607
04d843a2
MA
176082001-11-27 Marc Autret <autret_m@epita.fr>
17609
17610 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
17611 Use %error-verbose.
17612
d2079671 176132001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
17614
17615 * src/bison.simple: Remove YYERROR_VERBOSE using.
17616 Use %%error_verbose.
17617 (yyparse): Likewise.
17618 * src/output.c (prepare): Give its final value.
17619 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
17620 * src/getargs.h: Add its extern declaration.
17621 * src/getargs.c (error_verbose_flag): New int.
17622 (getargs): Update to catch new case.
17623 * src/options.c (option_table): 'error-verbose' is a new option.
17624 (shortopts): Update.
17625
e0327bc8
AD
176262001-11-27 Akim Demaille <akim@epita.fr>
17627
17628 * src/system.h: Use intl/libgettext.h.
17629 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
17630
000f1a3c
AD
176312001-11-27 Akim Demaille <akim@epita.fr>
17632
17633 * tests/torture.at (Exploding the Stack Size with Malloc):
17634 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
17635
26cfe0be
AD
176362001-11-27 Akim Demaille <akim@epita.fr>
17637
17638 * src/files.c: Include error.h.
17639 Reported by Hans Aberg.
17640
f6bd5427
MA
176412001-11-26 Marc Autret <autret_m@epita.fr>
17642
d2079671 17643 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
17644 (read_declarations): Add case tok_include.
17645 * src/getargs.h (include): Add its extern definition.
17646 * src/getargs.c (include): New const char *.
17647 (getargs): Add case '-I'.
17648 * src/options.c (option_table): Add include as command line and
17649 percent option.
17650 * src/lex.h (token_t): Add tok_include.
17651
2ca209c1
AD
176522001-11-26 Akim Demaille <akim@epita.fr>
17653
17654 * src/reader.c (readgram): Make sure rules for mid-rule actions
17655 have a lineno equal to that of their host rule.
17656 Reported by Hans Aberg.
17657 * tests/regression.at (Rule Line Numbers): New.
17658
0e41b407
AD
176592001-11-26 Akim Demaille <akim@epita.fr>
17660
17661 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
17662 size_ts.
17663
176642001-11-26 Akim Demaille <akim@epita.fr>
17665
17666 * src/complain.c, src/complain.h (error): Remove, provided by
17667 lib/error.[ch].
17668
e0c40012
AD
176692001-11-26 Akim Demaille <akim@epita.fr>
17670
17671 * src/reader.c (read_declarations): Don't abort on tok_illegal,
17672 issue an error message.
17673 * tests/regression.at (Invalid %directive): New.
17674 Reported by Hans Aberg.
17675
5e147124
AD
176762001-11-26 Akim Demaille <akim@epita.fr>
17677
17678 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
17679 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17680
a034c8b8
AD
176812001-11-26 Akim Demaille <akim@epita.fr>
17682
17683 * src/conflicts.c (conflicts_print): Don't complain at all when
17684 there are no reduce/reduce conflicts, and as many shift/reduce
17685 conflicts as expected.
17686 * tests/regression.at (%expect right): Adjust.
17687
c64a20f3
AD
176882001-11-23 Akim Demaille <akim@epita.fr>
17689
17690 * lib/alloca.c: Update, from fileutils.
17691
5b0d29bb
AD
176922001-11-23 Akim Demaille <akim@epita.fr>
17693
17694 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
17695
722c4bfe
AD
176962001-11-23 Akim Demaille <akim@epita.fr>
17697
17698 * src/system.h: Include alloca.h.
17699 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
17700
6255b435
AD
177012001-11-23 Akim Demaille <akim@epita.fr>
17702
17703 * src/print_graph.c (print_actions): Remove `rule', unused.
17704 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
17705 pacify GCC's signed < unsigned warnings.
17706 * src/closure.c (itemsetsize): Likewise.
17707 * src/reader.c (symbol_list_new): Static.
17708
b29b2ed5
AD
177092001-11-23 Akim Demaille <akim@epita.fr>
17710
17711 Attaching lineno to buckets is stupid, since only one copy of each
17712 symbol is kept, only the line of the first occurrence is kept too.
17713
17714 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
17715 * src/reader.c (rline_allocated): Remove, unused.
17716 (symbol_list): Have a `line' member.
17717 (symbol_list_new): New.
17718 (readgram): Use it.
17719 * src/print.c (print_grammar): Output the rule line numbers.
17720 * tests/regression.at (Solved SR Conflicts)
17721 (Unresolved SR Conflicts): Adjust.
17722 Reported by Hans Aberg.
17723
a81b1d4a
MA
177242001-11-22 Marc Autret <autret_m@epita.fr>
17725
17726 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
17727
c1ecb3c1
MA
177282001-11-22 Marc Autret <autret_m@epita.fr>
17729
17730 * src/muscle_tab.c (muscle_init): Remove initialization of
17731 skeleton muscle.
17732 * src/output.c (output_master_parser): Do it here.
17733
fbe01355
AD
177342001-11-20 Akim Demaille <akim@epita.fr>
17735
17736 * po/sv.po: New.
17737 * configure.in (ALL_LINGUAS): Adjust.
17738 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
17739 longer contains strings to translate.
17740
81e895c0
AD
177412001-11-19 Akim Demaille <akim@epita.fr>
17742
17743 * src/conflicts.c (conflicts_print): Add a missing \n.
17744
6bb1878b
AD
177452001-11-19 Akim Demaille <akim@epita.fr>
17746
17747 * src/nullable.c (nullable_print): New.
17748 (set_nullable): Call it when tracing.
17749 Better locality of variables.
17750
d9ec2d07
AD
177512001-11-19 Akim Demaille <akim@epita.fr>
17752
17753 * src/print.c (print_actions): Better locality of variables.
17754
720e5c1b
AD
177552001-11-19 Akim Demaille <akim@epita.fr>
17756
17757 * src/derives.c (print_derives): Fix and enrich.
17758 * src/closure.c (print_fderives): Likewise.
17759
fb908786
AD
177602001-11-19 Akim Demaille <akim@epita.fr>
17761
17762 * src/closure.c (itemsetend): Remove, replaced with...
17763 (itemsetsize): new.
17764
125ecb56
AD
177652001-11-19 Akim Demaille <akim@epita.fr>
17766
17767 * src/LR0.c (kernel_end): Remove, replaced with...
17768 (kernel_size): new.
17769
d8cf039f
AD
177702001-11-19 Akim Demaille <akim@epita.fr>
17771
17772 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
17773 to clarify.
17774
7bec0760
AD
177752001-11-19 Akim Demaille <akim@epita.fr>
17776
17777 * src/closure.c (closure): Use arrays instead of pointers to clarify.
17778
c87d4863
AD
177792001-11-19 Akim Demaille <akim@epita.fr>
17780
17781 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
17782 trace messages.
17783 * src/LR0.c: Likewise.
17784 (allocate_itemsets): Use arrays instead of pointers to clarify.
17785
9bfe901c
AD
177862001-11-19 Akim Demaille <akim@epita.fr>
17787
17788 * src/getargs.c (statistics_flag): Replace with...
17789 (trace_flag): New.
17790 (longopts): Accept --trace instead of --statistics.
17791 * src/getargs.h, src/options.c: Adjust.
17792 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
17793 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
17794
97db7bd4
AD
177952001-11-19 Akim Demaille <akim@epita.fr>
17796
cc72668c 17797 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
17798 pointers to clarify the code.
17799 (save_reductions, save_shifts): Factor common parts of alternatives.
17800
2c5f66ed
AD
178012001-11-19 Akim Demaille <akim@epita.fr>
17802
17803 * src/LR0.c (new_state, get_state): Complete TRACE code.
17804 * src/closure.c: Include `reader.h' to get `tags', needed by the
17805 trace code.
17806 Rename the conditional DEBUG as TRACE.
17807 Output consistently TRACEs to stderr, not stdout.
17808 * src/derives.c: Likewise.
17809 * src/reduce.c: (inaccessable_symbols): Using if is better style
17810 than goto.
17811 Use `#if TRACE' instead of `#if 0' for tracing code.
17812
300f275f
AD
178132001-11-19 Akim Demaille <akim@epita.fr>
17814
17815 * src/system.h (LIST_FREE, shortcpy): New.
17816 * src/LR0.c: Use them.
17817 * src/output.c (free_itemsets, free_reductions, free_shifts):
17818 Remove, replaced by LIST_FREE.
17819
f59c437a
AD
178202001-11-19 Akim Demaille <akim@epita.fr>
17821
17822 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
17823 (REDUCTIONS_ALLOC): New.
17824 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
17825 allocation.
17826
6986fd9e
AD
178272001-11-19 Akim Demaille <akim@epita.fr>
17828
17829 * src/LR0.c (new_state): Complete trace code.
17830 * src/nullable.c (set_nullable): Don't translate traces.
17831
4bc30f78
AD
178322001-11-19 Akim Demaille <akim@epita.fr>
17833
17834 * src/print_graph.c (print_core): Better locality of variables.
17835 * src/print.c (print_core): Likewise.
17836
08a946e0
AD
178372001-11-19 Akim Demaille <akim@epita.fr>
17838
17839 * src/vcg.c: You do the output, so you are responsible of the
17840 handling of VCG syntax, in particular: use quotearg.
17841 * src/print_graph.c: Don't.
17842 (print_actions): Don't output the actions as part of the nodes,
17843 since that's the job of the edges.
17844 (print_state): Don't output by hand: fill the node description,
9bfe901c 17845 and ask for its output.
08a946e0 17846
f0473484
AD
178472001-11-19 Akim Demaille <akim@epita.fr>
17848
cc72668c
AD
17849 * src/bison.simple (yyparse): When verbosely reporting an error,
17850 no longer put additional quotes around token names.
f0473484
AD
17851 * tests/calc.at: Adjust.
17852
e41dc700
AD
178532001-11-19 Akim Demaille <akim@epita.fr>
17854
17855 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
17856 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
17857 * src/output.c: Adjust.
17858
652a871c
AD
178592001-11-19 Akim Demaille <akim@epita.fr>
17860
17861 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
17862 (rule_t): this.
17863 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
17864
b2ed6e58
AD
178652001-11-19 Akim Demaille <akim@epita.fr>
17866
17867 * src/gram.h (rule_t): New.
17868 (rule_table): New.
17869 (rrhs, rlhs): Remove, part of state_t.
17870 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
17871 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17872 * src/reader.c, src/reduce.c: Adjust.
17873
edad7067
AD
178742001-11-19 Akim Demaille <akim@epita.fr>
17875
17876 * src/reader.c (symbols_output): New, extracted from...
17877 (packsymbols): Here.
17878 (reader): Call it.
17879
3feec034
AD
178802001-11-19 Akim Demaille <akim@epita.fr>
17881
17882 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
17883 (maxrhs): this new function.
17884
ddcd5fdf
AD
178852001-11-19 Akim Demaille <akim@epita.fr>
17886
cc72668c 17887 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
17888 Adjust.
17889
bb527fc2
AD
178902001-11-19 Akim Demaille <akim@epita.fr>
17891
cc72668c 17892 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
17893 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17894 * src/lalr.c: Adjust.
17895
a845a697
AD
178962001-11-19 Akim Demaille <akim@epita.fr>
17897
17898 * src/lalr.c (initialize_LA): Only initialize LA. Let...
17899 (set_state_table): handle the `lookaheads' members.
17900
f004bf6a
AD
179012001-11-19 Akim Demaille <akim@epita.fr>
17902
cc72668c
AD
17903 * src/lalr.h (lookaheads): Removed array, whose contents is now
17904 a member of...
f004bf6a
AD
17905 (state_t): this structure.
17906 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17907 Adjust.
17908
de326cc0
AD
179092001-11-19 Akim Demaille <akim@epita.fr>
17910
cc72668c
AD
17911 * src/lalr.h (consistent): Removed array, whose contents is now
17912 a member of...
de326cc0
AD
17913 (state_t): this structure.
17914 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17915 Adjust.
17916
90b4416b
AD
179172001-11-19 Akim Demaille <akim@epita.fr>
17918
cc72668c
AD
17919 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
17920 contents are now members of...
90b4416b
AD
17921 (state_t): this structure.
17922 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17923 Adjust.
17924
9703cc49
AD
179252001-11-19 Akim Demaille <akim@epita.fr>
17926
17927 * src/lalr.h (state_t): New.
17928 (state_table): Be a state_t * instead of a core **.
17929 (accessing_symbol): Remove, part of state_t.
17930 * src/lalr.c: Adjust.
17931 (set_accessing_symbol): Merge into...
17932 (set_state_table): this.
17933 * src/print_graph.c, src/conflicts.c: Adjust.
17934
d803322e
AD
179352001-11-14 Akim Demaille <akim@epita.fr>
17936
17937 * tests/calc.at, tests/output.at, tests/regression.at,
17938 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
17939 now the tests are run in private dirs, therefore AC_CLEANUP and
17940 family can be simplified to 0-ary.
17941 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
17942 use abs. path to find config.h.
17943 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
17944 stderr, there can be way too much random noise.
17945 Instead pass -Werror to GCC and rely on the exit status.
17946 Reported by Wolfram Wagner.
17947
3d76b07d
AD
179482001-11-14 Akim Demaille <akim@epita.fr>
17949
17950 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
17951 defined only if yyoverflow is defined, to avoid `warning: unused
17952 variable `yyvs1''.
17953 Reported by The Test Suite.
17954
09b503c8
AD
179552001-11-14 Akim Demaille <akim@epita.fr>
17956
17957 * src/print.c: Include reduce.h.
17958 Reported by Hans Aberg.
17959
179602001-11-14 Akim Demaille <akim@epita.fr>
17961
17962 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
17963 Revert a previous patch: these are really const.
17964 * src/conflicts.c (conflict_report): Additional useless pair of
17965 braces to pacify GCC's warnings for `if () if () {} else {}'.
17966 * src/lex.c (parse_percent_token): Replace equal_offset with
17967 arg_offset.
17968 arg is const.
17969 Be sure to strdup `arg' when used, since there is no reason for
17970 token_buffer not to change.
17971
0f37a994
AD
179722001-11-14 Akim Demaille <akim@epita.fr>
17973
17974 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
17975 definition.
17976 * src/main.c (main): Use them.
17977 Suggested by Hans Aberg.
17978
d39d93b8
AD
179792001-11-12 Akim Demaille <akim@epita.fr>
17980
17981 * src/system.h (ngettext): Now that we use ngettext, be sure to
17982 provide a default definition when NLS are not used.
17983
9edcd895
AD
179842001-11-12 Akim Demaille <akim@epita.fr>
17985
17986 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
17987 Use @kbd to denote user input.
17988 (Language and Grammar): ANSIfy the example.
17989 Adjust its layout for info/notinfo.
17990 (Location Tracking Calc): Output error messages to stderr.
17991 Output locations in a more GNUtically correct way.
17992 Fix a couple of Englishos.
17993 Adjust @group/@end group pairs.
17994
7da99ede
AD
179952001-11-12 Akim Demaille <akim@epita.fr>
17996
e3aa65c5 17997 %expect was not functioning at all.
7da99ede
AD
17998
17999 * src/conflicts.c (expected_conflicts): Set to -1.
18000 (conflict_report): Use ngettext.
18001 (conflicts_print): Check %expect and make its violation an error.
18002 * doc/bison.texinfo (Expect Decl): Adjust.
18003 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
18004 * tests/regression.at (%expect not enough, %expect right)
18005 (%expect too much): New.
18006
ba9dda1a
AD
180072001-11-12 Akim Demaille <akim@epita.fr>
18008
18009 * tests/regression.at (Conflicts): Rename as...
18010 (Unresolved SR Conflicts): this.
18011 (Solved SR Conflicts): New.
18012
337c5bd1
AD
180132001-11-12 Akim Demaille <akim@epita.fr>
18014
18015 * src/reduce.c (print_results): Rename as...
18016 (reduce_output): This.
18017 Output to OUT, passed as argument, instead of output_obstack.
18018 (dump_grammar): Likewise.
18019 (reduce_free): New.
18020 Also free V1.
18021 (reduce_grammar): No longer call reduce_output, since...
18022 * src/print.c (print_results): do it.
18023 * src/main.c (main): Call reduce_free;
18024
c73a41af
AD
180252001-11-12 Akim Demaille <akim@epita.fr>
18026
18027 * src/conflicts.c (print_reductions): Accept OUT as argument.
18028 Output to it, not to output_obstack.
18029 * src/print.c (print_actions): Adjust.
18030
0df87bb6
AD
180312001-11-12 Akim Demaille <akim@epita.fr>
18032
18033 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
18034 the result instead of using...
18035 (src_total, rrc_total, src_count, rrc_count): Remove.
18036 (any_conflicts): Remove.
18037 (print_conflicts): Split into...
18038 (conflicts_print, conflicts_output): New.
18039 * src/conflicts.h: Adjust.
18040 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 18041 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
18042 * tests/regression.at (Conflicts): New.
18043 Reported by Tom Lane.
18044
e4d3d4de
AD
180452001-11-12 Akim Demaille <akim@epita.fr>
18046
18047 * tests/regression.at (Invalid input): Remove, duplicate with
18048 ``Invalid input: 1''.
18049
6d7d248e
AD
180502001-11-12 Akim Demaille <akim@epita.fr>
18051
18052 * tests/torture.at (AT_DATA_STACK_TORTURE)
18053 (Exploding the Stack Size with Alloca)
18054 (Exploding the Stack Size with Malloc): New.
18055
e9e4c321
AD
180562001-11-12 Akim Demaille <akim@epita.fr>
18057
18058 * src/bison.simple (YYSTACK_REALLOC): New.
18059 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 18060 Reported by Per Allansson.
e9e4c321 18061
5f7e0832
AD
180622001-11-12 Pascal Bart <pascal.bart@epita.fr>
18063
18064 * src/bison.simple: Define type yystype instead of YYSTYPE, and
18065 define CPP macro, which substitute YYSTYPE by yystype.
18066 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
18067 with yyltype/YYLTYPE. This allows inclusion of the generated
18068 header within the parser if the compiler, such as GGC, accepts
18069 multiple equivalent #defines.
18070 From Akim.
18071
e3f1699f
AD
180722001-11-05 Akim Demaille <akim@epita.fr>
18073
18074 * src/reader.c (symbols_output): New, extracted from...
18075 (packsymbols): here.
18076 (reader): Adjust.
18077
65be0866
AD
180782001-11-05 Akim Demaille <akim@epita.fr>
18079
18080 * src/lex.c (parse_percent_token): s/quotearg/quote/.
18081
e4d910bf
AD
180822001-11-05 Akim Demaille <akim@epita.fr>
18083
18084 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
18085 pattern.
18086
951366c1
AD
180872001-11-05 Akim Demaille <akim@epita.fr>
18088
18089 * src/options.h (struct option_table_struct): set_flags is void*.
18090 * src/options.c (longopts): Support `--output' and `%output'.
18091 (usage): Adjust.
18092 * src/lex.h (tok_setopt): Remove, replaced with...
18093 (tok_intopt, tok_stropt): these new guys.
18094 * src/lex.c (getopt.h): Not needed.
18095 (token_buffer, unlexed_token_buffer): Not const.
18096 (percent_table): Promote `-' over `_' in directive names.
18097 Active `%name-prefix', `file-prefix', and `output'.
18098 (parse_percent_token): Accept possible arguments to directives.
18099 Promote `-' over `_' in directive names.
18100
d8988b2f
AD
181012001-11-04 Akim Demaille <akim@epita.fr>
18102
18103 * doc/bison.texinfo (Decl Summary): Split the list into
18104 `directives for grammars' and `directives for bison'.
18105 Sort'em.
18106 Add description of `%name-prefix', `file-prefix', and `output'.
18107 Promote `-' over `_' in directive names.
18108 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
18109 Simplify the description of `--name-prefix'.
18110 Promote `-' over `_' in directive names.
18111 Promote `--output' over `--output-file'.
18112 Fix the description of `--defines'.
18113 * tests/output.at: Exercise %file-prefix and %output.
18114
6468d18e
AD
181152001-11-02 Akim Demaille <akim@epita.fr>
18116
18117 * doc/refcard.tex: Update.
18118
6b7e85b9
AD
181192001-11-02 Akim Demaille <akim@epita.fr>
18120
18121 * src/symtab.h (SUNDEF): New.
18122 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
18123 stand for `uninitialized', instead of 0.
18124 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
18125 * src/lex.c (lex): Adjust.
18126
18127 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
18128 Number it 0.
18129 Let yylex return it instead of a plain 0.
18130 Reported by Dick Streefland.
18131
cd5aafcf
AD
181322001-11-02 Akim Demaille <akim@epita.fr>
18133
18134 * tests/regression.at (Mixing %token styles): New test.
18135
037ca2f1
AD
181362001-11-02 Akim Demaille <akim@epita.fr>
18137
18138 * src/reader.c (parse_thong_decl): Formatting changes.
18139 (token_translations_init): New, extracted from...
18140 (packsymbols): Here.
18141 Adjust.
18142
270a173c
AD
181432001-11-01 Akim Demaille <akim@epita.fr>
18144
18145 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
18146 Check that `9foo.y' produces correct cpp guards.
18147 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
18148 guards.
18149 Reported by Wwp.
18150
561f9a30
AD
181512001-11-01 Akim Demaille <akim@epita.fr>
18152
18153 * tests/regression.at (Invalid input: 2): New.
18154 * src/lex.c (unlexed_token_buffer): New.
18155 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
18156 too.
18157 Reported by Wwp.
18158
f987e9d2
AD
181592001-11-01 Akim Demaille <akim@epita.fr>
18160
18161 * tests/calc.at: Catch up with 1.30.
18162 * configure.in: Bump to 1.49a.
18163 Adjust to newer Autotest.
18164
0846f581
PB
181652001-10-19 Pascal Bart <pascal.bart@epita.fr>
18166
18167 * src/conflicts.c: Move global variables rrc_total and src_total ...
18168 (print_conflicts): here.
18169 * src/output.c (output): Free global variable user_toknums.
18170 * src/lex.c (token_obstack): Become static.
18171
3c1a79b3
AD
181722001-10-18 Akim Demaille <akim@epita.fr>
18173
18174 * tests/atlocal.in (GCC): Add.
18175 * tests/calc.at: s/m4_match/m4_bmatch/.
18176 s/m4_patsubst/m4_bpatsubst/.
18177 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
18178 * configure.in: AC_SUBST(GCC).
18179
5d52e7d0
MA
181802001-10-14 Marc Autret <autret_m@epita.fr>
18181
18182 * src/options.c (create_long_option_table): Fix.
18183
631aa1d3
AD
181842001-10-10 Akim Demaille <akim@epita.fr>
18185
18186 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
18187
f6ec6d13
AD
181882001-10-04 Akim Demaille <akim@epita.fr>
18189
18190 * src/reader.c (parse_union_decl): Push the caracters in
18191 union_obstack, not attrs_obstack.
18192
342b8b6e
AD
181932001-10-04 Akim Demaille <akim@epita.fr>
18194
18195 Merge in the branch 1.29.
18196
18197 * src/reader.c (packsymbols): Use a temporary obstack for
18198 `%%tokendef', since output_stack is already used elsewhere.
18199
18200 2001-10-02 Akim Demaille <akim@epita.fr>
18201
18202 Bump 1.29d.
18203
18204 2001-10-02 Akim Demaille <akim@epita.fr>
18205
18206 Version 1.29c.
18207
18208 2001-10-02 Akim Demaille <akim@epita.fr>
18209
18210 * tests/regression.at (Invalid CPP headers): New.
18211 From Alexander Belopolsky.
18212 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
18213
18214 2001-10-02 Akim Demaille <akim@epita.fr>
18215
18216 * tests/regression.at (Invalid input): New.
18217 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
18218 Reported by Shura.
18219
18220 2001-10-02 Akim Demaille <akim@epita.fr>
18221
18222 * tests/calc.at: Now that --debug works, the tests must be adjusted.
18223
18224 2001-10-02 Akim Demaille <akim@epita.fr>
18225
18226 * src/output.c (output_parser): Assert `skeleton'.
18227 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
18228 systems.
18229 From Shura.
18230
18231 2001-10-01 Marc Autret <autret_m@epita.fr>
18232
18233 * src/lex.h: Echo modifications.
18234 * src/lex.c (unlex): Parameter is now token_t.
18235 From Hans Aberg.
18236
18237 2001-10-01 Marc Autret <autret_m@epita.fr>
18238
18239 * src/main.c: Include lex.h.
18240 From Hans Aberg.
18241
18242 2001-09-29 Akim Demaille <akim@epita.fr>
18243
18244 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
18245
18246 2001-09-28 Akim Demaille <akim@epita.fr>
18247
18248 * tests/testsuite.at: Update to newer Autotest.
18249 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
18250
18251 2001-09-27 Akim Demaille <akim@epita.fr>
18252
18253 Position independent wrapper.
18254
18255 * tests/bison: Remove.
18256 * tests/bison.in: New.
18257 * configure.in: Adjust.
18258
18259 2001-09-27 Paul Eggert <eggert@twinsun.com>
18260
18261 Port quotearg fixes from tar 1.13.24.
18262
18263 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
18264 tm to be declared.
18265 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
18266 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
18267
18268 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
18269 * m4/mbrtowc.m4: New file.
18270 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
18271 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
18272
18273 2001-09-27 Akim Demaille <akim@epita.fr>
18274
18275 Bump to 1.29c.
18276
18277 2001-09-27 Akim Demaille <akim@epita.fr>
18278
18279 Version 1.29b.
18280
18281 2001-09-25 Akim Demaille <akim@epita.fr>
18282
18283 * src/system.h: Include `xalloc.h'.
18284 Remove it from the C files.
18285 * src/files.c (output_files): Free the obstacks.
18286 * src/lex.c (init_lex): Rename as...
18287 (lex_init): this.
18288 (lex_free): New.
18289 * src/main.c (main): Use it.
18290
18291 2001-09-24 Marc Autret <autret_m@epita.fr>
18292
18293 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
18294 to output informations in fout (FILE*).
18295 (open_graph, close_graph): Likewise.
18296 (output_graph, output_edge, output_node): Likewise.
18297 * src/vcg.h: Update function prototypes.
18298 * src/print_graph.c (print_graph): Open output graph file.
18299 (print_actions): Adjust.
18300 * src/files.h: Remove extern declaration.
18301 * src/files.c: Remove graph_obstack declaration.
18302 (open_files): Remove graph_obstack initialization.
18303 (output_files): Remove graph_obstack saving.
18304
18305 2001-09-24 Marc Autret <autret_m@epita.fr>
18306
18307 * src/files.c (compute_output_file_names): Fix.
18308
18309 2001-09-24 Marc Autret <autret_m@epita.fr>,
18310 Akim Demaille <akim@epita.fr>
18311
18312 * src/reader.c (reader): Remove call to free_symtab ().
18313 * src/main.c (main): Call it here.
18314 Include symtab.h.
18315 * src/conflicts.c (initialize_conflicts): Rename as...
18316 (solve_conflicts): this.
18317 * src/print.c (print_core, print_actions, print_state)
18318 (print_grammar): Dump to a file instead a `output_obstack'.
18319 (print_results): Dump `output_obstack', and then proceed with the
18320 FILE *.
18321 * src/files.c (compute_output_file_names, close_files): New.
18322 (output_files): Adjust.
18323 * src/main.c (main): Adjust.
18324
18325 2001-09-23 Marc Autret <autret_m@epita.fr>
18326
18327 * src/files.c (compute_header_macro): Computes header macro name
18328 from spec_defines_file when given.
18329
18330 2001-09-23 Marc Autret <autret_m@epita.fr>
18331
18332 * src/files.c (output_files): Add default extensions.
18333
18334 2001-09-22 Akim Demaille <akim@epita.fr>
18335
18336 * src/conflicts.c (finalize_conflicts): Rename as...
18337 (free_conflicts): this.
18338
18339 2001-09-22 Akim Demaille <akim@epita.fr>
18340
18341 * src/gram.c (gram_free): Rename back as...
18342 (dummy): this.
18343 (output_token_translations): Free `token_translations'.
18344 * src/symtab.c (free_symtab): Free the tag field.
18345
18346 2001-09-22 Akim Demaille <akim@epita.fr>
18347
18348 Remove `translations' as it is always set to true.
18349
18350 * src/gram.h: Adjust.
18351 * src/reader.c (packsymbols, parse_token_decl): Adjust
18352 * src/print.c (print_grammar): Adjust.
18353 * src/output.c (output_token_translations): Adjust.
18354 * src/lex.c (lex): Adjust.
18355 * src/gram.c: Be sure the set pointers to NULL.
18356 (dummy): Rename as...
18357 (gram_free): this.
18358
18359 2001-09-22 Akim Demaille <akim@epita.fr>
18360
18361 * configure.in: Invoke AM_LIB_DMALLOC.
18362 * src/system.h: Use dmalloc.
18363 * src/LR0.c: Be sure to have pointers initialized to NULL.
18364 (allocate_itemsets): Allocate kernel_items only if needed.
18365
18366 2001-09-22 Akim Demaille <akim@epita.fr>
18367
18368 * configure.in: Bump to 1.29b.
18369 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
18370 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
18371 need xmalloc.c in calc.y.
18372 From Pascal Bart.
18373
18374 2001-09-21 Akim Demaille <akim@epita.fr>
18375
18376 Version 1.29a.
18377 * Makefile.maint, config/config.guess, config/config.sub,
18378 * config/missing: Update from masters.
18379 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
18380 upon package.m4.
18381 * configure.in (ALL_LINGUAS): Add `tr'.
18382
18383 2001-09-21 Akim Demaille <akim@epita.fr>
18384
18385 * tests/Makefile.am (package.m4): Move to...
18386 ($(srcdir)/$(TESTSUITE)): here.
18387
18388 2001-09-20 Akim Demaille <akim@epita.fr>
18389
18390 * src/complain.c: No longer try to be standalone: use system.h.
18391 Don't assume __STDC__ is defined to 1. Just test if it is defined.
18392 * src/complain.h: Likewise.
18393 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
18394 Remove the unused variable `n'.
18395 From Albert Chin-A-Young.
18396
18397 2001-09-18 Marc Autret <autret_m@epita.fr>
18398
18399 * doc/bison.1: Update.
18400 * doc/bison.texinfo (Bison Options): Update --defines and --graph
18401 descriptions.
18402 (Option Cross Key): Update.
18403 Add --graph.
18404
18405 2001-09-18 Marc Autret <autret_m@epita.fr>
18406
18407 * tests/regression.at: New test (comment in %union).
18408
18409 2001-09-18 Marc Autret <autret_m@epita.fr>
18410
18411 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
18412 do that.
18413 Reported by Keith Browne.
18414
18415 2001-09-18 Marc Autret <autret_m@epita.fr>
18416
18417 * tests/output.at: Add tests for --defines and --graph.
18418
18419 2001-09-18 Marc Autret <autret_m@epita.fr>
18420
18421 * tests/output.at: Removes tests of %{header,src}_extension features.
18422
18423 2001-09-18 Akim Demaille <akim@epita.fr>
18424
18425 * tests/Makefile.am (package.m4): New.
18426 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
18427 (_AT_CHECK_CALC_ERROR): Likewise.
18428 Factor the `, ' part of verbose error messages.
18429
18430 2001-09-18 Marc Autret <autret_m@epita.fr>
18431
18432 * src/getargs.c (longopts): Declare --defines and --graph as options
18433 with optional arguments.
18434 * src/files.h: Add extern declarations.
18435 * src/files.c (spec_graph_file, spec_defines_file): New.
18436 (output_files): Update.
18437 Remove CPP-outed code.
18438
18439 2001-09-18 Marc Autret <autret_m@epita.fr>
18440
18441 Turn off %{source,header}_extension feature.
18442
18443 * src/files.c (compute_exts_from_gf): Update.
18444 (compute_exts_from_src): Update.
18445 (output_files): CPP-out useless code.
18446 * src/files.h: Remove {header,source}_extension extern declarations.
18447 * src/reader.c (parse_dquoted_param): CPP-out.
18448 (parse_header_extension_decl): Remove.
18449 (parse_source_extension_decl): Remove.
18450 (read_declarations): Remove cases tok_{hdrext,srcext}.
18451 * src/lex.c (percent_table): Remove {header,source}_extension entries.
18452 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
18453
18454 2001-09-10 Akim Demaille <akim@epita.fr>
18455
18456 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
18457 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
18458 (AT_CHECK_OUTPUT): this.
18459 Merely check ls' exit status, its output is useless.
18460
18461 2001-09-10 Akim Demaille <akim@epita.fr>
18462
18463 * tests/calc.at: Use m4_match.
18464 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
18465
18466 2001-09-10 Marc Autret <autret_m@epita.fr>,
18467 Akim Demaille <akim@epita.fr>
18468
18469 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
18470 enum color_e.
18471 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
18472 to `normal'.
18473 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
18474 * src/lex.h: Adjust prototype.
18475 (token_t): Add `tok_undef'.
18476 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
18477 (parse_percent_token): Now returns token_t.
18478 Add default statement in switch.
18479 (lex): Separate `c' as an input variable, from the token_t result
18480 part.
18481 (unlexed): Is a token_t.
18482
18483 2001-09-10 Akim Demaille <akim@epita.fr>
18484
18485 * configure.in: Bump to 1.29a.
18486
18487 2001-09-07 Akim Demaille <akim@epita.fr>
18488
18489 Version 1.29.
18490
18491 2001-08-30 Akim Demaille <akim@epita.fr>
18492
18493 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
18494 * m4/atconfig.m4: Remove.
18495 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
18496 * tests/bison: New.
18497 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
18498 m4_if, m4_patsubst, and m4_regexp.
18499 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
18500 `input' file instead of echo.
18501
18502 2001-08-29 Akim Demaille <akim@epita.fr>
18503
18504 Bump to 1.28e.
18505
18506 2001-08-29 Akim Demaille <akim@epita.fr>
18507
18508 Version 1.28d.
18509
18510 2001-08-29 Paul Eggert <eggert@twinsun.com>
18511
18512 * src/bison.simple (yyparse): Don't take the address of an
18513 item before the start of an array, as that doesn't conform to
18514 the C Standard.
18515
18516 2001-08-29 Robert Anisko <anisko_r@epita.fr>
18517
18518 * doc/bison.texinfo (Location Tracking Calc): New node.
18519
18520 2001-08-29 Paul Eggert <eggert@twinsun.com>
18521
18522 * src/output.c (output): Do not define const, as this now
18523 causes more problems than it cures.
18524
18525 2001-08-29 Akim Demaille <akim@epita.fr>
18526
18527 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
18528 the nodes.
18529 Be sure to tag the `detailmenu'.
18530
18531 2001-08-29 Akim Demaille <akim@epita.fr>
18532
18533 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
18534 download in a tmp dir.
18535
18536 2001-08-28 Marc Autret <autret_m@epita.fr>
18537
18538 * config/depcomp: New file.
18539
18540 2001-08-28 Marc Autret <autret_m@epita.fr>
18541
18542 * doc/bison.1 (mandoc): Adjust.
18543 From Juan Manuel Guerrero.
18544
18545 2001-08-28 Marc Autret <autret_m@epita.fr>
18546
18547 * src/print_graph.c (print_state): Fix.
18548
18549 2001-08-27 Marc Autret <autret_m@epita.fr>
18550
18551 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
18552 char * members.
18553 Echo modifications to the functions prototypes.
18554 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
18555
18556 2001-08-27 Marc Autret <autret_m@epita.fr>
18557
18558 * src/vcg.c: Include `xalloc.h'.
18559 (add_colorentry): New.
18560 (add_classname): New.
18561 (add_infoname): New.
18562 * src/vcg.h: Add new prototypes.
18563
18564 2001-08-27 Akim Demaille <akim@epita.fr>
18565
18566 * Makefile.maint: Sync. again with CVS Autoconf.
18567
18568 2001-08-27 Akim Demaille <akim@epita.fr>
18569
18570 * Makefile.maint: Formatting changes.
18571 (po-update, cvs-update, update): New targets.
18572 (AMTAR): Remove.
18573
18574 2001-08-27 Akim Demaille <akim@epita.fr>
18575
18576 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18577 * Makefile.maint: Sync. with CVS Autoconf.
18578
18579 2001-08-27 Marc Autret <autret_m@epita.fr>
18580
18581 * src/vcg.h (struct infoname_s): New.
18582 (struct colorentry_s): New.
18583 (graph_s): New fields {vertical,horizontal}_order in structure.
18584 Add `infoname' field.
18585 Add `colorentry' field;
18586 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
18587 (G_HORIZONTAL_ORDER): New.
18588 (G_INFONAME): New.
18589 (G_COLORENTRY): New.
18590 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
18591 Add output of `infoname'.
18592 Add output of `colorentry'.
18593
18594 2001-08-27 Marc Autret <autret_m@epita.fr>
18595
18596 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
18597 This one shadowed a global parameter.
18598
18599 2001-08-24 Marc Autret <autret_m@epita.fr>
18600
18601 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
18602 instead of `unsigned'.
18603 (print_state): Do not call obstack_object_size () in obstack_grow ()
18604 to avoid macro variables shadowing.
18605
18606 2001-08-23 Marc Autret <autret_m@epita.fr>
18607
18608 * src/lex.c (percent_table): Typo: s/naem/name/.
18609 Add graph option.
18610 Normalize new options declarations.
18611
18612 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
18613
18614 * tests/suite.at: Exercise %header_extension and %source_extension.
18615
18616 2001-08-16 Marc Autret <autret_m@epita.fr>
18617
18618 * src/reader.c (parse_dquoted_param): New.
18619 (parse_header_extension_decl): Use it.
18620 (parse_source_extension_decl): Likewise.
18621
18622 2001-08-16 Marc Autret <autret_m@epita.fr>
18623
18624 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
18625 (get_xxxx_str): Use assert () instead of complain ().
18626 Remove return invokations in default cases.
18627 (get_decision_str): Modify default behaviour. Remove second argument.
18628 Echo modifications on calls.
18629 (output_graph): Fix.
18630
18631 2001-08-16 Marc Autret <autret_m@epita.fr>
18632
18633 * src/getargs.c (usage): Update with ``-g, --graph''.
18634
18635 2001-08-16 Marc Autret <autret_m@epita.fr>
18636
18637 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
18638 (Option Cross Key): Likewise.
18639 * doc/bison.1: Update.
18640
1c8c2190
PB
186412001-09-25 Pascal Bart <pascal.bart@epita.fr>
18642
18643 * src/output.c (output_master_parser): Don't finish action_obstack.
18644 (output_parser): Don't care about the muscle action, here.
18645 (prepare): Copy the action_obstack in the action muscle.
18646 (output): Free action_obstack.
18647
180d45ba
PB
186482001-09-23 Pascal Bart <pascal.bart@epita.fr>
18649
18650 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
18651 will contain `%union' declaration.
18652 (parse_union_decl): Delete #line directive output.
18653 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
18654 informations about %union.
18655 (parse_union_decl): Copy the union_obstack in the muscle stype.
18656 * src/bison.simple: Add new #line directive.
18657 Add typdef %%stype YYSTYPE.
18658
c51d1a19
PB
186592001-09-23 Pascal Bart <pascal.bart@epita.fr>
18660
18661 * src/bison.simple: Add new `#line' directive.
18662
6f9344da
PB
186632001-09-22 Pascal Bart <pascal.bart@epita.fr>
18664
18665 * src/bison.simple: New `#line' directive.
18666 * src/output.c (output_parser): Support new dynamic muscle input_line.
18667
652def80
MA
186682001-09-22 Marc Autret <autret_m@epita.fr>
18669
18670 * src/output.c (output_master_parser): New.
18671 (output_parser): Be more re-entrant.
18672
25b222fa
MA
186732001-09-21 Marc Autret <autret_m@epita.fr>
18674
18675 * src/reader.c (copy_definition, parse_union_decl): Update and use
18676 `linef' muscle.
18677 (copy_action): Likewise.
18678 Use obstack_1grow ().
18679 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
18680
6bc35ae5
MA
186812001-09-21 Marc Autret <autret_m@epita.fr>
18682
18683 * src/options.c (option_table): Adjust.
18684 * src/lex.c (parse_percent_token): Fix.
18685
c0629aa1
PB
186862001-09-20 Pascal Bart <pascal.bart@epita.fr>
18687
18688 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 18689
82b6d266
PB
186902001-09-20 Pascal Bart <pascal.bart@epita.fr>
18691
18692 * src/lex.c (parse_percent_token): Change type of variable `tx', which
18693 is now an option_table_struct*.
18694 (option_strcmp): New function option_strcmp.
18695 (parse_percent_token): Call option_strcmp.
18696 * src/getargs.c (xalloc.h, options.h): Include it.
18697 (getargs): Call create_long_option_table.
18698 (getargs): Free longopts at the end of the function.
18699 (shortopts): Move in options.c.
18700 * src/options.c (create_long_option_table): New function. Convert
18701 information from option_table to option structure.
18702 * src/reader.c (options.h): Include it.
18703
18704 * src/Makefile.am: Adjust.
18705 * src/options.c (option_table): Create from longopts and percent_table.
18706 * src/getargs.c (longopts): Delete.
18707 * src/lex.c (struct percent_table_struct): Delete.
18708 (percent_table): Delete.
18709 (options.h): Include it.
18710 * src/options.c: Create.
18711 * src/options.h: Create.
18712 Declare enum opt_access_e.
18713 Define struct option_table_struct.
18714
75f5aaea
MA
187152001-09-20 Marc Autret <autret_m@epita.fr>
18716
18717 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
18718 sections of Bison.
18719
f508cb0a
PB
187202001-09-19 Pascal Bart <pascal.bart@epita.fr>
18721
18722 * src/bison.simple: s/%%filename/%%skeleton.
18723 * src/muscle_tab.c (getargs.h): Include it.
18724 (muscle_init): Insert new muscle skeleton.
18725
13105fc1
PB
187262001-09-18 Pascal Bart <pascal.bart@epita.fr>
18727
18728 * src/output.c (output_parser): Delete unused variable actions_dumped.
18729
b0c4483e
PB
187302001-09-07 Pascal Bart <pascal.bart@epita.fr>
18731
18732 * src/output.c (output): Delete call to reader_output_yylsp.
18733 * src/reader.c (reader): Likewise.
ba0fe3c7 18734 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 18735
11d82f03
MA
187362001-09-02 Marc Autret <autret_m@epita.fr>
18737
18738 * src/reader.c: Include muscle_tab.h.
18739 (parse_union_decl): Update.
18740 (parse_macro_decl): Rename parse_muscle_decl.
18741 Update to use renamed functions and variable.
18742 (read_declarations, copy_action, read_additionnal_code, : Updated
18743 with correct variables and functions names.
18744 (packsymbols, reader): Likewise.
342b8b6e 18745
11d82f03 18746 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 18747
11d82f03
MA
18748 * src/output.c: Include muscle_tab.h
18749 In all functions using macro_insert, change by using muscle_insert ().
18750 (macro_obstack): Rename muscle_obstack.
18751 Echo modifications in the whole file.
18752 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
18753 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
18754 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
18755
18756 * src/muscle_tab.h: Update double inclusion macros.
18757 (macro_entry_s): Rename muscle_entry_s.
18758 Update prototypes.
342b8b6e 18759
11d82f03
MA
18760 * src/muscle_tab.c: Include muscle_tab.h.
18761 Rename macro_tabble to muscle_table.
18762 (mhash1, mhash2, mcmp): Use muscle_entry.
18763 (macro_init): Rename muscle_init. Update.
18764 (macro_insert): Rename muscle_insert. Update.
18765 (macro_find): Rename muscle_find. Update.
18766
18767 * src/main.c: Include muscle_tab.h.
18768 (main): Call muscle_init ().
18769 * src/Makefile.am (bison_SOURCES): Echo modifications.
18770
93a37297
MA
187712001-09-02 Marc Autret <autret_m@epita.fr>
18772
f753cd62 18773 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 18774
f753cd62
MA
18775 * src/muscle_tab.c, src/muscle_tab.h: Add files.
18776
187772001-09-02 Marc Autret <autret_m@epita.fr>
18778
18779 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 18780
682d48cd
PB
187812001-09-01 Pascal Bart <pascal.bart@epita.fr>
18782
342b8b6e 18783 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
18784 filename.
18785
087c8fda
MA
187862001-09-01 Marc Autret <autret_m@epita.fr>
18787
18788 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
18789 to an explicit value to activate the feature. We do it here.
18790
dda680cb
PB
187912001-08-31 Pascal Bart <pascal.bart@epita.fr>
18792
18793 * src/output.c (prepare): Delete the `filename' muscule insertion.
18794 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
18795 (parse_union_decl): Likewise.
18796 * src/macrotab.c (macro_init): Initialize filename by infile.
18797
9e644e64
MA
187982001-08-31 Marc Autret <autret_m@epita.fr>
18799
18800 * src/bison.simple (YYLSP_NEEDED): New definition.
18801 * src/output.c (prepare): Add macro insertion of `locations_flag'
18802
17da6427
PB
188032001-08-31 Pascal Bart <pascal.bart@epita.fr>
18804
18805 * src/output.c (prepare): Delete insertion of previous muscles,
18806 and insert the `prefix' muscles.
18807 * src/macrotab.c (macro_init): Likewise.
18808 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 18809 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
18810 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
18811 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 18812 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
18813 name_prefix.
18814
e8cb70b9
PB
188152001-08-31 Pascal Bart <pascal.bart@epita.fr>
18816
18817 * src/main.c (main): Standardize.
18818 * src/output.c (output_table_data, output_parser): Likewise.
18819 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
18820
63c2d5de
MA
188212001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
18822
342b8b6e 18823 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
18824 %%epilogue.
18825 * src/output.c (output): Rename %%declarations to %%prologue.
18826 * src/bison.simple: Echo modifications.
342b8b6e 18827
d8cb5183
MA
188282001-08-31 Marc Autret <autret_m@epita.fr>
18829
18830 * src/reader.c (readgram): CleanUp.
18831 (output_token_defines): Likewise.
18832 (packsymbols): Likewise.
18833 (reader): Likewise.
18834 * src/output.c (output): CPP-out useless code.
18835
6c686258
PB
188362001-08-31 Pascal Bart <pascal.bart@epita.fr>
18837
342b8b6e 18838 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
18839 output_trailers and output_headers.
18840 * src/output.h: Remove obsolete functions prototypes of output_headers
18841 and output_trailers.
18842
8f451ef7
PB
188432001-08-30 Pascal Bart <pascal.bart@epita.fr>
18844
18845 * src/main.c: Include macrotab.h.
342b8b6e 18846 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
18847 Adjust functions prototypes.
18848 * src/macrotab.c (macro_insert): Constify key and value.
18849 (macro_find): Constify key.
18850 (macro_insert): Include 'xalloc.h'
18851 (macro_insert): Use XMALLOC.
18852 (macro_find): Constify return value.
18853 * src/output.c (output_table_data): Rename table to table_data.
18854 (output_parser): Constify macro_key, macro_value.
18855
997b6fd0 188562001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
18857
18858 * src/reader.c (parse_skel_decl): New.
342b8b6e 18859 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
18860 * src/lex.h (token_t): New token `tok_skel'.
18861 * src/lex.c (percent_table): Add skeleton option entry.
18862 Standardize.
18863
ff48177d
MA
188642001-08-29 Marc Autret <autret_m@epita.fr>
18865
18866 * src/bison.simple: Add %%user_code directive at the end.
18867 * src/reader.c (read_additionnal_code): New.
18868 (reader): Use it.
18869 * src/output.c (output_program): Remove.
18870 (output): Update.
18871
b33160bf
MA
188722001-08-28 Marc Autret <autret_m@epita.fr>
18873
18874 * src/output.c (output_actions): Clean up.
4e5caae2 18875 (output_gram): CPP-out useless code.
b33160bf
MA
18876 * src/reader.c (reader): Clean up, CPP-out useless code.
18877
d1a2daf7
PB
188782001-08-28 Pascal Bart <pascal.bart@epita.fr>
18879
342b8b6e 18880 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 18881 directive.
d1a2daf7
PB
18882 * src/bison.simple: Add `%%definitions'.
18883
2b763dfe
MA
188842001-08-28 Marc Autret <autret_m@epita.fr>
18885
18886 * config/depcomp: New file.
18887
f1a87ef6
PE
188882001-08-27 Paul Eggert <eggert@twinsun.com>
18889
18890 * src/bison.simple (yyparse): Don't take the address of an
18891 item before the start of an array, as that doesn't conform to
18892 the C Standard.
18893
82e236e2
RA
188942001-08-27 Robert Anisko <robert.anisko@epita.fr>
18895
f1a87ef6 18896 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
18897 obstack. It was done too late here.
18898
18899 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
18900 completely wrong.
18901 (reader): Initialize the macro obstack here, since we need it to grow
18902 '%define' directives.
18903
18904 * src/reader.h: Declare the macro obstack as extern.
18905
b0cfa28a
RA
189062001-08-27 Robert Anisko <robert.anisko@epita.fr>
18907
18908 * src/output.c (output_parser): Fix. Store single '%' characters in
18909 the output obstack instead of throwing them away.
18910
6fc74234
AD
189112001-08-27 Akim Demaille <akim@epita.fr>
18912
18913 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18914
9c76d118
RA
189152001-08-25 Robert Anisko <robert.anisko@epita.fr>
18916
18917 * lib/Makefile.am: Adjust.
18918
a8289c62
RA
189192001-08-25 Robert Anisko <robert.anisko@epita.fr>
18920
18921 * src/bison.simple: Update and add '%%' directives.
18922
b6610515
RA
189232001-08-25 Robert Anisko <robert.anisko@epita.fr>
18924
18925 * src/reader.c (reader): Remove calls to 'output_headers' and
18926 'output_trailers'. Remove some C output.
18927 (readgram): Disable a piece of code that was writing a default
18928 definition for 'YYSTYPE'.
18929 (reader_output_yylsp): Remove.
18930 (packsymbols): Output token defintions to a macro.
18931 (copy_definition): Disable C output.
6fc74234 18932
b6610515
RA
18933 * src/reader.c (parse_macro_decl): New function used to parse macro
18934 declarations.
18935 (copy_string2): Put the body of copy_string into this new function.
18936 Add a parameter to let the caller choose whether he wants to copy the
18937 string delimiters or not.
18938 (copy_string): Be a simple call to copy_string2 with the last argument
18939 bound to true.
18940 (read_declarations): Add case for macro definition.
18941 (copy_identifier): New.
6fc74234 18942 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
18943 rather than lex.
18944
26f609ff
RA
189452001-08-25 Robert Anisko <robert.anisko@epita.fr>
18946
18947 * src/output.c (prepare): Add prefixed names.
18948 (output_parser): Output semantic actions.
18949 (output_parser): Fix bug on '%%line' directives.
6fc74234 18950
26f609ff
RA
18951 * src/output.c (output_headers): Remove. The C code printed by this
18952 function should now be in the skeletons.
18953 (output_trailers): Remove.
18954 (output): Disable call to 'reader_output_yylsp'.
18955 (output_rule_data): Do not output tables to the table obstack.
18956
18957 * src/output.c: Remove some C dedicated output.
18958 Improve the use of macro and output obstacks.
18959 (output_defines): Remove.
6fc74234 18960
26f609ff
RA
18961 * src/output.c (output_token_translations): Associate 'translate'
18962 table with a macro. No output to the table obstack.
18963 (output_gram): Same for 'rhs' and 'prhs'.
18964 (output_stos): Same for 'stos'.
18965 (output_rule_data): Same for 'r1' and 'r2'.
18966 (token_actions): Same for 'defact'.
18967 (goto_actions): Same for 'defgoto'.
18968 (output_base): Same for 'pact' and 'pgoto'.
18969 (output_table): Same for 'table'.
18970 (output_check): Same for 'check'.
6fc74234 18971
26f609ff
RA
18972 * src/output.c (output_table_data): New function.
18973 (output_short_table): Remove.
18974 (output_short_or_char_table): Remove.
6fc74234 18975
26f609ff
RA
18976 * src/output.c (output_parser): Replace most of the skeleton copy code
18977 with something new. Skeletons are now processed character by character
18978 rather than line by line, and Bison looks for '%%' macros. This is the
18979 first step in making Bison's output process (a lot) more flexible.
18980 (output_parser): Use the macro table.
18981
6f43b113
RA
189822001-08-25 Robert Anisko <robert.anisko@epita.fr>
18983
18984 * src/main.c (main): Initialize the macro table.
18985
dd3127cf
RA
189862001-08-25 Robert Anisko <robert.anisko@epita.fr>
18987
18988 * src/lex.c (percent_table): Add tok_define.
18989 * src/lex.h: Add tok_define.
18990
aa321494
RA
189912001-08-25 Robert Anisko <robert.anisko@epita.fr>
18992
18993 * src/macrotab.c: New file.
18994 * src/macrotab.h: New file.
18995 * src/Makefile.am: Update.
18996
68bd3b6b
RA
189972001-08-25 Robert Anisko <robert.anisko@epita.fr>
18998
18999 * lib/hash.c: New file.
19000 * lib/hash.h: New file.
19001 * lib/Makefile.am: Update.
19002
45f8dd1e
AD
190032001-08-15 Akim Demaille <akim@epita.fr>
19004
19005 Version 1.28c.
19006
40a64a7a 190072001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
19008
19009 * src/reader.c (readgram): Indent output macro YYSTYPE.
19010 (packsymbols): Likewise.
19011 (output_token_defines): Likewise.
19012 * src/files.c: Standardize.
19013 (compute_header_macro): New.
19014 (defines_obstack_save): New. Use compute_header_macro.
19015 (output_files): Update. Use defines_obstack_save.
19016
f9a8293a
AD
190172001-08-15 Akim Demaille <akim@epita.fr>
19018
19019 * doc/bison.texinfo (Table of Symbols): Document
19020 YYSTACK_USE_ALLOCA.
19021
150ca7a7
AD
190222001-08-15 Akim Demaille <akim@epita.fr>
19023
19024 * missing: Update from CVS Automake.
19025 * config/config.guess, config/config.sub, config/texinfo.tex:
19026 Update from gnu.org.
19027
69b5cec4
AD
190282001-08-15 Akim Demaille <akim@epita.fr>
19029
19030 * Makefile.maint: Sync with CVS Autoconf.
19031
f2b5126e
PB
190322001-08-14 Pascal Bart <pascal.bart@epita.fr>
19033
69b5cec4 19034 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
19035 `fdl.texi'.
19036 * doc/fdl.texi: Add to package.
19037
4ecbf796
MA
190382001-08-14 Marc Autret <autret_m@epita.fr>
19039
19040 Turn on %{source,header}_extension features.
19041
69b5cec4 19042 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
19043 source_extension.
19044 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 19045 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
19046 between options.
19047
95fb5662
MA
190482001-08-14 Marc Autret <autret_m@epita.fr>
19049
19050 * src/files.c (compute_base_names): Add extensions computing when
19051 `--file-prefix' used.
19052 Standardize function calls.
19053
78d09da9
MA
190542001-08-13 Marc Autret <autret_m@epita.fr>
19055
69b5cec4 19056 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
19057 defining it (defined but null disables alloca).
19058
5a009f2c
MA
190592001-08-13 Marc Autret <autret_m@epita.fr>
19060
19061 * src/bison.simple (_yy_memcpy): CPP reformat.
19062
1e41465a
PB
190632001-08-13 Pascal Bart <pascal.bart@epita.fr>
19064
19065 * tests/atconfig.in (CPPFLAGS): Fix.
19066
c67a198d
PB
190672001-08-10 Pascal Bart <pascal.bart@epita.fr>
19068
79282c6c 19069 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
19070 `gpl.texi'.
19071 * doc/gpl.texi: Add to package.
19072
09a6de7e
MA
190732001-08-10 Marc Autret <autret_m@epita.fr>
19074
19075 * src/print_graph.h: Fix.
19076 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
19077
b77b9ee0
AD
190782001-08-10 Akim Demaille <akim@epita.fr>
19079
19080 * src/system.h: Provide default declarations for stpcpy, strndup,
19081 and strnlen.
19082
3e259915
MA
190832001-08-10 Robert Anisko <anisko_r@epita.fr>
19084
19085 * doc/bison.texinfo (Locations): Update @$ stuff.
19086
ca96bc2d
MA
190872001-08-09 Robert Anisko <anisko_r@epita.fr>
19088
19089 * src/bison.simple (YYLLOC_DEFAULT): Update.
19090 (yyparse): Adjust.
19091
fdc6758b
MA
190922001-08-08 Marc Autret <autret_m@epita.fr>
19093
b77b9ee0 19094 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
19095 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
19096 Reported by Fabrice Bauzac.
957d4dbf 19097
600cad3b
MA
190982001-08-08 Marc Autret <autret_m@epita.fr>
19099
19100 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
19101 * src/vcg.c (output_node): Fix.
19102 * src/vcg.h: Cleanup.
19103 * src/print_graph.c: Add comments.
b77b9ee0 19104 (node_output_size): New global variable. Simplify the formatting of
600cad3b 19105 the VCG graph output.
b77b9ee0 19106 (print_actions): Unused code is now used. It notifies the final state
600cad3b 19107 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 19108 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
19109 blue.
19110 Get the current node name and node_obstack by argument.
19111 (node_obstack): New variable.
19112 (print_state): Manage node_obstack.
19113 (print_core): Use node_obstack given by argument.
19114 A node is not only computed here but in print_actions also.
19115 (print_graph): CPP out useless code instead of commenting it.
19116
976e528f
AD
191172001-08-07 Pascal Bart <pascal.bart@epita.fr>
19118
19119 * tests/atconfig.in (CPPFLAGS): Fix.
19120
20e8e5ca
AD
191212001-08-07 Akim Demaille <akim@epita.fr>
19122
19123 * src/print_graph.c (quote): New.
19124 (print_core): Use it.
19125
957d4dbf 191262001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 19127
3e3da797
AD
19128 * src/vcg.c (complain.h): Include it.
19129 Unepitaize `return' invocations.
c4b66126 19130 [NDEBUG] (main): Remove.
79282c6c 19131 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
19132 * src/files.c (open_files): Initialize graph_obstack.
19133 * src/print_graph.c (print_actions): CPP out useless code.
19134 (print_core): Don't output the last `\n' in labels.
19135 Use `quote'.
19136 * src/files.c (output_files): Output the VCG file.
19137 * src/main.c (main): Invoke print_graph ();
3e3da797 19138
957d4dbf 191392001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
19140
19141 Automaton VCG graph output.
19142 Using option ``-g'' or long option ``--graph'', you can generate
19143 a gram_filename.vcg file containing a VCG description of the LALR (1)
19144 automaton of your grammar.
19145
19146 * src/main.c: Call to print_graph() function.
19147 * src/getargs.h: Update.
19148 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
19149 (graph_flag): New flag.
19150 (longopts): Update.
19151 (getargs): Add case `g'.
19152 * src/files.c (graph_obstack): New obstack struct.
19153 (open_files): Initialize new obstack.
19154 (output_files): Saves graph_obstack if required.
19155 * src/files.h (graph_obstack): New extern declaration.
19156 * src/Makefile.am: Add new source files.
19157
927c1557 191582001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
19159
19160 * src/print_graph.c, src/print_graph.h (graph): New.
19161 * src/vcg.h: New file.
19162 * src/vcg.c: New file, VCG graph handling.
19163
7333d403
AD
191642001-08-06 Marc Autret <autret_m@epita.fr>
19165
19166 Add of %source_extension and %header_extension which specify
19167 the source or/and the header output file extension.
19168
19169 * src/files.c (compute_base_names): Remove initialisation of
19170 src_extension and header_extension.
19171 (compute_exts_from_gf): Update.
19172 (compute_exts_from_src): Update.
19173 (output_files): Update.
19174 * src/reader.c (parse_header_extension_decl): New.
19175 (parse_source_extension_decl): New.
19176 (read_declarations): New case statements for the new tokens.
19177 * src/lex.c (percent_table): Add entries for %source_extension
19178 and %header_extension.
19179 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
19180
84163231
AD
191812001-08-06 Marc Autret <autret_m@epita.fr>
19182
19183 * configure.in: Bump to 1.28c.
19184 * doc/bison.texinfo: Texinfo thingies.
19185
8303fc42
AD
191862001-08-04 Pascal Bart <pascal.bart@epita.fr>
19187
19188 * tests/atconfig.in (CPPFLAGS): Add.
19189 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
19190
70a84437
AD
191912001-08-03 Akim Demaille <akim@epita.fr>
19192
19193 Version 1.28b.
19194
2ce10144
AD
191952001-08-03 Akim Demaille <akim@epita.fr>
19196
19197 * tests/Makefile.am (check-local): Ship testsuite.
19198 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
19199 Include `string.h'.
19200
1e3e4bc1
AD
192012001-08-03 Akim Demaille <akim@epita.fr>
19202
19203 * configure.in: Try using -Wformat when compiling.
19204
42b45b7f
AD
192052001-08-03 Akim Demaille <akim@epita.fr>
19206
19207 * configure.in: Bump to 1.28b.
19208
8f13fe33
AD
192092001-08-03 Akim Demaille <akim@epita.fr>
19210
19211 * src/complain.c: Adjust strerror_r portability issues.
19212
b37ba92c
AD
192132001-08-03 Akim Demaille <akim@epita.fr>
19214
19215 Version 1.28a.
19216
b0ce6046
AD
192172001-08-03 Akim Demaille <akim@epita.fr>
19218
19219 * src/getargs.c, src/getarg.h (skeleton)): Constify.
19220 * src/lex.c (literalchar): Avoid name clashes on `buf'.
19221 * src/getargs.c: Include complain.h.
19222 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
19223 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
19224
d01c415b
AD
192252001-08-03 Akim Demaille <akim@epita.fr>
19226
19227 * src/reader.c (readgram): Display hidden chars in error messages.
19228
459dd1a6
AD
192292001-08-03 Akim Demaille <akim@epita.fr>
19230
19231 Update to gettext 0.10.39.
19232
53b74c0c
AD
192332001-08-03 Akim Demaille <akim@epita.fr>
19234
19235 * lib/strspn.c: New.
19236
234a3be3
AD
192372001-08-01 Marc Autret <autret_m@epita.fr>
19238
19239 * doc/bison.texinfo: Update.
19240 * doc/bison.1 (mandoc): Update.
19241 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
19242 * src/files.c: Support output files extensions computing.
19243 (src_extension): New static variable.
19244 (header_extension): New static variable.
19245 (tr): New function.
19246 (get_extension_index): New function, gets the index of an extension
19247 filename in a string.
19248 (compute_exts_from_gf): New function, computes extensions from the
19249 grammar file extension.
19250 (compute_exts_from_src): New functions, computes extensions from the
19251 C source file extension, file given by ``-o'' option.
19252 (compute_base_names): Update.
19253 (output_files): Update.
19254
847bf1f5
AD
192552001-08-01 Robert Anisko <anisko_r@epita.fr>
19256
d995fee7 19257 * doc/bison.texi: Document @$.
847bf1f5
AD
19258 (Locations): New section.
19259
d074a105
AD
192602001-07-18 Akim Demaille <akim@epita.fr>
19261
19262 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
19263 * config/prev-version.txt, config/move-if-change: New.
19264 * Makefile.am: Adjust.
19265
3419715d
AD
192662001-07-08 Pascal Bart <pascal.bart@epita.fr>
19267
19268 * src/bison.simple (yyparse): Suppress warning `comparaison
19269 between signed and unsigned'.
19270
62ab6972
AD
192712001-07-05 Pascal Bart <pascal.bart@epita.fr>
19272
19273 * src/getargs.h (raw_flag): Remove.
19274 * src/getargs.c: Die on `-r'/`--raw'.
19275 * src/lex.c (parse_percent_token): Die on `%raw'.
19276 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
19277 * tests/calc.at: Suppress test with option `--raw'.
19278
1e24cc5b
AD
192792001-07-14 Akim Demaille <akim@epita.fr>
19280
19281 * config/: New.
19282 * configure.in: Require Autoconf 2.50.
19283 Update to gettext 0.10.38.
19284
32dfccf8
AD
192852001-03-16 Akim Demaille <akim@epita.fr>
19286
19287 * doc/bison.texinfo: ANSIfy the examples.
19288
cd5bd6ac
AD
192892001-03-16 Akim Demaille <akim@epita.fr>
19290
19291 * getargs.c (skeleton): New variable.
19292 (longopts): --skeleton is a new option.
19293 (shortopts, getargs): -S is a new option.
19294 * getargs.h: Declare skeleton.
19295 * output.c (output_parser): Use it.
19296
5141b016
AD
192972001-03-16 Akim Demaille <akim@epita.fr>
19298
19299 * m4/strerror_r.m4: New.
19300 * m4/error.m4: Run AC_FUNC_STRERROR_R.
19301 * lib/error.h, lib/error.c: Update.
19302
447992b9
AD
193032001-03-16 Akim Demaille <akim@epita.fr>
19304
19305 * src/getargs.c (longopts): Clean up.
19306
274d42ce
AD
193072001-02-21 Akim Demaille <akim@epita.fr>
19308
19309 * src/reader.c (gensym): `gensym_count' is your own.
19310 Use a static buf to create the symbol name, as token_buffer is no
19311 longer a buffer.
19312
22c821f3
AD
193132001-02-08 Akim Demaille <akim@epita.fr>
19314
19315 * src/conflicts.c (conflict_report): Be sure not to append to res
19316 between two calls, which could happen if both first sprintf were
19317 skipped, but not the first cp += strlen.
19318
18569462
AD
193192001-02-08 Akim Demaille <akim@epita.fr>
19320
19321 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
19322 New, from fileutils 4.0.37.
19323 * configure.in: Require Autoconf 2.49c. I took some time before
19324 making this decision. This is the only way out for portability
19325 issues in Bison, it would mean way too much duplicate effort to
19326 import in Bison features implemented in 2.49c since 2.13.
19327 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
19328
0d8f3c8a
AD
193292001-02-02 Akim Demaille <akim@epita.fr>
19330
19331 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 19332 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 19333
f17bcd1f
AD
193342001-01-19 Akim Demaille <akim@epita.fr>
19335
19336 Get rid of the ad hoc handling of token_buffer in the scanner: use
19337 the obstacks.
19338
19339 * src/lex.c (token_obstack): New.
19340 (init_lex): Initialize it. No longer call...
19341 (grow_token_buffer): this. Remove it.
19342 Adjust all the places which used it to use the obstack.
19343
511e79b3
AD
193442001-01-19 Akim Demaille <akim@epita.fr>
19345
19346 * src/lex.h: Rename all the tokens:
19347 s/\bENDFILE\b/tok_eof/g;
19348 s/\bIDENTIFIER\b/tok_identifier/g;
19349 etc.
19350 Let them be enums, not #define, to ease debugging.
19351 Adjust all the code.
19352
0d6508ef
AD
193532001-01-18 Akim Demaille <akim@epita.fr>
19354
19355 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
19356 * src/lex.c (maxtoken, grow_token_buffer): Static.
19357
6deb4447
AD
193582001-01-18 Akim Demaille <akim@epita.fr>
19359
19360 Since we now use obstacks, more % directives can be enabled.
19361
19362 * src/lex.c (percent_table): Also accept `%yacc',
19363 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
19364 `%debug'.
19365 Handle the actions for `%semantic_parser' and `%pure_parser' here,
19366 instead of returning a token.
19367 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
19368 * src/reader.c (read_declarations): Adjust.
19369 * src/files.c (open_files): Don't call `compute_base_names', don't
19370 compute `attrsfile' since they depend upon data which might be
19371 *in* the input file now.
19372 (output_files): Do it here.
19373 * src/output.c (output_headers): Document the fact that this patch
19374 introduces a guaranteed SEGV for semantic parsers.
19375 * doc/bison.texinfo: Document them.
19376 * tests/suite.at: Exercise these %options.
19377
ff4423cc
AD
193782000-12-20 Akim Demaille <akim@epita.fr>
19379
19380 Also handle the output file (--verbose) with obstacks.
19381
19382 * files.c (foutput): Remove.
19383 (output_obstack): New.
19384 Adjust all dependencies.
19385 * src/conflicts.c: Return a string.
19386 * src/system.h (obstack_grow_string): Rename as...
19387 (obstack_sgrow): this. Be ready to work with non literals.
19388 (obstack_fgrow4): New.
19389
956dba3a
AD
193902000-12-20 Akim Demaille <akim@epita.fr>
19391
19392 * src/files.c (open_files): Fix the computation of short_base_name
19393 in the case of `-o foo.tab.c'.
19394
337bab46
AD
193952000-12-20 Akim Demaille <akim@epita.fr>
19396
19397 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
19398 (copy_dollar): Now that everything uses obstacks, get rid of the
19399 FILE * parameters.
19400
5d3214b8
AD
194012000-12-20 Akim Demaille <akim@epita.fr>
19402
19403 * src/files.c (open_files): Actually the `.output' file is based
19404 on the short_base_name, not base_name.
19405 * tests/suite.at (Checking output file names): Adjust.
19406
29092a57
AD
194072000-12-20 Akim Demaille <akim@epita.fr>
19408
19409 * src/bison.s1: Remove, we now use directly...
19410 * src/bison.simple: this.
19411 * src/Makefile.am: Use pkgdata instead of data.
19412
ea5607fd
AD
194132000-12-20 Akim Demaille <akim@epita.fr>
19414
19415 * src/files.c (guard_obstack): New.
19416 (open_files): Initialize it.
19417 (output_files): Dump it...
19418 * src/files.h: Export it.
19419 * src/reader.c (copy_guard): Use it.
19420
27110317
AD
194212000-12-19 Akim Demaille <akim@epita.fr>
19422
19423 * src/files.c (outfile, defsfile, actfile): Removed as global
19424 vars.
19425 (open_files): Don't compute them.
19426 (output_files): Adjust.
19427 (base_name, short_base_name): Be global.
19428 Adjust dependencies.
19429
19c50364
AD
194302000-12-19 Akim Demaille <akim@epita.fr>
19431
19432 * src/files.c (strsuffix): New.
19433 (stringappend): Be just like strcat but allocate.
19434 (base_names): Eve out from open_files.
19435 Try to simplify the rather hairy computation of base_name and
19436 short_base_name.
19437 (open_files): Use it.
19438 * tests/suite.at (Checking output file names): New test.
19439
573c1d9f
AD
194402000-12-19 Akim Demaille <akim@epita.fr>
19441
19442 * src/system.h (obstack_grow_literal_string): Rename as...
19443 (obstack_grow_string): this.
19444 * src/output.c (output_parser): Recognize `%% actions' instead of
19445 `$'.
19446 * src/bison.s1: s/$/%% actions/.
19447 * src/bison.hairy: Likewise.
19448
ef7ddedd
AD
194492000-12-19 Akim Demaille <akim@epita.fr>
19450
19451 * src/output.c (output_parser): Compute the `#line' lines when
19452 there are.
19453 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
19454 Suggested by Hans Aberg.
19455
ff61dabd
AD
194562000-12-19 Akim Demaille <akim@epita.fr>
19457
19458 Let the handling of the skeleton files be local to the procedures
19459 that use it.
19460
19461 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
19462 longer static.
19463 (fparser, open_extra_files): Remove.
19464 (open_files, output_files): Don't take care of fparser.
19465 * src/files.h: Adjust.
19466 * src/output.c (output_parser): Open and close the file to the
19467 skeleton.
19468 * src/reader.c (read_declarations): When %semantic_parser, open
19469 fguard.
19470
55b96341
AD
194712000-12-19 Akim Demaille <akim@epita.fr>
19472
19473 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
19474 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
19475
358c15b7
AD
194762000-12-19 Akim Demaille <akim@epita.fr>
19477
19478 * src/files.c (open_files): Yipee! We no longer need all the code
19479 looking for `/tmp' since we have no tmp file.
19480
7de3329e
AD
194812000-12-19 Akim Demaille <akim@epita.fr>
19482
19483 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
19484 New macros.
19485 * src/files.c (open_files): Less dependency on MSDOS etc.
19486
3abcd459
AD
194872000-12-14 Akim Demaille <akim@epita.fr>
19488
19489 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
19490 Provide a default definition.
19491 Use it when executing the default @ action.
19492 * src/reader.c (reader_output_yylsp): No longer include
19493 `timestamp' and `text' in the default YYLTYPE.
19494
2a91a95e
AD
194952000-12-12 Akim Demaille <akim@epita.fr>
19496
19497 * src/reader.c (copy_definition, parse_union_decl, copy_action)
19498 (copy_guard): Quote the file names.
19499 Reported by Laurent Mascherpa.
19500
14d3eb9b
AD
195012000-12-12 Akim Demaille <akim@epita.fr>
19502
19503 * src/output.c (output_headers, output_program, output): Be sure
19504 to escape special characters when outputting filenames.
19505 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
19506 (output_headers): Don't depend on them, Use ACTSTR.
19507
d7045ec6
AD
195082000-11-17 Akim Demaille <akim@epita.fr>
19509
19510 * lib/obstack.h: Formatting changes.
19511 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
19512 prevents type checking.
19513 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
19514 cast the value to (void *): assigning a `foo *' to a `void *'
19515 variable is valid.
19516 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
19517 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
19518 append characters.
19519
6fd54b73
AD
195202000-11-17 Akim Demaille <akim@epita.fr>
19521
19522 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
19523 as...
19524 (suite.m4, regression.m4, calc.m4): these.
19525 * tests/atgeneral.m4: Update from CVS Autoconf.
19526
4c50eae6
AD
195272000-11-17 Akim Demaille <akim@epita.fr>
19528
19529 * tests/regression.m4 (%union and --defines): New test,
19530 demonstrating a current bug in the obstack implementation.
19531
a35f64ea
AD
195322000-11-17 Akim Demaille <akim@epita.fr>
19533
19534 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
19535 macros.
19536 Use them to declare the variables which are global or local to
19537 `yyparse'.
19538
7de23534
AD
195392000-11-17 Akim Demaille <akim@epita.fr>
19540
19541 * acconfig.h: Remove, no longer used.
19542
aa7815f5
AD
195432000-11-07 Akim Demaille <akim@epita.fr>
19544
19545 * src: s/Copyright (C)/Copyright/g.
19546
5af1f549
AD
195472000-11-07 Akim Demaille <akim@epita.fr>
19548
19549 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
19550 defining.
19551 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
19552
553e2b22
AD
195532000-11-07 Akim Demaille <akim@epita.fr>
19554
19555 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
19556 Merge in a single CPP if/else.
19557
8a4f41d6
AD
195582000-11-07 Akim Demaille <akim@epita.fr>
19559
19560 * src/output.c (output): Remove useless variables.
19561 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
19562 argument `data' for consistency with the prototypes.
19563 Qualify it `const'.
19564 (obstack_copy, obstack_copy0): Rename the second argument as
19565 `address' for consistency. Qualify it `const'.
19566 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
19567 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
19568 `const' their input argument (`data' or `address').
19569 Adjust the corresponding macros to include `const' in casts.
19570
095a3fb5
AD
195712000-11-03 Akim Demaille <akim@epita.fr>
19572
19573 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
19574 s/PFILE1/BISON_HAIRY/.
19575 Adjust dependencies.
19576
d1cdce7c
AD
195772000-11-03 Akim Demaille <akim@epita.fr>
19578
090c5ebf 19579 For some reason, this was not applied.
d1cdce7c
AD
19580
19581 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
19582 `unlink': it's no longer used.
19583
9311529b
AD
195842000-11-03 Akim Demaille <akim@epita.fr>
19585
19586 * src/files.c (skeleton_find): New function, eved out of...
19587 (open_files, open_extra_files): here.
19588
d8880f69
AD
195892000-11-03 Akim Demaille <akim@epita.fr>
19590
19591 Don't use `atexit'.
19592
19593 * src/files.c (obstack_save): New function.
19594 (done): Rename as...
19595 (output_files): this.
19596 Use `obstack_save'.
19597 * src/main.c (main): Don't use `atexit' to register `done', since
19598 it no longer has to remove tmp files, just call `output_files'
19599 when there are no errors.
19600
0dbb648e
AD
196012000-11-02 Akim Demaille <akim@epita.fr>
19602
19603 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
19604 `unlink': it's no longer used.
19605 * src/files.h: Formatting changes.
19606
896fe5c1
AD
196072000-11-02 Akim Demaille <akim@epita.fr>
19608
19609 Remove the last uses of mktemp and unlink/delete.
19610
19611 * src/files.c (fdefines, ftable): Removed.
19612 (defines_ostack, table_obstack): New.
19613 Adjust dependencies of the former into uses of the latter.
19614 * src/output.c (output_short_or_char_table, output_short_table):
19615 Convert to using obstacks.
19616 * src/reader.c (copy_comment2): Accept one FILE * and two
19617 obstacks.
19618 (output_token_defines, reader_output_yylsp): Use obstacks.
19619 * src/system.h (obstack_fgrow3): New.
1f65350a 19620 * po/POTFILES.in: Adjust.
896fe5c1 19621
dd60faec
AD
196222000-11-01 Akim Demaille <akim@epita.fr>
19623
19624 Change each use of `fattrs' into a use of `attrs_obstack'.
19625
19626 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
19627 * src/files.c (fattrs): Remove.
19628 (attrs_obstack): New.
19629 Adjust all dependencies.
19630 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
19631
8c7ebe49
AD
196322000-11-01 Akim Demaille <akim@epita.fr>
19633
19634 Introduce obstacks.
19635 Change each use of `faction' into a use of `action_obstack'.
19636
19637 * lib/obstack.h, lib/obstack.c: New files.
19638 * src/files.c (faction): Remove.
19639 (action_obstack): New.
19640 Adjust all dependencies.
19641
77aee789
AD
196422000-10-20 Akim Demaille <akim@epita.fr>
19643
19644 * lib/quote.h (PARAMS): New macro. Use it.
19645
43591cec
AD
196462000-10-16 Akim Demaille <akim@epita.fr>
19647
19648 * src/output.c (output_short_or_char_table): New function.
19649 (output_short_table, output_token_translations): Use it.
19650 (goto_actions): Use output_short_table.
19651
1e9798d5
AD
196522000-10-16 Akim Demaille <akim@epita.fr>
19653
19654 * src/symtab.c (bucket_new): New function.
19655 (getsym): Use it.
19656
19657 * src/output.c (output_short_table): New argument to display the
19658 comment associated with the table.
19659 Adjust dependencies.
19660 (output_gram): Use it.
19661 (output_rule_data): Nicer output layout for YYTNAME.
19662
f282676b
AD
196632000-10-16 Akim Demaille <akim@epita.fr>
19664
19665 * src/lex.c (read_typename): New function.
19666 (lex): Use it.
19667 * src/reader.c (copy_dollar): Likewise.
19668
550a72a3
AD
196692000-10-16 Akim Demaille <akim@epita.fr>
19670
19671 * src/reader.c (copy_comment2): Expect the input stream to be on
19672 the `/' which is suspected to open a comment, instead of being
19673 called after `//' or `/*' was read.
19674 (copy_comment, copy_definition, parse_union_decl, copy_action)
19675 (copy_guard): Adjust.
19676
131e2fef
AD
196772000-10-16 Akim Demaille <akim@epita.fr>
19678
19679 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
19680 `read_signed_integer'.
19681
79282c5a
AD
196822000-10-16 Akim Demaille <akim@epita.fr>
19683
19684 * src/reader.c (copy_dollar): New function.
19685 (copy_guard, copy_action): Use it.
19686
ff4a34be
AD
196872000-10-16 Akim Demaille <akim@epita.fr>
19688
19689 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
19690 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
19691 New files, from Fileutils 4.0.27.
19692 * src/main.c (printable_version): Remove.
19693 * src/lex.c, src/reader.c: Use `quote'.
19694
196952000-10-04 Akim Demaille <akim@epita.fr>
19696
19697 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
19698
14ded682
AD
196992000-10-04 Akim Demaille <akim@epita.fr>
19700
19701 * doc/bison.texinfo: Various typos spotted by Neil Booth.
19702
8e03724b
AD
197032000-10-04 Akim Demaille <akim@epita.fr>
19704
19705 When a literal string is used to define two different tokens,
19706 `bison -v' segfaults.
19707 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
19708
19709 * tests/regression.m4: New file.
19710 Include the core of the sample provided by Piotr Gackiewicz.
19711 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
19712 properly.
19713
a9e64249
AD
197142000-10-04 Akim Demaille <akim@epita.fr>
19715
19716 * src/reader.c (parse_expect_decl): Keep `count' within the size
19717 of `buffer'.
19718 From Neil Booth.
19719
da9abf43
AD
197202000-10-02 Paul Eggert <eggert@twinsun.com>
19721
19722 * bison.s1 (yyparse): Assign the default value
19723 unconditionally, to avoid a GCC warning and make the parser a
19724 tad smaller.
19725
c33638bb
AD
197262000-10-02 Akim Demaille <akim@epita.fr>
19727
19728 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
19729 options.
19730
444c570a
AD
197312000-10-02 Akim Demaille <akim@epita.fr>
19732
19733 * src/derives.c, src/print.c, src/reduce.c: To ease the
19734 translation, move some `\n' out of the translated strings.
19735
89cab50d
AD
197362000-10-02 Akim Demaille <akim@epita.fr>
19737
19738 The location tracking mechanism is precious for parse error
19739 messages. Nevertheless, it is enabled only when `@n' is used in
19740 the grammar, which is a different issue (you can use it in error
19741 message, but not in the grammar per se). Therefore, there should
19742 be another means to enable it.
19743
19744 * src/getargs.c (getargs): Support `--locations'.
19745 (usage): Report it.
19746 * src/getargs.h (locationsflag): Export it.
19747 * src/lex.c (percent_table): Support `%locations'.
19748 * src/reader.c (yylsp_needed): Remove this variable, now replaced
19749 with `locationsflag'.
19750 * doc/bison.texinfo: Document `--locations' and `%locations'.
19751 Sort the options.
19752 * tests/calc.m4: Test it.
19753
19754 For regularity of the names, replace each
19755 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
19756 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
19757 In addition replace each `flag' with `_flag'.
19758
d6c2cba0
AD
197592000-10-02 Akim Demaille <akim@epita.fr>
19760
19761 Also test parse error messages, including with YYERROR_VERBOSE.
19762
19763 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
19764 associative).
19765 Use it to check the computations.
19766 Use it to check `nonassoc' is honored.
19767 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
19768 `--yyerror-verbose'.
19769 (_AT_CHECK_CALC): Adjust to this option.
19770 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
19771
5a35a6cb
AD
197722000-10-02 Akim Demaille <akim@epita.fr>
19773
19774 Test also `--verbose', `--defines' and `--name-prefix'. Testing
19775 the latter demonstrates a flaw in the handling of non debugging
19776 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
19777 was used in order to simplify:
19778
19779 #if YYDEBUG
19780 if (yydebug)
19781 {
19782 ...
19783 }
19784 #endif
19785
19786 into
19787
19788 if (yydebug)
19789 {
19790 ...
19791 }
19792
19793 unfortunately this leads to a CPP conflict when
19794 `--name-prefix=foo' is used since it produces `#define yydebug
19795 foodebug'.
19796
19797 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
19798 (YYDPRINTF): New macro.
19799 Spread its use.
19800 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
19801 the bison options.
19802 Also test `--verbose', `--defines' and `--name-prefix'.
19803
71da9eea
AD
198042000-10-02 Akim Demaille <akim@epita.fr>
19805
19806 Improve the readability of the produced parsers.
19807
19808 * src/bison.s1: Formatting changes.
19809 Improve the comment related to the `$' mark.
19810 (yydefault): Don't fall through to `yyresume': `goto' there.
19811 * src/output.c (output_parser): When the `$' is met, skip the end
19812 of its line.
19813 New variable, `number_of_dollar_signs', to check there's exactly
19814 one `$' in the parser skeleton.
19815
95e36146
AD
198162000-10-02 Akim Demaille <akim@epita.fr>
19817
19818 * lib/xstrdup.c: New file, from the fileutils.
19819 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
19820 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
19821 instead of strlen + xmalloc + strcpy.
19822 * src/symtab.c (copys): Remove, use xstrdup instead.
19823
d7020c20
AD
198242000-10-02 Akim Demaille <akim@epita.fr>
19825
19826 * src/gram.h (associativity): New enum type which replaces the
19827 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
19828 `right_assoc', `left_assoc' and `non_assoc'.
19829 Adjust all dependencies.
19830 * src/reader.c: Formatting changes.
19831 (LTYPESTR): Don't define it, use it as a literal in
19832 `reader_output_yylsp'.
19833 * src/symtab.h (symbol_class): New enum type which replaces the
19834 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
19835 `sunknown', `stoken and `snterm'.
19836
1916f98e
AD
198372000-10-02 Akim Demaille <akim@epita.fr>
19838
19839 * src/getargs.c (fixed_outfiles): Rename as...
19840 (yaccflag): for consistency and accuracy.
19841 Adjust dependencies.
19842
d7913476
AD
198432000-10-02 Akim Demaille <akim@epita.fr>
19844
19845 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
19846 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
19847 difficult and introduced a lot of core dump. It turns out that
19848 Bison used an implementation of `xmalloc' based on `calloc', and
19849 at various places it does depend upon the initialization to 0. I
19850 have not tried to isolate the pertinent places, and all the former
19851 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
19852 someone should address this issue.
19853
19854 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
19855 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
19856 files.
19857 Adjust dependencies.
19858 * src/warshall.h: New file.
19859 Propagate.
19860
340ef489
AD
198612000-10-02 Akim Demaille <akim@epita.fr>
19862
19863 Various anti-`extern in *.c' changes.
19864
19865 * src/system.h: Include `assert.h'.
19866
b2ca4022
AD
198672000-10-02 Akim Demaille <akim@epita.fr>
19868
19869 * src/state.h (nstates, final_state, first_state, first_shift)
19870 (first_reduction): Move their exportation from here...
19871 * src/LR0.h: to here.
19872 Adjust dependencies.
19873 * src/getargs.c (statisticsflag): New variable.
19874 Add support for `--statistics'.
19875 Adjust dependencies.
19876
19877 Remove a lot of now useless `extern' statements in most files.
19878
403b315b
AD
198792000-10-02 Akim Demaille <akim@epita.fr>
19880
19881 * src/LR0.h: New file.
19882 Propagate its use.
19883
07a58c13
AD
198842000-10-02 Akim Demaille <akim@epita.fr>
19885
19886 * src/print.h: New file.
19887 Propagate its use.
19888 * src/print.c: Formatting and ordering changes.
19889 (verbose, terse): Replace with...
19890 (print_results): this new function.
19891 Adjust dependencies.
19892
0619caf0
AD
198932000-10-02 Akim Demaille <akim@epita.fr>
19894
19895 * src/conflicts.c (conflict_report): New function.
19896 (conflict_log, verbose_conflict_log): Replace with...
19897 (print_conflicts): this function.
19898 Adjust dependencies.
19899 * src/conflicts.h: New file.
19900 Propagate its inclusion.
19901
3519ec76
AD
199022000-10-02 Akim Demaille <akim@epita.fr>
19903
19904 * src/nullable.h: New file.
19905 Propagate its inclusion.
19906 * src/nullable.c: Formatting changes.
19907
015acc48
AD
199082000-10-02 Akim Demaille <akim@epita.fr>
19909
19910 * src/reduce.h: New file.
19911 Propagate its inclusion.
19912 * src/reduce.c: Topological sort and other formatting changes.
19913 (bool, TRUE, FALSE): Move their definition to...
19914 * src/system.h: here.
19915
8963a27b
AD
199162000-10-02 Akim Demaille <akim@epita.fr>
19917
19918 * src/files.c: Formatting changes.
19919 (tryopen, tryclose, openfiles): Rename as...
19920 (xfopen, xfclose, open_files): this.
19921 (stringappend): static.
19922 * src/files.h: Complete the list of exported symbols.
19923 Propagate its use.
19924
a70083a3
AD
199252000-10-02 Akim Demaille <akim@epita.fr>
19926
19927 * src/reader.h: New file.
19928 Propagate its use instead of tedious list of `extern' and
19929 prototypes.
19930 * src/reader.c: Formatting changes, topological sort,
19931 s/register//.
19932
abadc117
AD
199332000-10-02 Akim Demaille <akim@epita.fr>
19934
19935 * src/lex.h: Prototype `lex.c' exported functions.
19936 * src/reader.c: Adjust.
19937 * src/lex.c: Formatting changes.
19938 (safegetc): Rename as...
19939 (xgetc): this.
19940
720d742f
AD
199412000-10-02 Akim Demaille <akim@epita.fr>
19942
19943 * src/lalr.h: New file.
19944 Propagate its inclusion instead of prototypes and `extern'.
19945 * src/lalr.c: Formatting changes, topological sorting etc.
19946
f2acea59
AD
199472000-10-02 Akim Demaille <akim@epita.fr>
19948
19949 * src/output.c (token_actions): Introduce a temporary array,
19950 YYDEFACT, that makes it possible for this function to use
19951 output_short_table.
19952
d019d655
AD
199532000-10-02 Akim Demaille <akim@epita.fr>
19954
19955 `user_toknums' is output as a `short[]' in `output.c', while it is
19956 defined as a `int[]' in `reader.c'. For consistency with the
19957 other output tables, `user_toknums' is now defined as a table of
19958 shorts.
19959
19960 * src/reader.c (user_toknums): Be a short table instead of an int
19961 table.
19962 Adjust dependencies.
19963
19964 Factor the short table outputs.
19965
19966 * src/output.c (output_short_table): New function.
19967 * src/output.c (output_gram, output_stos, output_rule_data)
19968 (output_base, output_table, output_check): Use it.
19969
6c89f1c1
AD
199702000-10-02 Akim Demaille <akim@epita.fr>
19971
19972 * src/output.c (output): Topological sort of the functions, in
19973 order to get rid of the `static' prototypes.
19974 No longer use `register'.
19975 * src/output.h: New file.
19976 Propagate its inclusion in files explicitly prototyping functions
19977 from output.c.
19978
d9efd181
AD
199792000-09-21 Akim Demaille <akim@epita.fr>
19980
19981 * src/atgeneral.m4: Update from Autoconf.
19982
c29240e7 199832000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
19984
19985 * src/closure.h: New file.
19986 * src/closure.c: Formatting changes, topological sort over the
19987 functions, use of closure.h.
19988 (initialize_closure, finalize_closure): Rename as...
19989 (new_closure, free_closure): these. Adjust dependencies.
19990 * src/LR0.c: Formatting changes, topological sort, use of
19991 cloture.h.
19992 (initialize_states): Rename as...
19993 (new_states): this.
19994 * src/Makefile.am (noinst_HEADERS): Adjust.
19995
499daa50
AD
199962000-09-20 Akim Demaille <akim@epita.fr>
19997
19998 * src/acconfig.h: Don't protect config.h against multiple
19999 inclusion.
20000 Don't define PARAMS.
20001 * src/system.h: Define PARAMS.
20002 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
20003 purpose of config.h. system.h must not try to fix wrong
20004 definitions in config.h.
20005
cc84fd5d
AD
200062000-09-20 Akim Demaille <akim@epita.fr>
20007
20008 * src/derives.h: New file.
20009 * src/main.c, src/derives.h: Use it.
20010 Formatting changes.
20011 * src/Makefile.am (noinst_HEADERS): Adjust.
20012
db5b3a89
AD
200132000-09-20 Akim Demaille <akim@epita.fr>
20014
20015 * tests/atgeneral.m4: Update from Autoconf.
20016 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
20017 (AT_CHECK_CALC): New macros.
20018 Use these macros to test bison with options `', `--raw',
20019 `--debug', `--yacc', `--yacc --debug'.
20020
ceed8467
AD
200212000-09-19 Akim Demaille <akim@epita.fr>
20022
20023 * src/output.c: Formatting changes.
20024 * src/machine.h: Remove, leaving its contents in...
20025 * src/system.h: here.
20026 Include stdio.h.
20027 Adjust all dependencies on stdio.h and machine.h.
20028 * src/getargs.h: New file.
20029 Let all `extern' declarations about getargs.c be replaced with
20030 inclusion of `getargs.h'.
20031 * src/Makefile.am (noinst_HEADERS): Adjust.
20032
20033 * tests/calc.m4 (yyin): Be initialized in main, not on the global
20034 scope.
20035 (yyerror): Returns void, not int.
20036 * doc/bison.texinfo: Formatting changes.
20037
05a1d24b
AD
200382000-09-19 Akim Demaille <akim@epita.fr>
20039
20040 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
20041 portable.
20042
cbd25751
AD
200432000-09-18 Akim Demaille <akim@epita.fr>
20044
20045 * configure.in: Append WARNING_CFLAGS to CFLAGS.
20046 * src/Makefile.am (INCLUDES): Don't.
20047 Be ready to fetch headers in lib/.
20048
13863333
AD
200492000-09-18 Akim Demaille <akim@epita.fr>
20050
20051 * doc/bison.texinfo: Update the copyright.
20052 ANSIfy and GNUify the examples.
20053 Remove the old menu.
20054
0d533154
AD
200552000-09-18 Akim Demaille <akim@epita.fr>
20056
20057 First set of tests: use the `calc' example from the documentation.
20058
20059 * src/bison.s1 (yyparse): Condition the code using `yytname' which
20060 is defined only when YYDEBUG is.
20061 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
20062 * src/files.c (tryopen, tryclose): Formatting changes.
20063 Move to the top and be static.
20064 * src/reader.c (read_signed_integer): Likewise.
20065 * tests/calc.m4: New file.
20066 * Makefile.am, suite.m4: Adjust.
20067 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
20068
e79137ac
AD
200692000-09-18 Akim Demaille <akim@epita.fr>
20070
20071 Add support for an Autotest test suite for Bison.
20072
20073 * m4/m4.m4, m4/atconfig.m4: New files.
20074 * m4/Makefile.am (EXTRA_DIST): Adjust.
20075 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
20076 files.
20077 * src/getargs.c: Display a more standard --version message.
20078 * src/reader.c (reader): Formatting changes.
20079 No longer depend upon VERSION_STRING.
20080 * configure.in: No longer use `dnl'.
20081 Set up the test suite and the new directory `tests/.
20082 (VERSION_STRING): Remove.
20083
27821bff
AD
200842000-04-14 Akim Demaille <akim@epita.fr>
20085
20086 * src/reader.c (copy_comment2): New function, same as former
20087 `copy_comment', but outputs into two FILE *.
20088 (copy_comment): Use it.
20089 (parse_union_decl): Use it.
20090 (get_type, parse_start_decl): Use the same `invalid' message.
20091 (parse_start_decl, parse_union_decl): Use the same `multiple'
20092 message.
20093 (parse_union_decl, copy_guard, copy_action): Use the same
20094 `unmatched' message.
20095 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
20096
cfe5fbc0
AD
200972000-03-31 Akim Demaille <akim@epita.fr>
20098
20099 * src/files.c (tryopen, tryclose): Move to the top.
20100 Be static.
20101
cb7db13e
AD
201022000-03-31 Akim Demaille <akim@epita.fr>
20103
20104 * src/main.c (main): Don't call `done', exit does it.
20105
a0f6b076
AD
201062000-03-31 Akim Demaille <akim@epita.fr>
20107
36281465
AD
20108 * allocate.c: s/return (foo)/return foo/.
20109 * lalr.c: Likewise.
20110 * LR0.c: Likewise.
20111 * output.c: Likewise.
20112 * reader.c: Likewise.
20113 * symtab.c: Likewise.
20114 * vmsgetargs.c: Likewise.
20115
201162000-03-31 Akim Demaille <akim@epita.fr>
20117
20118 Clean up the error reporting functions.
a0f6b076
AD
20119
20120 * src/report.c: New file.
20121 * src/report.h: Likewise.
20122 * src/Makefile.am: Adjust.
20123 * m4/error.m4: New file.
20124 * m4/Makefile.am: Adjust.
20125 * configure.in (jm_PREREQ_ERROR): Call it.
20126 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
20127 Remove.
20128 (fatal, fatals): Remove. All callers use complain.c::fatal.
20129 (warn, warni, warns, warnss, warnss): Remove. All callers use
20130 complain.c::complain.
20131 (toomany): Remove, use fatal instead.
20132 * src/files.c (done): No argument, use complain_message_count.
20133 * src/main.c (main): Register `done' to `atexit'.
20134
20135 * src/getargs.c (usage): More `fputs', less `fprintf'.
20136
18539825
AD
201372000-03-28 Akim Demaille <akim@epita.fr>
20138
20139 * lib/: New directory.
20140 * Makefile.am (SUBDIRS): Adjust.
20141 * configure.in: Adjust.
20142 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
20143 useless.
20144 * src/alloca.c: Moved to lib/.
20145 * src/getopt.c: Likewise.
20146 * src/getopt1.c: Likewise.
20147 * src/getopt.h: Likewise.
20148 * src/ansi2knr.c: Likewise.
20149 * src/ansi2knr.1: Likewise.
20150 * src/Makefile.am: Adjust.
20151 * lib/Makefile.am: New file.
20152
9f306f2a
AD
201532000-03-28 Akim Demaille <akim@epita.fr>
20154
20155 * src/getargs.c (usage): Refresh the help message.
20156
0ba347b6
AD
201572000-03-17 Akim Demaille <akim@epita.fr>
20158
20159 * src/getopt1.c: Updated from textutils 2.0e
20160 * src/getopt.c: Likewise.
20161 * src/getopt.h: Likewise.
20162
dbe7f271
AD
201632000-03-17 Akim Demaille <akim@epita.fr>
20164
20165 * src/Makefile.am (bison.simple): Fix the awk program: quote only
20166 the file name, not the whole `#line LINE FILE'.
20167
75bbe78d
AD
201682000-03-17 Akim Demaille <akim@epita.fr>
20169
20170 On syntax errors, report the token on which we choked.
20171
aa5fd0ee
AD
20172 * src/bison.s1 (yyparse): In the label yyerrlab, when
20173 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 20174
7b306f52
AD
201752000-03-17 Akim Demaille <akim@epita.fr>
20176
aa5fd0ee 20177 * src/reader.c (copy_at): New function.
7b306f52
AD
20178 (copy_guard): Use it.
20179 (copy_action): Use it.
20180
e87b5700
AD
201812000-03-17 Akim Demaille <akim@epita.fr>
20182
20183 Be kind to translators, save some useless translations.
20184
aa5fd0ee 20185 * src/main.c (banner): New function.
e87b5700
AD
20186 (fatal_banner): Use it.
20187 (warn_banner): Use it.
20188
ae3c3164
AD
201892000-03-17 Akim Demaille <akim@epita.fr>
20190
aa5fd0ee
AD
20191 * src/reader.c (copy_definition): Use copy_string and
20192 copy_comment. Removed now unused `match', `ended',
20193 `cplus_comment'.
ae3c3164
AD
20194 (copy_comment, copy_string): Moved, to be visible from
20195 copy_definition.
20196
4dc58e7c
AD
201972000-03-17 Akim Demaille <akim@epita.fr>
20198
aa5fd0ee
AD
20199 * src/reader.c (copy_string): Declare `static inline'. No
20200 problems with inline, since it is checked by configure.
4dc58e7c
AD
20201 (copy_comment): Likewise.
20202
0a6384c4
AD
202032000-03-17 Akim Demaille <akim@epita.fr>
20204
aa5fd0ee 20205 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 20206
3cef001a
AD
202072000-03-17 Akim Demaille <akim@epita.fr>
20208
aa5fd0ee 20209 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
20210 (copy_action): Use it. Removed now unused `match', `ended',
20211 `cplus_comment'.
20212 (copy_guard): Likewise.
20213
ca36d2ef
AD
202142000-03-17 Akim Demaille <akim@epita.fr>
20215
aa5fd0ee 20216 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
20217 (copy_action): Use it.
20218 (copy_guard): Likewise.
20219
6666f98f
AD
202202000-03-17 Akim Demaille <akim@epita.fr>
20221
20222 Change the handling of @s so that they behave exactly like $s.
20223 There is now a pseudo variable @$ (readble and writable), location
20224 of the lhs of the rule (by default ranging from the location of
20225 the first symbol of the rhs, to the location of the last symbol,
20226 or, if the rhs is empty, YYLLOC).
20227
20228 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
20229 yyval.
20230 (yyparse): When providing a default semantic action, provide a
20231 default location action.
20232 (after the $): No longer change `*YYLSP', just stack YYLOC the
20233 same way you stack YYVAL.
20234 * src/reader.c (read_declarations): Use warns.
20235 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
20236 (copy_action, case '@'): Likewise.
20237 Use a standard error message, to save useless work from
20238 translators.
20239
41aca2e0
AD
202402000-03-17 Akim Demaille <akim@epita.fr>
20241
aa5fd0ee
AD
20242 * src/bison.s1: Formatting and cosmetics changes.
20243 * src/reader.c: Likewise.
41aca2e0
AD
20244 Update the Copyright notice.
20245
dc08c1d5
AD
202462000-03-17 Akim Demaille <akim@epita.fr>
20247
aa5fd0ee
AD
20248 * src/bison.s1 (#line): All set to `#line' only, since the
20249 Makefile now handles them.
dc08c1d5 20250
9ee3c97b
AD
202512000-03-16 Akim Demaille <akim@epita.fr>
20252
20253 * src/output.c (output_rule_data): Output the documentation of
20254 some of the tables.
20255 (Copyright notice): Update.
20256 Formatting changes.
20257
0de741ca
AD
202582000-03-16 Akim Demaille <akim@epita.fr>
20259
20260 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
20261 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
20262 One `#if YYDEBUG' remains, since it uses variables which are
20263 defined only if `YYDEBUG != 0'.
20264
bb10be54
AD
202652000-03-16 Akim Demaille <akim@epita.fr>
20266
20267 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
20268 and related variables so that the similarities are highlighted.
20269
b07b484a
AD
202702000-03-16 Akim Demaille <akim@epita.fr>
20271
20272 * src/bison.s1: Properly indent CPP directives.
20273
361f60b3
AD
202742000-03-16 Akim Demaille <akim@epita.fr>
20275
20276 * src/bison.s1: Properly indent the `alloca' CPP section.
20277
8c44d3ec
AD
202782000-03-16 Akim Demaille <akim@epita.fr>
20279
20280 Do not hard code values of directories in `configure.in'.
20281 Update the `configure' tool chain.
20282
20283 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
20284 src/makefile.am.
20285 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
20286 (AC_OUTPUT): Add m4/Makefile.
20287 Bump to bison 1.28a, 1.29 has never been released.
20288 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
20289 handled via src/Makefile.am.
20290 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
20291 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
20292 autoheader.
20293 * Makefile.am (SUBDIRS): Add m4.
20294 (ACLOCAL_AM_FLAGS): New variable.
20295 (AUTOMAKE_OPTIONS): Add check-news.
20296 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
20297 the proper line number and file name.
20298 (DEFS): Propagate the location of bison library files and of the
20299 locale files.
20300 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
20301 builddir.
20302 * acinclude.m4: Remove, replaced by the directory m4.
20303 * m4/Makefile.am (EXTRA_DIST): New variable.
20304 * m4/gettext.m4: New file, from the fileutils.
20305 * m4/lcmessage.m4: Likewise
20306 * m4/progtest.m4: Likewise.
20307 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
20308
f95997e7
AD
203092000-03-10 Akim Demaille <akim@epita.fr>
20310
20311 * src/closure.c:
20312 Formatting changes of various comments.
20313 Respect the GNU coding standards at various places.
20314 Don't use `_()' when no translation is needed.
20315
203161999-12-13 Jesse Thilo <jthilo@gnu.org>
20317
20318 * src/files.c:
20319 OS/2 honors TMPDIR environment variable.
20320
203211999-12-13 Jesse Thilo <jthilo@gnu.org>
20322
20323 * doc/bison.texinfo: Tweaked spelling and grammar.
20324 Updated ISBN.
20325 Removed reference to price of printed copy.
20326 Mention BISON_SIMPLE and BISON_HAIRY.
20327
203281999-12-13 Jesse Thilo <jthilo@gnu.org>
20329
20330 * configure.in, NEWS:
20331 Bison 1.29 released.
20332
203331999-10-27 Jesse Thilo <jthilo@gnu.org>
20334
20335 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
20336 Added reference card.
20337
203381999-07-26 Jesse Thilo <jthilo@gnu.org>
20339
20340 * po/ru.po: Added Russian translation.
20341
203421999-07-26 Jesse Thilo <jthilo@gnu.org>
20343
20344 * configure.in: Added Russian translation.
20345
203461999-07-06 Jesse Thilo <jthilo@gnu.org>
20347
20348 * configure.in, NEWS, README:
20349 Released version 1.28.
20350
203511999-06-14 Jesse Thilo <jthilo@gnu.org>
20352
20353 * src/system.h:
20354 Squashed redefinition warning on some systems.
20355
20356 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
20357 Have configure build version string instead of relying on ANSI string
20358 concatentation.
20359
203601999-06-14 Jesse Thilo <jthilo@gnu.org>
20361
20362 * po/POTFILES.in: Got rid of version.c.
20363
203641999-06-14 Jesse Thilo <jthilo@gnu.org>
20365
20366 * acconfig.h, configure.in:
20367 Have configure build version string instead of relying on ANSI string
20368 concatentation.
20369
203701999-06-08 Jesse Thilo <jthilo@gnu.org>
20371
20372 * doc/bison.1:
20373 Dropped mention of `+' for long-named options.
20374
203751999-05-30 Jesse Thilo <jthilo@gnu.org>
20376
20377 * src/files.c: Added <unistd.h> for unlink().
20378
20379 * src/Makefile.am, src/system.h:
20380 I18n fixes.
20381
203821999-05-30 Jesse Thilo <jthilo@gnu.org>
20383
20384 * README: Added a FAQ list.
20385
20386 * configure.in, acconfig.h:
20387 I18n fixes.
20388
203891999-05-30 Jesse Thilo <jthilo@gnu.org>
20390
20391 * doc/FAQ, doc/Makefile.am:
20392 Added a FAQ list.
20393
203941999-05-19 Jesse Thilo <jthilo@gnu.org>
20395
20396 * src/alloc.h, src/symtab.h, src/version.c:
20397 Protected inclusion of "config.h" with HAVE_CONFIG_H.
20398
203991999-04-18 Jesse Thilo <jthilo@gnu.org>
20400
20401 * src/.cvsignore, src/Makefile.am:
20402 Reorganized: sources in `src', documentation in `doc'.
20403
20404 * src/lex.c (literalchar):
20405 fixed the code for escaping double quotes (thanks
20406 Jonathan Czisny.)
20407
204081999-04-18 Jesse Thilo <jthilo@gnu.org>
20409
20410 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
20411 Adjusted paths to reflect directory reorganization.
20412
204131999-04-18 Jesse Thilo <jthilo@gnu.org>
20414
20415 * doc/.cvsignore, doc/Makefile.am:
20416 Reorganized: sources in `src', documentation in `doc'.
20417
204181999-04-18 Jesse Thilo <jthilo@gnu.org>
20419
20420 * configure.in:
20421 Updated AC_INIT file to reflect directory reorganization.
20422
20423 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
20424 Reorganized: sources in `src', documentation in `doc'.
20425
204261999-04-13 Jesse Thilo <jthilo@gnu.org>
20427
20428 * src/allocate.c:
20429 Don't declare calloc() and realloc() if not necessary.
20430
204311999-04-13 Jesse Thilo <jthilo@gnu.org>
20432
20433 * configure.in, acconfig.h, acinclude.m4:
20434 Don't declare calloc() and realloc() if not necessary.
20435
204361999-03-23 Jesse Thilo <jthilo@gnu.org>
20437
20438 * po/.cvsignore: Added i18n support.
20439
204401999-03-23 Jesse Thilo <jthilo@gnu.org>
20441
20442 * acconfig.h, configure.in, Makefile.am:
20443 Added i18n support.
20444
204451999-03-22 Jesse Thilo <jthilo@gnu.org>
20446
20447 * src/bison.s1: Fixed #line numbers.
20448
204491999-03-15 Jesse Thilo <jthilo@gnu.org>
20450
20451 * po/es.po, po/fr.po, po/nl.po, po/de.po:
20452 Added PO files from Translation Project.
20453
204541999-03-03 Jesse Thilo <jthilo@gnu.org>
20455
20456 * Makefile.am:
20457 Added support for non-ANSI compilers (ansi2knr).
20458
204591999-02-16 Jesse Thilo <jthilo@gnu.org>
20460
20461 * configure.in: Bumped version number to 1.27.
20462
20463 * Makefile.am:
20464 Added `bison.simple' to list of files removed by `make distclean'.
20465
204661999-02-12 Jesse Thilo <jthilo@gnu.org>
20467
20468 * src/files.c, src/files.h:
20469 Defined locations of parser files in config.h instead of Makefile.
20470
204711999-02-12 Jesse Thilo <jthilo@gnu.org>
20472
20473 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
20474 Defined locations of parser files in config.h instead of Makefile.
20475
204761999-02-09 Jesse Thilo <jthilo@gnu.org>
20477
20478 * Makefile.am:
20479 Removed inappropriate use of $< macro.
20480
204811999-02-05 Jesse Thilo <jthilo@gnu.org>
20482
20483 * po/Makefile.in.in, po/POTFILES.in:
20484 Add `po' directory skeleton.
20485
204861999-01-27 Jesse Thilo <jthilo@gnu.org>
20487
20488 * README: Document help-bison list.
20489
20490 * configure.in: Add check for mkstemp().
20491
204921999-01-20 Jesse Thilo <jthilo@gnu.org>
20493
20494 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
20495 Hush a few compiler warnings.
20496
20497 * src/files.c:
20498 Add tryclose(), which verifies that fclose was successful.
20499 Hush a couple of compiler warnings.
20500
205011999-01-20 Jesse Thilo <jthilo@gnu.org>
20502
20503 * Makefile.am, OChangeLog:
20504 ChangeLog is now automatically generated. Include the old version as
20505 OChangeLog.
20506
205071999-01-14 Jesse Thilo <jthilo@gnu.org>
20508
20509 * 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:
20510 Update FSF address.
20511
205121999-01-14 Jesse Thilo <jthilo@gnu.org>
20513
20514 * doc/bison.texinfo: Fix formatting glitch.
20515
20516 * doc/bison.texinfo: Update FSF address.
20517
205181999-01-14 Jesse Thilo <jthilo@gnu.org>
20519
20520 * acconfig.h: Update FSF address.
20521
205221999-01-08 Jesse Thilo <jthilo@gnu.org>
20523
20524 * src/system.h:
20525 Don't define PACKAGE here, since config.h defines it.
20526
205271998-12-30 Jesse Thilo <jthilo@gnu.org>
20528
20529 * src/reader.c: Update copyright date.
20530
20531 * src/main.c:
20532 Ditch sprintf to statically-sized buffers in fatal/warn functions in
20533 favor of output directly to stderr (avoids buffer overruns).
20534
20535 * src/reader.c: Some checks for premature EOF.
20536
20537 * 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:
20538 Use prototypes if the compiler understands them.
20539
20540 * src/files.c: Honor TMPDIR on Unix hosts.
20541 Use prototypes if the compiler understands them.
20542
20543 * src/reader.c:
20544 Fix a couple of buffer overrun bugs.
20545 Use prototypes if the compiler understands them.
20546
20547 * src/system.h: Include unistd.h and ctype.h.
20548 Use #ifdef instead of #if for NLS symbols.
20549
205501998-12-30 Jesse Thilo <jthilo@gnu.org>
20551
20552 * doc/bison.texinfo:
20553 Delete comment "consider using @set for edition number, etc..." since
20554 we now are doing so.
20555
205561998-12-30 Jesse Thilo <jthilo@gnu.org>
20557
20558 * configure.in:
20559 Use prototypes if the compiler understands them.
20560
20561 * NEWS: Document 1.26 highlights.
20562
20563 * Makefile.am: Require Automake 1.3 or later.
20564
20565 * acconfig.h:
20566 Use prototypes if the compiler understands them.
20567
205681998-12-29 Jesse Thilo <jthilo@gnu.org>
20569
20570 * src/version.c:
20571 Use VERSION symbol from automake for version number.
20572
205731998-12-29 Jesse Thilo <jthilo@gnu.org>
20574
20575 * acconfig.h, configure.in, version.cin:
20576 Use VERSION symbol from automake for version number.
20577
205781998-11-28 Jesse Thilo <jthilo@gnu.org>
20579
20580 * Makefile.am:
20581 Distribute original version of simple parser (bison.s1), not built
20582 version (bison.simple).
20583
205841998-11-28 Jesse Thilo <jthilo@gnu.org>
20585
20586 * doc/bison.texinfo: Add info dir entry.
20587
20588 * doc/bison.texinfo:
20589 Let automake put version number into documentation.
20590
205911998-11-26 Jesse Thilo <jthilo@gnu.org>
20592
20593 * src/bison.cld, src/build.com, src/vmshlp.mar:
20594 Add non-RCS files from /gd/gnu/bison.
20595
205961998-11-26 Jesse Thilo <jthilo@gnu.org>
20597
20598 * doc/bison.1:
20599 Document the BISON_HAIRY and BISON_SIMPLE variables.
20600
206011998-11-25 Jesse Thilo <jthilo@gnu.org>
20602
20603 * src/version.c: Build version.c automatically.
20604
20605 * src/reader.c:
20606 Fix token numbering (used to start at 258, not 257).
20607
20608 * src/system.h: Include config.h.
20609
20610 * src/getargs.c: Update bug report address.
20611
20612 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
20613 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
20614
206151998-11-25 Jesse Thilo <jthilo@gnu.org>
20616
20617 * Makefile.am:
20618 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
20619
20620 * configure.in, version.cin:
20621 Build version.c automatically.
20622
20623 * AUTHORS: Add AUTHORS file.
20624
20625 * README: Update bug report address.
20626
20627 * bison.simple:
20628 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
20629
20630 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
20631 Add automake stuff.
20632
206331998-11-25 Jesse Thilo <jthilo@gnu.org>
20634
20635 * doc/bison.texinfo: Clean up some formatting.
20636
206371998-05-05 Richard Stallman <rms@gnu.org>
20638
20639 * doc/bison.texinfo:
20640 Explain better why to make a pure parser.
20641
206421998-01-05 Richard Stallman <rms@gnu.org>
20643
20644 * src/files.c (openfiles):
20645 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
20646 find a temporary directory, if possible. Do not unlink files while
20647 they are open.
20648
206491997-08-25 Richard Stallman <rms@gnu.org>
20650
20651 * src/reader.c (stack_offset;):
20652 Change some warni to warns.
20653
20654 * src/lex.c (literalchar): Use warns, not warni.
20655
206561997-06-28 Richard Stallman <rms@gnu.org>
20657
20658 * src/bison.s1: Add a Bison version comment.
20659
20660 * src/main.c (fatal, warn, berror):
20661 Use program_name.
20662
206631997-06-28 Richard Stallman <rms@gnu.org>
20664
20665 * Makefile.in (bison_version): New variable.
20666 (dist): Use that variable.
20667 (bison.s1): Substitute the Bison version into bison.simple.
20668
20669 * bison.simple: Add a Bison version comment.
20670
206711997-06-18 Richard Stallman <rms@gnu.org>
20672
20673 * src/main.c (fatal, warn, berror):
20674 Make error messages standard.
20675 (toomany): Improve error message text.
20676
20677 * 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:
20678 new.h renamed to alloc.h.
20679
206801997-06-18 Richard Stallman <rms@gnu.org>
20681
20682 * Makefile.in: new.h renamed to alloc.h.
20683
206841997-05-24 Richard Stallman <rms@gnu.org>
20685
20686 * src/lex.c (literalchar):
20687 Fix the code for escaping \, " and '.
20688
20689 (lex): Avoid trouble when there are many chars
20690 to discard in a char literal with just several chars in it.
20691
206921997-05-17 Richard Stallman <rms@gnu.org>
20693
20694 * src/bison.s1:
20695 Use malloc, if using alloca is troublesome.
20696 (YYSTACK_USE_ALLOCA): New flag macro.
20697 Define it for some systems and compilers.
20698 (YYSTACK_ALLOC): New macro.
20699 (yyparse): Use YYSTACK_ALLOC to allocate stack.
20700 If it was malloc'd, free it.
20701
207021997-05-17 Richard Stallman <rms@gnu.org>
20703
20704 * bison.simple:
20705 Use malloc, if using alloca is troublesome.
20706 (YYSTACK_USE_ALLOCA): New flag macro.
20707 Define it for some systems and compilers.
20708 (YYSTACK_ALLOC): New macro.
20709 (yyparse): Use YYSTACK_ALLOC to allocate stack.
20710 If it was malloc'd, free it.
20711
207121997-04-23 Richard Stallman <rms@gnu.org>
20713
20714 * src/bison.s1:
20715 (alloca) [__hpux]: Always define as __builtin_alloca.
20716
207171997-04-23 Richard Stallman <rms@gnu.org>
20718
20719 * bison.simple:
20720 (alloca) [__hpux]: Always define as __builtin_alloca.
20721
207221997-04-22 Richard Stallman <rms@gnu.org>
20723
20724 * src/bison.s1:
20725 [__hpux]: Include alloca.h (right for HPUX 10)
20726 instead of declaring alloca (right for HPUX 9).
20727
20728 * src/bison.s1 (__yy_memcpy):
20729 Declare arg `count' as unsigned int.
20730 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
20731
207321997-04-22 Richard Stallman <rms@gnu.org>
20733
20734 * bison.simple:
20735 [__hpux]: Include alloca.h (right for HPUX 10)
20736 instead of declaring alloca (right for HPUX 9).
20737
20738 * bison.simple (__yy_memcpy):
20739 Declare arg `count' as unsigned int.
20740 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
20741
207421997-01-03 Richard Stallman <rms@gnu.org>
20743
20744 * src/allocate.c: [__STDC__ or _MSC_VER]:
20745 Declare calloc and realloc to return void *.
20746
207471997-01-02 Richard Stallman <rms@gnu.org>
20748
20749 * src/system.h:
20750 [_MSC_VER]: Include stdlib.h and process.h.
20751 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
20752
20753 * src/main.c (main): Return FAILURE as a value.
20754 (printable_version): Declare arg as int, not char.
20755
207561997-01-02 Richard Stallman <rms@gnu.org>
20757
20758 * Makefile.in (dist):
20759 Explicitly check for symlinks, and copy them.
20760
207611996-12-19 Richard Stallman <rms@gnu.org>
20762
20763 * src/files.c:
20764 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
20765
207661996-12-18 Paul Eggert <eggert@gnu.org>
20767
20768 * src/bison.s1 (yyparse):
20769 If __GNUC__ and YYPARSE_PARAM are both defined,
20770 declare yyparse to have a void * argument.
20771
207721996-12-18 Paul Eggert <eggert@gnu.org>
20773
20774 * bison.simple (yyparse):
20775 If __GNUC__ and YYPARSE_PARAM are both defined,
20776 declare yyparse to have a void * argument.
20777
207781996-12-17 Richard Stallman <rms@gnu.org>
20779
20780 * src/reduce.c (nbits): Add some casts.
20781
207821996-08-12 Richard Stallman <rms@gnu.org>
20783
20784 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
20785
207861996-08-12 Richard Stallman <rms@gnu.org>
20787
20788 * bison.simple: Test _MSDOS as well as _MSDOS_.
20789
207901996-07-31 Richard Stallman <rms@gnu.org>
20791
20792 * src/bison.s1:
20793 [__sun && __i386]: Include alloca.h.
20794
207951996-07-31 Richard Stallman <rms@gnu.org>
20796
20797 * bison.simple:
20798 [__sun && __i386]: Include alloca.h.
20799
208001996-07-30 Richard Stallman <rms@gnu.org>
20801
20802 * src/bison.s1: Comment change.
20803
20804 * src/bison.s1: Test _MSDOS_, not MSDOS.
20805
208061996-07-30 Richard Stallman <rms@gnu.org>
20807
20808 * bison.simple: Comment change.
20809
20810 * bison.simple: Test _MSDOS_, not MSDOS.
20811
208121996-06-01 Richard Stallman <rms@gnu.org>
20813
20814 * 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:
20815 Insert `_' macro around many string constants.
20816
20817 * src/main.c:
20818 Insert `_' macro around many string constants.
20819
20820 (main): Call setlocale, bindtextdomain and textdomain.
20821
20822 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
20823 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
20824 [ENABLE_NLS]: Include libintl.h.
20825 [ENABLE_NLS] (gettext): Define.
20826 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
20827 (N_, PACKAGE, LOCALEDIR): New macros.
20828
208291996-06-01 Richard Stallman <rms@gnu.org>
20830
20831 * POTFILES.in: New file.
20832
20833 * Makefile.in (allocate.o):
20834 Define target explicitly.
20835
20836 * Makefile.in (CFLAGS): Set to @CFLAGS@.
20837 (LDFLAGS): Set to @LDFLAGS@.
20838 (configure): Run autoconf only if preceding `cd' succeeds.
20839 (bison.s1): Redirect output to temporary file then move the
20840 temporary to the target, rather than redirecting directly to bison.s1.
20841 (clean): Remove config.status and config.log.
20842 (distclean): Don't remove config.status here.
20843
208441996-05-12 Richard Stallman <rms@gnu.org>
20845
20846 * src/bison.s1:
20847 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20848
208491996-05-12 Richard Stallman <rms@gnu.org>
20850
20851 * bison.simple:
20852 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20853
208541996-05-11 Richard Stallman <rms@gnu.org>
20855
20856 * src/bison.s1 (__yy_memcpy):
20857 Really reorder the args, as was supposedly done on Feb 14 1995.
20858 (yyparse): Calls changed accordingly.
20859
208601996-05-11 Richard Stallman <rms@gnu.org>
20861
20862 * Makefile.in (dist): Don't use $(srcdir).
20863
20864 * bison.simple (__yy_memcpy):
20865 Really reorder the args, as was supposedly done on Feb 14 1995.
20866 (yyparse): Calls changed accordingly.
20867
208681996-01-27 Richard Stallman <rms@gnu.org>
20869
20870 * src/output.c (output_rule_data):
20871 Test YYERROR_VERBOSE in the conditional
20872 around the definition of ttyname.
20873
208741995-12-29 Richard Stallman <rms@gnu.org>
20875
20876 * src/bison.s1:
20877 Fix line numbers in #line commands.
20878
208791995-12-29 Richard Stallman <rms@gnu.org>
20880
20881 * bison.simple:
20882 Fix line numbers in #line commands.
20883
208841995-12-27 Richard Stallman <rms@gnu.org>
20885
20886 * src/bison.s1 (YYPARSE_PARAM_DECL):
20887 In C++, make it always null.
20888 (YYPARSE_PARAM_ARG): New macro.
20889 (yyparse): Use YYPARSE_PARAM_ARG.
20890
208911995-12-27 Richard Stallman <rms@gnu.org>
20892
20893 * bison.simple (YYPARSE_PARAM_DECL):
20894 In C++, make it always null.
20895 (YYPARSE_PARAM_ARG): New macro.
20896 (yyparse): Use YYPARSE_PARAM_ARG.
20897
208981995-11-29 Richard Stallman <rms@gnu.org>
20899
20900 * doc/bison.texinfo:
20901 Describe literal string tokens, %raw, %no_lines, %token_table.
20902
209031995-11-29 Daniel Hagerty <hag@gnu.org>
20904
20905 * doc/bison.texinfo: Fixed update date
20906
209071995-10-16 Richard Stallman <rms@gnu.org>
20908
20909 * src/version.c: Version 1.25.
20910
209111995-10-16 Richard Stallman <rms@gnu.org>
20912
20913 * NEWS: *** empty log message ***
20914
209151995-10-16 Richard Stallman <rms@gnu.org>
20916
20917 * doc/bison.1, doc/bison.rnh:
20918 Add new options.
20919
209201995-10-15 Richard Stallman <rms@gnu.org>
20921
20922 * src/vmsgetargs.c, src/getargs.c:
20923 Added -n, -k, and -raw switches.
20924 (noparserflag, toknumflag, rawtoknumflag): New variables.
20925
20926 * src/symtab.h (SALIAS):
20927 New #define for adding aliases to %token.
20928 (struct bucket): Added `alias' field.
20929
20930 * src/reduce.c (reduce_grammar):
20931 Revise error message.
20932 (print_notices): Remove final `.' from error message.
20933
20934 * src/reader.c (reader_output_yylsp):
20935 New function.
20936 (readgram): Use `#if 0' around code that accepted %command
20937 inside grammar rules: The documentation doesn't allow it,
20938 and it will fail since the %command processors scan for the next %.
20939 (parse_token_decl): Extended the %token
20940 declaration to allow a multi-character symbol as an alias.
20941 (parse_thong_decl): New function.
20942 (read_declarations): Added %thong declarations.
20943 (read_declarations): Handle NOOP to deal with allowing
20944 % declarations as another means to specify the flags.
20945 (readgram): Allow %prec prior to semantics embedded in a rule.
20946 (skip_to_char, read_declarations, copy_definition)
20947 (parse_token_decl, parse_start_decl, parse_type_decl)
20948 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
20949 (get_type_name, copy_guard, copy_action, readgram)
20950 (get_type, packsymbols): Revised most error messages.
20951 Changed `fatal' to `warnxxx' to avoid aborting for error.
20952 Revised and use multiple warnxxx functions to avoid using VARARGS1.
20953 (read_declarations): Improve the error message for
20954 an invalid character. Do not abort.
20955 (read_declarations, copy_guard, copy_action): Use
20956 printable_version to avoid unprintable characters in printed output.
20957 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
20958 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
20959 Allow the type of a non-terminal can be given
20960 more than once, as long as all specifications give the same type.
20961
20962 * src/output.c:
20963 (output_headers, output_trailers, output, output_gram)
20964 (output_rule_data): Implement noparserflag variable.
20965 Implement toknumflag variable.
20966 (output): Call reader_output_yylsp to output LTYPESTR.
20967
20968 * src/main.c (main):
20969 If reader sees an error, don't process the grammar.
20970 (fatals): Updated to not use VARARGS1.
20971 (printable_version, int_to_string, warn, warni, warns, warnss)
20972 (warnsss): New error reporting functions. Avoid abort for error.
20973
20974 * src/lex.h:
20975 Added THONG and NOOP for alias processing.
20976 Added SETOPT for the new code that allows setting options with %flags.
20977
20978 * src/lex.c:
20979 Include getopt.h. Add some extern decls.
20980 (safegetc): New function to deal with EOF gracefully.
20981 (literalchar); new function to deal with reading \ escapes.
20982 (lex): Use literalchar.
20983 (lex): Implemented "..." tokens.
20984 (literalchar, lex, parse_percent_token): Made tokenbuffer
20985 always contain the token. This includes growing the token
20986 buffer while reading an integer.
20987 (parse_percent_token): Replaced if-else statement with percent_table.
20988 (parse_percent_token): Added % declarations as another
20989 way to specify the flags -n, -l, and -r. Also added hooks for
20990 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
20991 major changes to files.c.
20992 (lex) Retain in the incoming stream a character following
20993 an incorrect '/'.
20994 (skip_white_space, lex): Revised most error messages
20995 and changed fatal to warn to avoid aborting.
20996 (percent_table): Added %thong declarations.
20997
20998 * src/gram.h: Comment changes.
20999
21000 * src/files.c (openfiles, open_extra_files, done):
21001 Add faction flag
21002 and actfile file. Handle noparserflag. Both for -n switch.
21003
21004 * src/conflicts.c (resolve_sr_conflict):
21005 Remove use of alloca.
21006
210071995-06-01 Jim Meyering <meyering@gnu.org>
21008
21009 * doc/bison.texinfo: *** empty log message ***
21010
210111995-05-06 Richard Stallman <rms@gnu.org>
21012
21013 * src/bison.s1: Comment change.
21014
210151995-05-06 Richard Stallman <rms@gnu.org>
21016
21017 * bison.simple: Comment change.
21018
210191995-05-03 Richard Stallman <rms@gnu.org>
21020
21021 * src/version.c: Version now 1.24.
21022
21023 * src/bison.s1: Change distribution terms.
21024
21025 * src/version.c: Version now 1.23.
21026
210271995-05-03 Richard Stallman <rms@gnu.org>
21028
21029 * doc/bison.texinfo:
21030 Rewrite "Conditions for Using Bison".
21031 Update version to 1.24.
21032
210331995-05-03 Richard Stallman <rms@gnu.org>
21034
21035 * bison.simple: Change distribution terms.
21036
210371995-02-23 Richard Stallman <rms@gnu.org>
21038
21039 * src/files.c: Test __VMS_POSIX as well as VMS.
21040
210411995-02-14 Jim Meyering <meyering@gnu.org>
21042
21043 * src/bison.s1 (__yy_memcpy):
21044 Renamed from __yy_bcopy to avoid
21045 confusion. Reverse FROM and TO arguments to be consistent with
21046 those of memcpy.
21047
210481995-02-14 Jim Meyering <meyering@gnu.org>
21049
21050 * bison.simple (__yy_memcpy):
21051 Renamed from __yy_bcopy to avoid
21052 confusion. Reverse FROM and TO arguments to be consistent with
21053 those of memcpy.
21054
210551994-11-10 David J. MacKenzie <djm@gnu.org>
21056
21057 * NEWS: reformat
21058
21059 * NEWS: New file.
21060
21061 * Makefile.in (DISTFILES): Include NEWS.
21062
21063 * Makefile.in (DISTFILES):
21064 Include install-sh, not install.sh.
21065
21066 * configure.in: Update to Autoconf v2 macro names.
21067
210681994-10-05 David J. MacKenzie <djm@gnu.org>
21069
21070 * Makefile.in: fix typo
21071
21072 * Makefile.in (prefix, exec_prefix):
21073 Let configure set them.
21074
210751994-09-28 David J. MacKenzie <djm@gnu.org>
21076
21077 * Makefile.in: Set datadir to $(prefix)/share.
21078
210791994-09-15 Richard Stallman <rms@gnu.org>
21080
21081 * src/bison.s1:
21082 Update copyright notice and GPL version.
21083
210841994-09-15 Richard Stallman <rms@gnu.org>
21085
21086 * bison.simple:
21087 Update copyright notice and GPL version.
21088
210891994-07-12 Richard Stallman <rms@gnu.org>
21090
21091 * src/reduce.c, src/reader.c:
21092 entered into RCS
21093
210941994-05-05 David J. MacKenzie <djm@gnu.org>
21095
21096 * Makefile.in: entered into RCS
21097
210981994-03-26 Richard Stallman <rms@gnu.org>
21099
21100 * src/bison.s1: entered into RCS
21101
211021994-03-26 Richard Stallman <rms@gnu.org>
21103
21104 * bison.simple: entered into RCS
21105
211061994-03-25 Richard Stallman <rms@gnu.org>
21107
21108 * src/main.c: entered into RCS
21109
211101994-03-24 Richard Stallman <rms@gnu.org>
21111
21112 * src/conflicts.c: entered into RCS
21113
211141994-01-02 Richard Stallman <rms@gnu.org>
21115
21116 * Makefile.in: *** empty log message ***
21117
211181993-11-21 Richard Stallman <rms@gnu.org>
21119
21120 * src/bison.s1: *** empty log message ***
21121
211221993-11-21 Richard Stallman <rms@gnu.org>
21123
21124 * doc/bison.texinfo: entered into RCS
21125
21126 * doc/bison.texinfo: *** empty log message ***
21127
211281993-11-21 Richard Stallman <rms@gnu.org>
21129
21130 * bison.simple: *** empty log message ***
21131
211321993-10-25 David J. MacKenzie <djm@gnu.org>
21133
21134 * doc/bison.texinfo: *** empty log message ***
21135
211361993-10-19 Richard Stallman <rms@gnu.org>
21137
21138 * src/bison.s1: *** empty log message ***
21139
211401993-10-19 Richard Stallman <rms@gnu.org>
21141
21142 * bison.simple: *** empty log message ***
21143
211441993-10-14 Richard Stallman <rms@gnu.org>
21145
21146 * src/bison.s1: *** empty log message ***
21147
211481993-10-14 Richard Stallman <rms@gnu.org>
21149
21150 * bison.simple: *** empty log message ***
21151
211521993-09-14 David J. MacKenzie <djm@gnu.org>
21153
21154 * doc/bison.texinfo: *** empty log message ***
21155
211561993-09-13 Noah Friedman <friedman@gnu.org>
21157
21158 * Makefile.in: *** empty log message ***
21159
211601993-09-10 Richard Stallman <rms@gnu.org>
21161
21162 * src/conflicts.c: *** empty log message ***
21163
21164 * src/system.h: entered into RCS
21165
211661993-09-10 Richard Stallman <rms@gnu.org>
21167
21168 * doc/bison.1: entered into RCS
21169
211701993-09-06 Noah Friedman <friedman@gnu.org>
21171
21172 * src/version.c: entered into RCS
21173
211741993-09-06 Noah Friedman <friedman@gnu.org>
21175
21176 * Makefile.in: *** empty log message ***
21177
211781993-07-30 David J. MacKenzie <djm@gnu.org>
21179
21180 * Makefile.in: *** empty log message ***
21181
211821993-07-24 Richard Stallman <rms@gnu.org>
21183
21184 * src/bison.s1: *** empty log message ***
21185
211861993-07-24 Richard Stallman <rms@gnu.org>
21187
21188 * bison.simple: *** empty log message ***
21189
211901993-07-08 David J. MacKenzie <djm@gnu.org>
21191
21192 * Makefile.in: *** empty log message ***
21193
211941993-07-04 Richard Stallman <rms@gnu.org>
21195
21196 * src/bison.s1: *** empty log message ***
21197
211981993-07-04 Richard Stallman <rms@gnu.org>
21199
21200 * bison.simple: *** empty log message ***
21201
212021993-06-26 David J. MacKenzie <djm@gnu.org>
21203
21204 * src/getargs.c: entered into RCS
21205
212061993-06-26 David J. MacKenzie <djm@gnu.org>
21207
21208 * doc/bison.texinfo: *** empty log message ***
21209
21210 * doc/bison.1: New file.
21211
212121993-06-25 Richard Stallman <rms@gnu.org>
21213
21214 * src/getargs.c: New file.
21215
212161993-06-16 Richard Stallman <rms@gnu.org>
21217
21218 * src/bison.s1: *** empty log message ***
21219
212201993-06-16 Richard Stallman <rms@gnu.org>
21221
21222 * bison.simple: *** empty log message ***
21223
212241993-06-03 Richard Stallman <rms@gnu.org>
21225
21226 * src/bison.s1: New file.
21227
212281993-06-03 Richard Stallman <rms@gnu.org>
21229
21230 * doc/bison.texinfo: *** empty log message ***
21231
212321993-06-03 Richard Stallman <rms@gnu.org>
21233
21234 * bison.simple: New file.
21235
212361993-05-19 Richard Stallman <rms@gnu.org>
21237
21238 * doc/bison.texinfo: New file.
21239
212401993-05-07 Noah Friedman <friedman@gnu.org>
21241
21242 * Makefile.in: *** empty log message ***
21243
212441993-04-28 Noah Friedman <friedman@gnu.org>
21245
21246 * src/reader.c: *** empty log message ***
21247
212481993-04-23 Noah Friedman <friedman@gnu.org>
21249
21250 * src/alloc.h: entered into RCS
21251
212521993-04-20 David J. MacKenzie <djm@gnu.org>
21253
21254 * src/version.c: *** empty log message ***
21255
21256 * src/files.c, src/allocate.c:
21257 entered into RCS
21258
21259 * src/reader.c: *** empty log message ***
21260
21261 * src/lex.c: entered into RCS
21262
21263 * src/conflicts.c: New file.
21264
21265 * src/symtab.c: entered into RCS
21266
21267 * src/alloc.h: New file.
21268
21269 * src/LR0.c: entered into RCS
21270
212711993-04-18 Noah Friedman <friedman@gnu.org>
21272
21273 * src/reader.c: New file.
21274
21275 * src/version.c: *** empty log message ***
21276
212771993-04-18 Noah Friedman <friedman@gnu.org>
21278
21279 * Makefile.in: *** empty log message ***
21280
212811993-04-17 Noah Friedman <friedman@gnu.org>
21282
21283 * Makefile.in: *** empty log message ***
21284
212851993-04-15 Richard Stallman <rms@gnu.org>
21286
21287 * src/main.c, src/files.c:
21288 New file.
21289
212901993-04-15 Noah Friedman <friedman@gnu.org>
21291
21292 * configure.in: entered into RCS
21293
21294 * configure.in: *** empty log message ***
21295
21296 * configure.in: New file.
21297
212981993-04-14 Richard Stallman <rms@gnu.org>
21299
21300 * Makefile.in: New file.
21301
213021993-04-13 Richard Stallman <rms@gnu.org>
21303
21304 * src/version.c: New file.
21305
213061993-03-25 Richard Stallman <rms@gnu.org>
21307
21308 * src/output.c: entered into RCS
21309
213101992-09-25 Richard Stallman <rms@gnu.org>
21311
21312 * configure.bat: entered into RCS
21313
213141992-06-22 Richard Stallman <rms@gnu.org>
21315
21316 * src/vmsgetargs.c: entered into RCS
21317
213181992-06-22 Richard Stallman <rms@gnu.org>
21319
21320 * doc/bison.rnh: entered into RCS
21321
213221992-04-20 David J. MacKenzie <djm@gnu.org>
21323
21324 * README: entered into RCS
21325
213261992-01-22 Richard Stallman <rms@gnu.org>
21327
21328 * src/machine.h: entered into RCS
21329
213301991-12-21 Richard Stallman <rms@gnu.org>
21331
21332 * src/lalr.c, src/closure.c:
21333 entered into RCS
21334
213351991-12-20 Richard Stallman <rms@gnu.org>
21336
21337 * src/state.h: entered into RCS
21338
213391991-12-18 Richard Stallman <rms@gnu.org>
21340
21341 * src/print.c, src/nullable.c, src/derives.c:
21342 entered into RCS
21343
213441991-11-03 David J. MacKenzie <djm@gnu.org>
21345
21346 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
21347 entered into RCS
21348
213491988-09-09 Richard Stallman <rms@gnu.org>
21350
21351 * src/bison.hairy: entered into RCS
21352
213531987-12-16 Richard Stallman <rms@gnu.org>
21354
21355 * REFERENCES: entered into RCS
dc546b0f 21356
f294a2c2 21357
04098407 21358 -----
f294a2c2 21359
04098407 21360 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
f490771b
JD
21361 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
21362 2007, 2008, 2009 Free Software Foundation, Inc.
f294a2c2 21363
04098407
PE
21364 Copying and distribution of this file, with or without
21365 modification, are permitted provided the copyright notice and this
21366 notice are preserved.