]> git.saurik.com Git - bison.git/blame - ChangeLog
Simplify last patch slightly.
[bison.git] / ChangeLog
CommitLineData
c4eb1e84
JD
12008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Simplify last patch slightly.
4 * src/getargs.c (getargs): Here.
5
10fa0146
JD
62008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
7
8 Fix last warning from --enable-gcc-warnings.
9 * src/getargs.c (getargs): Don't assign const address to non-const
10 pointer.
11
6f5be1ab
DJ
122008-11-17 Di-an Jan <dianj@freeshell.org>
13
14 Handle --enable-gcc-warnings.
15 * src/getargs.c (command_line_location): Set parameters to void.
16
11c4e57d
AD
172008-11-11 Akim Demaille <demaille@gostai.com>
18
19 AT_FULL_COMPILE.
20 * tests/actions.at, tests/regression.at: Use it.
21
e186a284
AD
222008-11-07 Akim Demaille <demaille@gostai.com>
23
24 Pass command line location to skeleton_arg and language_argmatch.
25 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
26 The location argument is now mandatory.
27 Adjust all dependencies.
28 (getargs): Use command_line_location.
29
e14c6831
AD
302008-11-07 Akim Demaille <demaille@gostai.com>
31
32 -D, --define.
33 * src/getargs.c (usage): Document -D.
34 Fix help string for --locations.
35 (command_line_location): New.
36 (short_options, long_options, getargs): Support -D, --define.
37 (getargs): Move -d support at the right place.
38 * doc/bison.texinfo (Bison Options): Update.
39 * tests/input.at (%define, --define): New.
40
75c21b61
AD
412008-11-07 Akim Demaille <demaille@gostai.com>
42
43 Initialize the muscle table before parsing the command line.
44 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
45 (getargs): Define file_name.
46 * src/main.c (main): Initialize muscle_tab before calling
47 getargs.
48 * src/muscle_tab.c (muscle_init): No longer define file_name, as
49 its value is not available yet.
50
33d2a860
AD
512008-11-09 Akim Demaille <demaille@gostai.com>
52
53 Require the generation of parse-gram.output.
54 * src/Makefile.am (YACC): Pass --report=all.
55
006faedf
JD
562009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
57
58 * NEWS (2.5): New stub.
59
ecd1b61c
JD
602009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
61
62 Fix options documentation.
63 * build-aux/cross-options.pl: As in --help output, write optional
64 arguments as [=ARG] not =[ARG].
65 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
66
f67c4037
AD
672008-11-07 Akim Demaille <demaille@gostai.com>
68
69 Fix --help.
70 * src/getargs.c (usage): Fix help string for -W.
71
0213d651
AD
722008-11-07 Akim Demaille <demaille@gostai.com>
73
74 Handle more general types of option arguments.
75 * build-aux/cross-options.pl: The argument ends at the first
76 space, not the first non-symbol character.
77 Use @var for each word appearing the argument description.
78
c19178bf
JD
792009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
80
81 Remove spurious initial empty lines.
82 * data/location.cc: End the @output lines with an @.
83
0d2b2ab0
AD
842008-11-04 Akim Demaille <demaille@gostai.com>
85
86 Remove spurious initial empty lines.
87 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
88 * data/yacc.c: End the @output lines with an @.
89
8ba62e3e
JD
902009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
91
92 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
93 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
94 requirements for a correct m4 are stricter.
95 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
96 * configure.ac: Update to use AC_PROG_GNU_M4.
97 Reported by Eric Blake.
98
5bc993d9
JD
992009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
100
101 Help with updating web manual.
102 * HACKING: Incorporate instructions from gnulib/doc/README.
103 * bootstrap.conf (gnulib_modules): Add gendocs.
104
580c075d
JD
1052009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
106
107 Fix strange %define locations for default values.
108 Reported by Akim Demaille at
109 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
110 and discussed again starting at
111 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
112 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
113 because location information is bogus.
114 Use angle brackets to delimit fake file name because square brackets
115 look like underexpanded m4. Choose a better fake file name.
116 Use negative line numbers.
117 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
118 * src/location.c (location_print): If line for a boundary is negative,
119 only print that boundary's file name.
120 * src/location.h: Document that.
121 * tests/skeletons.at (%define Boolean variables: invalid skeleton
122 defaults): Update output.
123
5d3a1ecb
AD
1242008-11-07 Akim Demaille <demaille@gostai.com>
125
126 Locations without columns for command line arguments.
127 * src/location.c (location_print): Don't display negative columns.
128 * src/location.h: Document this.
129
015e86a7
JD
1302009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
131
132 Add reminder about uploading public key to keys.gnupg.net.
133 * HACKING (Release Procedure): Here.
134
c1455bab
AD
1352009-03-31 Akim Demaille <demaille@gostai.com>
136
137 bootstrap: --help to stdout.
138 * bootstrap (usage): Don't send --help to stderr.
139 Use a here doc instead of a long string.
140
2075a82a
AD
1412009-03-31 Akim Demaille <demaille@gostai.com>
142
143 bootstrap: README-hacking no longer exists
144 * bootstrap (checkout_only_file): Set to HACKING.
145
26fccd4d
AD
1462009-03-26 Akim Demaille <demaille@gostai.com>
147
148 doc: merge HACKING and README-hacking.
149 Two files is confusing.
150 Reported by Alexandre Duret-Lutz.
5bc993d9 151
26fccd4d
AD
152 * README-hacking: Merge into...
153 * HACKING (Working from the repository): here.
154
6469c4d7
AD
1552009-03-26 Akim Demaille <demaille@gostai.com>
156
157 doc: update README-hacking.
158 * README-hacking: We now use git and git submodules.
159 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
160
b328890a
AD
1612009-03-26 Akim Demaille <demaille@gostai.com>
162
163 lalr1.cc: avoid GCC 4.3 warnings.
164 GCC 4.3 now warns about "a || b && c" and asks for explicit
165 parentheses.
166 Reported by Alexandre Duret-Lutz.
167 * data/location.cc: Update copyright years.
168 (Position::operator==): Use parens to make precedence explicit.
169 Compare lines and columns first, as they are more likely to be
170 different, and they are faster to compare.
171
f3079439
AD
1722009-03-26 Akim Demaille <demaille@gostai.com>
173
174 gnulib: update.
175 * gnulib: Update to latest.
176 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
177 use +=.
178
8defe11b
AD
1792009-01-08 Akim Demaille <demaille@gostai.com>
180
181 Fix grep portability issues.
182 Grep on Solaris does not support -q.
183 Reported by Summum Bonum.
5bc993d9 184
8defe11b
AD
185 * NEWS: Add a stub for 2.4.2.
186 * THANKS: Add Summum Bonum.
187 * tests/atlocal.in (EGREP): New.
188 (CC, CXX, XSLTPROC): Make it possible to override them via
189 envvars.
190 * tests/java.at: Use $EGREP instead of egrep.
191 Use AT_CHECK's ignore instead of grep's -q.
192
41930e7a
JD
1932008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
194
195 Version 2.4.1.
196 * NEWS: Set version and date.
197 * lib/Makefile.am: Update copyright year.
198 * tests/atlocal.in: Update copyright year.
199
d07932ef
JD
2002008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
201
202 Semicolon feature removal is not about future language support.
203 * NEWS: The semicolon feature is no longer active for newer languages,
204 so don't claim that it causes trouble for them.
205
0364b334
JD
2062008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
207
208 * gnulib: Update submodule to HEAD.
209
876fd835
AD
2102008-12-09 Akim Demaille <demaille@gostai.com>
211
212 Update data/README.
213 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
214
bee1df15
EB
2152008-12-05 Eric Blake <ebb9@byu.net>
216
217 Build testsuite with newer autoconf.
218 * tests/output.at (m4_expand): Don't override in newer autoconf,
219 where the underlying implementation changed.
220 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
221 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
222 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
223 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
224 since some of them contain unbalanced ')'.
225
7e6d1e22
JD
2262008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
227
228 * NEWS: Clarify a little.
229
a957d06c
JD
2302008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
231
232 * NEWS: Update for recent changes.
233
462503f8
JD
2342008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
235
236 Fix unexpanded macros in GLR defines file.
237 Reported by Csaba Raduly at
238 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
239 * THANKS (Csaba Raduly): Add.
240 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
241 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
242 lexer in a separate module that includes the defines file.
243 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
244 source.
245 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
246 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
247 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
248 (AT_DATA_SOURCE_PROLOGUE): New.
249 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
250 (AT_DATA_SOURCE): New.
251 (AT_FULL_COMPILE): New, copied from master branch and extended to
252 support an additional source file.
253
bf151b75
JD
2542008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
255
256 Don't let maintainer-*-check targets force a version update.
257 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
258 handled.
259
f56274a8
DJ
2602008-11-17 Di-an Jan <dianj@freeshell.org>
261
262 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
263 Align menus. Adjust word wrapping. Use node names for menu names.
264 (Examples): Don't abbreviate node names.
265 (LocalWords): Remove abbreviations.
266 (Copying): Make description a sentence.
bf151b75 267 (Java Action Features): Remove period to match the rest of menu.
f56274a8 268
b5775a81
PB
2692008-11-11 Paolo Bonzini <bonzini@gnu.org>
270
271 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
272 * configure.ac: Adjust usage.
273 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
274 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
275 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
276
7ed73f82
JD
2772008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
278
279 Don't add a semicolon to actions for %skeleton or %language.
280 It breaks Java test cases as reported by Akim Demaille.
281 * src/scan-code.l: Implement.
282
4b1ebc49
JD
2832008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
284
285 Clean up %skeleton and %language priority implementation.
286 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
287 remove static qualifier because others will soon need to see it.
288 (language_prio): Likewise.
289 (getargs): Use command_line_prio rather than 0.
290 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
291 enum fields.
292 (skeleton_prio): Extern it.
293 (language_prio): Extern it.
294 * src/parse-gram.y: Use grammar_prio rather than 1.
295
738cde3e
AD
2962008-11-04 Akim Demaille <demaille@gostai.com>
297
298 * NEWS: Mention the trailing semicolon in action.
299
d6fb461d
AD
3002008-11-04 Akim Demaille <demaille@gostai.com>
301
302 Reformat NEWS.
303 * NEWS: Use more outline-mode markup.
304 Suggested by Jim Meyering.
305
14da0cdd
JD
3062008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
307
308 Fix user actions without a trailing semicolon.
309 Reported by Sergei Steshenko at
310 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
311 * THANKS (Sergei Steshenko): Add.
312 * src/scan-code.l (SC_RULE_ACTION): Fix it.
313 * tests/regression.at (Fix user actions without a trailing semicolon):
314 New test case.
315
c9ba9e59
JD
3162008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
317
318 Initiate further development.
319 * NEWS: Create an empty section for new entries.
320 * gnulib: Update submodule to HEAD.
321
bfb40910
JD
3222008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
323
324 * NEWS: Version 2.4.
325
241fda7a
JD
3262008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
327
328 Prepare for next release.
329 * NEWS: Briefly mention changes since 2.3b.
330 * README: Say GNU m4 1.4.6, which we've been requiring in release
331 announcements already, not 1.4.3, which breaks the build.
332
ed4d67dc
JD
3332008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
334
335 Say %language is experimental.
336 We're thinking of extending it's effect on output file naming. See the
337 thread at
338 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
339 * NEWS: Say it's experimental.
340 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
341 recommend it over %skeleton for now.
342 (Bison Options): Likewise.
343 (C++ Bison Interface): Use %skeleton not %language.
344 (Calc++ Parser): Use %skeleton not %language.
345 * src/getargs.c (usage): Say it's experimental.
346
e254a580
DJ
3472008-11-01 Di-an Jan <dianj@freeshell.org>
348 Paolo Bonzini <bonzini@gnu.org>
349
350 Support all Java parser class modifiers.
351 * data/java.m4 (b4_percent_define_get3): New.
352 (b4_final_if, b4_strictfp_if): New.
353 * data/lalr1.java (final, strictfp, extends, implements): Support.
354 * doc/bison.texinfo (final, strictfp, extends, implements): Add
355 documentation.
356 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
357 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
358 (AT_CHECK_JAVA_GREP): New.
359 (Java parser class modifiers): New test.
360 (Java parser class extends and implements): New test.
361
362 Model exception propagation better with throws and lex_throws.
363 * data/java.m4 (b4_list2): New.
364 (throws): Change default.
365 * data/lalr1.java (yyaction): Add throws.
366 (parse): Add lex_throws in addition to throws.
367 * doc/bison.texinfo (throws, lex_throws): Add documentation.
368 * tests/java.at (Java throws specifications): New test.
369
370 Improve documentation for Java parsers.
371 * doc/bison.texinfo (Java Parsers): Add subsections.
372 Don't quote first argument of %define.
373 (Java Bison Interface): Document output files. Move documentation
374 of parser class and merge into Java Parser Interface. Document
375 features that error out. Document directives with no effect.
376 Move note about Javadoc higher.
377 (Java Semantic Values): Explicitly mention stype.
378 Document that generic types cannot be used.
379 (Java Location Values): Use @deftypeivar. Document constructors.
380 Correct return value for toString.
381 (Java Parser Interface): List undocumented constants/fields.
382 Move documentation of fields added by %parse-param closer to list
383 of members. Document that token names are added as fields.
384 Document constructors accurately. Remove error method.
385 (Java Scanner Interface): Move note on %pure-parser to Java Bison
386 Interface. Describe %code lexer and yylex accutately.
387 Remove documentation that does not match the code.
388 (Java Action Features): New.
389 (Java Differences): Add reference. Add item on semantic values.
390 Add note about @{ ... @}. Clarify %% epilogue placement.
391 (Java Declarations Summary): New.
392
393 Fix Java skeleton.
394 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
395 (b4_remove_comma): Quote test argument.
396 (b4_identification): Remove "bison" field.
397 * tests/java.at (Java parser class and package names): New test.
398 (Java %parse-param and %lex-param): New test.
399 (Java stype, position_class and location_class): New test.
400
f259e4e6
PB
4012008-10-31 Di-an Jan <dianj@freeshell.org>
402
403 * data/lalr1.jave: Update copyright years.
404 (YYParser): Correct name of "generated from" file in Javadoc:
405 use b4_file_name instead of @ofile@.
406 (Location constructor): Correct Javadoc parameter name.
407 (yylloc): Add missing opening m4 quote after b4_location_if.
408 This removes a stray [ in the Javadoc of Lexer.getStartPos.
409 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
410 (YYParser constructor): Correct Javadoc parameter name.
411
cae5057f
JD
4122008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
413
414 Always put auxiliary code files in the same dir as other output files.
415 * src/files.c (compute_file_name_parts): When the user specifies
416 --output but not --file-prefix, extract the directory prefix from the
417 file prefix not from the grammar file name. This affects the location
418 of files like location.hh generated by the C++ skeleton. The includes
419 in the other output files require this fix.
420 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
421 for expected output files.
422 (Output files): Add a test for the above.
423
4af432ba
JD
4242008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
425
426 * gnulib: Update submodule to HEAD.
427
e26d4e43
JD
4282008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
429
430 Update copyright year.
431 * src/files.c: Here.
432
c0ee9e21
DJ
4332008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
434
435 Don't overwrite the input file.
436 * src/files.c (output_file_name_check): Fatal error if using input file
437 for output.
438 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
439 argument.
440 (Conflicting output files): Add test.
441
482dc52f
AD
4422008-10-28 Akim Demaille <demaille@gostai.com>
443
444 Space changes.
445 * data/lalr1.cc: Formatting changes.
446
52cbbe84
AD
4472008-10-28 Akim Demaille <demaille@gostai.com>
448
449 Don't define debugging functions when !YYDEBUG.
450 * data/lalr1.cc (debug_stream, set_debug_stream)
451 (debug_level_type, debug_level, set_debug_level): Don't
452 declare them when YYDEBUG is not defined.
453 The implementation are already YYDEBUG-aware.
454
0925d5bf
AD
4552008-10-28 Akim Demaille <demaille@gostai.com>
456
457 Prefer "continue" for empty loop bodies.
458 * etc/bench.pl.in: Use "continue" instead of {}.
459
cf98343c
AD
4602008-10-28 Akim Demaille <demaille@gostai.com>
461
462 Space and comments changes.
463 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
464 * data/c.m4, data/lalr1.cc: Space changes.
465
9f467b7d
AD
4662008-10-28 Akim Demaille <demaille@gostai.com>
467
468 Make gnulib a submodule.
469 * gnulib: New.
470 * .gitmodules (gnulib): New.
471
0f0e1ace
JD
4722008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
473
474 Fix yyerror_range for user-defined location type in C++. Reported by
475 Georg Sauthoff at
476 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
477 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
478 * THANKS (Georg Sauthoff): Add.
479
548e2104
JD
4802008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
481
482 Update several administrative files mainly to facilitate releasing.
483 * HACKING (Administrivia): Make the git-merge-changelog notes more
484 helpful.
485 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
486 (Release Procedure): Update for git and add numerous details that were
487 previously missing.
488 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
489 * maint.mk (announcement): Don't list bison as a bootstrap tool so
490 that announcements don't claim we bootstrapped with whatever bison
491 happened to be in PATH. Add flex as a bootstrap tool.
492 * Makefile.maint: Remove, previously replaced by maint.mk.
493 * Makefile.cfg: Remove, and migrate settings to...
494 * cfg.mk: ... here for the sake of `make announcement'.
495 * bootstrap.conf (gnulib_modules): Add announce-gen.
496 * README: Say GNU Bison instead of just Bison. Suggested by Karl
497 Berry.
498
ddf17a6e
PB
4992008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
500
501 Small but important bugfixes for the Java skeleton.
502 * data/lalr1.java (yyerror): Change Location to b4_location_type.
503 (yy_symbol_print): Call toString on yyvaluep.
504
e1145ad8
AD
5052008-08-29 Akim Demaille <demaille@gostai.com>
506
507 Clarify UPDATED use.
bee1df15 508 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 509 not to the release date of Bison.
bee1df15 510 Reported by Joel E. Denny.
e1145ad8 511
0df72d78
AD
5122008-08-29 Akim Demaille <demaille@gostai.com>
513
514 * README: Update FAQ pointer.
515 Reported by Joel E. Denny.
516
9a90b6bb
EB
5172008-08-27 Eric Blake <ebb9@byu.net>
518
519 Resync m4sugar from autoconf.
520 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
521 (m4_init): Adjust to latest m4.git changes.
522 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
523 effects.
524 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
525 (_m4_list_cmp): Reduce side effects.
526
65015668
AD
5272008-08-27 Akim Demaille <demaille@gostai.com>
528
529 Check yyerrok in calc.at.
bee1df15
EB
530 * tests/calc.at (calc.y): Use yyerrok on "( error )".
531 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
532 expected.
65015668 533
98e26a92
AD
5342008-08-27 Akim Demaille <demaille@gostai.com>
535
536 Support yyerrok in lalr1.cc.
537 YYBACKUP is still to import back into lalr1.cc.
bee1df15 538 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 539
86c0e784
JD
5402008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
541
542 For maintainer-check*, don't recompile for a $(VERSION) update.
543 * cfg.mk: New file.
544 (_is-dist-target): Override the one in GNUmakefile.
545 * Makefile.am (EXTRA_DIST): Add cfg.mk.
546
88511166
JD
5472008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
548
549 Update for recent change to gnulib.
550 * src/parse-gram.y: Don't include strverscmp.h. It comes from
551 string.h now.
552
6bbb2ed5
EB
5532008-08-15 Eric Blake <ebb9@byu.net>
554
d67c52e8
EB
555 Remaining m4sugar merge from autoconf.
556 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
557 * data/m4sugar/foreach.m4: New file, copied from autoconf.
558 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
559 * src/output.c (output_skeleton): Tell m4 how to find it.
560
6bbb2ed5
EB
561 Partial m4sugar merge from autoconf: m4_map.
562 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
563 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
564 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
565 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
566 for empty list.
567 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
568 Likewise.
569 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
570 declares it.
571
8dce3875
JD
5722008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
573
574 Keep .version and PACKAGE_VERSION in sync.
575 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
576 dependency, and add comments justifying this in more detail. Discussed
577 starting at
578 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
579
882a1fbf
EB
5802008-08-06 Eric Blake <ebb9@byu.net>
581
a3764451
EB
582 Partial m4sugar merge from autoconf: m4_shiftn.
583 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
584 (m4_shift2, m4_shift3): New macros.
585 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
586 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
587 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
588 * data/java.m4 (b4_remove_comma): Likewise.
589
882a1fbf
EB
590 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
591 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
592 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
593 (m4_init): Consolidate wrapped text into single m4_wrap.
594 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
595 in wrapped text.
596
a30e920d
EB
5972008-08-05 Eric Blake <ebb9@byu.net>
598
dfcc5959
EB
599 Partial m4sugar merge from autoconf: builtins, version.m4.
600 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
601 (m4_prepend): Remove, as it is unused and inherently quadratic,
602 whereas m4_append is linear in newer m4.
603 (m4_mkstemp): New builtin.
604 (m4_symbols): Make rename conditional.
605 (m4_version_prereq): Ensure fatal error if used in bison, which
606 intentionally lacks version.m4.
607
a30e920d
EB
608 Fix comments in m4sugar.
609 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
610
445b7470
JD
6112008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
612
613 Update for recent .gitignore fix in Gnulib.
614 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
615 anchored .gitignore entries.
616
a1e50014
JD
6172008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
618
619 Set gnu or gnits strictness.
620 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
621 development and gnits strictness for releases. Based on Eric Blake's
622 suggestion at
623 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
624
d43f77e7
PB
6252008-07-31 Paolo Bonzini <bonzini@gnu.org>
626
627 * NEWS: Clarify documentation of %language.
628
fee2ed87
PB
6292008-07-31 Paolo Bonzini <bonzini@gnu.org>
630
631 Support usage of git-merge-changelog.
632 * .gitattributes: New.
633 * HACKING: Document usage of git-merge-changelog.
634 * bootstrap: Install git-merge-changelog entries in .git/config
635 if appropriate.
636
78029cd5
JD
6372008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
638
639 Remove remaining dependence on CVS Id keyword.
640 * ChangeLog: For the sake of people still using CVS, don't use dollars
641 when mentioning Id.
642 * data/xslt/bison.xsl: Remove Id from header comments, where it was
643 unusual anyway.
644 * data/xslt/xml2dot.xsl: Likewise.
645 * data/xslt/xml2text.xsl: Likewise.
646 * data/xslt/xml2xhtml.xsl: Likewise.
647 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
648 * doc/Makefile.am (neutralize): Remove, no longer needed.
649 (.x.1): Don't use neutralize.
650 (edit): Don't substitute for ID.
651 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
652
c53d18b1
JD
6532008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
654
655 Fix dependence on computed configure variables.
656 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
657 $(top_srcdir)/configure.ac so that changes to computed variables, such
658 as PACKAGE_VERSION, are seen.
659 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
660
5523ac79
JD
6612008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
662
663 Update copyright dates for recent changes.
664 * Makefile.am: Here.
665 * src/Makefile.am: Here.
666 * src/reduce.c: Here.
667 * tests/reduce.at: Here.
668
8fa36911
JD
6692008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
670
671 Use git-version-gen for version names between releases.
672 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
673 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
674 * .prev-version: New.
675 * .version.in: Remove.
78029cd5 676 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
677 revision.
678 * GNUmakefile: Remove, now copied from Gnulib.
679 * Makefile.am: Add code suggested by comments in
680 build-aux/git-version-gen.
681 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
682 .prev-version, and .version.
683 * NEWS (2.3b+): Rename to...
684 (?.?): ... this because we're dropping the "+" version naming scheme,
685 but, in general, we still can't be sure of our next release name.
686 * bootstrap: Add a quick hack to remove from .gitignore the
687 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
688 entry. This should really be fixed in gnulib instead.
689 * bootstrap.conf (gnulib_modules): Add gnumakefile.
690 * configure.ac (AC_INIT): Set version name by invoking
691 build-aux/git-version-gen.
692 (AC_CONFIG_FILES): Remove .version, now generated by
693 build-aux/git-version-gen.
694 * maint.mk: New, copied from coreutils.
695 * doc/.cvsignore (bison.1): Add.
696 * doc/.gitignore (/bison.1): Add.
697 * doc/bison.1: Remove, generated.
698 * src/.cvsignore (revision.c): Remove.
699 * src/.gitignore (/revision.c): Remove.
700 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
701 (BUILT_SOURCES): Remove revision.c.
702 (revision.c): Remove.
703 * src/getargs.c (version): Don't print revision after the VERSION.
704 * src/revision.h: Remove.
705
bcf07cb7
JD
7062008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
707
708 Fix untranslatable composition of sentences. Reported by Goran
709 Uddeborg at
710 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
711 * THANKS (Goran Uddeborg): Add.
712 * src/reduce.c (reduce_print): Report the number of nonterminals and
713 rules useless in the grammar in separate sentences.
714 * tests/reduce.at (Useless Rules): Update output.
715 (Reduced Automaton): Likewise.
716 (Underivable Rules): Likewise.
717 (Empty Language): Likewise.
718
9aacab9a
JD
7192008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
720
721 Fix some .gitignore and .cvsignore problems.
722 * bootstrap (insert_sorted_if_absent): Replace all uses with...
723 (insert_vc_ignore): ... this new function, which prepends `/' to all
724 .gitignore entries before passing them to insert_sorted_if_absent.
725 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
726 .cvsignore files are maintained even though Bison developers run
727 bootstrap while using Git.
728 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
729 unneeded by Bison.
730 (gnulib): Add.
731 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
732 unneeded. Reported by Eric Blake.
733 * lib/.gitignore (/*~): Add.
734 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
735 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
736 Blake.
737 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
738
a9fc7990
JD
7392008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
740
741 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
742 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
743 * bootstrap.conf (gnulib_modules): Add unsetenv.
744 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
745 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
746 (/setenv.m4): Add.
747 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
748 the first argument because it may become position-dependent, and unset
749 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
750 Add comments explaining these issues in more detail.
751
0f1d6f10
JD
7522008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
753
754 Add .gitignore everywhere based on .cvsignore.
755 * .gitignore: New.
756 * build-aux/.gitignore: New.
757 * data/.gitignore: New.
758 * doc/.gitignore: New.
759 * etc/.gitignore: New.
760 * examples/.gitignore: New.
761 * examples/calc++/.gitignore: New.
762 * lib/.gitignore: New.
763 * m4/.gitignore: New.
764 * po/.gitignore: New.
765 * runtime-po/.gitignore: New.
766 * src/.gitignore: New.
767 * tests/.gitignore: New.
768
7bd1665a
JD
7692008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
770
771 * NEWS (2.3b+): New section, empty for now.
772 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
773
72c5b982
JD
7742008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
775
776 * NEWS (2.3b): Update release date since there has been a delay in
777 getting the announcements and tarballs out.
778
bd02cd5d
JD
7792008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
780
781 * NEWS: Version 2.3b.
782 * configure.ac (AC_INIT): Likewise.
783 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
784
9126263e
JD
7852008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
786
787 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
788 been doing it for years.
789 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
790 (Release Procedure): Add FIXME about make alpha being unmaintained.
791
fa6aa7b3
JD
7922008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
793
794 * data/yacc.c: Reformat m4 a little for readability.
795 * src/lalr.c (build_relations): Correct comment.
796
d30b312d
JMG
7972008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
798
799 DJGPP specific issue.
800 * djgpp/config.sed: Fixes required to run configure scripts generated
801 by autoconf 2.62.
802
138d4cd9
JD
8032008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
804
805 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
806 coordinator@translationproject.org.
807
8f7e2e1f
JD
8082008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
809
810 * THANKS: Add Eric Blake.
811
f55efa38
JD
8122008-04-23 Eric Blake <ebb9@byu.net>
813
814 Revert prior patch, by working around autoconf regression.
815 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
816 ("Output file name: ("): Uncomment test.
817 ("Output file name: )"): Likewise.
818 Based on an idea from Noah Misch.
819
096c9f9d
JD
8202008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
821
822 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
823 2.61. Reported by Juan Manuel Guerrero at
824 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
825 * tests/output.at ("Output file name: ("): Comment out test case for
826 now.
827 ("Output file name: )"): Likewise.
828
0f664b89
JD
8292008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
830
831 * GNUmakefile: Update git-version-gen invocation so make dist
832 succeeds.
833
1cfe6375
JD
8342008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
835
836 Update to the current gnulib CVS repository, and fix trigraph handling
837 in Bison.
838 * bootstrap: Update gnulib CVS repository URL.
839 (symlink_to_dir): Encapsulate the code that guarantees the destination
840 directory exists into...
841 (check_dst_dir): ... this new function, and...
842 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
843 fail when copying files into lib/uniwidth/.
844 * src/output.c (prepare_symbols): When writing yytname muscles, where
845 symbol names will be encoded in C-string literals, tell quotearg to
846 escape trigraphs. This used to be the default in gnulib.
847 * tests/regression.at (Token definitions): Because of the change in
848 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
849 escapes trigraphs in symbol names. Thus, yytname no longer has
850 trigraphs unnecessarily doubly escaped. Update test case output.
851 Extend test case to be sure Bison's own error messages will no longer
852 have trigraphs in symbol names unnecessarily escaped once.
853
74c52fc8
JD
8542008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
855
856 Fix make dist infinite loop reported by Juan Manuel Guerrero at
857 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
858 * .cvsignore: Add .version.
859 * .version.in: New.
860 * bootstrap.conf (gnulib_modules): Add git-version-gen.
861 * configure.ac (AC_CONFIG_FILES): Add .version.
862 * build-aux/.cvsignore: Add git-version-gen.
863
8e55b3aa
JD
8642008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
865
866 * NEWS (2.3a+): Mention that -g now takes an argument.
867 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
868 consistency. Update the -g and -x entries now that they take
869 arguments. Use brackets to indicate optional arguments.
870 * src/getargs.c (usage): Explain the relationship between arguments of
871 long and short options more completely. Document --defines and -d
872 separately since the former takes an argument but, for POSIX Yacc, the
873 latter does not.
874 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 875 (getargs): Sort cases.
8e55b3aa 876
59c5ac72
AD
8772008-02-28 Akim Demaille <demaille@gostai.com>
878
879 * doc/bison.texinfo: Fix a few typos.
880
118d4978
AD
8812008-02-28 Akim Demaille <akim@epita.fr>
882
883 * doc/bison.texinfo (Bison Options): Document -W.
884 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
885
7020f1e9
AD
8862008-02-28 Akim Demaille <akim@epita.fr>
887
888 * src/getargs.c (short_options): Split and sort for readability.
889 -g and -x take optional arguments, just like their long options.
890 * build-aux/cross-options.pl: Use /x to make the regexp easier to
891 understand.
892 Fix the handling of $opt which resulted in all the argument to be
893 considered as optional.
894
59da312b
JD
8952008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
896
897 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
898 say its interface is experimental.
899 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
900 Java.
901 (Bison Options): In the -L and --language entry, mention Java.
902 (Java Bison Interface): Say the interface is experimental.
903 * src/getargs.c (usage): Mention -L and --language.
904
905 * NEWS (2.3a+): Say the push parsing interface is experimental.
906 * doc/bison.texinfo (Push Decl): Likewise.
907 (Decl Summary): Likewise in the "%define api.push_pull" entry.
908 (Push Parser Function): Likewise.
909 (Pull Parser Function): Likewise.
910 (Parser Create Function): Likewise.
911 (Parser Delete Function): Likewise.
912 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
913 yypull_parse, and yypush_parse entries.
914
915 * NEWS (2.3a+): Mention XML support, and say the schema is
916 experimental.
917 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
918 * src/getargs.c (usage): Say the XML schema is experimental.
919
920 * NEWS (2.3a+): Say option instead of flag.
921
2bb3ebec
WP
9222008-02-21 Wojciech Polak <polak@gnu.org>
923
924 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
925 text.
926
333e670c
JD
9272008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
928
929 Fix impure push parser compile error reported by Bob Rossi at
930 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
931 * data/yacc.c: Clean up whitespace in the output a little.
932 (yypstate_allocated): Define for impure push parsers regardless of
933 whether the pull interface is also requested.
934 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
935 check impure push parsers without the pull interface.
936
937 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
938 yyerror takes arguments specified by %parse-param while yypstate_new
939 does not.
940 * doc/bison.texinfo (Parser Create Function): Document that
941 yypstate_new returns 0 for multiple impure parser instances.
942 * tests/push.at (Push Parsing: Multiple impure instances): Update
943 expected stderr output.
944
798096e1
JD
9452008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
946
947 * runtime-po/POTFILES.in (push.c): Remove.
948
9ca7f077
JD
9492008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
950
951 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
952 * data/push.c: Rename to...
953 * data/yacc.c: ... this, overwriting it.
954 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
955 `%push-pull-parser' -> `%define api.push_pull "both"'.
956 Remove old yacc.c tests, and update push.c tests to yacc.c.
957
42ee26bb
JD
9582008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
959
960 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
961 `"%code top" blocks' instead of `%code "top" blocks'.
962 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
963 Clean up whitespace in the output a little.
964
b1cc23c4
JD
9652008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
966
967 Fix documentation problems reported by Tim Josling at
968 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
969 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
970 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
971 integers. Explain the effect of literal string aliases on error
972 messages. Copy token 0 documentation from the C++ skeleton
973 documentation.
974
ab7f29f8
JD
9752008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
976
977 Accept a token number in a %left, %right, or %nonassoc for POSIX
978 conformance. Reported by Tim Josling at
979 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
980 * NEWS (2.3a+): Mention.
981 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
982 and code numbers are treated by precedence declarations.
983 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
984 of symbols.1.
985 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
986 of symbol.
987 (symbol.prec): New, just like symbol but allows INT.
988 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
989 longer holds.
990 * tests/regression.at (Token number in precedence declaration): New
991 test case.
992
a924ef36
JMG
9932008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
994
995 DJGPP specific issues.
996 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
997 be changed. Copyright timestamp adjusted.
998 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
999 be changed. Copyright timestamp adjusted.
1000 * djgpp/config.site: Copyright timestamp adjusted.
1001 * djgpp/config_h.sed: Copyright timestamp adjusted.
1002 * djgpp/djunpack.bat: Copyright timestamp adjusted.
1003 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
1004 filename translation list.
1005 * djgpp/subpipe.c (init_subpipe): Check the environment variables
1006 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
1007 files shall be created. Before trying to use the temp dir where the
1008 environment variable points to check that the dir really exists. If
1009 not default to the cwd as temp dir. Copyright timestamp adjusted.
1010 * djgpp/subpipe.h: Copyright timestamp adjusted.
1011 * djgpp/testsuite.sed: Copyright timestamp adjusted.
1012
389c8cfd
PE
10132008-01-30 Paul Eggert <eggert@cs.ucla.edu>
1014
1015 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
1016
5d1cfef4
PE
10172008-01-09 Paul Eggert <eggert@cs.ucla.edu>
1018
1019 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
1020 Problem reported by Claudio Saavedra in
1021 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
1022
e2dcf996
WP
10232008-01-05 Wojciech Polak <polak@gnu.org>
1024
1025 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
1026 document's title with the input grammar file name.
1027
da730230
JD
10282007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
1029
1030 Automate regression testing of the XML/XSLT implementation. Discussed
1031 starting at
1032 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
1033 * configure.ac (XSLTPROC): New substitution.
1034 * Makefile.am (maintainer-xml-check): New phony target invoking...
1035 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
1036 invoking make maintainer-check with BISON_TEST_XML=1.
1037 * tests/atlocal.in (XSLTPROC): New.
1038 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
1039 not to report reachable memory when Bison is expected to have a
1040 non-zero exit status and (2) to compare XML/XSLT output with --graph
1041 and --report=all output for every working grammar when
1042 BISON_TEST_XML=1.
1043 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
1044 (AT_BISON_CHECK_XML): New.
1045 (AT_QUELL_VALGRIND): New.
1046 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
1047 (AT_CHECK): ... don't redefine this since this was the old way to
1048 quell Valgrind.
1049 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
1050 AT_BISON_CHECK invocations.
1051 * tests/c++.at: Likewise.
1052 * tests/calc.at: Likewise.
1053 * tests/conflicts.at: Likewise.
1054 * tests/cxx-type.at: Likewise.
1055 * tests/existing.at: Likewise.
1056 * tests/glr-regression.at: Likewise.
1057 * tests/headers.at: Likewise.
1058 * tests/input.at: Likewise.
1059 * tests/java.at: Likewise.
1060 * tests/output.at: Likewise.
1061 * tests/push.at: Likewise.
1062 * tests/reduce.at: Likewise.
1063 * tests/regression.at: Likewise.
1064 * tests/sets.at: Likewise.
1065 * tests/skeletons.at: Likewise.
1066 * tests/synclines.at: Likewise.
1067 * tests/torture.at: Likewise.
1068 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
1069 tends to hang xsltproc.
1070 (Big horizontal): Likewise.
1071
408476bc
JD
10722007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1073
1074 In XML output, remove redundant class attribute on symbol element.
1075 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
1076 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
1077 look up a symbol to determine whether it's a nonterminal or terminal.
1078 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
1079 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
1080
1081 Add prec/assoc information to XML output.
1082 * src/gram.c (grammar_rules_print_xml): For each rule that has a
1083 %prec, add a percent_prec attribute.
1084 * src/print-xml.c (print_grammar): For each terminal that has a
1085 precedence or associativity, add a prec or assoc attribute.
1086 (xml_indent): New.
1087 (xml_puts): Use xml_indent.
1088 (xml_printf): Use xml_indent.
1089 * src/print-xml.h (xml_indent): Prototype.
1090
1091 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
1092 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
1093
d4a26c48
JD
10942007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1095
1096 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
1097 (bison:ruleByNumber): ... this for clarity.
1098 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
1099 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
1100 (xsl:template match="reduction"): Update.
1101 (xsl:template match="item"): Update.
1102 (xsl:template match="reduction"): Update.
1103
1104 In the XML output, don't print the list of rules where symbols appear.
1105 Compute it in XSLT instead. Discussed at
1106 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
1107 * data/xslt/bison.xsl (bison:ruleByLhs): New.
1108 (bison:ruleByRhs): New.
1109 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
1110 bison:ruleByRhs.
1111 (xsl:template match="terminal/rule"): Remove.
1112 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1113 bison:ruleByRhs.
1114 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1115 Remove.
1116 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
1117 bison:ruleByRhs and mode="number-link" for rule template.
1118 (xsl:template match="terminal/rule"): Remove.
1119 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1120 bison:ruleByRhs and mode="number-link" for rule template.
1121 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1122 Rewrite as...
1123 (xsl:template match="rule" mode="number-link"): ... this.
1124 * src/print-xml.c (print_grammar): Don't print the list of rules.
1125
ef1b4273
JD
11262007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
1127
1128 Don't let --report affect XML output; always print all information.
1129 Discussed at
1130 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
1131 * src/conflicts.c (log_resolution): Implement.
1132 * src/print-xml.c (print_core): Implement.
1133 (print_state): Implement.
1134 (print_xml): Implement.
1135
1136 * NEWS (2.3a+): Fix quotes.
1137 * src/parse-gram.y (prologue_declaration): For consistency with -v,
1138 don't let %verbose clear the list specified by --report.
1139
0f6cd9e3
AD
11402007-11-26 Akim Demaille <akim@epita.fr>
1141
1142 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
1143
d80fb37a
JD
11442007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
1145
1146 In the XML output, list useless and unused symbols and rules with the
1147 useful ones and add a "usefulness" attribute. Discussed starting at
1148 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
1149 * src/gram.c (grammar_rules_partial_print_xml): Remove.
1150 (grammar_rules_print_xml): Print all rules instead of just those
1151 useful in the grammar, and add a "usefulness" attribute.
1152 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
1153 * src/print-xml.c (print_rules_useless_in_parser): Remove.
1154 (print_grammar): Print all nonterminals instead of just useful ones,
1155 and add a "usefulness" attribute to nonterminals and terminals.
1156 (print_xml): Don't print a separate "reductions" or
1157 "rules-useless-in-parser" element.
1158 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
1159 (reduce_xml): Remove.
1160 (reduce_token_unused_in_grammar): New.
1161 (reduce_nonterminal_useless_in_grammar): New.
1162 * src/reduce.h (reduce_xml): Remove prototype.
1163 (reduce_token_unused_in_grammar): Add prototype.
1164 (reduce_nonterminal_useless_in_grammar): Add prototype.
1165 * data/xslt/xml2text.xsl: Update for XML changes.
1166 * data/xslt/xml2xhtml.xsl: Update for XML changes.
1167 * tests/reduce.at (Useless Terminals): Update output.
1168 (Useless Rules): Update output.
1169 (Reduced Automaton): Update output.
1170
1171 Say "Terminals unused in grammar" instead of "Unused terminals".
1172 * NEWS (2.3a+): Update.
1173 * doc/bison.texinfo (Understanding): Update example output.
1174 * src/reduce.c (reduce_output): Implement.
1175 * data/xslt/xml2text.xsl: Implement.
1176 * data/xslt/xml2xhtml.xsl: Implement.
1177
1bb2bd75
JD
11782007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1179
1180 Accept --report-file=FILE to override the default `.output' filename.
1181 * NEWS (2.3a+): Mention.
1182 * doc/bison.texinfo (Bison Options): Add an entry.
1183 * src/files.c (compute_output_file_names): Don't override
1184 spec_verbose_file if already set.
1185 * src/getargs.c (usage): Document --report-file.
1186 (REPORT_FILE_OPTION): New anonymous enum member.
1187 (long_options): Add entry for it.
1188 (getargs): Add case for it setting spec_verbose_file.
1189
1190 * build-aux/cross-options.pl: Don't record a short option just because
1191 there's an arg.
1192 * doc/.cvsignore: Add yacc.1.
1193
a005a9c4
AD
11942007-11-14 Akim Demaille <akim@epita.fr>
1195
1196 * doc/yacc.1.in: New.
1197 * configure.ac, doc/Makefile.am: Adjust.
1198 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
1199 config.h symbol.
1200 Use AC_SUBST for assignments too.
1201 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
1202
cff03fb2
JD
12032007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1204
1205 * src/gram.c: Remove comments that duplicate comments in gram.h.
1206
1207 When reporting useless rules and nonterminals, say "useless in grammar"
1208 instead of "useless", and say "useless in parser" instead of "never
1209 reduced". Discussed starting at
1210 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
1211 * NEWS (2.3a+): Mention this change.
1212 * data/xslt/xml2text.xsl: Update output text and expected input XML
1213 element names to match changes below.
1214 * data/xslt/xml2xhtml.xsl: Likewise.
1215 (xsl:template match="bison-xml-report"): Add missing entry in Table of
1216 Contents: "Rules useless in parser due to conflicts".
1217 * doc/bison.texinfo (Decl Summary): Reword a little.
1218 (Understanding): Update example output for changes below.
1219 * src/gram.c: (rule_useful_p): Rename to...
1220 (rule_useful_in_grammar_p): ... this.
1221 (rule_useless_p): Rename to...
1222 (rule_useless_in_grammar_p): ... this.
1223 (rule_never_reduced_p): Rename to...
1224 (rule_useless_in_parser_p): ... this.
1225 (grammar_rules_print): Update for renames.
1226 (grammar_rules_print_xml): Update for renames.
1227 (grammar_rules_never_reduced_report): Rename to...
1228 (grammar_rules_useless_report): ... this since it is used for either
1229 kind of useless rule.
1230 * src/gram.h: Reword comments and update function names in prototypes.
1231 * src/main.c (main): Say "rule useless in parser due to conflicts".
1232 * src/print-xml.c (print_rules_never_reduced): Rename to...
1233 (print_rules_useless_in_parser): ... this, and rename output XML
1234 element "rules-never-reduced" to "rules-useless-in-parser".
1235 (print_xml): Update for rename.
1236 * src/print.c (print_results): Say "Rules useless in parser due to
1237 conflicts".
1238 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
1239 (nonterminals_reduce): Say "nonterminal useless in grammar".
1240 (reduce_output): Say "Nonterminals useless in grammar".
1241 Say "Rules useless in grammar".
1242 (reduce_xml): Rename output XML element "useless" to
1243 "useless-in-grammar".
1244 (reduce_print): Don't report the count of grammatically useless rules
1245 as "rules never reduced" just because %yacc is specified.
1246 In the correct report of this count, say nonterminal(s) and rule(s)
1247 "useless in grammar".
1248 * tests/conflicts.at (S/R in initial): Update expected output.
1249 (Defaulted Conflicted Reduction): Likewise.
1250 (Unreachable States After Conflict Resolution): Likewise.
1251 * tests/existing.at (GNU pic Grammar): Likewise.
1252 * tests/reduce.at (Useless Nonterminals): Likewise.
1253 (Useless Rules): Likewise.
1254 (Reduced Automaton): Likewise.
1255 (Underivable Rules): Likewise.
1256 (Empty Language): Likewise.
1257
66f0441d
JD
12582007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
1259
1260 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
1261 here document and before the EOF so that BSD's implementation of Bourne
1262 shell doesn't parse the delimiter as part of the here document.
1263 * doc/.cvsignore: Add cross-options.texi.
1264 * src/getargs.c (usage): Add a blank line after the warning categories.
1265
d0ee4105
PB
12662007-11-08 Paolo Bonzini <bonzini@gnu.org>
1267
1268 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
1269
e8b1fb9b
AD
12702007-11-05 Akim Demaille <akim@epita.fr>
1271
1272 Remove Id: from bison.1.
1273 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
1274 (perl -0777 -pi -e 's/\.PP\nId): New.
1275 (.x.1): Use it to ignore the version control revision.
1276
2f7a96b5
AD
12772007-11-05 Akim Demaille <demaille@gostai.com>
1278
1279 * build-aux/Makefile.am: Ship cross-options.pl.
1280 * doc/Makefile.am: Always refer to cross-options.texi with
1281 $(srcdir).
1282 (MAINTAINERCLEANFILES): Add it.
1283
f4101aa6
AD
12842007-11-04 Akim Demaille <demaille@gostai.com>
1285
1286 Generate the long/short option cross-table.
1287 * build-aux/cross-options.pl: New.
1288 * doc/Makefile.am (cross-options.texi): New.
1289 * doc/bison.texinfo: Use it.
1290
727a1401
AD
12912007-11-04 Akim Demaille <demaille@gostai.com>
1292
1293 Generate bison.1 using help2man.
1294 * doc/common.x, doc/bison.x: New.
1295 * doc/Makefile.am (bison.1, .x.1): New.
1296 The code is taken from autoconf-2.61/man/Makefile.am.
1297 * configure.ac: Look for help2man.
1298
6aeb9c57
AD
12992007-11-04 Akim Demaille <demaille@gostai.com>
1300
1301 Complete --help.
1302 * src/getargs.c (usage): Document -W, make it clear that -d,
1303 -g and -x have optional arguments.
1304
d7be4085
AD
13052007-11-04 Akim Demaille <demaille@gostai.com>
1306
1307 Find sha1sum when named gsha1sum.
1308 * bootstrap (find_tool): New.
1309 ($SHA1SUM): New.
1310
d9df47b6
JD
13112007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1312
1313 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
1314 at
1315 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
1316 * NEWS (2.3a+): Mention.
1317 * data/bison.m4 (b4_pure_if): Don't define it here.
1318 * data/c.m4 (b4_identification): Depend on individual skeletons to
1319 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
1320 values of the %define variables api.pure or api.push_pull. Define
1321 YYPURE, YYPUSH, and YYPULL accordingly.
1322 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
1323 glr.cc has already defined b4_pure_flag.
1324 * data/push.c: Define b4_pure_if based on `%define api.pure'.
1325 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 1326 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
1327 * doc/bison.texinfo (Pure Decl): Update.
1328 (Push Decl): Update.
1329 (Decl Summary): Add api.pure to %define entry.
1330 In %pure-parser entry, say it's deprecated and reference %define.
1331 (Pure Calling): Update.
1332 (Error Reporting): Update.
1333 (C++ Scanner Interface): Update.
1334 (How Can I Reset the Parser): Update.
1335 (Table of Symbols): In %pure-parser entry, say it's deprecated and
1336 reference %define.
1337 * src/getargs.c (pure_parser): Remove global variable.
1338 * src/getargs.h (pure_parser): Remove extern.
1339 * src/output.c (prepare): Don't define pure_flag muscle.
1340 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
1341 wrapper around `%define api.pure'.
1342 * tests/calc.at (Simple LALR Calculator): Update.
1343 (Simple GLR Calculator): Update.
1344 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
1345 Update.
1346 (GLR: Resolve ambiguity, pure, locations): Update.
1347 (GLR: Merge conflicting parses, pure, no locations): Update.
1348 (GLR: Merge conflicting parses, pure, locations): Update.
1349 * tests/glr-regression.at (Uninitialized location when reporting
1350 ambiguity): Update
1351 * tests/input.at (Unused %define api.pure): New test case.
1352 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
1353 AT_PURE_IF and AT_PURE_AND_LOC_IF.
1354 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
1355
c373bf8b
JD
13562007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1357
1358 %define push_pull -> %define api.push_pull. Discussed starting at
1359 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
1360 * data/push.c: Expect the new name.
1361 * data/yacc.c: Likewise.
1362 * doc/bison.texinfo (Push Decl): Update.
1363 (Decl Summary): Update %define entry.
1364 (Push Parser Function): Update.
1365 (Pull Parser Function): Update.
1366 (Parser Create Function): Update.
1367 (Parser Delete Function): Update.
1368 * tests/calc.at (Simple LALR Calculator): Update.
1369 * tests/input.at (%define enum variables): Update.
1370 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
1371 (Push Parsing: Multiple impure instances): Update.
1372 (Push Parsing: Unsupported Skeletons): Update.
1373 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
1374 (Exploding the Stack Size with Malloc): Update.
1375
1376 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
1377 other entries some.
1378
32f19b6b
JD
13792007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
1380
1381 For the XML output's terminal element, rename @number to @token-number,
1382 and add @symbol-number. In the nonterminal element, rename @number to
1383 @symbol-number. Discussed starting at
1384 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
1385 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
1386 renames.
1387 (xsl:template match="nonterminal"): Likewise.
1388 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
1389 (xsl:template match="nonterminal"): Likewise.
1390 * src/print-xml.c (print_grammar): Implement.
1391
255a6b90
JD
13922007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1393
1394 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
1395 2007-10-11 change, the child elements here are items not rules.
408476bc 1396 (xsl:template match="item"): New.
255a6b90
JD
1397 (xsl:template match="rule"): Update for new reduced itemset.
1398 (xsl:template match="point"): Remove.
1399 (xsl:template match="empty"): For consistency with --graph, don't
1400 output "/* empty */".
1401 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
1402 line-wrap, don't pass a negative value as first-line-length since this
1403 won't work with the following changes.
1404 (xsl:template name="line-wrap"): Simplify slightly.
1405 (xsl:template name="ws-search"): Eliminate recursion.
1406 * src/print_graph.c (print_core): Don't print a reduction's lookahead
1407 set next to an item whose dot is not at the end of the RHS even if it
1408 happens to be associated with the same rule.
1409
88c78747
JD
14102007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
1411
31984206
JD
1412 Add %define lr.keep_unreachable_states.
1413 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
1414 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
1415 * src/main.c (main): Implement it.
1416 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1417 Extend to test it, and fix a typo.
1418
14192007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
1420
1421 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
1422 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
1423 the example .output text.
1424 * tests/regression.at (Extra lookahead sets in report): Improve wording
1425 of comments.
1426
b7a70162
WP
14272007-10-17 Wojciech Polak <polak@gnu.org>
1428
1429 * src/print-xml.c (print_grammar): Renamed
1430 <terminal> and <nonterminal> attributes:
1431 "type" to "number" and "symbol" to "name".
1432 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
1433 Use new attribute names.
1434 (xsl:template match="nonterminal"): Likewise.
1435 * data/xslt/xml2xhtml.xsl: Likewise.
1436
a0de5091
JD
14372007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
1438
1439 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
1440 (Option Cross Key): Likewise.
1441
1442 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
1443 next to an item whose dot is not at the end of the RHS even if it
1444 happens to be associated with the same rule.
1445 * src/print.c (print_core): Likewise.
1446 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
1447 (Resolved SR Conflicts): Update output.
1448 * tests/regression.at (Extra lookahead sets in report): New test case.
1449
4c20d18d
WP
14502007-10-11 Wojciech Polak <polak@gnu.org>
1451
1452 * src/print-xml.c (print_core): Remove item set
1453 redundancy.
1454 * data/xslt/bison.xsl (bison:ruleNumber): New key.
1455 Improve processing time. Suggested by Joel E. Denny.
1456 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
1457 Write xsl:param "required" attribute as comment.
1458 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
1459 (xsl:template match="rule"): Support new reduced itemset.
1460 (xsl:template match="point"): Remove.
1461 * data/xslt/xml2xhtml.xsl: Likewise.
1462
f506ad1c
JD
14632007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
1464
1465 * src/getargs.c (version): Update copyright year.
1466
21f1b063
JD
14672007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
1468
1469 Make xml2dot.xsl and --graph produce the same output.
1470 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
1471 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
1472 escaped later.
1473 (xsl:template name="output-node"): Use the new escape template instead
1474 of the string-replace template directly.
1475 (xsl:template name="output-edge"): Likewise.
1476 (xsl:template name="escape"): New, escapes backslashes and newlines in
1477 addition to quotation marks.
1478 * src/graphviz.c (start_graph, output_node, output_edge): Add
1479 whitespace to output for legibility.
1480
1481 Make xml2text.xsl and --report produce the same output, and remove the
1482 XML "conflicts" element since a conflict summary is easily extracted
1483 from the automaton.
1484 * data/xslt/bison.xsl: New.
1485 (xsl:template match="state" mode="bison:count-conflicts): New.
1486 * data/xslt/xml2text.xsl: Import bison.xsl.
1487 (xsl:template match="bison-xml-report"): Instead of styling the
1488 "conflicts" element, style the "automaton" element with mode
1489 "conflicts". Unlike the former, the latter lists S/R and R/R
1490 conflicts for a state on the same line.
1491 (xsl:template match="conflicts"): Remove.
1492 (xsl:template match="conflict"): Remove.
1493 (xsl:template match="terminal"): Line-wrap the list of rules in which
1494 the terminal is used.
1495 (xsl:template match="nonterminal"): Likewise for nonterminals.
1496 (xsl:template match="automaton" mode="conflicts"): New.
1497 (xsl:template match="state" mode="conflicts"): New.
1498 (xsl:template name="line-wrap"): New.
1499 (xsl:template name="ws-search"): New.
1500 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
1501 (xsl:template match="bison-xml-report"): Instead of styling the
1502 "conflicts" element, style the "automaton" element with mode
1503 "conflicts."
1504 (xsl:template match="conflicts"): Remove.
1505 (xsl:template match="conflict"): Remove.
1506 (xsl:template match="automaton" mode="conflicts"): New.
1507 (xsl:template match="state" mode="conflicts): New.
1508 * src/conflicts.c (conflicts_output_xml): Remove.
1509 * src/conflicts.h (conflicts_output_xml): Remove prototype.
1510 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
1511 * src/print.c (print_grammar): Consistently wrap at the 66th column so
1512 the corresponding XSLT is easier. Also, never wrap between a word and
1513 the comma that follows it.
1514
793fbca5
JD
15152007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
1516
1517 Improve C++ namespace support. Discussed starting at
1518 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
1519 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
1520 b4_namespace_close): New macros that interpret the %define variable
1521 "namespace" so its value can contain "::" to indicate nested
1522 namespaces.
1523 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
1524 the above macros.
1525 * data/lalr1.cc (b4_namespace): Likewise.
1526 * data/location.cc (b4_namespace): Likewise.
1527 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
1528 inside a new table in the general %define entry. Document `%define
1529 namespace' there as well. Point the %name-prefix entry to it since it
1530 explains it more completely in the case of C++.
1531 (C++ Bison Interface): Mention `%define namespace' instead of
1532 %name-prefix.
1533 (Table of Symbols): Remove the `%define push_pull' entry. The %define
1534 entry suffices.
1535 * tests/c++.at (Relative namespace references): New test case.
1536 (Absolute namespace references): New test case.
1537 (Syntactically invalid namespace references): New test case.
1538 * tests/input.at (C++ namespace reference errors): New test case.
1539
35b8730d
JD
15402007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
1541
1542 Add syncline support and location accessor to internal %define
1543 interfaces.
1544 * data/bison.m4 (b4_percent_define_get_loc): New.
1545 (b4_percent_define_get_syncline): New.
1546 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
1547 (b4_percent_define_default): Record defining location as line 1 rather
1548 than 0 for the sake of synchronizing #line's, and define
1549 b4_percent_define_syncline(VARIABLE).
1550 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
1551 * src/muscle_tab.c (muscle_syncline_grow): New.
1552 (muscle_code_grow): Use muscle_syncline_grow.
1553 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
1554 define b4_percent_define_syncline(VARIABLE).
1555 (muscle_percent_define_get_loc): New.
1556 (muscle_percent_define_get_syncline): New.
1557 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
1558 remove some unused variables.
1559 (muscle_percent_define_default): Record defining location as line 1
1560 rather than 0 for the sake of synchronizing #line's, and define
1561 b4_percent_define_syncline(VARIABLE).
1562 (muscle_percent_define_check_values): Use
1563 muscle_percent_define_get_loc.
1564 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
1565 (muscle_percent_define_get_syncline): Prototype.
1566 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1567 defaults): Update output for location change.
1568 (Complaining during macro argument expansion): Extend to test
1569 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
1570
7dc4a694
JD
15712007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
1572
1573 Fix some error-reporting macro bugs.
1574 * data/bison.m4 (b4_cat): New.
1575 (b4_error, b4_error_at): Use b4_cat to send error directives directly
1576 to stdout so they don't become arguments to other macros. Update
1577 comments and add examples.
1578 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
1579 add examples.
1580 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
1581 after printing the error directive so that M4 doesn't report subsequent
1582 problems that are induced by this problem.
1583 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
1584 instead of just in them. Recognize @\n in both places. Both expand to
1585 the empty string. Needed by b4_cat.
1586 * tests/skeletons.at (Complaining during macro argument expansion):
1587 New test case.
1588 (Fatal errors make M4 exit immediately): New test case.
1589
d4bd2295
JD
15902007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
1591
1592 Implement --print-datadir.
1593 * src/getargs.c (usage): Mention.
1594 (PRINT_DATADIR_OPTION): New anonymous enum member.
1595 (long_options): Add entry for it.
1596 (getargs): Add case for it calling compute_pkgdatadir.
1597 * src/output.c (output_skeleton): Encapsulate data directory
1598 computation from here...
1599 (prepare): ... and from here...
1600 (compute_pkgdatadir): ... into this new function.
1601 * src/output.h (compute_pkgdatadir): Prototype.
1602
34cdeddf
JD
16032007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
1604
1605 * src/print-xml.c (escape_bufs): New static global variable
1606 replacing...
1607 (xml_escape_n): ... the static local variable buf here.
1608 (print_xml): Free memory for escape_bufs.
1609 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
1610
d782395d
JD
16112007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
1612
1613 Replace `%push-parser' and `%push-pull-parser' with
1614 `%define push_pull "push"' and `%define push_pull "both"'.
1615 `%define push_pull "pull"' is the default.
1616 * doc/bison.texinfo (Push Decl, Push Parser Function,
1617 Pull Parser Function, Parser Create Function, Parser Delete Function):
1618 Update declarations.
1619 (Decl Summary, Table of Symbols): Replace %push-parser and
1620 %push-pull-parser entries with a %define push_pull entry.
1621 * data/bison.m4 (b4_percent_define_check_values): New macro.
1622 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
1623 definitions...
1624 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
1625 definitions...
1626 * data/push.c: ... to here and compute them from the value of the
1627 %define variable push_pull.
1628 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
1629 parsing requests here...
1630 * data/yacc.c: ... hack this to switch to push.c any time
1631 b4_use_push_pull_flag or the %define variable push_pull is set. This
1632 will go away when we mv push.c yacc.c.
1633 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
1634 push parsing is not supported since unused %define variables are
1635 reported anyway.
1636 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
1637 * src/muscle_tab.h (muscle_percent_define_check_values): Update
1638 comments for consistency with b4_percent_define_check_values.
1639 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
1640 muscles.
1641 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
1642 Remove.
1643 (prologue_declaration): Remove %push-parser and %push-pull-parser
1644 rules.
1645 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
1646 * tests/calc.at: Update declarations.
1647 * tests/input.at (%define enum variables): New test case.
1648 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
1649 declaration.
1650 (Push Parsing: Multiple impure instances): Update declaration.
1651 (Push Parsing: Unsupported Skeletons): New test case.
1652 * tests/torture.at (Exploding the Stack Size with Alloca): Update
1653 declaration.
1654 (Exploding the Stack Size with Malloc): Update declaration.
1655
3f999f78
WP
16562007-09-24 Wojciech Polak <polak@gnu.org>
1657
1658 Add XSLT transformations.
1659
1660 * data/xslt/xml2dot.xsl: Transform XML into DOT.
1661 * data/xslt/xml2text.xsl: Transform XML into plain text.
1662 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
1663 * data/Makefile.am (xsltdir): New variable.
1664 (dist_xslt_DATA): Add xslt/*.xsl files.
1665
a4f75309
PE
16662007-09-23 Paul Eggert <eggert@cs.ucla.edu>
1667
1668 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
1669 Problem reported by Wojciech Polak.
1670 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
1671 (xml_printf): Undo change I made on 21 September; that is,
1672 indent 2 spaces, not 1.
1673
ad5feac4
JD
16742007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
1675
1676 Pacify ./configure --enable-gcc-warnings.
1677 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
1678 `char const *' instead of `char *'.
1679 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
1680 local variable `sep'.
1681
41d7a5f2
PE
16822007-09-21 Paul Eggert <eggert@cs.ucla.edu>
1683
1684 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
1685 elsewhere.
1686 * src/print-xml.c: Prefer "const" after types; that's more consistent.
1687 (xml_printf): Indent just 1 space for level.
1688 (e_char, xlate_char): Remove.
1689 (xml_escape_string): Rewrite to avoid undefined behavior (used
1690 storage that was freed from the stack).
1691 (xml_escape_n): Don't bother checking for subscript error.
1692
3f999f78
WP
16932007-09-21 Wojciech Polak <polak@gnu.org>
1694
1695 Add Bison XML Automaton Report.
41d7a5f2
PE
1696
1697 Add support for an -x option to generate an XML report.
1698 It is not documented yet.
1699 * src/print-xml.c: New file.
1700 * src/print-xml.h: Likewise.
1701 * lib/timevar.def (TV_XML): New var.
1702 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
1703 * src/conflicts.c: Include print-xml.h.
1704 (solved_conflicts_xml_obstack): New var.
1705 (log_resolution, conflicts_solve, conflicts_free):
1706 Add support for XML report.
1707 (conflicts_output_val): New function.
1708 * src/conflicts.h (conflicts_output_val): New decl.
1709 * src/files.c (spec_xml_file): New var.
1710 (compute_output_file_names, output_file_names_free): Add XML support.
1711 * src/files.h (spec_xml_file): New decl.
1712 * src/getargs.c (xml_flag): New var.
1713 (usage, short_options, long_options, getargs): Add XML support.
1714 * src/getargs.h (xml_flag): New decl.
1715 * src/gram.c: Include print-xml.h.
1716 (rule_lhs_print_xml, rule_rhs_print_xml):
1717 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
1718 New functions.
1719 * src/gram.h: Declare external ones.
1720 * src/main.c: Include print-xml.h.
1721 (main): Add XML support.
1722 * src/reduce.c: Include print-xml.h.
1723 (reduce_xml): New function.
1724 * src/reduce.h: Declare it.
1725 * src/state.c: Include print-xml.h.
1726 (state_new): Add XML support.
1727 (state_rule_lookahead_tokens_print_xml): New function.
1728 * src/state.h: Declare it.
1729 (struct state): New member solved_conflicts_xml.
1730 * src/symtab.c (symbol_class_get_string): New function.
1731 * src/symtab.h: Declare it.
1732
6d8e724d
PE
17332007-09-21 Paul Eggert <eggert@cs.ucla.edu>
1734
1735 * GNUmakefile: Switch to coreutils's version.
1736 * bootstrap: Likewise.
1737 * Makefile.cfg: Adjust to new GNUmakefile.
1738 * README-hacking: Likewise.
1739
1740 Import from gnulib:
1741
1742 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
1743 Bruno Haible <bruno@clisp.org>
1744
1745 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
1746 and is a script that invokes bison. Tighten the code. Add comments.
1747
922bdd7f
JD
17482007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
1749
1750 Spell "boolean" as "Boolean". Reported by Akim Demaille.
1751 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
1752 * doc/bison.texinfo (Decl Summary): Fix.
1753 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
1754 * tests/input.at (Boolean %define variables): Update output.
1755 * tests/skeletons.at (%define boolean variables: invalid skeleton
1756 defaults): Rename to...
1757 (%define Boolean variables: invalid skeleton defaults): ... this and
1758 update output.
1759
1b17b01d
JD
17602007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
1761
1762 In impure push mode, don't allow more than one yypstate to be allocated
1763 since multiple impure parsers would corrupt yynerrs.
1764 * data/push.c (yypstate_allocated): New static global variable
1765 initialized to 0.
1766 (yypull_parse): If yypstate_new returns 0, don't report it as memory
1767 exhaustion if yypstate_allocated is 1, but still return 2.
1768 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
1769 already 1. Otherwise, set it to 1.
1770 (yypstate_delete): Set it to 0.
1771 * tests/push.at (Push Parsing: Multiple impure instances): New test
1772 case.
1773
9987d1b3
JD
17742007-08-17 Bob Rossi <bob@brasko.net>
1775
1776 * doc/bison.texinfo (Push Decl): Document the push parser.
1777 (Table of Symbols): Ditto.
1778 (Pure Decl): Ditto.
1779 (Decl Summary): Ditto.
1780 (Multiple Parsers, Push Parser Function, Pull Parser Function,
1781 Parser Create Function, Parser Delete Function):
1782 Add new push parser symbols.
1783 (Table of Symbols): Document push-parser, push-pull-parser,
1784 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
1785
f16b0819
PE
17862007-08-15 Paul Eggert <eggert@cs.ucla.edu>
1787
1788 Update to GPLv3.
1789 * doc/gpl-3.0.texi: New file.
1790 * doc/gpl.texi: Remove.
1791 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
1792 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
1793 * README-hacking, TODO, bootstrap, bootstrap.conf:
1794 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
1795 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
1796 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
1797 * data/lalr1.cc, data/lalr1.java, data/location.cc:
1798 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
1799 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
1800 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
1801 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
1802 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
1803 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
1804 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
1805 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
1806 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
1807 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
1808 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
1809 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
1810 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
1811 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
1812 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
1813 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
1814 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
1815 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
1816 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
1817 * src/complain.c, src/complain.h, src/conflicts.c:
1818 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
1819 * src/files.h, src/flex-scanner.h, src/getargs.c:
1820 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
1821 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
1822 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
1823 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
1824 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
1825 * src/print.c, src/print.h, src/print_graph.c:
1826 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
1827 * src/reduce.h, src/relation.c, src/relation.h:
1828 * src/revision.h, src/scan-code.h, src/scan-code.l:
1829 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
1830 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
1831 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
1832 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
1833 * tests/Makefile.am, tests/actions.at, tests/c++.at:
1834 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
1835 * tests/existing.at, tests/glr-regression.at:
1836 * tests/headers.at, tests/input.at, tests/java.at:
1837 * tests/local.at, tests/output.at, tests/push.at:
1838 * tests/reduce.at, tests/regression.at, tests/sets.at:
1839 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
1840 * tests/torture.at:
1841 Update to GPLv3.
1842
728c4be2
JD
18432007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1844
1845 Get rid of broken %no-parser, -n, and --no-parser implementation and
1846 documentation.
1847 * TODO: Don't mention them.
1848 * doc/bison.1: Likewise.
1849 * doc/bison.texinfo (Decl Summary): Likewise.
1850 (Bison Options): Likewise.
1851 (Option Cross Key): Likewise.
1852 * src/getargs.c (no_parser_flag): Remove global variable.
1853 (usage): Don't print description of -n and --no-parser.
1854 (long_options): Remove --no-parser entry here.
1855 (getargs): Remove -n case in the switch here.
1856 * src/getargs.h (no_parser_flag): Remove extern.
1857 * tests/regression.at (Web2c Actions): Remove comment that mentions
1858 --no-parser.
1859
5d31a216
JD
18602007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1861
1862 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
1863 name user variables starting with `yy'. Just pass NULL instead of a
1864 dummy local &yylval to yypush_parse.
1865 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
1866 starting with `yy'.
1867
a2ea208d
JD
18682007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
1869
1870 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
1871 true since it's then always used regardless of whether yyoverflow is
1872 defined. Reported by Christian Burger at
1873 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
1874 * THANKS: Add Christian Burger.
1875
91661ebb
JD
1876 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1877 node names: say "Decl Summary" not "Bison Declaration Summary".
1878
cbd50549
JD
18792007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
1880
1881 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
1882 determine whether this function has already complained about an invalid
1883 value for a %define boolean variable, don't check whether Bison has
1884 ever examined the value. As written, the check was a tautology.
1885 Instead, record and check for this complaint using a separate muscle.
1886
eb1b0740
JD
18872007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1888
1889 Fix push parsing memory leak reported by Brandon Lucia at
1890 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
1891 * THANKS: Add Brandon Lucia.
1892 * data/push.c (yypstate_delete): Free the stack if it was reallocated
1893 but the parse never completed and thus freed it.
1894 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
1895 * tests/testsuite.at: Include push.at.
1896 * test/push.at: New.
1897 (Push Parsing: Memory Leak for Early Deletion): New test case.
1898
9d774aff
JD
18992007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
1900
1901 Improve handling of multiple S/R conflicts in the same state and of S/R
1902 conflicts involving multiple reductions.
1903 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
1904 set for a state here or Bison will abort if it is reassigned on a
1905 later conflicted reduction in the same state.
1906 Similarly, don't finalize and assign the solved conflicts report here
1907 or it will be lost if it is reassigned on a later conflicted reduction
1908 in the same state.
1909 (set_conflicts): Instead, assign them both here after all S/R conflicts
1910 in the state have been fully examined.
1911 * src/print.c (shift_set): Rename to...
1912 (no_reduce_set): ... this.
1913 (print_reductions): Update for rename, and add %nonassoc error action
1914 tokens to no_reduce_set so that, when printing the first remaining
1915 reduction on an error action token, the reduction is enclosed in
1916 brackets.
1917 (print_results): Update for rename.
1918 * tests/conflicts.at (Solved conflicts report for multiple reductions
1919 in a state): New test case.
1920 (%nonassoc error actions for multiple reductions in a state): New test
1921 case.
1922
1923 * src/main.c (main): Don't depend on C99 features.
1924
10159d2a
JD
19252007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1926
1927 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
1928 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
1929 uniwidth.
10159d2a 1930
953b3935
JD
19312007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
1932
1933 * bootstrap (slurp): Create target directories that don't exist.
1934 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
1935
6ce2d93a
JD
19362007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1937
1938 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
1939 than item number.
1940 * closure.c (closure): Likewise.
1941 * state.h (reductions): Comment sorting of rules.
1942 (state): Comment sorting of items.
1943
ce3448d5
JD
19442007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
1945
1946 Fix C++ test cases after recent Gnulib changes. Discussed starting at
1947 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
1948 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
1949 definition in order to avoid Gnulib headers since we don't use config.h
1950 here.
1951 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
1952 rather than AT_DATA so that config.h is included.
1953
8a86eef0
JD
19542007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
1955
1956 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
1957 instead of fprintf. Guard these functions with #if YYDEBUG instead of
1958 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
1959 and so that YYFPRINTF is guaranteed to be defined here.
1960
b1a81613
JD
19612007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1962
1963 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
1964 with...
1965 (muscle_percent_define_check_values): ... this more helpful function.
1966 Again, it's not used yet, but it will be.
1967 * src/muscle_tab.h: Likewise.
1968
71b61d4d
JD
1969 Improve some comments in parser table construction.
1970 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
1971 (generate_states): Don't mention ruleset, which is internal to closure.
1972 * src/closure.c (closure): Explain sorting of core and itemset, which
1973 is required for this function to behave correctly.
1974 * src/closure.h (closure): Mention sorting.
1975
2a6b783d
JD
19762007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
1977
1978 * src/lalr.c (state_lookahead_tokens_count): For code readability,
1979 move the check for disabled transitions to an aver since conflict
1980 resolution hasn't happened yet.
1981
1982 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
1983 labels a state as inconsistent just because it has error transitions.
1984 The original form of this check appeared in revision 1.1 of lalr.c,
1985 which was committed on 1991-12-21. Now (at least), changing the
1986 consistency label on such a state appears to have no useful effect in
1987 any of the places it is examined, which I enumerate below. The key
1988 point to understanding each item in this enumeration is that a state
1989 with an error transition is labelled consistent in the first place only
1990 if it has no rules, so the check cannot matter for states that have
1991 rules. (1) Labelling a state as inconsistent will cause set_conflicts
1992 to try to identify its conflicts, and a state must have *rules* to have
1993 conflicts. (2) Labelling a state as inconsistent will affect how
1994 action_row sets the default *rule* for the state. (3) Labelling a
1995 state as inconsistent will cause build_relations to add lookback edges
1996 to *rules* in that state.
1997 * src/state.h (struct state): Word the comment for member consistent
1998 more carefully.
1999
14462c2b
JD
20002007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2001
2002 Don't depend on C99 features.
2003 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
2004 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
2005 * src/reader.c (check_and_convert_grammar): Fix for-loop.
2006 * src/state.c (state_mark_reachable_states): Fix for-loop.
2007 (state_remove_unreachable_states): Fix for-loop.
2008
2009 Don't widen struct state with member reachable just to temporarily
2010 record reachability. Instead, use a local bitset.
2011 * src/state.h (struct state): Remove member.
2012 * src/state.c (state_new): Don't initialize it.
2013 (state_mark_reachable_states): Rename to...
2014 (state_record_reachable_states): ... this, and use bitset.
2015 (state_remove_unreachable_states): Use bitset.
2016
5a43d418
JD
20172007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
2018
2019 * src/Makefile.am (yacc): Quote target action commands properly so
2020 that the yacc script isn't corrupt. Reported by Hans Aberg at
2021 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
2022
0c650a20
JD
2023 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
2024 the case of pure parsers. Reported by Frans Englich at
2025 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
2026 * THANKS: Add Frans Englich.
2027
61fee93e
JD
2028 * NEWS (2.3a+): In the %code entry, reference section `Bison
2029 Declaration Summary' from the manual now since the %code summary has
2030 moved there.
2031 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
2032 in the rules section must be terminated by semicolons.
2033
f124d423
JD
20342007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2035
2036 Extend the front-end API for %define variables to more completely
2037 mirror the back-end. This will be useful in the future.
2038 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
2039 Update comments to mention the new front-end counterparts of these
2040 macros.
2041 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
2042 for muscle_string_decode and muscle_location_decode.
2043 (muscle_string_decode): New static function.
2044 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
2045 (muscle_percent_define_get, muscle_percent_define_ifdef): New
2046 functions.
2047 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
2048 muscle_percent_define_get to mimic the b4_percent_define_flag_if
2049 implementation more closely.
2050 (muscle_percent_define_invalid_value): New function.
2051 * src/muscle_tab.h (muscle_percent_define_get,
2052 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
2053 Prototype.
2054
75ad86ee
JD
20552007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2056
2057 * NEWS (2.3a+): Mention yesterday's state-removal change.
2058 (2.3a): Remove the %language entry, which was added after 2.3a.
2059 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
2060 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
2061 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
2062 tests/existing.at: Update copyright date.
2063
5967f0cf
JD
20642007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2065
2066 If conflict resolution makes states unreachable, remove those states,
2067 report rules that are then unused, and don't report conflicts in those
2068 states.
2069 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
2070 New global function.
2071 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
2072 function.
2073 * src/main.c (main): After conflict resolution, remove the unreachable
2074 states and update all data structures that reference states by number.
2075 * src/state.c (state_new): Initialize each state's reachable member to
2076 false.
2077 (state_mark_reachable_states): New static function.
2078 (state_remove_unreachable_states): New global function.
2079 * src/state.h (struct state): Add member bool reachable.
2080 (state_remove_unreachable_states): Prototype.
2081 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2082 New test case.
2083 * tests/existing.at (GNU pic Grammar): Update test case output now that
2084 an unused rule is discovered.
2085
b09f4f48
JD
20862007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2087
2088 Minor code cleanup in parser table construction.
2089 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
2090 (new_itemsets, save_reductions): Update for rename to nitemset.
2091 * src/closure.c (nritemset): Rename to...
2092 (nitemset): ... this since the "r" appears to meaningless and isn't
2093 used in the comments.
2094 (closure): Update for rename.
2095 * src/closure.h (nritemset): Update extern to...
2096 (nitemset): ... this.
2097 * src/lalr.c (LA): Fix a typo in comments.
2098 * src/print.c (print_core): Update for rename to nitemset.
2099 * src/print_graph.c (print_graph): Likewise.
2100 * src/state.h: Fix some typos in header comments.
2101
bbb44d83
PE
21022007-04-04 Paul Eggert <eggert@cs.ucla.edu>
2103
9b33de72
PE
2104 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
2105 still sticks to ASCII. Sorry!
2106
bbb44d83
PE
2107 * README-hacking: New file, taken mostly from coreutils, with changes
2108 for Bison. Contains much of the contents of:
2109 * README-cvs: Remove.
2110 * bootstrap: Sync from gnulib.
2111 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
2112 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
2113
29553547
JD
21142007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
2115
2116 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
2117 Setzer.
2118 (Java Differences): Fix some typos.
2119 * THANKS: Add Sebastian Setzer.
2120
01b477c6
PB
21212007-03-07 Paolo Bonzini <bonzini@gnu.org>
2122
730739e4
AD
2123 * data/java.m4 (b4_single_class_if): Remove.
2124 (b4_abstract_if): Look at "%define abstract".
2125 (b4_lexer_if): New.
2126 (b4_union_name): Rename...
2127 (b4_yystype): ... to this. Map to "%define stype".
2128 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
2129 b4_maybe_throws): Fix quoting.
2130 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
2131 * data/lalr1.java (Lexer interface): Always define.
2132 (Lexer interface within parser class): Remove.
2133 (YYLexer class): New, used when "%code lexer" is present.
2134 (constructor): When "%code lexer" is used, pass %lex-param
2135 to the lexer constructor.
2136 (yylex, yyparse): Remove %lex-param from method invocations
2137 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
2138
2139 * doc/bison.texinfo (Java Bison Interface): Mention "%define
2140 abstract". Rename "%define union_name" to "%define stype".
2141 Rename method names according to previous patch.
2142 (Java Scanner Interface): Describe "%code lexer" instead of
2143 "%pure-parser" and "%define single_class".
2144 (Java Differences): Mention "%code lexer".
2145
2146 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
2147 Include scanner here, using macros from tests/local.at.
2148 (AT_DATA_CALC_Y): Remove final argument.
2149 (_AT_CHECK_JAVA_CALC): Likewise.
2150 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
2151 of %locations and %error-verbose.
2152 (main): Test with and without %lex-param.
2153 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
2154 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 2155
122bea3a
JMG
21562007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2157
2158 DJGPP spefic issue. Inhibit the use of disallowed characters for
2159 file name genertion on Win98, WinXP, etc. These are |<>":?*\
2160 and concern testsuite case 46.
2161 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
2162 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
2163 * djgpp/config.bat: Inhibit the use of disallowed characters.
2164
9611cfa2
JD
21652007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2166
2167 Miscellaneous %define and %code cleanup.
2168 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
2169 values are interpreted.
2170 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
2171 documentation a little more.
2172 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
2173 muscle_percent_define_insert, muscle_percent_code_grow): New
2174 functions/macros.
2175 * src/muscle_tab.h (muscle_percent_define_insert,
2176 muscle_percent_code_grow): Prototype.
2177 * src/parse-gram.y (prologue_declaration): Use
2178 muscle_percent_define_insert and muscle_percent_code_grow when parsing
2179 %define and %code directives.
2180
2181 Make it easy to share %define boolean variables between the front-end
2182 and back-end. Though not used yet, this will be useful in the future.
2183 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
2184 Bison uses of names rather than just skeleton uses of names.
2185 (b4_percent_define_get, b4_percent_define_ifdef): Rename
2186 b4_percent_define_skeleton_variables(VARIABLE) to
2187 b4_percent_define_bison_variables(VARIABLE).
2188 (b4_percent_code_get, b4_percent_code_ifdef): Rename
2189 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
2190 b4_percent_code_bison_qualifiers(QUALIFIER).
2191 (b4_check_user_names_wrap): Update for renames.
2192 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
2193 muscle_percent_define_default): New functions mimicking
2194 b4_percent_define_flag_if and b4_percent_define_default.
2195
2196 For %define variables, report locations for invalid values and
bbb44d83 2197 redefinitions.
9611cfa2
JD
2198 * data/bison.m4 (b4_percent_define_flag_if): Read
2199 b4_percent_define_loc(VARIABLE) to report the location of an invalid
2200 value for VARIABLE.
2201 (b4_percent_define_default): Save a special location in
2202 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
2203 must later be reported as invalid.
2204 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
2205 functions.
2206 (muscle_percent_define_insert): Record the location of VARIABLE in
2207 muscle percent_define_loc(VARIABLE), and use it to report the previous
2208 location for a redefinition.
2209 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
2210 (muscle_percent_define_default): Update like b4_percent_define_default.
2211 (muscle_grow_user_name_list): Rename to...
2212 (muscle_user_name_list_grow): ... this for consistency and use
2213 muscle_location_grow.
2214 * src/muscle_tab.h (muscle_location_grow): Prototype.
2215 * tests/input.at (%define errors): Update expected output.
2216 * tests/skeletons.at (%define boolean variables: invalid skeleton
2217 defaults): New test case.
2218
0bf92491
JD
22192007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
2220
2221 * src/print.c (lookahead_set, state_default_rule): Remove.
2222 (print_reductions): Replace state_default_rule invocation with
2223 equivalent use of yydefact, which was computed in token_actions in
2224 tables.c.
2225 (print_results): Don't allocate lookahead_set.
2226
d3b12988
PB
22272007-02-27 Paolo Bonzini <bonzini@gnu.org>
2228
2229 * data/lalr1.java: Prefix all private members with yy.
2230
f57a7536
JD
22312007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
2232
2233 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 2234 Sebastien Fricker at
f57a7536 2235 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 2236 * THANKS: Add Sebastien Fricker.
f57a7536
JD
2237 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
2238 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
2239 accept a variable number of arguments.
2240
6404a5bf
JD
22412007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2242
2243 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
2244
e4e09639
JMG
22452007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2246
2247 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
2248 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
2249 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
2250
d7e0a1a7
PE
22512007-02-11 Paul Eggert <eggert@cs.ucla.edu>
2252
2253 Undo my 2007-02-07 change, switching back to the c-strcase module
2254 introduced in the 2007-02-03 change. Bruno Haible reported that
2255 the 2007-02-07 change would be dangerous in Turkish if we add a
2256 language whose name contains "i", since "i" is not lowercase "I"
2257 in Turkish.
2258 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
2259 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
2260 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
2261 * m4/.cvsignore: Remove strcase.m4.
2262 * src/getargs.c: Revert 2007-02-07 change, as follows.
2263 Include c-strcase.h.
2264 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
2265
deee93a1
JD
22662007-02-11 Bruno Haible <bruno@clisp.org>
2267
2268 Enable the Java related testsuite tests when the only Java compiler
2269 found is a gcj < 4.3. Discussed at
2270 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
2271 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
2272
574add85
JD
22732007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
2274
2275 * data/Makefile.am: Update copyright date.
2276 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
2277 yypstate_new returns NULL.
2278 (yypstate_new): Return NULL if malloc does.
2279 * src/reader.c (packgram): Move translation of rule actions from the
2280 beginning of packgram to...
2281 (check_and_convert_grammar): ... here right before packgram is invoked
2282 so it's easier to write more complete comments, and remove redundant
2283 code.
2284
e785ccf7
JD
22852007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
2286
2287 As in semantic actions, make @$ in %initial-action, %destructor, and
2288 %printer imply %locations.
2289 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
2290 scanning @$.
2291 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
2292 (@$ in %initial-action implies %locations,
2293 @$ in %destructor implies %locations,
2294 @$ in %printer implies %locations): ... these new test cases.
2295
1cfe1ed7
PE
22962007-02-07 Paul Eggert <eggert@cs.ucla.edu>
2297
2298 Undo most of the 2007-02-03 change, switching to the strcase module
2299 now that gnulib strcase has been fixed.
2300 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
2301 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
2302 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
2303 * m4/.cvsignore: Add strcase.m4.
2304 * src/getargs.c: Revert 2007-02-03 change, as follows.
2305 Don't include c-strcase.h.
2306 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
2307 strcasecmp has "unspecified behavior" outside the POSIX locale,
2308 but it works fine in practice if at least one argument is ASCII,
2309 as is the case in Bison.
2310
0049ec86
PB
23112007-02-07 Paolo Bonzini <bonzini@gnu.org>
2312
2313 * tests/java.at: Skip tests if only one of javac/java is present.
2314 Reported by Joel E. Denny.
2315 * tests/atlocal.in: Adjust copyright years.
2316
23172007-02-05 Paolo Bonzini <bonzini@gnu.org>
2318
2319 * data/lalr1.java (Stack): Work around old verifiers that disallow
2320 access to the private fields of an inner class, from the outer class.
2321 We can make Stack's fields public because user code doesn't have access
2322 to the instance of Stack used by parse(). Reported by Paul Eggert.
2323
2c2b7220
PE
23242007-02-03 Paul Eggert <eggert@cs.ucla.edu>
2325
2326 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
2327 the right spot for these files?
2328 * bootstrap.conf (gnulib_modules): Add c-strcase.
2329 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
2330 c-strncasecmp.c.
2331 * src/getargs.c: Include c-strcase.h.
2332 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
2333 to avoid unspecified behavior.
2334
b2b81dae
JD
23352007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
2336
2337 * doc/bison.texinfo (Decl Summary): Correct typo.
2338
c1d19e10
PB
23392007-01-30 Paolo Bonzini <bonzini@gnu.org>
2340
2341 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
2342 Complain if the value does not match empty, "true" or "false".
2343 * data/c++.m4: Adjust default definitions of %define variables.
2344 * data/java.m4: Adjust default definitions of %define variables.
2345 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
2346 to above behavior.
2347 * tests/input.at (Boolean %define variables): Test new behavior.
2348
8405b70c
PB
23492007-01-29 Paolo Bonzini <bonzini@gnu.org>
2350
2351 * NEWS: Mention java.
2352 * TODO: Remove things that are done.
2353 * bootstrap.conf: Add javacomp-script and javaexec-script.
2354 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
2355
2356 * data/Makefile.am: Add new files.
2357 * data/java-skel.m4: New.
2358 * data/java.m4: New.
2359 * data/lalr1.java: New.
2360
2361 * doc/bison.texinfo: Put "A Complete C++ Example" under
2362 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
2363 under Other Languages.
2364
2365 * src/getargs.c (valid_languages): Add Java.
2366 * src/getargs.h (struct bison_language): Update size of string fields.
2367
2368 * tests/Makefile.am: Add java.at.
2369 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
2370 * tests/java.at: New.
2371 * tests/testsuite.at: Include it.
2372
3eb82471
JD
23732007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
2374
2375 Clean up.
2376 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
2377 at_directive_argv arguments so these no longer have to be global
2378 variables. Also, update the implementation for the following changes.
2379 (fail_for_at_directive_too_many_args,
2380 fail_for_at_directive_too_few_args): Add at_directive_name argument.
2381 (at_directive_name): Remove as at_directive_argv[0] will be used for
2382 this now.
2383 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
2384 for the directive name.
2385 (at_directive_argc, at_directive_argv): Make these local within
2386 skel_lex instead of global.
2387 (INITIAL): Update directive start action for above changes.
2388 (SC_AT_DIRECTIVE_ARG): Rename to...
2389 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
2390 (SC_AT_DIRECTIVE_SKIP_WS): Update.
2391 (scan_skel): Move yylex_destroy to...
2392 (skel_scanner_free): ... here.
2393 * tests/skeletons.at (installed skeleton file name): Rename to...
2394 (installed skeleton file names): ... this.
2395
148d66d8
JD
23962007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
2397
2398 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2399 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
2400 Summary" not "Directives".
2401 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
2402 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
2403 since the former is now the more complete one.
2404 (Prologue Alternatives): Likewise and do the same for %defines.
2405 (Table of Symbols): Add summary of %code, add summary of %define, and
2406 move full %code documentation to...
2407 (Decl Summary): ... here for consistency with other entries in these
2408 sections.
2409 Move %define entry in order to keep this list alphabetized.
2410 Reword %define entry a little to put less emphasis on the skeleton
2411 concept, which most users shouldn't have to think about.
2412
665f0c24
PE
24132007-01-26 Paul Eggert <eggert@cs.ucla.edu>
2414
2415 Adjust to recent gnulib changes.
2416 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
2417 Add string.h, string_.h, unistd_.h, wchar_.h.
2418 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
2419 * src/system.h: Don't include <stpcpy.h>; this is now done by
2420 <string.h>.
2421
592d0b1e
PB
24222007-01-23 Paolo Bonzini <bonzini@gnu.org>
2423
2424 Simplify implementation of unqualified %code, implement macros for
2425 uniform treatment of boolean %define flags. Document %define.
2426 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
2427 b4_percent_code_ifdef): New.
2428 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
2429 * data/c++.m4: Define default value for global_tokens_and_yystype.
2430 * data/glr.cc: Likewise.
2431 * data/location.cc: Use b4_percent_define_flag_if.
2432
148d66d8 2433 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
2434
2435 * src/parse-gram.y (Unqualified %code): Change muscle name to
2436 b4_percent_code().
2437 (content.opt): Default to empty.
2438
a7867f53
JD
24392007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
2440
2441 Implement support for relative and absolute skeleton file names.
2442 Discussed starting at
2443 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
2444 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
2445 (Bison Options): Document in --skeleton entry.
2446 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
2447 full_skeleton can't necessarily hold all of pkgdatadir.
2448 If the specified skeleton file name contains a `/', don't prepend
2449 pkgdatadir.
2450 * src/parse-gram.y (prologue_declaration): If the specified skeleton
2451 file name contains a `/', prepend the grammar file directory.
2452 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
2453 * skeletons.at: New file.
2454 (relative skeleton file names): New test case.
2455 (installed skeleton file names): New test case.
2456 * tests/testsuite.at: Include skeletons.at.
2457
2458 * bootstrap: Update copyright to 2007.
2459
830c9b18
PB
24602007-01-17 Paolo Bonzini <bonzini@gnu.org>
2461
2462 * bootstrap: Remove occurrences of .#bootmp from the files.
2463
a8c2e813
AD
24642007-01-17 Akim Demaille <akim@epita.fr>
2465
2466 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
2467 nonterminals.
2468 Use per-type %printer.
2469
279cabb6
JD
24702007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
2471
2472 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
2473 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2474 djgpp/config.site, src/files.c, src/files.h, src/main.c,
2475 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
2476 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
2477 tests/glr-regression.at, tests/input.at, tests/local.at,
2478 tests/output.at, tests/torture.at: Update copyright to 2007.
2479
bb32f4f2
AD
24802007-01-16 Akim Demaille <akim@epita.fr>
2481
2482 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
2483 error code.
2484 (Calc++ Scanner): Exit with failure if we can't open the input
2485 file.
2486 Accept "-" standing for stdin.
2487 (Calc++ Top Level): Print the result only if the parsing was
2488 successful.
2489
7cff04b5
AD
24902007-01-16 Akim Demaille <akim@epita.fr>
2491
2492 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
2493
a4e25e1d
JD
24942007-01-15 Paolo Bonzini <bonzini@gnu.org>
2495 and Joel E. Denny <jdenny@ces.clemson.edu>
2496
2497 Clean up %define and %code implementation in M4 some. Most
2498 importantly, rename all related macros to be in the b4_percent_define
2499 and b4_percent_code namespaces. Also, complete support for `.' in
2500 %define variable names and %code qualifiers.
2501 * data/bison.m4 (b4_check_user_names): Check for special
2502 "SKELETON-NAMESPACE(name)" macros instead of using two nested
2503 m4_foreach loops.
2504 (b4_get_percent_define, b4_get_percent_code): Rename to...
2505 (b4_percent_define_get, b4_percent_code_get): ... these.
2506 Extend documentation with examples.
2507 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
2508 b4_percent_define_skeleton_variables and
2509 b4_percent_code_skeleton_qualifiers.
2510 Expect any value for the %define variable `foo' to be stored in the
2511 macro named `b4_percent_define(foo)'; expect any %code blocks for the
2512 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
2513 expect any unqualified %code blocks to be stored in a macro named
2514 `b4_percent_code_unqualified'.
2515 Use m4_indir so that %define variable names and %code qualifiers can
2516 contain `.', which is allowed by the grammar parser.
2517 (b4_percent_define_default): New macro to set a default value for a
2518 %define variable.
2519 (m4_wrap): Update wrapped code, and fix some underquoting.
2520 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
2521 Expect grammar uses of %define variables and %code qualifiers to be
2522 defined in b4_percent_define_user_variables and
2523 b4_percent_code_user_qualifiers.
2524 * data/c++.m4: Use b4_percent_define_default rather than
2525 m4_define_default. Fix some underquoting. Skeleton usage of %define
2526 variable define_location_comparison now implies skeleton usage of
2527 %define variable filename_type.
2528 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2529 data/push.c, data/yacc.c: Update macro names.
2530 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
2531 muscle names.
2532
e37c665c
JMG
25332007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2534
2535 DJGPP specific issues.
2536
2537 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
2538 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
2539
7d2d521f
JD
25402007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
2541
2542 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
2543 run parsers in all tests so that Valgrind is invoked during
2544 maintainer-check-valgrind.
2545 (Duplicate representation of merged trees): Free all semantic values.
2546 (Duplicated user destructor for lookahead): Likewise.
2547
e0ac9b4b
JD
25482007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
2549
2550 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
2551 command-line prefix.
2552 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
2553 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
2554 miss Valgrind messages.
2555 (Exploding the Stack Size with Malloc): Likewise.
2556
78143faa
JD
25572007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
2558
2559 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
2560 locals. Reported by Juan Manuel Guerrero at
2561 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
2562 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
2563 Fix some indentation also.
2564 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
2565 explaining this issue.
2566
7ecec4dd
JD
25672007-01-09 Paolo Bonzini <bonzini@gnu.org>
2568 and Joel E. Denny <jdenny@ces.clemson.edu>
2569
2570 Simplify union and prologue handling, and escape union and lex/parse
2571 params with digraphs.
2572 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
2573 values to the empty string since these are no longer guaranteed
2574 initialized by the front-end.
2575 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
2576 braces around b4_user_stype since this is no longer done by the
2577 front-end.
2578 * src/files.c, src/files.h (pre_prologue_obstack,
2579 post_prologue_obstack): Remove.
2580 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
2581 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
2582 with digraphs. This fixes lex params and parse params.
2583 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
2584 * src/output.c (prepare): Remove muscle insertion of the prologues.
2585 (output): Remove freeing of pre_prologue_obstack and
2586 post_prologue_obstack.
2587 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
2588 than prologue_augment for prologue parsing so you don't need prologue
2589 obstacks.
5c80250c
JD
2590 (grammar_declaration): For %union RHS, use `braceless' instead of
2591 "{...}" so that braces are already stripped and code is escaped with
2592 digraphs.
7ecec4dd
JD
2593 * src/reader.c (prologue_augment): Remove.
2594 (reader): Remove initialization of pre_prologue_obstack and
2595 post_prologue_obstack.
2596 * src/reader.h (prologue_augment): Remove.
2597
2598 * data/c.m4: Remove stray parenthesis.
2599
16dc6a9e
JD
26002007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2601
2602 Remove quotes from variables names in %define directives and from
2603 qualifiers in %code directives, and restrict the characters that are
2604 allowed in them to M4-friendly ones. For %define, continue to support
2605 the quoted form as a deprecated feature. Discussed starting at
2606 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
2607 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
2608 %code.
2609 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
2610 (Decl Summary): In %defines entry, update mention of `%code requires'
2611 and `%code provides'.
16dc6a9e
JD
2612 (C++ Location Values): Update %define uses.
2613 (Calc++ Parser Interface): Likewise.
2614 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 2615 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
2616 * src/parse-gram.y (prologue_declaration): For %define variables, use
2617 `variable' instead of `STRING'.
2618 (grammar_declaration): For %code qualifiers, use `ID' instead of
2619 `STRING'.
2620 (variable): New nonterminal that takes an `ID' or a `STRING'.
2621 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
2622 and %define uses.
2623 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
2624 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
2625 (%define errors): Update %define uses.
2626
e9813cd4
JD
26272007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2628
2629 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
2630 instead of muscle_insert for %define values so that M4-special
2631 characters are replaced with digraphs.
2632 * tests/input.at (%define errors): Extend to check weird values.
2633
6afc30cc
JD
26342007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2635
2636 Instead of having skeletons declare all valid %define variables and
2637 %code qualifiers, provide macros that retrieve the associated values
2638 and build these lists automatically. Thus Bison will now warn when a
2639 variable or qualifier is not used by the skeleton in the current
2640 invocation regardless of whether it might sometimes be used by that
2641 skeleton in other invocations. Also, move all %define value macros to
2642 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
2643 form, which is replaced by %code.
2644 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
2645 (b4_check_user_names): ... this, and change the series of valid name
2646 arguments to a single list argument for names used in the skeleton
2647 similar to the existing list argument for names used in the grammar.
2648 Warn instead of complaining.
2649 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
2650 values and %code code, to format %code code properly, and to build
2651 lists of all %define variables and %code qualifiers used in the
2652 skeleton: b4_skeleton_percent_define_variables and
2653 b4_skeleton_percent_code_qualifiers.
2654 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
2655 Remove, and...
2656 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
2657 the skeleton names lists can finish building first. In place of
2658 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
2659 expect the lists b4_user_percent_define_variables and
2660 b4_user_percent_code_qualifiers.
2661 * data/c++.m4: Where setting default values for b4_parser_class_name,
2662 b4_location_type, b4_filename_type, b4_namespace, and
2663 b4_define_location_comparison, update their names to the
2664 b4_percent_define_ namespace.
2665 * data/glr.c: Don't use b4_check_percent_define_variables and
2666 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
2667 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
2668 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 2669 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
2670 * data/location.cc: Use b4_get_percent_define.
2671 * data/push.c: Don't use b4_check_percent_define_variables and
2672 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
2673 * data/yacc.c: Likewise, and don't call m4_exit in
2674 b4_use_push_for_pull_if or m4_wrap code will never execute.
2675 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
2676 Rename to...
2677 (muscle_grow_user_name_list): ... this for consistency with the
2678 terminology used in bison.m4.
2679 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
2680 %define variable names, and rename muscle used_percent_define_variables
2681 to user_percent_define_variables.
2682 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
2683 user_percent_code_qualifiers.
2684 (content): Remove.
2685 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
2686 {CODE} form is no longer accepted.
2687 * tests/input.at (Reject bad %code qualifiers): Rename to...
2688 (Reject unused %code qualifiers): ... this, and update test output.
2689 (%define error): Update test output.
2690
7eb8a0bc
JD
26912007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
2692
2693 Check for unrecognized %define variables similar to checking for
2694 unrecognized %code qualifiers. Check for redefined %define variables.
2695 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
2696 generalizes...
2697 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
2698 (b4_check_percent_define_variables): New, also wraps it.
2699 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
2700 variables using b4_check_percent_define_variables.
2701 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
2702 all those exercised in the test suite and all those listed in the
2703 `Default values' section of c++.m4. Are there others?
2704 * data/push.c, data/yacc.c: Declare no valid %define variables.
2705 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
2706 similar to muscle_find, but it works even when the muscle stores a
2707 const value.
2708 (muscle_grow_used_name_list): New function for constructing the used
2709 name list muscles that b4_check_for_unrecognized_names requires.
2710 * src/parse-gram.y (prologue_declaration): Warn if a variable is
2711 %define'd more than once. Define the b4_used_percent_define_variables
2712 muscle with muscle_grow_used_name_list.
2713 (grammar_declaration): Abbreviate %code code with
2714 muscle_grow_used_name_list.
2715 * tests/input.at (%define errors): New.
2716
3fc65ead
JD
27172007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2718
2719 Provide warn_at, complain_at, and fatal_at function callbacks to the
2720 skeletons, and use this for %code qualifier complaints.
2721 * data/bison.m4 (b4_error_at): New, invoked by...
2722 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
2723 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
2724 @fatal_at(...@) directives.
2725 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
2726 qualifiers in b4_used_percent_code_qualifiers and to use
2727 b4_complain_at.
2728 * src/location.c, src/location.h (boundary_set_from_string): New global
2729 function.
2730 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
2731 function.
2732 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
2733 to b4_used_percent_code_qualifiers.
2734 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
2735 function.
2736 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
2737 (lineno): Rename to...
2738 (out_lineno): ... this so I don't misunderstand it again.
2739 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
2740 here; these newlines are in the input but not the output file.
2741 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
2742 (at_directive_perform): ... this new static function, and add handling
2743 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
2744 directives.
2745 * tests/input.at (Reject bad %code qualifiers): Update test output with
2746 locations and extend.
2747
2748 * tests/output.at (Output file name: [, Output file name: ]): Remove
2749 bogus comment about these tests failing.
2750
1c7b7e1d
JD
27512007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2752
2753 Clean up b4_check_percent_code_qualifiers a little.
2754 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
2755 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
2756 documentation and add examples.
2757 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
2758 qualifiers here.
2759
08af01c2
JD
27602007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2761
2762 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
2763 unreliable -- especially when they're hidden inside another macro.
2764 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
2765 data/c.m4: Remove m4_divert(-1).
2766 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2767 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
2768 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 2769 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
2770 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
2771 pushed and popped by m4sugar, should be first on the stack.
2772
2773 Provide warn, complain, and fatal function callbacks to the skeletons.
2774 This provides more flexibility than m4_fatal, improves the error
2775 message format, and captures messages for translation. Discussed
2776 starting at
2777 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
2778 * data/bison.m4 (b4_error): New, invoked by...
2779 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
2780 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
2781 directives. Because these M4 macros might be called when the current
2782 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
2783 the previous removal of uses of m4_divert, which caused trouble.
2784 (b4_check_percent_code_qualifiers): Use b4_complain instead of
2785 m4_fatal to report unrecognized %code qualifiers.
2786 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
2787 push parser requests.
2788 * data/glr.c: Use b4_complain instead of m4_fatal to report
2789 non-deterministic push parser requests.
2790 Update @output usage to @output(...@) form.
2791 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
2792 report missing %defines. Update @output usage to @output(...@) form.
2793 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
2794 @output(...@) form.
2795 * src/main.c (main): Invoke skel_scanner_free.
2796 * src/scan-skel.h (skel_scanner_free): Prototype new function.
2797 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
2798 obstack_for_string from flex-scanner.h.
2799 (YY_DECL): Use to declare skel_lex static.
2800 (decode_at_digraphs): Remove; now handled in the new
2801 SC_AT_DIRECTIVE_ARG start condition.
2802 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
2803 functions.
2804 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
2805 at_directive_argv): New static globals.
2806 (INITIAL): Use fail_for_invalid_at.
2807 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
2808 recognize the start of a generalized `@directive(...@)' form and
2809 start...
2810 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
2811 directive args (using the new obstack_for_string), to decode the
2812 contained @ diagraphs, and to perform the directive. It recognizes
2813 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
2814 @output(...@).
2815 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
2816 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
2817 `@,'.
2818 (scan_skel): Initialize obstack_for_string on the first call.
2819 (skel_scanner_free): New function to free obstack_for_string.
2820 * tests/input.at (Reject bad %code qualifiers): Update test output.
2821
8e0a5e9e
JD
28222007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
2823
2824 Consolidate the 4 prologue alternative directives (%code, %requires,
2825 %provides, and %code-top) into a single %code directive with an
2826 optional qualifier field. Discussed at
2827 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
2828 * NEWS (2.3a+): Rewrite the existing entry for the prologue
2829 alternatives.
2830 * doc/bison.texinfo (Prologue Alternatives): Update.
2831 (Decl Summary): Update to %code "requires" and %code "provides".
2832 (Calc++ Parser): Update to %code "requires".
148d66d8 2833 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
2834 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
2835 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
2836 are replaced by b4_percent_code_provides and b4_percent_code_requires,
2837 which are skeleton-specific.
2838 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
2839 declare what %code qualifiers it supports and to complain if any other
2840 qualifiers were used in the grammar.
2841 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
2842 and b4_user_code([b4_percent_code_provides]) in place of
2843 b4_user_requires and b4_user_provides.
2844 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
2845 Add b4_user_code([b4_percent_code_top]) and
2846 b4_user_code([b4_percent_code]).
2847 Invoke b4_check_percent_code_qualifiers.
2848 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2849 PERCENT_REQUIRES): Remove.
2850 (grammar_declaration): Remove RHS's for %code-top, %provides, and
2851 %requires. Rewrite the %code RHS as the unqualified form defining the
2852 muscle b4_percent_code. Add another RHS for the qualified %code form,
2853 which defines muscles of the form b4_percent_code_QUALIFIER and the
2854 b4_used_percent_code_qualifiers muscle.
2855 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2856 PERCENT_REQUIRES): Remove.
2857 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
2858 %code "requires" and %code "provides".
2859 * tests/input.at (Reject bad %code qualifiers): New.
2860
95021767
JD
28612007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2862
2863 Use the new code_props interface for destructors and printers.
2864 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
2865 printer_location members, and change the type of the destructor and
2866 printer members to code_props.
2867 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
2868 symbol_printer_get, semantic_type_destructor_set,
2869 semantic_type_printer_set, default_tagged_destructor_set,
2870 default_tagless_destructor_set, default_tagged_printer_set,
2871 default_tagless_printer_set): Use code_props in arguments and return
2872 types in place of char const * and location.
2873 (symbol_destructor_location_get, symbol_printer_location_get): Remove
2874 since the locations are now contained in the return of
2875 symbol_destructor_get and symbol_printer_get.
2876 * src/output.c (symbol_destructors_output, symbol_printers_output):
2877 Replace with...
2878 (symbol_code_props_output): ... this to eliminate duplicate code.
2879 (output_skeleton): Update to use symbol_code_props_output.
2880 * src/reader.c (symbol_should_be_used): Update use of
2881 symbol_destructor_get.
2882 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2883 Update uses of the various _destructor_set and _printer_set functions.
2884 * src/symtab.c: (default_tagged_destructor_location,
2885 default_tagless_destructor_location, default_tagged_printer_location,
2886 default_tagless_printer_location): Remove since we...
2887 (default_tagged_destructor, default_tagless_destructor,
2888 default_tagged_printer, default_tagless_printer): ... change the type
2889 of these to code_props.
2890 (symbol_new, semantic_type_new, symbol_destructor_set,
2891 semantic_type_destructor_set, symbol_destructor_get,
2892 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
2893 symbol_check_alias_consistency, default_tagged_destructor_set,
2894 default_tagless_destructor_set, default_tagged_printer_set,
2895 default_tagless_printer_set): Update.
2896 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
2897 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
2898 code_props members.
2899 (symbol_print): Use SYMBOL_CODE_PRINT.
2900
f6857bbf
JD
29012007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2902
2903 Use the new code_props interface for rule actions.
2904 * src/symlist.h (symbol_list): Replace action, action_location, and
2905 used members with a code_props action_props member.
2906 * src/reader.c (symbol_should_be_used, grammar_rule_check,
2907 grammar_midrule_action, grammar_current_rule_merge_set,
2908 grammar_current_rule_symbol_append, packgram): Update.
2909 * src/scan-code.h (translate_rule_action): Remove, no longer used.
2910 * src/scan-code.l (handle_action_dollar): Update.
2911 (translate_rule_action): Remove, no longer used.
2912 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
2913
7c0c6181
JD
29142007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2915
2916 Use the new code_props interface in parse-gram.y.
2917 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
2918 Update all uses of translate_* functions to use the new code_props
2919 interface and to use gram_scanner_last_string_free and
2920 code_scanner_last_string_free where possible.
2921 (grammar_declaration): symbol_list_destructor_set and
2922 symbol_list_printer_set now perform the translation, so don't do it
2923 here. Use gram_scanner_last_string_free where possible.
2924 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
2925 translate_code): Remove, no longer used.
2926 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
2927 symbol_list_printer_set): Perform code translation here rather than
2928 depending on the caller to do so.
2929
2930 * src/symlist.h (struct symbol_list): Correct some documentation typos.
2931 * src/scan-gram.h (gram_last_string): Remove declaration.
2932 * src/scan-gram.l (last_string): Declare it static.
2933
28e52c0d
JD
29342007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2935
2936 Encapsulate code properties and related functionality for the various
2937 destructors, printers, and actions into a code_props structure and
2938 interface. This patch merely implements code_props in scan-code.h and
2939 scan-code.l. Future patches will rewrite other modules to use it.
2940 Discussed starting at
2941 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
2942 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
2943 consistently initialize const structs that have an empty location
2944 field.
2945 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
2946 to ensure consistency.
2947 * src/scan-code.h (code_props): New structure.
2948 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
2949 function, macro, and const global variable for initializing a
2950 code_props with no code.
2951 (code_props_plain_init, code_props_symbol_action_init,
2952 code_props_rule_action_init, code_props_translate_code): The rest of
2953 the new code_props functional interface. Among other things, the init
2954 functions set the code_props kind field so that
2955 code_props_translate_code will know whether to behave like
2956 translate_symbol_action, translate_rule_action, or translate_code.
2957 These old translate functions must remain until all other modules are
2958 updated to use the new code_props interface.
2959 (code_scanner_last_string_free): New function similar to
2960 gram_scanner_last_string_free.
2961 (code_scanner_free): Add documentation.
2962 * src/scan-code.l: Implement the new interface.
2963 (code_lex): Make it static, add a code_props* argument, and remove the
2964 rule argument.
2965 (last_string): New static global similar to the one in scan-gram.l.
2966 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
2967 instead of rule.
2968 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
2969 code_props since Bison may one day use this information for destructors
2970 and printers.
2971 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
2972 (handle_action_dollar): Use symbol_list_n_get and set used flag
2973 directly since symbol_list_n_used_set is removed.
2974 (translate_action): Add a code_props* argument and remove the rule,
2975 action, and location arguments. Pass the code_props* on to code_lex.
2976 (translate_rule_action, translate_symbol_action, translate_code):
2977 Rewrite as wrappers around the new code_props interface.
2978 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
2979 it would eventually need to break the encapsulation of code_props.
2980
96034983
JD
29812007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2982
2983 * etc/.cvsignore: New.
2984
945e396c
JD
29852007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2986
2987 Add maintainer-push-check to run maintainer-check using push parsing in
2988 place of pull parsing where available.
2989 * Makefile.am (maintainer-push-check): New.
2990 * data/bison.m4 (b4_use_push_for_pull_if): New.
2991 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
2992 appropriately based on their existing values.
2993 (yypush_parse): Don't print push-parser-specific diagnostics if push
2994 parsing is being used in place of pull parsing.
2995 * data/yacc.c: If push parsing should replace pull parsing, redirect to
2996 push.c.
2997 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
2998 variable, and insert b4_use_push_for_pull_flag into muscles.
2999 * tests/Makefile.am (maintainer-push-check): New.
3000
7d596384
JD
30012006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3002
3003 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
3004 (whether successful or failed) so that yypush_parse can be invoked
3005 again to start a new parse using the same yypstate.
3006 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
3007 check multiple yypull_parse invocations on the same yypstate. For pull
3008 mode, extend to check multiple yyparse invocations.
3009 (Exploding the Stack Size with Alloca): Extend to try with
3010 %push-pull-parser.
3011 (Exploding the Stack Size with Malloc): Likewise.
3012
3013 * tests/calc.at (Simple LALR Calculator): Don't specify
3014 %skeleton "push.c" since %push-pull-parser implies that now.
3015 * tests/headers.at (export YYLTYPE): Don't check for the push
3016 declarations. Otherwise, this test case can't be used to see if push
3017 mode can truly emulate pull mode.
3018 * tests/input.at (Torturing the Scanner): Likewise.
3019 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
3020 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
3021 AT_YACC_IF, which now includes the case of push mode since %skeleton
3022 need not be used for push mode. This will be more intuitive once
3023 push.c is renamed to yacc.c.
3024
7172e23e
JD
30252006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3026
3027 For push mode, convert yyparse from a macro to a function, invoke yylex
3028 instead of passing a yylexp argument to yypull_parse, and don't
3029 generate yypull_parse or yyparse unless %push-pull-parser is declared.
3030 Discussed starting at
3031 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
3032 * data/bison.m4 (b4_pull_if): New.
3033 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
3034 * data/push.c: Improve M4 quoting a little.
3035 (b4_generate_macro_args, b4_parenthesize): Remove.
3036 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
3037 any time a pull parser is requested.
3038 Don't #define this as a wrapper around yypull_parse. Instead, when
3039 both push and pull are requested, make it a function that does that
3040 same thing.
3041 (yypull_parse): If there's a b4_prefix, #define this to
3042 b4_prefix[pull_parse] when both push and pull are requested.
3043 Don't define this as a function unless both push and pull are
3044 requested.
3045 Remove the yylexp argument and hard-code yylex invocation instead.
3046 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
3047 %push-parser.
3048 * src/getargs.c (pull_parser): New global initialized to true.
3049 * getargs.h (pull_parser): extern it.
3050 * src/output.c (prepare): Insert pull_flag muscle.
3051 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
3052 (prologue_declaration): Set both push_parser and pull_parser = true for
3053 %push-pull-parser. Set push_parser = true and pull_parser = false for
3054 %push-parser.
3055 * src/scan-gram.l: Don't accept %push_parser as an alternative to
3056 %push-parser since there's no backward-compatibility concern here.
3057 Scan %push-pull-parser.
3058 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
3059 instead of %push-parser.
3060 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
3061 prototype it in the module that calls yyparse.
3062 * tests/input.at (Torturing the Scanner): Likewise.
3063 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
3064
2e7944cb
JD
30652006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
3066
3067 Update etc/bench.pl. Optimize push mode a little (the yyn change
3068 deserves most of the credit).
3069 * Makefile.am (SUBDIRS): Add etc subdirectory.
3070 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
3071 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
3072 yytoken, yyval, and yyloc declarations to...
3073 (yyparse or yypush_parse): ... here to improve performance. For
3074 yypush_parse invocations after the first, be sure to assign yyn its old
3075 value again.
3076 (yypstate_new): Don't bother initializing the yyresult field since the
3077 initial value isn't used.
3078 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
3079 remove the #define that, in push mode, set it to yyps->NAME.
3080 * etc/Makefile.am: New.
3081 * etc/bench.pl: Remove and build it instead from...
3082 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
3083 "tests/bison" from the build directory by default rather than just
3084 invoking "bison" from $PATH.
3085 (calc_grammar): Update push parser code: don't declare yylval globally,
3086 don't define yyparse_wrapper, and don't #define yyparse.
3087 (bench_grammar): Update to check all working combinations of yacc.c,
3088 push.c, impure, pure, pull, and push.
3089
c3d50342
JD
30902006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3091
3092 For push mode, add pull wrappers around yypush_parse.
3093 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
3094 (yypull_parse): New function wrapping yypush_parse.
3095 (yyparse): New #define wrapping yypull_parse.
3096 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
3097 is declared.
3098 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
3099 prototype yylex in the module that calls yyparse, and don't prototype
3100 yyparse there. Otherwise, the yyparse expansion won't compile.
3101 * tests/input.at (Torturing the Scanner): Likewise.
3102
94ebeba5
JD
31032006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3104
3105 Enable push parsers to operate in impure mode. Thus, %push-parser no
3106 longer implies %pure-parser. The point of this change is to move
3107 towards being able to test the push parser code by running the entire
3108 test suite as if %push-parser had been declared.
3109 * data/push.c (yypush_parse): For impure mode, remove the
3110 yypushed_char, yypushed_val, and yypushed_loc arguments.
3111 Instead, declare these as local variables initialized to the global
3112 yychar, yylval, and yylloc.
3113 For the first yypush_parse invocation only, restore the initial values
3114 of these global variables when it's time to read a token since they
3115 have been overwritten.
3116 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
3117 %push-parser.
3118 * tests/calc.at (Simple LALR(1) Calculator): Always declare
3119 %pure-parser along with %push-parser since this test case was designed
3120 for pure push parsers.
3121 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
3122 (AT_YACC_OR_PUSH_IF): New.
3123 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
3124 add a note that it's still wrong for some cases (as it has been for a
3125 while).
3126 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
3127 %push-parser no longer implies %pure-parser.
3128
a0633178
JD
31292006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3130
3131 Remove some unnecessary differences between the pull parser code and
3132 the push parser code. This patch enables yynerrs in push mode.
3133 * data/push.c: Reformat M4 a little.
3134 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
3135 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
3136 because push mode is on. Instead, if pure mode is on, move yynerrs
3137 to...
3138 (b4_declare_parser_state_variables): ... here.
3139 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
3140 to yyps->NAME so it can be used in yypush_parse.
3141 (yypush_parse): Don't omit uses of yynerrs in push mode.
3142
8646b6a3
JD
31432006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3144
3145 Fix bug such that the first pushed token's value and location are
3146 sometimes overwritten (sometimes by %initial-action) before being used.
3147 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
3148 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
3149 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
3150 more closely mimic the pull parser logic.
3151 Don't copy the pushed token to yychar, yylval, and yylloc until it's
3152 time to read a token, which is after any initialization of yylval and
3153 yylloc.
3154 (gottoken): Rename label to...
3155 (yyread_pushed_token): ... for clarity and to avoid infringing on the
3156 user namespace.
3157
9baf4d74
JD
31582006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3159
3160 Rearrange initialization of the parser state variables so that the
3161 skeleton doesn't have to have a copy for pull mode and another for push
3162 mode. This patch also fixes at least a bug such that yylloc was not
3163 initialized (with b4_location_initial_line and
3164 b4_location_initial_column) upon calling yypush_parse. However, that
3165 initialization now overwrites the first token's location;
3166 %initial-action assigning @$ already did the same thing, and both bugs
3167 will be fixed in a later patch.
3168 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
3169 (b4_declare_parser_state_variables): Remove initialization of yytoken,
3170 yyss, yyvs, yyls, and yystacksize.
3171 (yypstate_new): Remove initialization of some yypstate fields: yystate,
3172 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
3173 yylsp.
3174 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
3175 yyps->NAME so it can be used in yypush_parse.
3176 (yyparse or yypush_parse): For yypush_parse, don't print the
3177 "Starting parse" diagnostic for invocations after the first.
3178 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
3179 yypush_parse, only do it for the first invocation.
3180 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
3181 initialization to occur in yypush_parse but only on the first
3182 invocation.
3183
23522164
JD
31842006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3185
3186 * data/push.c: Add CPP guards around push parser declarations in both
3187 the header and the code file.
3188 In the code file, move the push parser declarations to the same place
3189 they appear in the header file.
3190 Clean up the M4 some, especially the inconsistent underquoting in
3191 some b4_c_function_def and b4_c_function_decl uses.
3192
bb010fe5
JD
31932006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3194
3195 Encapsulate the push parser state variables into an M4 macro so the
3196 push skeleton doesn't have to list them again for pull mode's yyparse.
3197 For push mode, remove yypush_parse's local equivalents of these
3198 variables to eliminate unnecessary copying between the two sets at
3199 run-time. This patch also fixes at least a bug related to multiple
3200 %initial-action invocations in push mode.
3201 * data/push.c (b4_declare_parser_variables): Rename to...
3202 (b4_declare_scanner_communication_variables): ... this for clarity and
3203 update both uses.
3204 (b4_declare_yyparse_variables): Remove and move its contents to the one
3205 spot where it was invoked.
3206 (b4_declare_parser_state_variables): New macro containing the parser
3207 state variables required by push mode.
3208 (struct yypstate): Replace all fields but yynew with
3209 b4_declare_parser_state_variables.
3210 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
3211 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
3212 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
3213 (yyparse or yypush_parse): For yyparse in pull mode, replace local
3214 parser state variable declarations with
3215 b4_declare_parser_state_variables.
3216 Don't initialize parser state variables when calling yypush_parse since
3217 yypstate_new already does that.
3218 Invoke the user's initial action only upon the first yypush_parse
3219 invocation.
3220 Remove all code that copies between the local parser state variables
3221 and the yypstate.
3222
2d212f8c
JD
32232006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3224
3225 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
3226 prevent a name collision in a future patch where these names will
3227 sometimes be #define'd.
3228 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
3229 since it no longer has the same name as the existing argument.
3230 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
3231
e6e704dc
JD
32322006-12-19 Paolo Bonzini <bonzini@gnu.org>
3233 and Joel E. Denny <jdenny@ces.clemson.edu>
3234
3235 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3236 that the argument is case-insensitive, and there's no `=' here.
3237 For the %skeleton entry, mention that %language is better.
3238 (Bison Options): Likewise for --language and --skeleton. Move the
3239 --skeleton entry so that the `Tuning the parser' section is sorted
3240 alphabetically on long options.
3241 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
3242 %language directive in detail here; cross-reference the %language
3243 documentation instead.
3244 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
3245 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 3246 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
3247 * examples/extexi (normalize): Instead of replacing every %require
3248 argument with the current Bison version, just substitute for
3249 `@value{VERSION}'. This guarantees that we're testing what actually
3250 appears in the documentation.
3251 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
3252 rather than `@VERSION@'.
3253
0e021770
PE
32542006-12-18 Paul Eggert <eggert@cs.ucla.edu>
3255
fd575f05
PE
3256 * NEWS: Reword the %language news a bit, and put it earlier.
3257
0e021770
PE
3258 * src/getargs.c (skeleton_arg): Last arg is now location const *.
3259 Rewrite to simplify the logic.
3260 (language_argmatch): Likewise.
fd575f05
PE
3261 (program_name): We now own this var.
3262 * src/getargs.h (struct bison_language): Use char[] rather than
3263 const char *.
0e021770
PE
3264
3265 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
3266 Java is supported.
3267 * src/complain.c (program_name): Remove decl; no longer needed.
3268 * src/main.c (program_name): Remove; now belongs to getargs.
3269
32702006-12-18 Paolo Bonzini <bonzini@gnu.org>
3271
3272 * NEWS: Document %language.
3273
3274 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
3275
3276 * data/c-skel.m4, data/c++-skel.m4: New files.
3277 * data/glr.c: Complain on push parsers.
3278
3279 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
3280 over %skeleton.
148d66d8 3281 (Decl Summary): Document %language and %skeleton.
0e021770
PE
3282 (Command line): Document -L.
3283
3284 * examples/extexi: Rewrite %require directive.
3285 * examples/calc++/Makefile.am: Pass VERSION to extexi.
3286
3287 * src/files.c (compute_exts_from_gc): Look in language structure
3288 for .y extension.
3289 (compute_file_name_parts): Check whether .tab should be added.
3290 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
3291 (language, skeleton_arg, language_argmatch): New.
3292 (long_options): Add --language.
3293 (getargs): Use skeleton_arg, add -L/--language.
3294 * src/getargs.h: Include location.h.
3295 (struct bison_language, language, skeleton_arg, language_argmatch): New.
3296 * src/output.c (prepare): Pick default skeleton from struct language.
3297 Don't dispatch C skeletons here.
3298 * src/parse-gram.y (PERCENT_LANGUAGE): New.
3299 (prologue_declaration): Add "%language" rule, use skeleton_arg.
3300 * src/scan-gram.l ("%language"): New rule.
3301
3302 * tests/calc.at: Test %skeleton and %language.
3303 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
3304 (AT_GLR_IF): Look for %skeleton "glr.cc".
3305 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
3306 (AT_YACC_IF): Reject %language.
3307
5691bf57
PE
33082006-12-18 Paul Eggert <eggert@cs.ucla.edu>
3309
db06f0ce
PE
3310 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
3311 since it wasn't used; only the typedef name 'semantic_type' is needed.
3312 Also, omit trailing white space.
3313
5691bf57
PE
3314 * bootstrap: Sync from coreutils.
3315 (gnulib_extra_files): Add build-aux/announce.gen.
3316 (slurp): Adjust .gitignore files like .cvsignore files.
3317 * build-aux/announce-gen: Remove from CVS, since bootstrap
3318 now creates this.
3319
791934e4
JD
33202006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
3321
3322 Make %push-parser imply %pure-parser. This fixes several bugs; see
3323 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
3324 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
3325 pure_parser = true.
3326 * data/push.c: Don't bother testing b4_push_if when deciding whether
3327 to expand b4_declare_parser_variables globally.
3328 (yypush_parse): Likewise in here.
3329
3330 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
3331 (yy_reduce_print): Reformat M4 for readability.
3332
ee5abb37
JD
33332006-12-15 Bob Rossi <bob@brasko.net>
3334 and Joel Denny <jdenny@ces.clemson.edu>
3335
3336 * data/push.c (yypstate): Add typedef, and update all uses of
3337 struct yypstate to just yypstate.
3338 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
3339
16ca01f9
JD
33402006-12-14 Bob Rossi <bob@brasko.net>
3341
3342 * data/push.c (yypush_parse): Declare prototype regardless of
3343 %locations option.
3344
ab8e7e1a
JD
33452006-12-14 Bob Rossi <bob@brasko.net>
3346
3347 * data/push.c (yyparse): Remove the prototype and the #define when in
3348 push-parser mode.
3349
9bf32be3
JD
33502006-12-13 Bob Rossi <bob@brasko.net>
3351
3352 * data/push.c (yypstate_init): Rename to...
3353 (yypstate_new): ... this and use b4_c_function_def.
3354 (yypstate_delete): New.
3355 (yypush_parse): Change parameters yynval and yynlloc to be const.
3356 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
3357 yypstate_delete functions.
3358
f02e2948
JD
33592006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
3360
3361 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
3362 strange test case titles. Reported by Bob Rossi.
3363
38eb7751
PE
33642006-12-13 Paul Eggert <eggert@cs.ucla.edu>
3365
3366 * TODO: Add pointer to Sylvain Schmitz's work on static detection
3367 of potential ambiguities in GLR grammers.
3368
bd9d212b
JD
33692006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
3370
3371 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
3372 `bison ', use m4_index instead of m4_substr since chopping up a string
3373 containing M4-special characters causes problems here.
3374
3375 Fix a couple of bugs related to special characters in user-specified
3376 file names, and make it easier for skeletons to compute output file
3377 names with the same file name prefix as Bison-computed output file
3378 names.
3379 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
3380 b4_parser_file_name and b4_spec_defines_file instead of
3381 @output_parser_name@ and @output_header_name@, which are now redundant.
3382 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
3383 b4_parser_file_name, b4_spec_defines_file, and the new
3384 @basename(FILENAME@) instead of @output_parser_name@ and
3385 @output_header_name@, which inappropriately escaped the file names as
3386 C string literals.
3387 * src/files.c (all_but_ext): Remove static qualifier.
3388 (compute_output_file_names): Move `free (all_but_ext)' to...
3389 (output_file_names_free): ... here since all_but_ext is needed later.
3390 * src/files.h (all_but_ext): Extern.
3391 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
3392 exactly what MUSCLE_INSERT_STRING used to do.
3393 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
3394 characters are escaped properly.
3395 * src/output.c (prepare): Define muscle file_name_all_but_ext as
3396 all_but_ext.
3397 For pkgdatadir muscle, maintain previous functionality by using
3398 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
3399 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
3400 digraphs would never be expanded. Hopefully no one has M4-special
3401 characters in his Bison installation path.
3402 * src/scan-skel.l: Don't parse @output_header_name@ and
3403 @output_parser_name@ anymore since they're now redundant.
3404 In @output, use decode_at_digraphs.
3405 Parse a new @basename command that invokes last_component.
3406 (decode_at_digraphs): New.
3407 (BASE_QPUTS): Remove unused.
3408 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
3409 (Output file name): New tests.
3410
3f7ca628
JD
34112006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
3412
3413 Warn about output files that are generated by the skeletons and that
3414 conflict with other output files.
3415 * data/glr.c: Don't generate the header file here when glr.cc does.
3416 * src/files.c (file_names, file_names_count): New static globals.
3417 (compute_output_file_names): Invoke output_file_name_check for files
3418 not generated by the skeletons and remove existing checks.
3419 (output_file_name_check): New function that warns about conflicting
3420 output file names.
3421 (output_file_names_free): Free file_names.
3422 * src/files.h (output_file_name_check): Declare.
3423 * src/scan-skel.l: Invoke output_file_name_check for files generated by
3424 the skeletons.
3425 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
3426 (Conflicting output files): New tests.
3427
178e123e
PE
34282006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3429
3430 * doc/bison.texinfo: Fix a couple of typos.
3431
34322006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
3433
3434 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
3435 Rename to...
3436 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
3437 update all uses.
3438 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
3439 (yypush_parse): Rename yypvars argument to yyps and remove redundant
3440 local pv.
3441 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
3442 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
3443
ea17f233
JD
34442006-12-07 Bob Rossi <bob@brasko.net>
3445 and Joel Denny <jdenny@ces.clemson.edu>
3446
3447 * data/push.c (yypvarsinit): Change return type from void* to struct
3448 yypvars*. No longer cast to void* on return.
3449 (struct yypvars): Remove yylen since it need not be remembered between
3450 yypushparse invocations.
3451 (yypushparse): Don't copy between yylen and pv->yylen.
3452
55a30bda
JD
34532006-12-05 Bob Rossi <bob@brasko.net>
3454
3455 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
3456 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
3457 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
3458 (struct yypvars): Remove b4_declare_parser_variables.
3459 (yypvarsinit): Remove init code for removed variables.
3460 (global scope): Do not declare b4_declare_parser_variables if
3461 push or pure mode.
3462 (yypushparse): Add b4_declare_parser_variables.
3463 Init new local variables, and remove init code for removed
3464 yypvars variables.
3465 (yyparse): Delete.
3466 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
3467 and yyparse for other modes.
3468 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
3469 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
3470 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
3471 (AT_PURE_LEX_IF): True if pure or push parser.
3472
85894313
JD
34732006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
3474
3475 Document Yacc prologue alternatives and default %destructor's and
3476 %printer's as experimental. Don't mention Java yet. Discussed at
3477 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
3478 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
3479 (2.3a): Annotate this entry to say the old forms of these features were
3480 also experimental.
3481 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 3482 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
3483 of Java (we'll want this back eventually).
3484
02975b9a
JD
34852006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3486
3487 Support a file name argument to %defines. Deprecate `=' in
3488 %file-prefix, %name-prefix, and %output. Discussed at
3489 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
3490 * NEWS (2.3a+): Mention.
148d66d8 3491 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
3492 form of %defines, and remove `=' from entries for %file-prefix,
3493 %name-prefix, and %output.
3494 * src/parse-gram.y (prologue_declaration): Implement.
3495 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
3496 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
3497 all but one occurrence of %name-prefix.
3498 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
3499 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
3500 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
3501 occurrence of each of %file-prefix and %output. Add check for %defines
3502 with argument.
3503 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
3504 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
3505 Remove the `=' from %output.
3506
287b314e
JD
35072006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
3508
3509 Don't escape $ in test case titles since Autoconf 2.61 now does that
3510 correctly.
3511 * tests/actions.at (Default %printer and %destructor are not for error
3512 or $undefined): Here.
3513 (Default %printer and %destructor are not for $accept): Here.
3514 * tests/input.at (Invalid $n and @n): Here.
3515
3ebecc24
JD
35162006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
3517
3518 Rename <!> to <>. Discussed starting at
3519 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
3520 * NEWS (2.3a+): Update.
148d66d8 3521 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
3522 Update.
3523 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
3524 * src/scan-gram.l (INITIAL): Implement.
3525 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
3526 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
3527 comment.
3528 * tests/actions.at (Default tagless %printer and %destructor,
3529 Default tagged and per-type %printer and %destructor,
3530 Default %printer and %destructor are not for error or $undefined,
3531 Default %printer and %destructor are not for $accept,
3532 Default %printer and %destructor for mid-rule values): Update.
3533 * tests/input.at (Default %printer and %destructor redeclared,
3534 Unused values with default %destructor): Update.
3535
26b8a438
JD
35362006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3537
3538 Don't let %prec take a nonterminal.
3539 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
3540 token.
3541 * tests/input.at (%prec takes a token): New test checking that %prec
3542 won't take a nonterminal.
3543
07c39ae9
JD
35442006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3545
405d53b7
JD
3546 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
3547 it was double-quoted.
07c39ae9
JD
3548 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
3549 grammar is maintained with Bison's highest standards.
3550 * src/getargs.c: Fix some typos in Doxygen comments.
3551
580b8926
JD
35522006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3553
3554 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
3555 later. Reported by Paul Eggert in
3556 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
3557 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
3558 * src/scan-code.l (translate_action): Don't bother invoking
3559 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
3560 (code_scanner_free): Instead of invoking
3561 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
3562 which frees more.
3563 * src/scan-gram.l (gram_scanner_free): Likewise.
3564 * src/scan-skel.l (scan_skel): Likewise.
3565
4502eadc
JD
35662006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3567
3568 * src/files.c (tr): Change return type to void.
3569 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
3570 has been called previously for the same key.
3571 (muscle_find): Return storage instead of value so that
3572 --enable-gcc-warnings doesn't produce warnings that the return discards
3573 const. aver that the value and storage are the same since storage
3574 could potentially be NULL when value is not.
3575 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
3576 same as 0.
3577
7746c8f6
PE
35782006-11-08 Paul Eggert <eggert@cs.ucla.edu>
3579
3580 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
3581 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
3582 us a slightly cleaner distribution, and also works.
3583 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
3584 gnulib changes.
3585
eb095650
PE
35862006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
3587 and Paul Eggert <eggert@cs.ucla.edu>
3588
3589 Don't let Bison leak memory except when it complains.
3590 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
3591 (spec_defines_file, dir_prefix): Now char *, not const char *,
3592 since they are freed.
3593 * src/files.c: Likewise.
3594 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
3595 Likewise.
3596 (tr): Now operates in-place. All uses changed.
3597 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
3598 values.
3599 (compute_file_name_parts, compute_output_file_names): Don't store
3600 read-only data in variables that will be freed.
3601 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
3602 src_extension, and header_extension.
3603 (output_file_names_free): New public function to free
3604 spec_verbose_file, spec_graph_file, spec_defines_file,
3605 parser_file_name, and dir_prefix.
3606 * src/getargs.c (getargs): Don't store read-only data in variables that
3607 will be freed.
3608 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
3609 (which previously existed but was unused), and quotearg_free.
3610 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
3611 * src/muscle_tab.c: Likewise.
3612 (muscle_entry): Make the value char const *,
3613 and add a new storage member that is char * and can be freed.
3614 (muscle_entry_free): New private function.
3615 (muscle_init): Use it instead of free.
3616 (muscle_insert, muscle_grow): Update and use new storage member.
3617 (muscle_code_grow): Free the string passed to muscle_grow
3618 since it's not needed anymore.
3619 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
3620 add a new `char *code' member.
3621 ("{...}"): Declare semantic type as code.
3622 * src/scan-code.h (translate_rule_action):
3623 (translate_symbol_action, translate_code, translate_action): Return
3624 `char const *' rather than `char *' since external code should not free
3625 these strings.
3626 * src/scan-code.l: Likewise.
3627 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
3628 which is "{...}" in the parser.
3629 * tests/Makefile.am (maintainer-check-valgrind): Set
3630 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
3631 Valgrind.
3632 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
3633 complain.
3634 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
3635 expecting a non-zero exit status sets --leak-check=summary and
3636 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
3637 this case, and we don't want to hear about it.
3638
ac564be4
PE
36392006-11-08 Paul Eggert <eggert@cs.ucla.edu>
3640
3641 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
3642 instead of from the template, to simplify configuration a bit.
3643 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
3644 and m4/wint_t.m4, as they are needed with the latest gnulib.
3645
17bd8a73
JD
36462006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3647
3648 Disable unset/unused mid-rule value warnings by default, and recognize
3649 --warnings=midrule-values to enable them. Discussed starting at
3650 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
3651 * NEWS (2.3a+): Mention.
3652 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
3653 warnings): Add entry for midrule-values subargument.
3654 * src/reader.c (symbol_should_be_used): Don't return true just because
3655 the value is a set/used mid-rule value unless
3656 --warnings=midrule-values was specified.
3657 * tests/input.at (Unused values, Unused values before symbol
3658 declarations): Run tests with and without --warnings=midrule-values.
3659
3660 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
3661 than LIST_FREE directly.
3662
89eb3c76
JD
36632006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3664
3665 Finish implementing --warnings=error, which should not be implied by
3666 --warnings=all (or by its synonyms -W and --warnings without
3667 subarguments).
3668 * src/complain.c (set_warning_issued): New function to report that
3669 warnings are being treated as errors and to record an error if so.
3670 Invoke...
3671 (warn_at, warn): ... here.
3672 * src/getargs.c (warnings_args, warnings_types): Reorder so that
3673 "error - warnings are errors" does not appear above "all - all of the
3674 above".
3675 (getargs): For -W and --warnings without subarguments, don't let
3676 FLAGS_ARGMATCH set warnings_error in warnings_flag.
3677 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
3678
ba7560e2
JD
36792006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
3680
3681 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
3682 empty subargument list. For example: `bison --warnings= parser.y'.
3683
31283fc3
JD
36842006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3685
3686 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
3687 the parser header file so that gcc doesn't warn.
3688
12e35840
JD
36892006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3690
3691 Split the default %destructor/%printer into two kinds: <*> and <!>.
3692 Discussed starting at
3693 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
3694 * NEWS (2.3a+): Mention.
3695 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
3696 previous change today related to mid-rules.
148d66d8 3697 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 3698 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
3699 (TYPE_TAG_ANY): Add as <*>.
3700 (TYPE_TAG_NONE): Add as <!>.
3701 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
3702 for <*> and <!>.
3703 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
3704 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
3705 * src/symlist.c (symbol_list_default_new): Split into tagged and
3706 tagless versions.
3707 (symbol_list_destructor_set, symbol_list_printer_set): Split
3708 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
3709 SYMLIST_DEFAULT_TAGLESS.
3710 * src/symlist.h: Update symbol_list_default*_new prototypes.
3711 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
3712 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
3713 * src/symtab.c (default_destructor, default_destructor_location,
3714 default_printer, default_printer_location): Split each into tagged and
3715 tagless versions.
3716 (symbol_destructor_get, symbol_destructor_location_get,
3717 symbol_printer_get, symbol_printer_location_get): Implement tagged
3718 default and tagless default cases.
3719 (default_destructor_set, default_printer_set): Split each into tagged
3720 and tagless versions.
3721 * src/symtab.h: Update prototypes.
3722 * tests/actions.at (Default %printer and %destructor): Rename to...
3723 (Default tagless %printer and %destructor): ... this, and extend.
3724 (Per-type %printer and %destructor): Rename to...
3725 (Default tagged and per-type %printer and %destructor): ... this, and
3726 extend.
3727 (Default %printer and %destructor for user-defined end token): Extend.
3728 (Default %printer and %destructor are not for error or $undefined):
3729 Update.
3730 (Default %printer and %destructor are not for $accept): Update.
3731 (Default %printer and %destructor for mid-rule values): Extend.
3732 * tests/input.at (Default %printer and %destructor redeclared): Extend.
3733 (Unused values with default %destructor): Extend.
3734
f91b1629
JD
37352006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3736
3737 Don't apply the default %destructor/%printer to an unreferenced midrule
3738 value. Mentioned at
3739 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
3740 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
3741 like $@n instead of just @n so that the default %destructor/%printer
3742 logic doesn't see them as user-defined symbols.
3743 (symbol_is_dummy): Check for both forms of the name.
3744 * src/reader.c (packgram): Remove the `$' from each midrule symbol
3745 name for which the midrule value is referenced in any action.
3746 * tests/actions.at (Default %printer and %destructor for mid-rule
3747 values): New test.
3748 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
3749 for change to dummy symbol names.
3750
519d0004
JD
37512006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
3752
3753 Warn about unset midrule $$ if the corresponding $n is used.
3754 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
3755 $n usage.
3756 (packgram): Before invoking grammar_rule_check on any rule, make sure
3757 all actions have already been scanned in order to set `used' flags.
3758 Otherwise, checking that a midrule's $$ is set will not always work
3759 properly because the midrule check must forward-reference the midrule's
3760 parent rule.
3761 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
3762 warning.
3763
a501eca9
JD
37642006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
3765
3766 More improvements to the documentation of the prologue alternatives:
3767 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
3768 Bison manual.
3769 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
3770 some text to clarify the relative importance of the new directives and
3771 to show how these directives may be viewed as code labels.
3772
2cbe6b7f
JD
37732006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
3774
3775 Similar to the recently removed %before-header, add %code-top as the
3776 alternative to the pre-prologue. Mentioned at
3777 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
3778 Also, let the prologue alternatives appear in the grammar section.
3779 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
3780 (prologue_declaration): Move the existing prologue alternatives to...
3781 (grammar_declaration): ... here and add %code-top.
3782 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
3783
3784 Clean up and extend documentation for the prologue alternatives.
3785 * NEWS (2.3a+): Describe prologue alternatives.
3786 * doc/bison.texinfo (Prologue): Move discussion of prologue
3787 alternatives to...
3788 (Prologue Alternatives): ... this new section, and extend it to discuss
3789 all 4 directives in detail.
148d66d8
JD
3790 (Table of Symbols): Clean up discussion of prologue alternatives and
3791 add %code-top.
2cbe6b7f 3792
e557d3ea
JMG
37932006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3794
3795 DJGPP specific issues.
3796
3797 * djgpp/config.bat: config.hin has been moved to lib. Adjust
3798 config.bat accordingly.
3799 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
3800 * djgpp/config.site: Likewise.
3801
136a0f76
PB
38022006-10-16 Paolo Bonzini <bonzini@gnu.org>
3803
27bd5d67
PB
3804 Replace %*-header with %provides, %requires, %code. See discussion at
3805 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
3806
136a0f76
PB
3807 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
3808 (b4_user_start_header): Remove.
3809 * data/glr.c: Use new macros instead of b4_*start_header
3810 and b4_*end_header.
3811 * data/glr.cc: Likewise.
3812 * data/lalr1.cc: Likewise.
3813 * data/push.c: Likewise.
3814 * data/yacc.c: Likewise.
3815
3816 * doc/bison.texinfo: Remove %before-header, rename
3817 %{start,end,after}-header to %requires, %provides, %code.
3818
3819 * src/parse-gram.y: Likewise (also rename token names accordingly).
3820 * src/scan-gram.l: Likewise.
3821 * tests/actions.at: Likewise.
3822
10f429ef
PE
38232006-10-14 Paul Eggert <eggert@cs.ucla.edu>
3824
3825 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
3826 Problem reported by Joel E. Denny.
3827
38282006-10-14 Jim Meyering <jim@meyering.net>
3829
3830 (Sync from coreutils.)
3831 Work also when the working directory (with e.g. coreutils sources)
3832 is version controlled with git, rather than CVS.
3833 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
3834 rather than CVS.
3835 In messages and comments, say e.g., "checked-out sources",
3836 rather than "CVS sources".
3837 (version_controlled_file): New function. Work for git as well as
3838 for CVS. Don't use grep's -q option.
3839 (slurp): Call it here, in place of CVS-specific code.
3840
c4bd5bf7
JD
38412006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
3842
3843 Fix testsuite for ./configure --enable-gcc-warnings:
3844 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
3845 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
3846 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
3847 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
3848 * test/regression.at (Diagnostic that expects two alternatives):
3849 Likewise.
3850
46356ea4
PE
38512006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3852
231ed89a
PE
3853 * bootstrap.conf (gnulib_modules): Add config-h.
3854 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
3855 worry about HAVE_CONFIG_H.
3856 * lib/abitset.c: Likewise.
3857 * lib/bitset.c: Likewise.
3858 * lib/bitset_stats.c: Likewise.
3859 * lib/bitsetv-print.c: Likewise.
3860 * lib/bitsetv.c: Likewise.
3861 * lib/ebitset.c: Likewise.
3862 * lib/get-errno.c: Likewise.
3863 * lib/lbitset.c: Likewise.
3864 * lib/subpipe.c: Likewise.
3865 * lib/timevar.c: Likewise.
3866 * lib/vbitset.c: Likewise.
3867 * lib/bitset.c: Include "bitset.h" first, to test interface.
3868 * lib/bitset_stats.c: Include "bitset_stats.h" first.
3869 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
3870 * lib/bitsetv.c: Include "bitsetv.h" first.
3871 * lib/get-errno.c: Include "get-errno.h" first.
3872 * m4/.cvsignore: Add config-h.m4.
3873 * tests/actions.at (Default %printer and %destructor for ...):
3874 Adjust expected line numbers in output to reflect removal of #if
3875 HAVE_CONFIG_H lines.
3876 * tests/glr-regression.at (Missed %merge type warnings when ...):
3877 Likewise.
3878 * tests/regression.at (Braced code in declaration in rules section):
3879 Likewise.
3880 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
3881 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
3882 Include <config.h> unconditionally.
3883
46356ea4
PE
3884 * bootstrap: Sync from coreutils, as follows:
3885
3886 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3887
3888 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
3889 variable was sometimes used without being initialized. This
3890 messed up the installation of the INSTALL file in some cases.
3891
3892 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3893
3894 * bootstrap (usage, main program, symlink_to_gnulib): Add option
3895 --copy. Inspired by a suggestion from Bruno Haible.
3896
3897 2006-10-03 Jim Meyering <jim@meyering.net>
3898
3899 * bootstrap: Undo last change to this file, since now gnulib-tool
3900 sticks with the automake default in generating dependencies.
3901
dd4bf078
PE
39022006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3903
cf2a5f7c
PE
3904 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
3905 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
3906
3907 * doc/bison.1: Add copyright notice.
3908
3909 * data/glr.c: Don't include <stdarg.h>; not used.
3910
35fe0834
PE
3911 * NEWS: The -g and --graph options now output graphs in Graphviz
3912 DOT format, not VCG format.
3913 * doc/bison.1: Likewise.
3914 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
3915 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
3916 of this change in
3917 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
3918 * TODO: Remove Graphviz entry.
3919 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
3920 remove vcg.c, vcg.h, vcg_defaults.h.
3921 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
3922 * src/graphviz.c, src/graphviz.h: New files.
3923 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
3924 * src/files.h: Make comment more generic.
3925 * src/main.c (main): Likewise.
3926 * src/print_graph.h: Likewise.
3927 * src/getargs.c (usage): Make usage description more generic.
3928 * src/print_graph.c: Include graphviz.h rather than vcg.h.
3929 (static_graph, fgraph): Remove. All uses changed to pass
3930 arguments instead of sharing a static var.
3931 (print_core, print_actions, print_state, print_graph):
3932 Output graphviz format rather than VCG format.
3933 * tests/.cvsignore: Remove *.vcg; add *.dot.
3934 * tests/output.at: Expect *.dot files, not *.vcg files.
3935
dd4bf078
PE
3936 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
3937 accommodates the 2006-10-08 change.
3938
efdd7421
PE
39392006-10-11 Bob Rossi <bob@brasko.net>
3940
3941 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
3942 (b4_yyssa, b4_yyerror_range): New macros.
3943 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
3944 (yypvarsinit): Remove init of removed fields.
3945 (yypushparse): Remove use of removed fields; use new macros instead.
3946
96a1981a
PE
39472006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3948
3949 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
3950 in a push parser. Reindent slightly to match yacc.c better.
3951
39522006-10-11 Bob Rossi <bob@brasko.net>
3953
46356ea4
PE
3954 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
3955 yymsg_alloc fields.
3956 (yypvarsinit, yypushparse): Remove init of removed fields.
3957 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 3958
c1630a8b
PE
39592006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3960
3961 * THANKS: Add Paolo Bonzini and Bob Rossi.
3962
90b9908d
PB
39632006-10-08 Paolo Bonzini <bonzini@gnu.org>
3964
3965 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
3966 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
3967 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
3968 b4_define_user_cde and uses): Remove.
3969 (b4_comment, b4_prefix, b4_sync_start): New.
3970 * data/bison.m4: New file, with most of the content removed from c.m4.
3971 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
3972 * src/output.c (output_skeleton): Pass bison.m4.
3973 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
3974 only if specified.
3975
cf806753
PE
39762006-10-05 Paul Eggert <eggert@cs.ucla.edu>
3977
3978 Fix test failure reported by Tom Lane in
3979 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
3980 and try to make such failures easier to catch in the future.
3981 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
3982 that's now the caller's responsibility.
3983 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
3984 Set yychar = YYEOF if it's negative.
3985 * tests/actions.at (yylex): Abort if asked to read past EOF.
3986 * tests/conflicts.at (yylex): Likewise.
3987 * tests/cxx-type.at (yylex): Likewise.
3988 * tests/glr-regression.at (yylex): Likewise.
3989 * tests/input.at (yylex): Likewise.
3990 * tests/regression.at (yylex): Likewise.
3991 * tests/torture.at (yylex): Likewise.
3992
0e2f006a
PE
39932006-10-01 Paul Eggert <eggert@cs.ucla.edu>
3994
3995 Fix problems with translating English-language diagnostics.
3996 * bootstrap: Fix bug introduced in recent bootstrap changes, with
3997 respect to bison-runtime pot generation. The YY_ stuff
3998 wasn't being captured.
3999 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
4000 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
4001 * runtime-po/POTFILES.in: Add data/push.c.
4002
e3ddc1e3
PE
40032006-09-29 Paul Eggert <eggert@cs.ucla.edu>
4004
4005 Merge bootstrap changes from coreutils.
4006
4007 2006-09-28 Jim Meyering <jim@meyering.net>
4008
4009 Automatically generated dependencies are important even
4010 when all of the sources in a directory come from gnulib.
4011 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
4012 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
4013
4014 2006-09-23 Jim Meyering <jim@meyering.net>
4015
4016 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
4017
4018 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4019
4020 * bootstrap: Add support for --force.
4021 (usage): New function. Describe usage less tersely.
4022 (CVS_only_file): New var.
4023
01e972b3
PE
40242006-09-21 Paul Eggert <eggert@cs.ucla.edu>
4025
4026 * data/push.c (YYPUSH_MORE): Make it an enum instead.
4027 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
4028 Adjust white space and comments to match GNU style better.
4029
c63d3e90
PE
40302006-09-20 Bob Rossi <bob@brasko.net>
4031
4032 * data/push.c (yyresult_get): Remove function.
4033 (YYPUSH_MORE): Add #define.
4034 (yypushparse): Modify return value.
4035
e70f46d1
PE
40362006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4037
4038 * stamp-h.in: Remove; no longer needed.
4039 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
4040 Remove config.h, config.hin, intl (no longer created).
4041 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
4042 stamp-h1.
4043
4044 Sync bootstrap from coreutils, as follows:
4045
4046 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
4047
4048 * bootstrap (symlink_to_gnulib): New function.
4049 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
4050 to copies-of-gnulib.
4051 (cp_mark_as_generated, slurp, gnulib_files):
4052 Avoid making a copy if it's the same as the old version.
4053 (gnulib_files): Add support for this variable (used by Bison).
4054
a92be413
PE
40552006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4056
4057 * src/getargs.c (usage): Rework to use conventions similar to
4058 coreutils, to make translation a bit easier and the code a bit
4059 smaller. Problem reported by Tim Van Holder.
4060
4f82b42a
PE
40612006-09-15 Paul Eggert <eggert@cs.ucla.edu>
4062
3b2942e6
PE
4063 Use some of gnulib's new modules, taken from coreutils.
4064
4065 * bootstrap: Sync from coreutils, except add support for gnulib_files.
4066 * bootstrap.conf: New file.
4067 (gnulib_modules): Add configmake, inttypes, unistd.
4068 (XGETTEXT_OPTIONS): Add complain, complain_at,
4069 fatal, fatal_at, warn, warn_at, unexpected_end.
4070 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
4071 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
4072 (gl_EARLY): Add.
4073 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
4074 (gl_INIT): Add
4075 (GNULIB_AUTOCONF_SNIPPET): Remove.
4076 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
4077 the pickiest.
4078 * lib/.cvsignore: Add inttypes_.h.
4079 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
4080 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
4081 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
4082 no-longer-necessary initializations.
4083 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
4084 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
4085 use the unistd module.
4086 * src/system.h: Likewise.
4087 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
4088 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
4089 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
4090 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
4091 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
4092 * src/system.h: Include inttypes.h unconditionally, now that we
4093 use the inttypes module. Don't bother to include stdint.h, since
4094 inttypes.h now does that for us.
4095 (LOCALEDIR): Remove, now that we use the configmake module.
4096 * src/getargs.c: Include configmake.h.
4097 * src/main.c: Likewise.
4098 * src/output.c: Likewise.
4099 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
4100 not from $abs_top_builddir, since config.h moved.
4101
4102
4f82b42a
PE
4103 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
4104 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
4105
4106 * src/parse-gram.y (symbol_declaration): Don't put statements
4107 before declarations; it's not portable to C89.
4108 * src/scan-code.l (handle_action_at): Likewise.
4109
4110 * src/scan-code.l: Always initialize braces_level; the old code
4111 left it uninitialized and therefore had undefined behavior.
4112
4113 Don't attempt to redefine 'assert', since it runs afoul of
4114 systems where standard headers (mistakenly) include <assert.h>.
4115 Instead, define and use our own alternative, called 'aver'.
4116 * src/reader.c: Don't include assert.h, since we no longer
4117 use assert.
4118 * src/scan-code.l: Likewise.
4119 * src/system.h (assert): Remove, replacing with....
4120 (aver): New function, taking a bool arg. All uses changed.
4121 * src/tables.c (pack_vector): Ensure that aver arg is bool,
4122 not merely an integer.
4123
31c10e38
PE
41242006-09-15 Bob Rossi <bob@brasko.net>
4125
4126 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
4127 * data/c.m4 (YYPUSH): New.
4128 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
4129 * src/getargs.c (push_parser): New var.
4130 * src/getargs.h (push_parser): New declaration.
4131 * src/output.c (prepare): Add macro insertion of `push_flag'.
4132 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
4133 (prologue_declaration): Parse %push-parser.
4134 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
4135 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
4136 list of removed lines from the traces observed.
4137 (AT_CHECK_CALC_LALR): Added push parser tests.
4138
fa7b79c0
PE
41392006-09-13 Paul Eggert <eggert@cs.ucla.edu>
4140
21fe08ca
PE
4141 * NEWS: Version 2.3a.
4142 * configure.ac (AC_INIT): Likewise.
4143
e8ec4d9b
PE
4144 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
4145 "#define YYSTYPE int" that caused "make maintainer-check" to fail
4146 due to header ordering dependencies. I don't know why the #define
4147 was there.
4148
fa7b79c0
PE
4149 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
4150 runtime cost when YYDEBUG is not defined, and so that some tests
4151 that used to fail now work. Problem and initial suggestion by
4152 Paolo Bonzini.
4153 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
4154 * data/glr.cc (b4_parser_class_name):
4155 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
4156 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
4157 (yydebug_) [YYDEBUG]: New member.
4158 (yycdebug_): Now defined only if YYDEBUG.
4159 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
4160 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
4161 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
4162 if YYYDEBUG.
4163 (debug_stream, set_debug_stream, debug_level, set_debug_level):
4164 Define only if YYDEBUG.
4165 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
4166 set_debug_level.
4167 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
4168 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
4169 AT_CHECK_CALC_GLR_CC that are working now.
4170
4ec13d60
PE
41712006-09-12 Paul Eggert <eggert@cs.ucla.edu>
4172
4173 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
4174 We don't need them in glr.cc, and glr.c defines them.
4175 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
4176 assumes that defining it to anything is the same as defining
4177 it to 1. Problem reported by Paolo Bonzini.
4178
8e1687ae
PE
41792006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
4180
4181 * data/c.m4 (b4_null, b4_case): Define.
4182 * src/output.c (prepare_symbols): Use b4_null.
4183 (user_actions_output): Use b4_case.
4184
3dc5e96b
PE
41852006-09-11 Paul Eggert <eggert@cs.ucla.edu>
4186
aef3da86
PE
4187 * data/glr.c (b4_shared_declarations): Put start-header first,
4188 before any #includes that we generate, so that feature-test
4189 macros work. Problem reported by Michael Deutschmann in
4190 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
4191 * data/lalr1.cc: Likewise.
4192 * doc/bison.texinfo (Prologue): Document that feature-test macros
4193 should be defined before any Bison declarations.
4194 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
4195 that depend on location.hh after, not before, Bison decls, since
4196 we now include location.hh after the first user prologue.
4197
3dc5e96b
PE
4198 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
4199 Sander Brandenburg in
4200 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
4201 Also, fix minor white space and comment issues.
aef3da86
PE
4202 (Prologue): Mention that it's better to define feature-test macros
4203 before Bison declarations. Problem reported by Michael Deutschmann.
4204
4205 * README-cvs: Fix typo: "&" should be "&&". Problem reported
4206 by Jim Meyering.
4207 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
4208 This adjusts to recent gnulib changes.
3dc5e96b 4209
b2a0b7ca
JD
42102006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
4211
4212 Finish implementation of per-type %destructor/%printer. Discussed
4213 starting at
4214 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
4215 and
4216 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
4217 * NEWS (2.3+): Add a description of this feature to the default
4218 %destructor/%printer description.
4219 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
4220 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4221 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
4222 list node contains a semantic type.
4223 * src/symtab.c, src/symtab.h: Extend with a table that associates
4224 semantic types with their %destructor's and %printer's.
4225 (semantic_type_from_uniqstr, semantic_type_get,
4226 semantic_type_destructor_set, semantic_type_printer_set): New functions
4227 composing the public interface of that table.
4228 (symbol_destructor_get, symbol_destructor_location_get,
4229 symbol_printer_get, symbol_printer_location_get): If there's no
4230 per-symbol %destructor/%printer, look up the per-type before trying
4231 the default.
4232 * tests/actions.at (Per-type %printer and %destructor): New test case.
4233 * tests/input.at (Default %printer and %destructor redeclared):
4234 Extend to check that multiple occurrences of %symbol-default in a
4235 single %destructor/%printer declaration is an error.
4236 (Per-type %printer and %destructor redeclared, Unused values with
4237 per-type %destructor): New test cases.
4238
3be03b13
JD
42392006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
4240
4241 Require default %destructor/%printer to be declared using
4242 %symbol-default instead of an empty symbol list, and start working on
4243 new per-type %destructor/%printer. Discussed at
4244 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
4245 * NEWS (2.3+): Add %symbol-default to example.
4246 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 4247 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
4248 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
4249 (generic_symlist, generic_symlist_item): New nonterminals for creating
4250 a list in which each item is a symbol, semantic type, or
4251 %symbol-default.
4252 (grammar_declaration): Use generic_symlist in %destructor and %printer
4253 declarations instead of symbols.1 or an empty list.
4254 (symbol_declaration, precedence_declaration, symbols.1): Update actions
4255 for changes to symbol_list.
4256 * src/reader.c: Update for changes to symbol_list.
4257 * src/scan-code.l: Likewise.
4258 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
4259 * src/symlist.c, src/symlist.h: Extend such that a list node may
4260 represent a semantic type or a %symbol-default in addition to just an
4261 ordinary symbol. Add switched functions for setting %destructor's and
4262 %printer's.
4263 * tests/actions.at, tests/input.at: Add %symbol-default to all default
4264 %destructor/%printer declarations.
4265
3508ce36
JD
42662006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
4267
4268 Whether the default %destructor/%printer applies to a particular symbol
4269 isn't a question of whether the user *declares* that symbol (in %token,
4270 for example). It's a question of whether the user by any means
4271 *defines* the symbol at all (by simply using a char token, for
4272 example). $end is defined by Bison whereas any other token with token
4273 number 0 is defined by the user. The error token is always defined by
4274 Bison regardless of whether the user declares it with %token, but we
4275 may one day let the user define error as a nonterminal instead.
4276 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
4277 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
4278 the meaning of "user-defined".
4279 * tests/actions.at (Default %printer and %destructor for user-declared
4280 end token): Rename to...
4281 (Default %printer and %destructor for user-defined end token): ...
4282 this.
4283
4284 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
4285 computation of whether to apply the default, don't maintain a list of
4286 every Bison-defined symbol. Instead, just check for a first character
4287 of '$', which a user symbol cannot have, and check for the error token.
4288
9350499c
JD
42892006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
4290
4291 Don't apply the default %destructor or %printer to the error token,
4292 $undefined, or $accept. This change fits the general rule that the
4293 default %destructor and %printer are only for user-declared symbols,
4294 and it solves several difficulties that are described in the new test
4295 cases listed below.
4296 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
4297 * tests/actions.at (Default %printer and %destructor are not for error
4298 or $undefined, Default %printer and %destructor are not for $accept):
4299 New test cases.
4300
4d7370cb
JD
43012006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
4302
4303 Allow %start after the first rule.
4304 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
4305 when parsing the first rule.
4306 (check_and_convert_grammar): Search for it here after all grammar
4307 declarations have been parsed. Skip midrules, which have dummy LHS
4308 nonterminals.
4309 * src/symtab.c (symbol_is_dummy): New function.
4310 * src/symtab.h (symbol_is_dummy): Declare it.
4311 * tests/input.at (%start after first rule): New test.
4312
6d0ef4ec
JD
43132006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
4314
4315 Redo some of the previous commit: add back the ability to use
4316 non-aliased/undeclared string literals since it might be useful to
4317 those declaring %token-table.
4318 * src/reader.c (check_and_convert_grammar): Undo changes in previous
4319 commit: don't worry about complaints from symbols_pack.
4320 * src/symtab.c (symbol_new, symbol_class_set,
4321 symbol_check_alias_consistency): Undo changes in previous commit: count
4322 each string literal as a new symbol and token, assign it a symbol
4323 number, and don't complain about non-aliased string literals.
4324 (symbols_pack): Since symbol_make_alias still does not decrement symbol
4325 and token counts but does still set aliased tokens to the same number,
4326 symbol_pack_processor now leaves empty slots in the symbols array.
4327 Remove those slots.
4328 * tests/regression.at (Undeclared string literal): Remove test case
4329 added in previous commit since non-aliased string literals are allowed
4330 again.
4331 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
4332 remove unnecessary string literal declarations.
4333 * tests/sets.at (Firsts): Likewise.
4334
965537bc
JD
43352006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
4336
4337 Don't allow an undeclared string literal, but allow a string literal to
4338 be used before its declaration.
4339 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
4340 symbols_pack complained.
4341 * src/symtab.c (symbol_new): Don't count a string literal as a new
4342 symbol.
4343 (symbol_class_set): Don't count a string literal as a new token, and
4344 don't assign it a symbol number since symbol_make_alias does that.
4345 (symbol_make_alias): It's not necessary to decrement the symbol and
4346 token counts anymore. Don't assume that an alias declaration occurs
4347 before any uses of the identifier or string, and thus don't assert that
4348 one of them has the highest symbol number so far.
4349 (symbol_check_alias_consistency): Complain if there's a string literal
4350 that wasn't declared as an alias.
4351 (symbols_pack): Bail if symbol_check_alias_consistency failed since
4352 symbol_pack asserts that every token has been assigned a symbol number
4353 although undeclared string literals have not.
4354 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 4355 string literal): New test cases.
965537bc
JD
4356 (Characters Escapes, Web2c Actions): Declare string literals as
4357 aliases.
4358 * tests/sets.at (Firsts): Likewise.
4359
47aee066
JD
43602006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
4361
4362 In the grammar scanner, STRING_FINISH unclosed constructs and return
4363 them to the parser in order to improve error messages.
4364 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
4365 SC_BRACED_CODE, SC_PROLOGUE): Implement.
4366 * tests/input.at (Unclosed constructs): New test case.
4367 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
4368 seen.
4369
4370 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
4371 unused global.
4372
1f6b3679
JD
43732006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
4374
4375 Handle string aliases for character tokens correctly.
4376 * src/symtab.c (symbol_user_token_number_set): If the token has an
4377 alias, check and set its alias's user token number instead of its own,
4378 which is set to indicate the alias. Previously, every occurrence of
4379 the character token in the grammar overwrote that alias indicator with
4380 the character code.
4381 * tests/input.at (String aliases for character tokens): New test.
4382
219741d8
JD
43832006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
4384
4385 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
4386
11daa4e7
PE
43872006-08-11 Paul Eggert <eggert@cs.ucla.edu>
4388
4389 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
4390 to prevent failures when building on older platforms.
4391 Check for autopoint failure.
4392 Set XGETTEXT_OPTIONS to values that check for C format strings,
4393 so that translators are warned about them (this also helps
4394 prevent core dumps).
4395
4396 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
4397 function, since it simplifies our code a bit.
4398
4399 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
4400 rather than -W, so we don't get bogus warnings about sign comparisons.
4401 Add -Wpointer-arith, since that warning is useful (it reports code
4402 that does not conform to C89 and that some compilers reject).
4403 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
4404 since it's no longer needed.
4405
f9bfc42a
JD
44062006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
4407
4408 Clean up scanners a bit.
4409 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
4410 definitions so gcc won't warn when obstack_for_string is unused.
4411 * src/scan-code.l: config.h and system.h are already #include'd by
4412 scan-code-c.c, so get rid of them here.
4413 * src/scan-gram.l: Likewise.
4414 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
4415 definitions rather than duplicating the rest of it.
4416 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
4417
06e8700a
JD
44182006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
4419
4420 Suppress signed/unsigned comparison warnings for yycheck.
4421 * data/c.m4 (b4_safest_int_type): New macro.
4422 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
4423 a signed int type, cast it to b4_safest_int_type first.
4424 * data/yacc.c: Likewise.
4425 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
4426 also overwritten.
4427
9c437126
PE
44282006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
4429
4430 * doc/bison.texinfo: Fix some typos.
4431
284d8a13
PE
44322006-08-02 Paul Eggert <eggert@cs.ucla.edu>
4433
4434 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
4435 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
4436
4437 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
4438 the latest gnulib does this a different way.
4439 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
4440 translation was patched, so stop omitting it.
4441
ec5479ce
JD
44422006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
4443
4444 Enable declaration of default %printer/%destructor. Make the parser
4445 use these for all user-declared grammar symbols for which the user does
4446 not declare a specific %printer/%destructor. Thus, the parser uses it
4447 for token 0 if the user declares it but not if Bison generates it as
4448 $end. Discussed starting at
4449 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
4450 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
4451 and
4452 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
4453 * NEWS (2.3+): Mention.
4454 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
4455 declare a %destructor for a mid-rule's semantic value. It's just
4456 impossible to declare one specific to it.
4457 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
4458 code. Describe default %destructor form.
4459 * src/parse-gram.y (grammar_declaration): Parse default
4460 %printer/%destructor declarations.
4461 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
4462 and symbol_destructor_location_get rather than accessing the destructor
4463 and destructor_location members of struct symbol.
4464 (symbol_printers_output): Likewise but for %printer's.
4465 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
4466 again.
4467 * src/symtab.c (default_destructor, default_destructor_location,
4468 default_printer, default_printer_location): New static global
4469 variables to record the default %destructor and %printer.
4470 (symbol_destructor_get, symbol_destructor_location_get,
4471 symbol_printer_get, symbol_printer_location_get): New functions to
4472 compute the appropriate %destructor and %printer for a symbol.
4473 (default_destructor_set, default_printer_set): New functions to set the
4474 default %destructor and %printer.
4475 * src/symtab.h: Prototype all those new functions.
4476 * tests/actions.at (Default %printer and %destructor): New test to
4477 check that the right %printer and %destructor are called, that they're
4478 not called for $end, and that $$ and @$ work correctly.
4479 (Default %printer and %destructor for user-declared end token): New
4480 test to check that the default %printer and %destructor are called for
4481 a user-declared end token.
4482 * tests/input.at (Default %printer and %destructor redeclared, Unused
4483 values with default %destructor): New tests to check related grammar
4484 warnings and errors.
4485
868d2d96
JD
44862006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
4487
4488 Clean up handling of %destructor for the end token (token 0).
4489 Discussed starting at
4490 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
4491 and
4492 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
4493
4494 Make the skeletons consistent in how they pop the end token and invoke
4495 its %destructor.
4496 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
4497 state, which has token number 0, since this would invoke the
4498 %destructor for the end token.
4499 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
4500 until after shifting the end token, or else it won't be popped.
4501 * data/yacc.c (yyparse): Likewise.
4502
4503 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
4504 it's the end token. Upon termination, destroy an unshifted lookahead
4505 even when it's the end token.
4506 * data/lalr1.cc (yy::parser::parse): Likewise.
4507 * data/yacc.c (yyparse): Likewise.
4508
4509 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
4510 value warnings for the end token when the user gives the end token a
4511 %destructor.
4512
4513 * tests/actions.at (Printers and Destructors): Test all the above.
4514
62a9592d
PE
45152006-07-24 Paul Eggert <eggert@cs.ucla.edu>
4516
4517 Update to latest gnulib and gettext versions.
4518 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
4519 Add fopen-safer.
4520 (gnulib_files): Add m4/warning.m4. Don't worry about files
4521 overwritten by autopoint.
4522 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
4523 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
4524 rejects them.
4525 Don't use autoreconf; instead, invoke autopoint etc. by hand,
4526 so that we can remove the intl files at a better time.
4527 (intl_files_to_remove): Remove aclocal.m4, since it gets
4528 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
4529 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
4530 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
4531 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
4532 Remove datarootdir hack; no longer needed.
4533 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
4534 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
4535 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
4536 strdup.h.
4537 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
4538 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
4539
10d6970f
PE
45402006-07-20 Paul Eggert <eggert@cs.ucla.edu>
4541
4542 * bootstrap: Adjust to today's change to gnulib-tool by invoking
4543 it with --assume-autoconf='latest-stable'.
4544
50a33993
JD
45452006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
4546
4547 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
4548 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
4549 YYSTYPE' and `{'.
4550 * src/muscle_tab.h (muscle_grow): Replace the header comments with
4551 those from muscle_tab.c since the old ones are misleading.
4552
2ce4ed68
AD
45532006-07-13 Akim Demaille <akim@epita.fr>
4554
4555 Support %define "KEY" {VALUE}.
4556 * src/scan-code.h, src/scan-code.l (translate_action)
4557 (translate_rule_action, translate_symbol_action, translate_code):
4558 Return char *, not const char *.
4559 * src/parse-gram.y (declaration): Rename as...
4560 (prologue_declaration): this.
4561 (string_content): Remove this nonterminal, use STRING.
4562 (braceless, content, content.opt): New nonterminal.
4563 Use them.
4564 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
4565 as value.
4566 * src/scan-gram.l (getargs.h): Don't include it.
4567
db7e5eb5
PE
45682006-07-12 Paul Eggert <eggert@cs.ucla.edu>
4569
4570 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
4571 rather than a for-loop that declares a local bool variable. This
4572 should work around a compatibility problem with a Cray x1e C++
4573 compiler reported by Hung Nguyen in
4574 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
4575 The for-loop was introduced in the 2004-11-17 change but I don't
4576 know why it was needed.
4577
a5d80ba5
AD
45782006-07-12 Akim Demaille <akim@epita.fr>
4579
4580 * data/c.m4: Comment changes.
4581
23eb2a69
AD
45822006-07-10 Akim Demaille <akim@lrde.epita.fr>
4583
4584 * src/complain.c (error_message, ERROR_MESSAGE): New.
4585 To factor...
4586 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
4587 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
4588
ddc8ede1
PE
45892006-07-09 Paul Eggert <eggert@cs.ucla.edu>
4590
4591 * NEWS: Instead of %union, you can define and use your own union type
4592 YYSTYPE if your grammar contains at least one <type> tag.
4593 Your YYSTYPE need not be a macro; it can be a typedef.
4594 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
4595 (Union Decl, Decl Summary): Document this.
4596 * data/glr.c (YYSTYPE): Implement this.
4597 * data/glr.cc (YYSTYPE): Likewise.
4598 * data/lalr1.cc (YYSTYPE): Likewise.
4599 * data/yacc.c (YYSTYPE): Likewise.
4600 * src/output.c (prepare): Output tag_seen_flag.
4601 * src/parse-gram.y (declaration, grammar_declaration):
4602 Use 'union_seen' rather than 'typed' to determine whether
4603 %union has been seen, since grammars can now be typed without
4604 %union.
4605 (symbol_declaration, type.opt, symbol_def):
4606 Keep track of whether a tag has been seen.
4607 * src/reader.c (union_seen, tag_seen): New vars.
4608 (typed): remove.
4609 * src/reader.h (union_seen, tag_seen, typed): Likewise.
4610 * src/scan-code.l (untyped_var_seen): New variable.
4611 (handle_action_dollar): Adjust to above changes.
4612 (handle_action_dollar, handle_action_at):
4613 Improve overflow checking for outlandish numbers.
4614 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
4615 avoid new diagnostics generated by above changes.
4616 * tests/regression.at (YYSTYPE typedef): Add test to check
4617 for type tags without %union.
4618
4619 * src/symlist.c (symbol_list_length): Return int, not unsigned
4620 int, since callers expect int. This may need to get revisited
4621 once we have proper integer overflow checking.
4622
4623 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
4624 object is now static.
4625
4626 * src/getargs.c (flags_argmatch): Return void, not int,
4627 to pacify ./configure --enable-gcc-warnings.
4628
4629 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
4630 since last_string is already defined to FLEX_PREFIX (last_string).
4631
7b42569e
AD
46322006-07-09 Akim Demaille <akim@lrde.epita.fr>
4633
4634 Implement --warnings/-W.
4635 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
4636 replaced by...
4637 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
4638 Adjust callers.
4639 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
4640 (warnings_args, warnings_types): New.
4641 (getargs, short_options, long_options): Accept -W/--warnings.
4642 Sort the options by alphabetical order, upper case letter right
4643 before its lower case.
4644
3b452f4e
JD
46452006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4646
4647 Change %merge result type clash warnings to errors. Discussed at
4648 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
4649 * src/reader.c (record_merge_function_type): Use complain_at.
4650 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4651 declared later): Update test case results.
4652
b8a41559
AD
46532006-07-09 Akim Demaille <akim@lrde.epita.fr>
4654
4655 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
4656 to be in alphabetical order.
4657 (trace_args): Spelling fixes.
4658
cd9e1ba2
PE
46592006-07-09 Paul Eggert <eggert@cs.ucla.edu>
4660
4661 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
4662 so they don't collide with user-defined macros.
4663 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
4664 this was never guaranteed, and now that we're using gnulib stdint,
4665 which defines int_fast16_t to long int, the problem is exposed.
4666
cb48f191
PE
46672006-07-08 Paul Eggert <eggert@cs.ucla.edu>
4668
b8445a15
PE
4669 * data/c.m4 (b4_basename): Simplify a bit, since we don't
4670 need the full POSIX semantics (and weren't implementing them
4671 anyway).
4672
cb48f191
PE
4673 Adjust to Autoconf 2.60 and today's gnulib.
4674 * bootstrap (gnulib_modules): Add stdint.
4675 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
4676 no longer copies it.
4677 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
4678 since stdint needs the former and wcwidth (which is now required
4679 by mbswidth) needs the latter.
4680 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
4681 work around a compatibility glitch between gettext 0.14.6 and
4682 Autoconf 2.60.
4683 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
4684 Do not check for uintptr_t, since new stdint module does the right
4685 thing.
4686 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
4687 Add stdint.h, stdint_.h, wcwidth.h.
4688 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
4689 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
4690 stdint.m4, wchar_t.m4, wcwidth.m4.
4691 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
4692 usual order for ../lib/*.h files.
4693 (file_name_split): Use last_component, not base_name, to adjust
4694 to gnulib changes.
4695 * src/parse-gram.h: Include <strverscmp.h> in the usual order
4696 for ../lib/*.h files.
4697 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
4698 Define unconditionally, since we now assume the stdint module.
4699 * src/scan-skel.l: Include <dirname.h>.
4700 (BASE_QPUTS): Use last_component, not base_name.
4701 * src/system.h: Include <unlocked-io.h> in the usual order
4702 for ../lib/*.h files. Include <stdint.h> unconditionally,
4703 since we now use the stdint module.
4704 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
4705 HAVE_UINTPTR_T, since we now use the stdint module.
4706 (base_name): Remove decl, since files now include <dirname.h>
4707 to get the decl.
4708
cd48d21d
AD
47092006-07-08 Akim Demaille <akim@lrde.epita.fr>
4710
4711 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
4712 New, default to 1.
4713 * data/yacc.c, data/glr.c, data/location.cc: Use them.
4714 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
4715 default.
4716 * tests/calc.at: Adjust.
4717
8ec0a172
AD
47182006-07-08 Akim Demaille <akim@lrde.epita.fr>
4719
b8445a15 4720 * data/c.m4 (b4_basename): New.
8ec0a172
AD
4721 (b4_syncline): Also output the location of its invocation (from
4722 the skeleton).
4723 (b4_user_action, b4_define_user_action, b4_user_actions)
4724 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
4725 (b4_user_stype): New.
4726 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
4727
4a678af8
JD
47282006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
4729
4730 In the grammar file, the first column is 1 not 0 on the first line as
4731 on every other line.
4732 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
4733 * tests/input.at (Torturing the Scanner): Update output.
4734
4735 * src/scan-gram.l (scanner_cursor): Declare it static.
4736
dd60572a
JD
47372006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
4738
4739 In warnings, say "previous declaration" rather than "first
4740 declaration".
4741 * src/symtab.c (redeclaration): Do that here.
4742 * src/reader.c (record_merge_function_type): In the case of a result
4743 type clash, report the previous declaration rather than the very first
4744 one in the grammar file.
4745 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4746 declared later): Add a third declaration to check this behavior.
4747 * tests/input.at (Incompatible Aliases): Update output.
4748
2073e1b6
AD
47492006-06-27 Akim Demaille <akim@epita.fr>
4750
4751 * doc/Doxyfile.in: New.
4752 * doc/Makefile.am: Use it.
4753 * src/lalr.h, src/symtab.h: Initial doxygenation.
4754
8ee5b538
JD
47552006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4756
4757 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
4758 declared after the %merge. This continues the effort of the previous
4759 patch.
8ee5b538
JD
4760 * src/reader.c (get_merge_function): Don't set the merger type yet.
4761 (record_merge_function_type): New function for setting the merger type
4762 and checking for clashes.
4763 (grammar_current_rule_merge_set): Set the location of the %merge for
4764 the current rule.
4765 (packgram): Invoke record_merge_function_type for each rule now that
4766 all symbol type declarations have been parsed.
4767 * src/reader.h (merger_list.type_declaration_location): New member
4768 storing the location of the first %merge from which the type for this
4769 merging function was derived.
4770 * src/symlist.h (symbol_list.merger_declaration_location): New member
4771 storing the location of a rule's %merge, if any.
4772 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
4773 declared later): New test to catch the error fixed by the above patch.
4774
ffa4ba3a
JD
47752006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4776
4777 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
4778 declarations appear after the rules. Discussed at
4779 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
4780 and
4781 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
4782 Don't mistake the type of $$ in a midrule to be that of its parent
4783 rule's $$.
ffa4ba3a
JD
4784 * src/reader.c (grammar_current_rule_end): Don't invoke
4785 grammar_rule_check yet since not all symbol declarations may have been
4786 parsed yet.
4787 (grammar_midrule_action): Likewise.
4788 Don't record whether the midrule's $$ has been used yet since actions
4789 haven't been translated yet.
4790 Record the midrule's parent rule and its RHS index within the parent
4791 rule.
4792 (grammar_current_rule_action_append): Don't translate the action yet
4793 since not all symbol declarations may have been parsed yet and, thus,
4794 warnings about types for $$, $n, @$, and @n can't be reported yet.
4795 (packgram): Translate the action and invoke grammar_rule_check now that
4796 all symbol declarations have been parsed.
4797 * src/scan-code.l (handle_action_dollar): Now that this is invoked
4798 after parsing the entire grammar file, the symbol list here in the case
4799 of a midrule is actually the midrule's empty RHS, so reference its
4800 parent rule's RHS where necessary.
4801 On the other hand, now that you can already know it's a midrule, you
4802 aren't forced to think $$ has the same type as its parent rule's $$.
4803 (handle_action_at): In the case of a midrule, reference the parent rule
4804 where necessary.
4805 * src/symlist.c (symbol_list_new): Initialize new midrule-related
4806 members.
4807 (symbol_list_length): Now that this is invoked after all rules have
4808 been parsed, a NULL symbol (rather than a NULL symbol list node)
4809 terminates a rule. symbol_list_print already does this correctly.
4810 * src/symlist.h (symbol_list.midrule_parent_rule,
4811 symbol_list.midrule_parent_rhs_index): New members so that midrules can
4812 remember their relationships with their parents.
4813 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
4814 fixed by the above patch.
4815 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
4816 implementing...
4817 (Unused values): ... this old test case and...
4818 (Unused values before symbol declarations): ... this new test case.
4819 This one is the same as `Unused values' except that all symbol
4820 declarations appear after the rules in order to catch the rest of the
4821 errors fixed by the above patch.
4822
e256e17f
JD
48232006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4824
300a1930
JD
4825 More cleanup.
4826 * src/reader.c (current_rule): Declare it static since it's no longer
4827 used outside this file.
4828 (grammar_current_rule_action_append): Remove redundant arguments from
4829 translate_rule_action invocation.
4830 * src/reader.h (current_rule): Remove this unused extern.
4831 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
4832 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 4833
381ecb06
JD
48342006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
4835
4836 Clean up yesterday's patch.
4837 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
4838 to...
4839 * src/reader.c (grammar_current_rule_action_append): ... here for
4840 consistency with grammar_current_rule_symbol_append.
4841 * tests/regression.at (Braced code in declaration in rules section):
4842 Make yyerror and yylex static as usual.
4843
4210cd0b
JD
48442006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
4845
4846 Fix bug that mistakes braced code in a declaration in the rules section
4847 to be a rule action. Mentioned at
4848 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
4849 * src/scan-gram.l: Move midrule action detection from the start of the
4850 scanning of any braced code to...
4851 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
4852 action. For readability, use $2 and @2 rather than the equivalent
4853 global variables.
4854 * tests/regression.at (Braced code in declaration in rules section):
4855 New test to catch the error fixed by the above patch.
4856
4857 Work on code readability some.
4858 * src/scan-code.l (current_rule): Get rid of this misleading and
4859 redundant declaration: it's actually extern'ed in reader.h.
4860 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
4861 translate_action): Add a rule argument and use it instead of the global
4862 current_rule.
4863 (translate_rule_action): This already receives current_rule through an
4864 argument, so pass it on to translate_action instead of assigning
4865 current_rule to current_rule.
4866 (translate_symbol_action, translate_code): Pass rule = NULL to
4867 translate_action.
4868
34f98f46
JD
48692006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
4870
4871 Rename %before-definitions to %start-header and %after-definitions to
4872 %end-header. Don't use these declarations to separate pre-prologue
4873 blocks from post-prologue blocks. Add new order-independent
4874 declarations %before-header and %after-header as alternatives to the
4875 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
4876 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
4877 * NEWS (2.3+): Update for these changes.
4878 * data/glr.c (b4_before_definitions): Update to...
4879 (b4_start_header): ... this.
4880 (b4_after_definitions): Update to...
4881 (b4_end_header): ... this.
4882 * data/glr.cc: Likewise.
4883 * data/lalr1.cc: Likewise.
4884 * data/yacc.c: Likewise.
4885 * doc/bison.texinfo (The prologue): Update names, and replace remaining
4886 prologue blocks with %*-header declarations.
4887 (Calc++ Parser): Likewise.
91661ebb 4888 (Decl Summary): Update names.
148d66d8 4889 (Table of Symbols): Update description.
34f98f46
JD
4890 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
4891 (PERCENT_END_HEADER): ... this.
4892 (PERCENT_BEFORE_DEFINITIONS): Update to...
4893 (PERCENT_START_HEADER): ... this.
4894 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4895 (declaration): Update token names and m4 macro names.
4896 When parsing %end-header and %start-header, invoke translate_code
4897 before muscle_code_grow, and no longer set global booleans to remember
4898 whether these declarations have been seen.
4899 Parse new %after-header and %before-header.
4900 * src/reader.c (before_definitions, after_definitions): Remove.
4901 (prologue_augment): Accept a new bool argument to specify whether to
4902 augment the pre-prologue or post-prologue.
4903 * src/reader.h (before_definitions, after_definitions): Remove these
4904 extern's.
4905 (prologue_augment): Add new bool argument.
4906 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
4907 (PERCENT_END_HEADER): ... this.
4908 (PERCENT_BEFORE_DEFINITIONS): Update to...
4909 (PERCENT_START_HEADER): ... this.
4910 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4911 * tests/actions.at (Printers and Destructors): Update names.
4912
31b2b07e
JD
49132006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
4914
4915 Add comparison operators for C++ location classes. Discussed at
4916 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
4917 * data/c++.m4 (b4_define_location_comparison): New boolean %define
4918 declaration indicating whether filename_type has an operator==. If
4919 filename_type is `std::string', it defaults to `1', `0' otherwise.
4920 * data/location.cc: Iff b4_define_location_comparison is `1', add
4921 operator== and operator!= for class position and for class location.
4922
4923 Some minor fixes.
4924 * src/scan-action.l: Remove unused file.
4925 * src/symtab.c (symbol_printer_set): Use printer_location not
4926 destructor_location.
4927 * src/symtab.h (struct symbol): Replace incorrect source comment for
4928 printer members.
4929 * tests/input.at (Incompatible Aliases): Update output with correct
4930 printer location.
4931
9bc0dd67
JD
49322006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
4933
4934 Don't put the pre-prologue in the header file. For the yacc.c code
4935 file and the glr.c header and code files, move the pre-prologue before
4936 the token definitions. Add new %before-definitions and
4937 %after-definitions to declare code that will go in both the header file
4938 and code file. Discussed at
4939 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
4940 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
4941 and
4942 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
4943 * NEWS (2.3+): Describe these changes.
4944 * data/glr.c (b4_pre_prologue): Move from within to before...
4945 (b4_shared_declarations): ... this.
4946 Add new b4_before_definitions before b4_token_enums.
4947 Add new b4_after_definitions at the end.
4948 * data/glr.cc (b4_pre_prologue): Replace with...
4949 (b4_before_definitions): ... this in the header file.
4950 (b4_after_definitions): New near the end of the header file.
4951 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
4952 code file right before including the header file.
4953 (b4_before_definitions): New in the previous position of
4954 b4_pre_prologue in the header file.
4955 (b4_after_definitions): New near the end of the header file.
4956 * data/yacc.c: Clean up some m4 quoting especially in the header file.
4957 (b4_token_enums_defines): In the code file, move to right before
4958 YYSTYPE for consistency with the header file.
4959 (b4_before_definitions): New right before b4_token_enums_defines in
4960 both the header and code file.
4961 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
4962 header and code file.
4963 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
4964 of prologues for %union dependencies.
91661ebb
JD
4965 (Decl Summary): In %defines description, mention the effect of
4966 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
4967 (Calc++ Parser): Forward declare driver in a %before-definitions rather
4968 than in the pre-prologue so that make check succeeds.
148d66d8 4969 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
4970 %after-definitions.
4971 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
4972 %before-definitions.
4973 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
4974 (declaration): Parse those declarations and append to
4975 b4_before_definitions and b4_after_definitions, respectively.
4976 * src/reader.c (before_definitions, after_definitions): New bools to
4977 track whether those declarations have been seen.
4978 (prologue_augment): Add to the post-prologue if %union,
4979 %before-definitions, or %after-definitions has been seen.
4980 * src/reader.h (before_definitions, after_definitions): New extern's.
4981 * src/scan-gram.l: Scan the new declarations.
4982 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
4983 prologue block in a %before-definitions or a %after-definitions based
4984 on whether the %union is declared.
4985 * tests/regression.at (Early token definitions with --yacc, Early token
4986 definitions without --yacc): Move tests for token definitions into the
4987 post-prologue since token names are no longer defined in the
4988 pre-prologue.
4989
203b9274
AD
49902006-06-20 Akim Demaille <akim@epita.fr>
4991
4992 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
4993 (symbol_get): Use it.
4994 * src/parse-gram.y: Use it.
4995
a7ee59cf
JD
49962006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
4997
4998 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
4999 build succeeds when configured with --enable-gcc-warnings.
5000
5a2baae7
PE
50012006-06-19 Paul Eggert <eggert@cs.ucla.edu>
5002
33ad1a9c
PE
5003 * src/parse-gram.y (char_name): New function.
5004 (CHAR, STRING, string_content): For %printer, properly escape.
5005 (ID): Prefer fputs to fprintf.
5006 (id): Reindent to be consistent with other rules.
5007 Properly quote char.
5008
5a2baae7
PE
5009 The Translation Project changed its way of publishing translations
5010 to maintainers. I haven't received any responses to my request
5011 for supporting the old way, or for documenting the new way. I
5012 have modified 'bootstrap' to use screen scraping
5013 (in this case, HTML scraping). This is unreliable and inelegant,
5014 but I don't see any better way. Yuck.
5015 * bootstrap (TP_URL, WGET_COMMAND): New vars.
5016 (get_translations): New function, which uses HTML scraping to
5017 deduce locations of latest translations.
5018 Use this function to grab both bison and bison-runtime .po files.
5019 Don't bother priming the pump for the runtime-po domain any more,
5020 as it's now translated better than bison is.
5021
58d7a1a1
AD
50222006-06-19 Akim Demaille <akim@epita.fr>
5023
5024 * src/scan-gram.l: No longer "parse" things after `%union' until
5025 `{'. Rather, return a single "%union" token.
5026 No longer make symbols: return strings, and leave the conversion
5027 to symbols to the parser.
5028 (SC_PRE_CODE, token_type): Remove.
5029 * src/parse-gram.y (%union): New field `character'.
5030 Sort tokens.
5031 (CHAR): New token.
5032 (ID, ID_COLON): Now that the scanner no longer makes them
5033 identifiers, adjust all uses to invoke symbol_get.
5034 (id_colon): New, wraps the conversion from string to symbol.
5035 (%union): Accept a possible union_name.
5036 (symbol): Now can be a char.
5037 * data/c.m4 (b4_union_name): Leave a default value.
5038 * data/glr.c, data/yacc.c: Use it.
5039
b931235e
JD
50402006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
5041
5042 For associating token numbers with token names for "yacc.c", don't use
5043 #define statements unless `--yacc' is specified; always use enum
5044 yytokentype. Most important discussions start at:
5045 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
5046 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
5047 and
5048 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
5049 * NEWS (2.3+): Mention.
5050 * data/c.m4 (b4_yacc_if): New.
5051 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
5052 token #define's.
5053 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
5054 on token name definitions.
5055 * src/getargs.c (usage): Capitalize `Yacc' in English.
5056 * src/output.c (prepare): Define b4_yacc_flag.
5057 * tests/regression.at (Early token definitions): Test that tokens names
5058 are defined before the pre-prologue not just before the post-prologue.
5059 Remove this test case and copy to...
5060 (Early token definitions with --yacc): ... this to test #define's.
5061 (Early token definitions without --yacc): ... and this to test enums.
5062
9e6e7ed2
PE
50632006-06-11 Paul Eggert <eggert@cs.ucla.edu>
5064
5065 * NEWS: Reword the post-2.3 change to not be so optimistic about
5066 removing the old "look-ahead" spelling.
5067 Update previous look-ahead/lookahead change reports.
5068 * REFERENCES: look-ahead -> lookahead (since that's
5069 what he actually wrote).
5070 * doc/refcard.tex: look ahead -> lookahead,
5071 look-ahead -> lookahead
5072
742e4900
JD
50732006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
5074
5075 For consistency, use `lookahead' instead of `look-ahead' or
5076 `look_ahead'. Discussed starting at
5077 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
5078 and then at
5079 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
5080 * NEWS: For the next release, note the change to `--report'.
5081 * TODO, doc/bison.1: Update English.
5082 * doc/bison.texinfo: Update English.
5083 (Understanding Your Parser, Bison Options): Document as
5084 `--report=lookahead' rather than `--report=look-ahead'.
5085 * src/conflicts.c: Update English in comments.
5086 (lookahead_set): Rename from look_ahead_set.
5087 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
5088 (resolve_sr_conflict): Rename local look_ahead_tokens to
5089 lookahead_tokens, and update other uses.
5090 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
5091 count_rr_conflicts, conflicts_free): Update uses.
5092 * src/getargs.c (report_args): Move "lookahead" before alternate
5093 spellings.
5094 (report_types): Update uses.
5095 (usage): For `--report' usage description, state `lookahead' spelling
5096 rather than `look-ahead'.
5097 * src/getargs.h (report.report_lookahead_tokens): Rename from
5098 report_look_ahead_tokens.
5099 * src/lalr.c: Update English in comments.
5100 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
5101 (state_lookahead_tokens_count): Rename from
5102 state_look_ahead_tokens_count.
5103 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5104 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
5105 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5106 Update other uses.
5107 Update English in output.
5108 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
5109 * src/print.c: Update English in comments.
5110 (lookahead_set): Rename from look_ahead_set.
5111 (print_reduction): Rename argument lookahead_token from
5112 look_ahead_token.
5113 (print_core, state_default_rule, print_reductions, print_results):
5114 Update uses.
5115 * src/print_graph.c: Update English in comments.
5116 (print_core): Update uses.
5117 * src/state.c: Update English in comments.
5118 (reductions_new): Update uses.
5119 (state_rule_lookahead_tokens_print): Rename from
5120 state_rule_look_ahead_tokens_print, and update other uses.
5121 * src/state.h: Update English in comments.
5122 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
5123 (state_rule_lookahead_tokens_print): Rename from
5124 state_rule_look_ahead_tokens_print.
5125 * src/tables.c: Update English in comments.
5126 (conflict_row, action_row): Update uses.
5127 * tests/glr-regression.at
5128 (Incorrect lookahead during deterministic GLR,
5129 Incorrect lookahead during nondeterministic GLR): Rename
5130 print_look_ahead to print_lookahead.
5131 * tests/torture.at: Update English in comments.
5132 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
5133 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
5134 (Many lookahead tokens): Update uses.
5135 * data/glr.c: Update English in comments.
5136 * lalr1.cc: Likewise.
5137 * yacc.c: Likewise.
5138 * src/conflicts.h: Likewise.
5139 * src/lalr.h: Likewise.
5140 * src/main.c: Likewise.
5141 * src/output.c: Likewise.
5142 * src/parse-gram.c: Likewise.
5143 * src/tables.h: Likewise.
5144 * tests/calc.at: Likewise.
5145
3c40d0b5
JD
51462006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
5147
5148 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
5149
5d278082
PE
51502006-06-07 Paul Eggert <eggert@cs.ucla.edu>
5151
5152 * TODO: Add request from Nelson H. F. Beebe to be able to install
5153 Bison without installing the yacc script.
5154
9e668899
JD
51552006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
5156
5157 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
5158 and yytext if they're already #define'd.
5159 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
5160 * src/scan-code-c.c: ... here.
5161 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
5162 <config.h>.
5163
0c8e079f
JD
51642006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
5165
5166 Get Bison to build again when configured with --enable-gcc-warnings.
5167 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
5168 missing #include's.
5169 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
5170 loc argument as it shadows a global.
5171 * src/scan-gram.l: Remove stray comma that prevents boundary_set
5172 invocation.
5173
5174 * src/.cvsignore: Add scan-code.c.
5175
2346344a
AD
51762006-06-07 Akim Demaille <akim@epita.fr>
5177
5178 * src/scan-gram.l: Move the "add a trailing ; to actions" code
5179 to...
5180 * src/scan-code.l: here.
5181 * tests/input.at (Torturing the Scanner): Fix another location
5182 error.
5183
4862bdfd
AD
51842006-06-07 Akim Demaille <akim@epita.fr>
5185
5186 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
5187
e9071366
AD
51882006-06-06 Akim Demaille <akim@epita.fr>
5189
5190 Extract the parsing of user actions from the grammar scanner.
5191 As a consequence, the relation between the grammar scanner and
5192 parser is much simpler. We can also split "composite tokens" back
5193 into simple tokens.
5194 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
5195 * src/scan-gram.l (add_column_width, adjust_location): Move to and
5196 rename as...
5197 * src/location.h, src/location.c (add_column_width)
5198 (location_compute): these.
5199 Fix the column count: the initial column is 0.
5200 (location_print): Be robust to ending column being 0.
5201 * src/location.h (boundary_set): New.
5202 * src/main.c: Adjust to scanner_free being renamed as
5203 gram_scanner_free.
5204 * src/output.c: Include scan-code.h.
5205 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
5206 Use boundary_set.
5207 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
5208 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
5209 which is now, again, a separate token.
5210 Adjust all dependencies.
5211 Whereever actions with $ and @ are used, use translate_code.
5212 (action): Remove this nonterminal which is now useless.
5213 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
5214 (grammar_current_rule_action_append): Use translate_code.
5215 (packgram): Bound check ruleno, itemno, and rule_length.
5216 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
5217 (last_string, last_braced_code_loc, max_left_semantic_context)
5218 (scanner_initialize, scanner_free, scanner_last_string_free)
5219 (gram_out, gram_lineno, YY_DECL_): Move to...
5220 * src/scan-gram.h: this new file.
5221 (YY_DECL): Rename as...
5222 (GRAM_DECL): this.
5223 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
5224 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
5225 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
5226 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
5227 Move these declarations, and...
5228 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
5229 these to...
5230 * src/flex-scanner.h: this new file.
5231 * src/scan-gram.l (rule_length, rule_length_overflow)
5232 (increment_rule_length): Remove.
5233 (last_braced_code_loc): Rename as...
5234 (gram_last_braced_code_loc): this.
5235 Adjust to the changes of the parser.
5236 Move all the handling of $ and @ into...
5237 * src/scan-code.l: here.
5238 * src/scan-gram.l (handle_dollar, handle_at): Remove.
5239 (handle_action_dollar, handle_action_at): Move to...
5240 * src/scan-code.l: here.
5241 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
5242 scan-code.h, scan-code-c.c, scan-gram.h.
5243 (EXTRA_bison_SOURCES): Add scan-code.l.
5244 (BUILT_SOURCES): Add scan-code.c.
5245 (yacc): Be robust to white spaces.
5246
5247 * tests/conflicts.at, tests/input.at, tests/reduce.at,
5248 * tests/regression.at: Adjust the column numbers.
5249 * tests/regression.at: Adjust the error message.
7891a7c4 5250
184e42f0
JD
52512006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
5252
5253 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
5254 Use Akim's wording from
5255 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
5256
7891a7c4
JD
52572006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
5258
5259 Between Bison releases, manually append `+' to the previous Bison
5260 release number, and use that as a signal to automatically print the
5261 ChangeLog's CVS Id keyword from --version. Discussed starting at
5262 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
5263 * ChangeLog: Add Id header.
5264 * configure.ac (AC_INIT): Append `+' to `2.3'.
5265 * src/.cvsignore: Add revision.c.
5266 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
5267 (BUILT_SOURCES): Add revision.c.
5268 (revision.c): New target rule. This file defines a new global variable
5269 named revision. It initializes it with either the Id from ChangeLog
5270 or, if VERSION doesn't contain `+', with the empty string.
5271 * src/getargs.c (version): Print the value of revision.
5272 * src/revision.h: Extern revision.
5273
4ad3ed84
PE
52742006-06-05 Paul Eggert <eggert@cs.ucla.edu>
5275
5276 * NEWS: Version 2.3.
5277 * configure.ac (AC_INIT): Likewise.
5278
02103984
PE
52792006-05-30 Paul Eggert <eggert@cs.ucla.edu>
5280
5281 * data/glr.c (YYRECOVERING): Define to be a function-like macro
5282 with no arguments, not as an object-like macro. This is for
5283 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
5284 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
5285 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
5286 Document this.
5287
2c08afa5
JD
52882006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
5289
5290 * src/getargs.c (usage): Back out yesterday's modification of the
5291 --help output so that we don't have to wait for translation before
5292 releasing 2.3.
5293
6077da58
PE
52942006-05-29 Paul Eggert <eggert@cs.ucla.edu>
5295
5296 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
5297 Problem reported by Akim Demaille.
5298
2a26b6c2
JD
52992006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5300
5301 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
5302
aefef0d6
PE
53032006-05-26 Paul Eggert <eggert@cs.ucla.edu>
5304
5305 * data/yacc.c (yy_reduce_print): Omit trailing white space in
5306 generated source code. Problem reported by Frans Englich in
5307 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
5308
fcd8e201
PE
53092006-05-22 Paul Eggert <eggert@cs.ucla.edu>
5310
5311 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
5312 shell, not within 'make', so that 'make' by an ordinary builder
5313 (using GNU make) does not worry about configuring gzip. This also
5314 works around a bug reported independently by Keith Thompson and by
5315 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
5316 stderr rather than stdout, messing up the build logs.
5317
7b5cdcbd
JD
53182006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
5319
5320 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
5321 to make sure that YYID will never be unused. This fixes a 'make
5322 maintainer-check' failure caused by the recent changes to the 'Trivial
5323 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
5324 not used.
5325 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
5326
5ad0a449
JD
53272006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
5328
5329 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
5330 state before an empty RHS is always resolved here. Only the location
5331 of that state is guaranteed to be resolved, and that's enough. This
5332 fixes the remaining bug reported by Derek M. Jones in
5333 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
5334 * tests/glr-regression.at (Uninitialized location when reporting
5335 ambiguity): Test the above case.
5336 Also, the embedded comments in this test case claim it checks the case
5337 of an empty RHS that has inherited the initial location. However, the
5338 corresponding LHS was already resolved, so yyresolveLocations didn't
5339 actually have reason to modify it. Fix this by forcing
5340 nondeterministic operation at the beginning of the parse.
5341
50cce58e
PE
53422006-05-20 Paul Eggert <eggert@cs.ucla.edu>
5343
5344 * data/c.m4 (b4_yy_symbol_print_generate):
5345 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
5346 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
5347 of the bugs reported today by Derek M Jones in
5348 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
5349 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
5350 defined to be a type name without parens or brackets.
5351 (Location Type): Similarly for YYLTYPE.
5352 * tests/regression.at (Trivial grammars): Put in a test for this
5353 bug that will be caught by 'make maintainer-check' (though not,
5354 alas, by 'make check' unless your compiler is picky).
5355
ab8d9dc5
PE
53562006-05-19 Paul Eggert <eggert@cs.ucla.edu>
5357
0d2c8934 5358 * NEWS: Version 2.2.
ab8d9dc5
PE
5359 * configure.ac (AC_INIT): Likewise.
5360
9138c575
JD
53612006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
5362
5363 * data/glr.c (yyreportTree): Make room in yystates for the state
5364 preceding the RHS. This fixes the segmentation fault reported by Derek
5365 M. Jones in
5366 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
5367 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
5368 to the user. Reported for yyreportTree by Derek M. Jones later in the
5369 same thread.
5370 * THANKS: Add Derek M. Jones.
5371 Update my email address.
5372 Fix typo in Steve Murphy's name.
5373
276f48df
PE
53742006-05-14 Paul Eggert <eggert@cs.ucla.edu>
5375
d6645148
PE
5376 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
5377 checking against YYLAST that caused the parser to miss a potential
5378 alternative in its diagnostic.
5379 Problem reported by Maria Jose Moron Fernandez in
5380 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
5381 * data/lalr1.cc (yysyntax_error_): Likewise.
5382 * data/yacc.c (yysyntax_error): Likewise.
5383 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
5384 tokens, in case we run into an older C compiler.
5385 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
5386 Use them to check for the off-by-one error fixed above.
5387
276f48df
PE
5388 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
5389 YYSIZE_T, not size_t.
5390 * tests/regression.at (Trivial grammars): New test, to catch
5391 the error fixed by the above patch.
5392
cd8b5791
AD
53932006-05-14 Akim Demaille <akim@lrde.epita.fr>
5394
5395 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
5396 scheme.
5397 Reported by Steve Murphy.
5398
34376418
AD
53992006-05-14 Akim Demaille <akim@lrde.epita.fr>
5400
5401 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
5402 * data/glr.cc: b4_location_flag is now b4_locations_flag.
5403
327afc7c
AD
54042006-05-14 Akim Demaille <akim@lrde.epita.fr>
5405
5406 Implement --trace=m4.
5407 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
5408 * src/output.c (output_skeleton): When set, pass -dV to m4.
5409
5410 Factor the handling of flags in m4.
5411 * src/output.c (prepare): Rename the muscle names debug, defines,
5412 error_verbose to debug_flag, defines_flag, error_verbose_flag.
5413 * data/c.m4: Adjust.
5414 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
5415 Use b4_define_flag_if to define other b4_FLAG_if macros.
5416 (b4_location_if): As a consequence, rename as...
5417 (b4_locations_if): this, for consistency.
5418 Adjust all the skeletons.
5419
ba9ecd19
AD
54202006-05-14 Akim Demaille <akim@lrde.epita.fr>
5421
5422 * etc/bench.pm: Shorten bench names.
5423
4e83ea15
AD
54242006-05-14 Akim Demaille <akim@lrde.epita.fr>
5425
5426 * src/output.h, src/output.c (error_verbose): Move to...
5427 * src/getargs.h, src/getargs.c: here.
5428 Sort the flags.
5429 Adjust dependencies.
5430
6e93d810
PE
54312006-05-13 Paul Eggert <eggert@cs.ucla.edu>
5432
5433 * data/c.m4 (b4_copyright): Put the special exception for Bison
5434 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
5435 uses changed. Suggested by Akim Demaille. Also, wrap the
5436 copyright notice, in case it is longer than 80 columns. Replace
5437 comma by newline after title.
6e93d810 5438
eaea13f5
PE
54392006-05-11 Paul Eggert <eggert@cs.ucla.edu>
5440
5441 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
5442 incompatibility, not a bug. Mention that it wasn't fixed as of
5443 flex 2.5.33.
5444
3cf084ec
AD
54452006-05-11 Akim Demaille <akim@lrde.epita.fr>
5446
5447 * examples/extexi: Enforce the precedence of concatenation over
5448 >>.
0a9f1c7d 5449 Reported by Tommy Nordgren.
3cf084ec 5450
32c96bd7
AD
54512006-05-11 Akim Demaille <akim@lrde.epita.fr>
5452
5453 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
5454 with the member "token".
f94705b2 5455 Reported by Martin Nylin.
32c96bd7 5456
eaea13f5
PE
54572006-05-08 Paul Eggert <eggert@cs.ucla.edu>
5458
5459 * data/glr.c: Switch to Bison 2.2 special-exception language in
5460 the copyright notice. Use more-regular format for titles and
5461 copyright notices.
5462 * data/glr.cc: Likewise.
5463 * data/location.cc: Likewise.
5464 * data/yacc.cc: Likewise.
5465 * doc/bison.texinfo (Conditions): Document this.
5466 * NEWS: likewise. Upgrade version to 2.2.
5467
6e2d1146
AD
54682006-04-27 Akim Demaille <akim@lrde.epita.fr>
5469
5470 * data/glr.cc: Remove dead code.
5471
47671055
PE
54722006-04-25 Paul Eggert <eggert@cs.ucla.edu>
5473
5474 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
5475 that variable and the line breaks the bootstrap. Problem reported
5476 by Juan M. Guerrero.
5477
ed2e6384
AD
54782006-04-24 Akim Demaille <akim@lrde.epita.fr>
5479
5480 * doc/bison.texinfo (Multiple start-symbols): New.
5481
3cedc2dc
AD
54822006-04-24 Akim Demaille <akim@lrde.epita.fr>
5483
5484 * etc/README, etc/bench.pl: New.
5485
b2ddc3f3
AD
54862006-04-03 Akim Demaille <akim@lrde.epita.fr>
5487
5488 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
5489 rule.
5490 Reported by Mickael Labau.
5491 * tests/input.at (Torturing the Scanner): Test it.
5492
91e3ac9a
PE
54932006-03-16 Paul Eggert <eggert@cs.ucla.edu>
5494
5495 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
5496 Problem reported by Bob Rossi.
5497
54982006-03-13 Paul Eggert <eggert@cs.ucla.edu>
5499
5500 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
5501 and didn't really work.
5502 For the index, use @ifnotinfo, not @iftex.
5503 Minor cleanups of spacing and terminology.
5504
5cf61e93
AD
55052006-03-12 Akim Demaille <akim@lrde.epita.fr>
5506
5507 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
5508 of AT_NAME_PREFIX when %name-prefix is not used.
5509
aa08666d
AD
55102006-03-12 Akim Demaille <akim@lrde.epita.fr>
5511
5512 Apply --prefix to C++ skeletons too: they change the namespace.
5513 The test suite already exercize these cases.
5514 * data/c++.m4 (b4_namespace): New.
5515 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
5516 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
5517 * data/yacc.c, data/glr.c: Remove a useless `[]'.
5518 * doc/bison.texinfo: Document it.
5519 (Option Cross Key): Use @multitable in all formats. It looks
5520 nicer, even in TeX outputs.
5521 (Rules): Use the same code whatever the output type is.
5522 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
5523 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
5524 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 5525
45567173
AD
55262006-03-10 Akim Demaille <akim@lrde.epita.fr>
5527
5528 * TODO: Remove dead items.
5529
e9d8f881 55302006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
5531
5532 * doc/FAQ: Remove, merged into...
5533 * doc/bison.texinfo (FAQ): this.
5534 * doc/Makefile.am (EXTRA_DIST): Adjust.
5535
c095d689
AD
55362006-03-10 Akim Demaille <akim@lrde.epita.fr>
5537
5538 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
5539 even if empty.
5540 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
5541 * doc/bison.texinfo (Calc++ Scanner): Use it.
5542
6e0f8287
PE
55432006-03-09 Paul Eggert <eggert@cs.ucla.edu>
5544
5545 Fix two nits reported by twlevo, plus one more that I discovered.
5546
5547 * src/assoc.h (assoc_to_string): Give a name to the arg, as
5548 this is the usual Bison style.
5549 * src/location.h (location_print): Likewise.
5550
5551 * src/reader.h (token_name): Likewise.
5552
d6b771c3
PE
55532006-03-08 Paul Eggert <eggert@cs.ucla.edu>
5554
5555 Fix some nits reported by twlevo.
5556 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
5557 and "POSIX". Use more-modern syntax for URLs. Mention C++
5558 and ask for Java. Don't hardwire OS version numbers. Add
5559 copyright notice.
5560 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
5561 * src/conflicts.c (solved_conflicts_obstack): Now static.
5562
1e137b71
JD
55632006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
5564
5565 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
5566 page. Say "you can use it" not "you may use it" as on the web page;
5567 we're describing capabilities not granting permission.
5568
73f2e47e
PE
55692006-03-06 Paul Eggert <eggert@cs.ucla.edu>
5570
6d05403d
PE
5571 * data/glr.c (yyresolveLocations): Rename local variables to avoid
5572 shadowing warnings. Use usual patter for iterating through RHS.
5573 * tests/glr-regression.at
5574 (Uninitialized location when reporting ambiguity):
5575 Modify yylex so that it uses its argument, rather than trying
5576 to rely on ARGSUSED (which doesn't work for gcc with warnings).
5577 const char -> char const.
5578
73f2e47e
PE
5579 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
5580 Don't use tabs inside commands; it messes up 'ps'.
5581 Problem reported by twlevo.
5582
8710fc41
JD
55832006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
5584
5585 * tests/glr-regression.at (Uninitialized location when reporting
5586 ambiguity): New test case.
5587 * data/glr.c (yyresolveLocations): New function, which uses
5588 YYLLOC_DEFAULT.
5589 (yyresolveValue): Invoke yyresolveLocations before reporting an
5590 ambiguity.
5591 * doc/bison.texinfo (Default Action for Locations): Note
5592 YYLLOC_DEFAULT's usage for ambiguity locations.
5593 (GLR Semantic Actions): Cross-reference those notes.
5594
ae952af2
JD
55952006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
5596
5597 * tests/glr-regression.at (Leaked semantic values when reporting
5598 ambiguity): Remove unnecessary union and type declarations.
5599 (Leaked lookahead after nondeterministic parse syntax error): New test
5600 case.
5601 * data/glr.c (yyparse): Check for zero stacks remaining before
5602 attempting to shift the lookahead so that you don't lose it.
5603
35ee866a
JD
56042006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5605
5606 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
5607 * tests/glr-regression.at (Leaked semantic values when reporting
5608 ambiguity): New test case.
5609 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
5610 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
5611 now unnecessary yystackp parameter.
5612 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
5613 destructors can be called.
5614
5615 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
5616 in existing testcases.
5617
520181ab
JD
56182006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5619
5620 Don't leak semantic values for parent RHS when a user action cuts the
5621 parser, and clean up related code a bit.
5622 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
5623 cuts parse): Rename to...
5624 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
5625 for leaked parent RHS values.
5626 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
5627 between an unresolved state (non-empty chain of semantic options) and
5628 an incomplete one (signaled by an empty chain).
ae952af2 5629 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
5630 successfully or unsuccessfully resolved yyGLRState to...
5631 (yyresolveValue): ... here so that yyresolveValue always leaves a
5632 yyGLRState with consistent data and thus is easier to understand.
5633 Remove the yyvalp and yylocp parameters since they are always just
5634 taken from the yys parameter. When reporting a discarded merged value
5635 in debugging output, note that it is incompletely merged. Document the
5636 interface.
5637 (yyresolveAction): If resolving any of the RHS states fails, destroy
5638 them all rather than leaking them. Thus, as long as user actions are
5639 written to clean up the RHS correctly, yyresolveAction always cleans up
5640 the RHS of a semantic option. Document the interface.
5641
18d9185c
PE
56422006-02-27 Paul Eggert <eggert@cs.ucla.edu>
5643
5644 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
5645 led to a segmentation fault in GNU Pascal. Problem reported
5646 by Waldek Hebisch.
5647
841a7737
JD
56482006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
5649
5650 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
5651 mid-rule action inside a nonterminal symbol in order to declare a
5652 destructor for its semantic value.
5653
fc3f467f
PE
56542006-02-16 Paul Eggert <eggert@cs.ucla.edu>
5655
5656 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
5657 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
5658 __cplusplus && ! defined _STDLIB_H && !
5659 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
5660 defined free))]: Include <stdlib.h> rather than rolling our own
5661 declarations of malloc and free, to avoid problems with
5662 incompatible declarations (using 'throw') C++'s stdlib.h. This
5663 should fix Debian bug 340012
5664 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
5665 reported by Guillaume Melquiond.
5666
a3af26dd
PE
56672006-02-13 Paul Eggert <eggert@cs.ucla.edu>
5668
4d7bc38c
PE
5669 * NEWS: Clarify symbols versus types in unused-value warnings.
5670
a3af26dd
PE
5671 * configure.ac (AC_INIT): Bump version number.
5672
4e26c69e
PE
56732006-02-13 Paul Eggert <eggert@cs.ucla.edu>
5674
5675 * NEWS: Version 2.1a.
5676 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
5677 since C99 requires this.
5678
498e897c
PE
56792006-02-11 Paul Eggert <eggert@cs.ucla.edu>
5680
5681 * m4/c-working.m4: New file.
5682 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
5683
57bb17ca
PE
56842006-02-10 Paul Eggert <eggert@cs.ucla.edu>
5685
5686 * Makefile.maint: Merge from coreutils.
5687
0be105dc
PE
56882006-02-09 Paul Eggert <eggert@cs.ucla.edu>
5689
5690 More portability fixes for problems summarized by Nelson H. F. Beebe.
5691
5692 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
5693 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
5694 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
5695 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
5696 messes up because C++ code is compiled in 32-bit mode but linked
5697 in 64-bit mode.
5698
6fc0c024
PE
56992006-02-08 Paul Eggert <eggert@cs.ucla.edu>
5700
5701 More portability fixes for problems summarized by Nelson H. F. Beebe.
5702
7870f699
PE
5703 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
5704 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
5705
6fc0c024
PE
5706 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
5707 nodist_PROGRAMS, since we don't need to actually compile the
5708 example if we're just doing a plain 'make'. This avoids bothering
5709 the installer unnecessarily about problems due to weird C++
5710 compilers.
5711
fe6c2fde
PE
57122006-02-06 Paul Eggert <eggert@cs.ucla.edu>
5713
5714 More portability fixes for problems summarized by Nelson H. F. Beebe.
5715
5716 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
5717 than #include "...", and compile with -I'.'. The old method was
5718 not portable, according to Posix and the C standard, and it does
5719 not work with Sun C 5.7, where previous #line directives affect
5720 the working directory used in later #include "..." directives.
5721
927b425b
JMG
57222006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5723
5724 Various DJGGP specific issues in /djgpp
5725
d9735e9e
PE
57262006-02-02 Paul Eggert <eggert@cs.ucla.edu>
5727
5728 More portability fixes for problems summarized by Nelson H. F. Beebe.
5729
5730 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
5731 '#include <map>' works and that you can apply ++ to iterators.
5732
5a6755af
PE
57332006-02-01 Paul Eggert <eggert@cs.ucla.edu>
5734
67a0dc4f
PE
5735 Work around portability problems summarized by Nelson H. F. Beebe in
5736 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
5737
8c86f0ef
PE
5738 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5739 that '#include <string>' works.
5740
de35dd59
PE
5741 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
5742 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
5743 "warning: sorry: semantics of inline function static data `const
5744 unsigned char translate_table[262]' are wrong (you'll wind up with
5745 multiple copies)".
5746
67a0dc4f
PE
5747 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
5748 or, xor to not_, and_, or_, and xor_, respectively. This works
5749 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
5750 random system header somewhere that includes the equivalent of
5751 <iso646.h>.
5752
5a6755af
PE
5753 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
5754 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 5755 Suite Version 2.0.
5a6755af 5756
3f001415
JD
57572006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
5758
5759 During deterministic GLR operation, user actions should be able to
5760 influence the parse by changing yychar. To make this easier to fix and
5761 to make glr.c easier to evolve in general, don't maintain yytoken in
5762 parallel with yychar; just compute yytoken when needed.
5763 * tests/glr-regression.at (Incorrect lookahead during deterministic
5764 GLR): Check that setting yychar in a user action has the intended
5765 effect.
5766 * data/glr.c (yyGLRStack): Remove yytokenp member.
5767 (yyclearin): Don't set *yytokenp.
5768 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
5769 yychar rather than *yytokenp to determine the current lookahead.
5770 Compute yytoken locally when needed.
5771 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
5772 point to.
5773
5774 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
5775 after `--report' documentation.
5776
e2a8c0f5
PE
57772006-01-30 Paul Eggert <eggert@cs.ucla.edu>
5778
5779 * src/parse-gram.y (grammar_declaration): Location of printer
5780 symbol is @1, not list->location. Bug reported by twlevo.
5781 * tests/input.at (Incompatible Aliases): Adjust to above change.
5782
6b702268
PE
57832006-01-29 Paul Eggert <eggert@cs.ucla.edu>
5784
27622431
PE
5785 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
5786 all the test at once. This makes the output easier to read in the
5787 normal case.
5788
6b702268
PE
5789 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
5790 got from <http://bro-ids.org/download.html>. The bug is that
5791 when two actions appeared in succession, the second one was
5792 scanned before the first one was added to the grammar rule
5793 as a midrule action. Bison then output the incorrect warning
5794 "parse.y:905.17-906.36: warning: unused value: $3".
5795 * src/parse-gram.y (BRACED_CODE, action): These are no longer
5796 associated with a value.
5797 (rhs): Don't invoke grammar_current_rule_action_append.
5798 (action): Invoke it here instead.
5799 * src/reader.c (grammar_midrule_action): Now extern.
5800 (grammar_current_rule_action_append): Don't invoke
5801 grammar_midrule_action; that is now the scanner's job.
5802 * src/reader.h (last_string, last_braced_code_loc):
5803 (grammar_midrule_action): New decls.
5804 * src/scan-gram.l (last_string): Now extern, sigh.
5805 (last_braced_code_loc): New extern variable.
5806 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
5807 rule already has an action.
5808 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
5809 * tests/input.at (AT_CHECK_UNUSED_VALUES):
5810 Add some tests to check that the above changes fixed the bug.
5811
d40ba6c2
PE
58122006-01-27 Paul Eggert <eggert@cs.ucla.edu>
5813
5814 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
5815 All used changed. Check whether the symbol has a destructor,
5816 not whether it is typed.
5817 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
5818 that the values are still reported as unused. All line numbers
5819 adjusted.
5820
401aace6
PE
58212006-01-23 Paul Eggert <eggert@cs.ucla.edu>
5822
5823 Work around a bug in bro 0.8, which underparenthesizes its
5824 definition of YYLLOC_DEFAULT.
5825 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
5826 their arguments.
5827 * data/lalr1.cc: Likewise.
5828 * data/yacc.cc: Likewise.
5829
06f01bc4
PE
58302006-01-22 Paul Eggert <eggert@cs.ucla.edu>
5831
401aace6
PE
5832 Work around a bug in Pike 7.0, and give the Pike folks a
5833 better way to override the usual int widths.
5834 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
5835 user can override the types.
5836 (short): #undef, to work around a bug in Pike 7.0.
5837 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
5838 (union yyalloc.yyss): Use yytype_int16 rather than short.
5839 All uses changed.
5840 (yysigned_char): Remove.
5841 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
5842 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
5843 * tests/regression.at (Web2c Actions): Adjust to above changes.
5844
5845 * src/reader.c (check_and_convert_grammar): New function.
5846 (reader): Close the input file even if something went wrong during
5847 parsing. Minor file descriptor leak reported by twlevo.
5848
06f01bc4
PE
5849 * src/assoc.c (assoc_to_string): Use a default: abort (); case
5850 to pacify gcc -Wswitch-default.
5851 * src/scan-gram.l (adjust_location): Use a default: break; case
5852 to pacify gcc -Wswitch-default.
5853 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
5854 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5855 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5856 Move these decls to scan-skel.l, since they don't need to be
5857 visible elsewhere.
5858 * src/scan-skel.l: Accept the above decls.
5859 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
5860 is used.
5861
02650b7f
PE
58622006-01-21 Paul Eggert <eggert@cs.ucla.edu>
5863
5864 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
5865 since we don't want to insist on a version number at the start
5866 of the changelog every time.
5867 * Makefile.maint: Sync from coreutils a bit better.
5868 (sc_trailing_blank): Renamed from sc_trailing_space.
5869 All uses changed.
5870 (sc_no_if_have_config_h, sc_require_config_h):
5871 (sc_prohibit_assert_without_use): New rules.
5872 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
5873 (sc_dd_max_sym_length): Fix leading spaces in rule.
5874 (sc_system_h_headers): Prefix with @.
5875 (sc_useless_cpp_parens, m4-check): Output line numbers.
5876 (changelog-check): Allow version only in head.
5877 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
5878 satisfy new Makefile.maint rule.
5879 * data/glr.c: Likewise.
5880 * data/glr.cc: Likewise.
5881 * data/lalr1.cc: Likewise.
5882 * data/yacc.c: Likewise.
5883 * lib/ebitsetv.c: Likewise.
5884 * lib/lbitset.c: Likewise.
5885 * lib/subpipe.c: Likewise.
5886 * lib/timevar.c: Likewise.
5887 * src/system.h: Likewise.
5888 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
5889 * djgpp/Makefile.maint: Add copyright notice.
5890 * djgpp/README.in: Likewise.
5891 * djgpp/config.bat: Likewise.
5892 * djgpp/config.site: Likewise.
5893 * djgpp/config_h.sed: Likewise.
5894 * djgpp/djunpack.bat: Likewise.
5895 * djgpp/config.sed: Fix copyright notice to match standard format.
5896 * djgpp/subpipe.h: Likewise.
5897 * lib/bitsetv-print.c: Likewise.
5898 * lib/bitsetv.c: Likewise.
5899 * lib/subpipe.h: Likewise.
5900 * lib/timevar.c: Likewise.
5901 * lib/timevar.h: Likewise.
5902 * djgpp/subpipe.c: Use standard recipe for config.h.
5903 * lib/abitset.c: Likewise.
5904 * lib/bitset.c: Likewise.
5905 * lib/bitset_stats.c: Likewise.
5906 * lib/bitsetv-print.c: Likewise.
5907 * lib/bitsetv.c: Likewise.
5908 * lib/ebitsetv.c: Likewise.
5909 * lib/get-errno.c: Likewise.
5910 * lib/lbitset.c: Likewise.
5911 * lib/subpipe.c: Likewise.
5912 * lib/timevar.c: Likewise.
5913 * lib/vbitset.c: Likewise.
5914 * tests/local.at: Likewise.
5915 * src/scan-gram.l: Don't include verify.h, since system.h does
5916 that for us.
5917 * .x-sc_require_config_h: New file.
5918 * .x-sc_unmarked_diagnostics: New file.
5919
287c78f6
PE
59202006-01-20 Paul Eggert <eggert@cs.ucla.edu>
5921
287c78f6
PE
5922 Be a bit more systematic about using 'abort'.
5923 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
5924 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
5925 Put 'default: abort ();' before some other case, to satisfy older
5926 pedantic compilers.
5927 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5928 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
5929 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
5930 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
5931 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
5932 (get_decision_str, get_orientation_str, get_node_alignment_str):
5933 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
5934 (get_linestyle_str, get_arrowstyle_str): Likewise.
5935 * src/conflicts.c (resolve_sr_conflict):
5936 Use a default case rather than one for the one remaining enum
5937 value, to catch invalid enum values as well.
5938 * src/lalr.c (set_goto_map, map_goto):
5939 Prefer "assert (FOO);" to "if (!FOO) abort ();".
5940 * src/nullable.c (nullable_compute, token_definitions_output):
5941 Likewise.
5942 * src/reader.c (packgram, reader): Likewise.
5943 * src/state.c (transitions_to, state_new, state_reduction_find):
5944 Likewise.
5945 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
5946 (symbol_pack): Likewise.
5947 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
5948 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
5949 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
5950 * src/system.h: Don't include <assert.h>.
5951 (assert): New macro.
5952
5953 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
5954 (Destructor Decl, Parser Function, Pure Calling):
5955 Describe rules for braces inside C code more carefully.
287c78f6 5956
c66dfadd
PE
59572006-01-19 Paul Eggert <eggert@cs.ucla.edu>
5958
c21493b8
PE
5959 Fix some porting glitches found by Nelson H. F. Beebe.
5960 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
5961 compilers that don't understand that abort () does not return.
5962 * src/state.c (transitions_to): Likewise.
5963 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5964 that '#include <cstdlib>' works.
5965 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
5966 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
5967 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
5968 for the benefit of some pre-C99 compilers.
5969
b6e3facf
PE
5970 * bootstrap: Undo changes to gnulib files that autoreconf made.
5971
c66dfadd
PE
5972 Minor fixups to get 'make maintainer-check' to work.
5973 * configure.ac: Don't use -Wnested-externs, as it's incompatible
5974 with the new verify.h implementation.
5975 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
5976 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
5977 * data/yacc.c (YYUSE): Likewise.
5978 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
5979 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
5980 * src/parse-gram.y (declaration): Don't pass a string constant
5981 to a function that expects char *, since GCC might complain
5982 about the constant value.
5983 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
5984 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
5985 before #defining them.
5986 * tests/glr-regression.at
5987 (Incorrectly initialized location for empty right-hand side in GLR):
5988 In yyerror, use the msg arg.
5989 (Corrupted semantic options if user action cuts parse):
5990 (Incorrect lookahead during deterministic GLR):
5991 (Incorrect lookahead during nondeterministic GLR):
5992 Don't name a local var 'index'; it shadows string.h's 'index'.
5993
ed94ef2a
AD
59942006-01-19 Akim Demaille <akim@epita.fr>
5995
5996 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
5997 location, not just parts of it.
5998
e9ad4aec
PE
59992006-01-18 Paul Eggert <eggert@cs.ucla.edu>
6000
d6ca7905
PE
6001 * NEWS: Document the fact that multiple %unions are now allowed.
6002 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
6003 * TODO: This feature is now implemented, so remove it from
6004 the wishlist.
d6ca7905 6005
ef1b70e0
PE
6006 * Makefile.maint: Merge with coreutils Makefile.maint.
6007 (CVS_LIST): Use build-aux version if available.
6008 (VERSION_REGEXP): New macro.
6009 (syntax-check-rules): Add sc_no_if_have_config_h,
6010 sc_prohibit_assert_without_use, sc_require_config_h,
6011 sc_useless_cpp_parens.
6012 (sc_obsolete_symbols): Check for O_NDELAY.
6013 (sc_dd_max_sym_length): Track coreutils.
6014 (sc_unmarked_diagnostics): Look in all files, not just *.c.
6015 (sc_useless_cpp_parens): New rule.
6016 (news-date-check): Look for version or today's date.
6017 (changelog-check): Don't require version number near head.
6018 (copyright-check): Use current year instead of hardwiring 2005.
6019 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
6020 (announcement): Add --gpg-key-ID.
6021
6022 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
6023 with "file system".
6024
2073ce56 6025 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
6026 array. Problem reported by twlevo.
6027 * src/reader.c (packgram): Prepend a new sentinel before ritem.
6028 * src/lalr.c (build_relations): Rely on new sentinel.
6029 * src/gram.c (gram_free): Adjust to new sentinel.
6030
b7691f15
JD
60312006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
6032
6033 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
6034 yylookaheadNeeds. All uses updated.
6035 (yysplitStack): Rename local yynewLookaheadStatuses to
6036 yynewLookaheadNeeds.
6037 * data/glr-regression.at (Incorrect lookahead during nondeterministic
6038 GLR): In comments, change `lookahead status' to `lookahead need'.
6039
ddee1b06
PH
60402006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6041
6042 * data/glr.c (yysplitStack): A little stylistic rewrite.
6043
12f4614d
PH
60442006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6045
6046 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
6047
32c29292
JD
60482006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
6049
6050 * doc/bison.texinfo: Fix some typos.
6051 (GLR Semantic Actions): New subsection discussing special
6052 considerations because GLR semantic actions might be deferred.
6053 (Actions): Mention look-ahead usage of yylval.
6054 (Actions and Locations): Mention look-ahead usage of yylloc.
6055 (Special Features for Use in Actions): Add YYEOF entry and mention it
6056 in the yychar entry.
6057 In the yychar entry, remove mention of the local yychar case (pure
6058 parser) since this is irrelevant information when writing semantic
148d66d8 6059 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
6060 yychar is otherwise described as an external variable.
6061 In the yychar entry, don't call it the `current' look-ahead since it
6062 isn't when semantic actions are deferred.
6063 In the yychar and yyclearin entries, add note about deferred semantic
6064 actions.
6065 Add yylloc and yylval entries discussing look-ahead usage.
6066 (Look-Ahead Tokens): When discussing yychar, don't call it the
6067 `current' look-ahead, and do mention yylval and yylloc.
6068 (Error Recovery): Cross-reference `Action Features' when mentioning
6069 yyclearin.
148d66d8 6070 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
6071 look-ahead.
6072 In the yylloc and yylval entries, mention look-ahead usage.
6073
de366a2f 60742006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
6075
6076 * tests/glr-regression.at: Update copyright year to 2006.
6077
bf70fa87
JD
60782006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6079
6080 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
6081 use during nondeterministic operation to track which stacks have
6082 actually needed the current lookahead.
6083 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
6084 Allocate, deallocate, resize, and otherwise shuffle space for
6085 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
6086 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
6087 appropriately during nondeterministic operation.
6088 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
6089 members to store the current lookahead to be used by the deferred
6090 user action.
6091 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
6092 from which the RHS is taken. Set the lookahead members of the new
6093 yySemanticOption according to the lookahead status for stack yyk.
6094 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
6095 yyaddDeferredAction.
6096 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
6097 members of yySemanticOption before invoking yyuserAction, and then set
6098 them back to their current values afterward.
6099 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
6100 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
6101 * tests/glr-regression.at: Remove `.' from the ends of recent test case
6102 titles for consistency.
6103 (Leaked merged semantic value if user action cuts parse): In order to
6104 suppress lint warnings, use arguments in merge function, and assign
6105 char value < 128 in main.
6106 (Incorrect lookahead during deterministic GLR): New test case.
6107 (Incorrect lookahead during nondeterministic GLR): New test case.
6108
05449a2c
JD
61092006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6110
de366a2f 6111 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
6112 !yyvaluep as signal that no semantic value is available to print.
6113 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
6114 to print a semantic value.
6115
4158e0a1 61162006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 6117
4158e0a1
JD
6118 * tests/glr-regression.at: For consistency with my newer test cases,
6119 don't thank myself.
6120
d659304d
JD
61212006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6122
6123 * data/glr.c (yyresolveValue): When merging semantic options, if at
6124 least one user action succeeds but a later one cuts the parse, then
6125 destroy the semantic value before returning rather than leaking it.
6126 (yyresolveStates): If a user action cuts the parse and thus
6127 yyresolveValue fails, ignore the (unset) semantic value rather than
6128 corrupting the yyGLRState, and empty the semantic options list since
6129 the user actions should have called all necessary destructors.
6130 Simplify code with YYCHK.
6131 * tests/glr-regression.at (Corrupted semantic options if user action
6132 cuts parse): New test case.
6133 (Undesirable destructors if user action cuts parse): New test case.
6134 Before applying any of this patch, this test case never actually failed
6135 for me... but only because the corrupted semantic options usually
6136 masked this bug.
6137 (Leaked merged semantic value if user action cuts parse): New test
6138 case.
6139
6ec2c0f2
AD
61402006-01-05 Akim Demaille <akim@epita.fr>
6141
6142 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
6143
1b9c21fb
PE
61442006-01-04 Paul Eggert <eggert@cs.ucla.edu>
6145
6146 * data/c.m4 (b4_c_modern): New macro, with a new provision for
6147 _MSC_VER. Problem reported by Cenzato Marco.
6148 (b4_c_function_def): Use it.
6149 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
6150 b4_c_modern.
6151 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
6152 than rolling our own.
6153
84866159
AD
61542006-01-04 Akim Demaille <akim@epita.fr>
6155
6156 Also warn about non-used mid-rule values.
6157 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
6158 member.
6159 (symbol_list_new): Adjust.
6160 * src/reader.c (symbol_typed_p): New.
6161 (grammar_rule_check): Use it.
6162 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
6163 Check its rule.
6164 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
6165 Use it.
6166 * tests/actions.at (Exotic Dollars): Adjust.
6167
378f4bd8
AD
61682006-01-04 Akim Demaille <akim@epita.fr>
6169
6170 * src/reader.c (grammar_midrule_action): If $$ is set in a
6171 mid-rule, move the `used' bit to its lhs.
6172 * tests/input.at (Unused values): New.
6173 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
6174
e2a21b6f
PE
61752006-01-03 Paul Eggert <eggert@cs.ucla.edu>
6176
54662697
PE
6177 * doc/bison.texinfo (Bison Options): Say more accurately what
6178 --yacc does.
6179 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
6180 about declarations in the grammar when in Yacc mode, as POSIX does
6181 not require a diagnostic when the grammar uses extensions.
6182
6183 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
6184
073f9288
PE
6185 Warn about dubious constructions like "%token T T".
6186 Reported by twlevo.
6187 * src/symtab.h (struct symbol.declared): New member.
6188 * src/symtab.c (symbol_new): Initialize it to false.
6189 (symbol_class_set): New arg DECLARING, specifying whether
6190 this is a declaration that we want to warn about, if there
6191 is more than one of them. All uses changed.
6192
1221b78a
PE
6193 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
6194 Allow multiple %union directives, whose contents concatenate.
6195 * src/parse-gram.y (grammar_declaration): Likewise.
6196 Use muscle_code_grow, so that we don't need stype_line any more.
6197 All uses changed.
6198
6199 * src/muscle_tab.c (muscle_grow): Fix comment.
6200
e2a21b6f
PE
6201 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
6202 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
6203 Update copyright year to 2006.
6204
8f7e3cf9
AD
62052006-01-03 Akim Demaille <akim@epita.fr>
6206
6207 Have glr.cc pass (some of) the calc.at tests.
6208 * data/glr.cc (b4_parse_param_orig): New.
6209 (b4_parse_param): Improve its definition, and bound it more
6210 clearly in the skeleton.
6211 (b4_epilogue): Append, instead of prepending, in order to keep
6212 #line consistency.
6213 Simplify the generation of auxiliary functions: locations and
6214 purity are mandated.
6215 (b4_global_tokens_and_yystype): Honor it.
6216 * data/location.cc (c++.m4): Don't include it.
6217 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
6218 and AT_SKEL_CC_IF.
6219 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
6220 AT_LALR1_CC_IF.
6221 Be sure to initialize the first position's filename.
6222 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
6223 mandated anyway.
6224 (AT_CHECK_CALC_GLR_CC): New.
6225 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
6226
3953ed88
AD
62272006-01-02 Akim Demaille <akim@epita.fr>
6228
6229 * src/output.c (output_skeleton): Don't hard wire the inclusion of
6230 c.m4.
0a96ba81 6231 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
6232 * data/glr.cc: Do not include stack.hh.
6233
9ecafbbf
AD
62342006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6235
6236 * data/glr.c: Reformat whitespace with tabs.
6237 (b4_lpure_formals): Remove this unused m4 macro.
6238 * tests/cxx-type.at: Reformat whitespace with tabs.
6239 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
6240 since it's a member. Rename type to isNterm for clarity.
6241
c4d497a0
AD
62422005-12-29 Akim <akim@sulaco.local>
6243
6244 Let glr.cc catch up with symbol_value_print.
6245 * data/glr.cc (b4_yysymprint_generate): Replace by...
6246 (b4_yy_symbol_print_generate): this.
6247 (yy_symbol_print, yy_symbol_value_print): Declare them.
6248
4517da37
PE
62492005-12-28 Paul Eggert <eggert@cs.ucla.edu>
6250
6251 * src/location.h (boundary): Note that a line or column equal
6252 to INT_MAX indicates an overflow.
6253 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
6254 (rule_length_overflow, increment_rule_length, add_column_width):
6255 New functions.
6256 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
6257 (<SC_BRACED_CODE>"}"):
6258 Use increment_rule_length rather than incrementing it by hand.
6259 (adjust_location, handle_syncline): Diagnose overflow.
6260 (handle_action_dollar, handle_action_at):
6261 Fix bug with monstrosities like $-2147483648.
6262 Remove now-unnecessary checks.
6263 (scan_integer): Verify assumptions and remove now-unnecessary checks.
6264 (convert_ucn_to_byte): Verify assumptions.
6265 (handle_syncline): New arg LOC. All callers changed.
6266 Don't store through a value derived from char const * pointer.
6267
6268 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
6269 GCC warnings.
6270
e3233bf6
PE
62712005-12-27 Paul Eggert <eggert@cs.ucla.edu>
6272
6273 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
6274 Remove unnecessary forward static decls.
6275
8f3596a6
AD
62762005-12-27 Akim Demaille <akim@epita.fr>
6277
6278 * src/reader.c (grammar_current_rule_check): Also check that $$
6279 is used.
6280 Take the rule to check as argument, hence rename as...
6281 (grammar_rule_check): this.
6282 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
6283 Rename as...
6284 (grammar_rule_begin, grammar_rule_end): these, for consistency.
6285 (grammar_midrule_action, grammar_symbol_append): Now static.
6286 * tests/torture.at (input): Don't rely on the default action
6287 being always performed.
6288 * tests/calc.at: "Set" $$ even when the action is "cut" with
6289 YYERROR or other.
6290 * tests/actions.at (Exotic Dollars): Instead of using unused
6291 values, check that the warning is issued.
6292
721be13c
PE
62932005-12-22 Paul Eggert <eggert@cs.ucla.edu>
6294
6295 * NEWS: Improve wording for unused-value warnings.
6296
a0af42fc
AD
62972005-12-22 Akim Demaille <akim@epita.fr>
6298
6299 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
6300 (b4_yysymprint_generate): Rename as...
6301 (b4_yy_symbol_print_generate): this.
6302 Generate yy_symbol_print instead of yysymprint.
6303 Generate also yy_symbol_value_print, and use it.
6304
affac613
AD
63052005-12-22 Akim Demaille <akim@epita.fr>
6306
721be13c 6307 * NEWS: Warn about unused values.
affac613
AD
6308 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
6309 a `used' member.
6310 (symbol_list_n_get, symbol_list_n_used_set): New.
6311 (symbol_list_n_type_name_get): Use symbol_list_n_get.
6312 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
6313 * src/reader.c (grammar_current_rule_check): Check that values are
6314 used.
6315 * src/symtab.c (symbol_print): Accept 0.
6316 * tests/existing.at: Remove the type information.
6317 Empty the actions.
6318 Remove useless actions (beware of mid-rule actions: perl -000
6319 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
6320 * tests/actions.at (Exotic Dollars): Use unused values.
6321 * tests/calc.at: Likewise.
6322 * tests/glr-regression.at (No users destructors if stack 0 deleted):
6323 Likewise.
6324
6325 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
6326 rule_useful_p.
6327
9d9b8b70
PE
63282005-12-21 Paul Eggert <eggert@cs.ucla.edu>
6329
8bb4c753
PE
6330 Undo 2005-12-01 tentative license wording change. The wording is
6331 still being reviewed by the lawyers, and we don't want to wait for
6332 them before publishing a test release. For now, revert to the
6333 previous wording.
6334 * NEWS: Undo 2005-12-01 change.
6335 * data/glr.c: Revert to previous license wording.
6336 * data/glr.cc: Likewise.
6337 * data/lalr1.cc: Likewise.
6338 * data/location.cc: Likewise.
6339 * data/yacc.c: Likewise.
6340
9d9b8b70
PE
6341 * NEWS: Reword %destructor vs YYABORT etc.
6342 * data/glr.c: Use American spacing, for consistency.
6343 * data/glr.cc: Likewise.
6344 * data/lalr1.cc: Likewise.
6345 * data/yacc.c: Likewise.
6346 * data/yacc.c: Reformat comments slightly.
6347 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
6348 for consistency. Fix some spelling errors and reword recently-included
6349 text slightly.
6350 * tests/cxx-type.at: Cast results of malloc, for C++.
6351
2c3b392a
AD
63522005-12-21 Joel E. Denny <address@hidden>
6353
6354 * tests/cxx-type.at: Construct a tree, count the parents of shared
6355 nodes, and free each node once and only once. Previously, the memory
6356 for semantic values was leaked instead.
6357
d6cff4dc
AD
63582005-12-21 Joel E. Denny <address@hidden>
6359
6360 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
6361 (yylval, yylloc): If pure, #define to yystackp->yyval and
6362 yystackp->yyloc similar to yychar and yynerrs.
6363 (yyparse): If pure, remove local yylval and yylloc. Add local
6364 yystackp to accommodate pure definitions of yylval and yylloc.
6365 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
6366 yylvalp and yyllocp to &yylval and &yylloc.
6367 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
6368 namespace. Previously, nerrs and char were missing, but lval and lloc
6369 weren't necessary.
6370 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
6371 yylvalp and yyllocp parameters since, if pure, these are now always
6372 accessible through yystackp. If not pure, they are still accessible
6373 globally.
6374 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
6375 `if (YYID (N))' to pacify lint.
6376
a85284cf
AD
63772005-12-21 Akim Demaille <akim@epita.fr>
6378
6379 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
6380 destroy the RHS symbols of a rule.
6381 * data/yacc.c (yylen): Initialize to 0.
6382 Keep its value to the number of items to possibly shift.
6383 In particular, a regular successful parse that ends on YYFINAL by
6384 a (internal) YYACCEPT must not have yylen != 0.
6385 (yyerrorlab, yyreturn): Pop the RHS.
6386 Reorder a bit to emphasize the `shifting' bits of code.
6387 (YYPOPSTACK): Now accept a number of items to pop.
6388 * data/lalr1.cc: Likewise.
6389 * data/glr.c: Formatting changes.
6390 Use goto instead of fall through.
6391 * doc/bison.texinfo (Destructor Decl): Complete.
6392
d508c281
JMG
63932005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6394
6395 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
6396 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
6397 * djgpp/config.bat: Replace every occurence of the file name
6398 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
6399 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
6400 * djgpp/config.sed: Replace every occurence of the file name
6401 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
6402 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
6403 * djgpp/djunpack.bat: DJGPP specific file.
6404 * djgpp/fnchange.lst: DJGPP specific file.
6405 * djgpp/README.in: Add new information about how to unpack the bison
6406 source on MSDOS and other systems which have 8.3 file name restrictions
6407 using djunpack.bat and fnchange.lst.
6408
3e7a2cd9
PE
64092005-12-12 Paul Eggert <eggert@cs.ucla.edu>
6410
6411 * bootstrap (build_cvs_prefix): Remove; unused.
6412 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
6413 when getting gnulib.
6414
64152005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
6416
6417 * data/glr.c: Reorder typedef declarations for structs to match order
6418 of struct declarations.
6419 Rename yystack everywhere to yystackp except in yyparse where it's not
6420 a pointer.
6421 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
6422 consistency.
6423 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
6424 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
6425 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
6426 lint.
6427
877519f8
PE
64282005-12-09 Paul Eggert <eggert@cs.ucla.edu>
6429
0eca5a39
PE
6430 * tests/sets.at (Accept): Fix typos in regular expression used to
6431 sed out the final state number.
6432
2cec9080
PE
6433 Work around portability problem on Solaris 10: flex-generated
6434 files include <stdio.h> before <config.h>, which messes up
6435 because the latter defines __EXTENSIONS__. Address the problem
6436 by creating two new little files that include <config.h> first,
6437 then include the flex-generated files. Rewrite everyone else
6438 to include <config.h> first, as well.
6439 * lib/timevar.c: Always include "config.h".
6440 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
6441 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
6442 (EXTRA_bison_SOURCES): New macro.
6443 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
6444 * src/system.h: Don't include config.h.
6445 * src/LR0.c: Include <config.h> first.
6446 * src/assoc.c: Likewise.
6447 * src/closure.c: Likewise.
6448 * src/complain.c: Likewise.
6449 * src/conflicts.c: Likewise.
6450 * src/derives.c: Likewise.
6451 * src/files.c: Likewise.
6452 * src/getargs.c: Likewise.
6453 * src/gram.c: Likewise.
6454 * src/lalr.c: Likewise.
6455 * src/location.c: Likewise.
6456 * src/main.c: Likewise.
6457 * src/muscle_tab.c: Likewise.
6458 * src/nullable.c: Likewise.
6459 * src/output.c: Likewise.
6460 * src/parse-gram.y: Likewise.
6461 * src/print.c: Likewise.
6462 * src/print_graph.c: Likewise.
6463 * src/reader.c: Likewise.
6464 * src/reduce.c: Likewise.
6465 * src/relation.c: Likewise.
6466 * src/state.c: Likewise.
6467 * src/symlist.c: Likewise.
6468 * src/symtab.c: Likewise.
6469 * src/tables.c: Likewise.
6470 * src/uniqstr.c: Likewise.
6471 * src/vcg.c: Likewise.
6472
877519f8
PE
6473 * src/parse-gram.y: Fix minor problems uncovered by lint.
6474 (current_lhs, current_lhs_location): Now static.
6475 (current_assoc): Remove unused variable.
6476
6477 Cleanups so that Bison-generated parsers have less lint.
6478 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
6479 Prepend /*ARGSUSED*/, for lint's sake.
6480 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
6481 definition if 'lint' is defined.
6482 (YYID): New macro (or function, if lint).
6483 All uses of /*CONSTCOND*/0 replaced by YYID(0).
6484 * data/yacc.c: Likewise.
6485 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
6486 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
6487 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
6488 is C++ only.
6489 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
6490 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
6491 Use YYID(0) rather than 0, for lint.
6492 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
6493 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
6494
f5228370
PE
64952005-12-07 Paul Eggert <eggert@cs.ucla.edu>
6496
6497 * tests/glr-regression.at
6498 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6499 Close memory leak reported by twlevo.
6500
69ce078b
PE
65012005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
6502
6ff99711
PE
6503 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
6504 all stacks.
6505 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
6506 * tests/glr-regression.at (No users destructors if stack 0 deleted):
6507 New test case.
6508 (Duplicated user destructor for lookahead): This test now is expected
6509 to succeed.
6510
af3412cd
PE
65112005-12-01 Paul Eggert <eggert@cs.ucla.edu>
6512
32b5b719 6513 * NEWS: Document the following change.
af3412cd
PE
6514 * data/yacc.c: Say "parser skeleton" rather than "file", since
6515 it's no longer just a file.
6516 * data/glr.c: Grant a special exception for C GLR parsers, that
6517 reads like the already-existing exception for C LALR(1) parsers.
6518 * data/glr.cc: Likewise.
6519 * data/lalr1.cc: Likewise.
6520 * data/location.cc: Likewise.
6521 * data/yacc.c: Reword the "written by" statement to clarify that
6522 it was the parser skeleton, not the entire output file.
6523 * data/glr.c: Written by Paul Hilfinger.
6524 * data/glr.cc: Written by Akim Demaille.
6525 * data/lalr1.cc: Likewise.
6526
035aa4a0
PE
65272005-11-18 Paul Eggert <eggert@cs.ucla.edu>
6528
d9963c85
PE
6529 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
6530 Fix typos in previous change that broke 'make check'.
6531 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
6532 supported in C.
6533 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
6534 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
6535 We can revert this once things settle down.
6536
035aa4a0
PE
6537 * src/conflicts.c (conflicts_print): Don't print file name twice
6538 when %expect fails because there were no conflicts.
6539 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
6540 change.
6541 * tests/conflicts.at (%expect not enough, %expect too much):
6542 (%expect with reduce conflicts): Adjust to new behavior.
6543
65442005-11-18 Akim Demaille <akim@epita.fr>
6545
6546 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
6547 errors.
6548 * NEWS: Document this.
6549 * doc/bison.texinfo (Expect Decl): Likewise.
6550
d1ff7a7c
AD
65512005-11-16 Akim Demaille <akim@epita.fr>
6552
6553 Generalize the display of semantic values and locations in traces.
6554 * data/glr.c (yy_reduce_print): Fix indices (again).
6555 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
6556 literal integers.
6557 * data/lalr1.cc (yyreduce_print): Rename as...
6558 (yy_reduce_print): this.
6559 Display values and locations.
6560 * data/yacc.c (yy_reduce_print): Likewise.
6561 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
6562 (yysymprint): Move higher to be visible from yy_reduce_print).
6563 (yyparse): Adjust.
6564 * tests/calc.at: Adjust the expected length of the traces.
6565
6de5398d
AD
65662005-11-14 Akim Demaille <akim@epita.fr>
6567
6568 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
6569 from 1 to N, while values and location start at 0.
6570 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
6571
a1373f55
AD
65722005-11-14 Akim Demaille <akim@epita.fr>
6573
6574 * data/glr.c (yy_reduce_print): Fix the $ number.
6575
613d8952
AD
65762005-11-14 Akim Demaille <akim@epita.fr>
6577
6578 "Use" parse parameters.
6579 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
6580 * data/glr.c, data/glr.cc: Use them.
6581 * data/glr.c (YYUSE): Have a C++ definition that supports
6582 non-pointer types.
6583
b2741627
AD
65842005-11-14 Akim Demaille <akim@epita.fr>
6585
6586 * data/glr.c (yyexpandGLRStack): Declare only if defined.
6587
5059b5c8
AD
65882005-11-14 Akim Demaille <akim@epita.fr>
6589
42249483
AD
6590 * data/glr.cc: New.
6591 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 6592
4626a15d
AD
65932005-11-12 Akim Demaille <akim@epita.fr>
6594
6595 Let position and location be PODs.
6596 * data/location.cc (position::initialize, location::initialize): New.
6597 (position::position, location::location): Define only if
6598 b4_location_constructors is defined.
6599 * data/lalr1.cc (b4_location_constructors): Define it for backward
6600 compatibility.
6601 * doc/bison.texinfo (Initial Action Decl): Use initialize.
6602
66032005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
6604
6605 * data/lalr1.cc: Move the body of the ctor and dtor into the
6606 parser file (instead of the header).
6607 Wrap the implementations in a "namespace yy".
6608
66092005-11-12 Akim Demaille <akim@epita.fr>
6610
6611 Have glr.c include its header file when created.
6612 * data/glr.c (b4_shared_declarations): New.
6613 Output them verbatim in the parser if !%defines, otherwise
6614 output then in the header file, and include it instead.
6615
1989d947
AD
66162005-11-11 Akim Demaille <akim@epita.fr>
6617
6618 * data/glr.c: Comment changes.
6619
66202005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
6621
6622 When yydebug, report semantic and location values for reductions.
6623 * data/glr.c (yy_reduce_print): Report the semantic values and the
6624 locations.
6625 (YY_REDUCE_PRINT): Adjust.
6626 (yyglrReduce): Use them.
6627 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
6628 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
6629 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
6630 traces.
6631
02998094
AD
66322005-11-10 Akim Demaille <akim@epita.fr>
6633
6634 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
6635 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
6636 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
6637
5210672f
PE
66382005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
6639
6640 * m4/cxx.m4, examples/Makefile.am: Don't build
6641 examples/calc++ if no C++ compiler is available. (trivial change)
6642
a8991a1d
AD
66432005-11-09 Akim Demaille <akim@epita.fr>
6644
6645 * src/scan-skel.l: Use a couple of asserts.
6646
36b5e963
AD
66472005-11-03 Akim Demaille <akim@epita.fr>
6648
6649 In some (weird) cases, the final state number is incorrect.
6650 Reported by Alexandre Duret-Lutz.
6651 * src/LR0.c (state_list_append): Remove the computation of
6652 final_state.
6653 (save_reductions): Do it here.
6654 (get_state): Alpha conversion.
6655 (generate_states): Use a for loop.
6656 * src/gram.h (item_number_is_rule_number)
6657 (item_number_is_symbol_number): New.
6658 * src/state.c: Use assert.
6659 * src/system.h: Include assert.h.
6660 * tests/sets.at (Accept): New.
6661
44e7ead1
PH
66622005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6663
6664 * data/glr.c (yyfill): Adjust comment.
36b5e963 6665 (yyresolveAction): Initialize default location properly
44e7ead1
PH
6666 for empty right-hand sides.
6667 (yydoAction): Ditto.
6668 Add comment explaining apparently dead code.
36b5e963
AD
6669 * tests/glr-regression.at
6670 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 6671 New test.
36b5e963 6672
e10a80ee
PE
66732005-10-30 Paul Eggert <eggert@cs.ucla.edu>
6674
6675 * bootstrap (cleanup_gnulib): New function. Use it to clean up
6676 gnulib when interrupted. This fixes some race conditions and
6677 works around some portability problems (one noted by Paul
6678 Hilfinger).
6679
067b32ee
AD
66802005-10-22 Akim <akim@epita.fr>
6681
6682 * Makefile.cfg: Adjust to config -> build-aux.
6683 Reported by twledo.
6684
4b367315
AD
66852005-10-21 Akim Demaille <akim@epita.fr>
6686
6687 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
6688 the %parse-params.
6689 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
6690 * data/yacc.c (b4_Pure_if): Rename as...
6691 (b4_yacc_pure_if): this.
6692 (YY_SYMBOL_PRINT, yyparse): Adjust.
6693 * doc/bison.texinfo: Formatting changes.
6694
24cc23d9
AD
66952005-10-21 Akim Demaille <akim@epita.fr>
6696
6697 Finish the transition config -> build-aux.
6698 * configure.ac, Makefile.am: Use build-aux.
6699 * config/prev-version, config/announce-gen, config/Makefile.am:
6700 Move to...
6701 * build-aux/prev-version, build-aux/announce-gen,
6702 * build-aux/Makefile.am: here.
6703
d4476375
AD
67042005-10-14 Akim Demaille <akim@epita.fr>
6705
6706 * examples/calc++/test: Use set -x only when VERBOSE.
6707
302c0aee
PE
67082005-10-13 Paul Eggert <eggert@cs.ucla.edu>
6709
6710 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
6711 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
6712
7625ec2c
AD
67132005-10-13 Akim Demaille <akim@epita.fr>
6714
6715 * src/scan-skel.l: Output the base name parts of the parser and
6716 header file names.
302c0aee 6717 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
6718 additional checks.
6719 Use this to exercise C++ outputs in subdirs.
6720 Reported by Oleg Smolsky.
6721
ba0fe3c7
PE
67222005-10-12 Paul Eggert <eggert@cs.ucla.edu>
6723
6724 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
6725 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
6726 Problem reported by John P. Hartmann.
6727 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
6728 already defined it.
6729
9b8a5ce0
AD
67302005-10-12 Akim Demaille <akim@epita.fr>
6731
6732 * src/parse-gram.y (version_check): Exit 63 to please missing
6733 (stands for "version mismatch).
6734 * tests/input.at, doc/bison.texinfo: Adjust.
6735
4f6e011e
PE
67362005-10-10 Paul Eggert <eggert@cs.ucla.edu>
6737
6738 Work around portability problems with Visual Age C compiler
6739 (xlc and xlC_r) reported by John P. Hartmann.
6740 * data/location.cc (initial_column, initial_line): Remove.
6741 All uses replaced by 0 and 1.
6742 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
6743 that xlc complains about.
6744 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 6745 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 6746 as __STDC__.
4d7aa45e
PE
6747 * data/yacc.c (YYMODERN_C): New macro, which also looks at
6748 __STDC_VERSION__. Use it everywhere instead of looking at
6749 __STDC__ and __cplusplus.
4f6e011e 6750
a1b3bf8c
AD
67512005-10-10 Akim Demaille <akim@epita.fr>
6752
6753 * examples/calc++/test: Be quiet unless VERBOSE.
6754
412e44aa
PE
67552005-10-05 Paul Eggert <eggert@cs.ucla.edu>
6756
2a4647a3
PE
6757 * data/c.m4 (yydestruct, yysymprint):
6758 Use YYUSE instead of casting to void.
6759 * data/glr.c (YYUSE): New macro.
6760 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6761 Use it instead of rolling our own.
6762 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
6763 (YYCHK1):
6764 Use /*CONSTCOND*/ to suppress lint warnings.
6765 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
6766 (YY_STACK_PRINT): Use 'false' not '0'.
6767 (YYUSE): New macro.
6768 (yysymprint_, yydestruct_): Use it instead of rolling our own.
6769 * data/yacc.c (YYUSE): New macro.
6770 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
6771 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
6772 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
6773
6774
412e44aa
PE
6775 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
6776 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
6777
88c6637f
PE
67782005-10-04 Paul Eggert <eggert@cs.ucla.edu>
6779
2f4f028d
PE
6780 Undo the parts of the unlocked-I/O change that substituted
6781 putc or puts for printf. This might hurt performance a bit,
6782 but some people prefer the printf style.
6783 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
6784 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
6785 All uses replaced by YYFPRINTF and YYDPRINTF.
6786 * data/yacc.c: Likewise.
6787 * lib/bitset.c (bitset_print): Likewise.
6788 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
6789 putc and puts.
6790 * lib/lbitset.c (debug_lbitset): Likewise.
6791 * src/closure.c (print_firsts, print_fderives): Likewise.
6792 * src/gram.c (grammar_dump): Likewise.
6793 * src/lalr.c (look_ahead_tokens_print): Likewise.
6794 * src/output.c (escaped_output): Likewise.
6795 (user_actions_output): Break apart two printfs.
6796 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
6797 * src/reduce.c (reduce_print): Likewise.
6798 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
6799 * src/system.h: Include unlocked-io.h rathe than stdio.h.
6800
88c6637f
PE
6801 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6802 Use assignments rather than casts-to-void to suppress
6803 unused-variable warnings. This pacifies 'lint'.
6804 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
6805 unused-variable warnings.
6806
fb32e373
JMG
68072005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6808
6809 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
6810
edb8f44f
PE
68112005-10-02 Paul Eggert <eggert@cs.ucla.edu>
6812
fb9c0b33
PE
6813 Use unlocked I/O for a minor performance improvement on hosts like
6814 GNU/Linux and Solaris that support unlocked I/O. The basic idea
6815 is to use the gnlib unlocked-io module, and to prefer putc and
6816 puts to printf when either will work (since the latter doesn't
6817 come in an unlocked flavor).
6818 * bootstrap (gnulib_modules): Add unlocked-io.
6819 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
6820 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
6821 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
6822 and similarly for puts and putc and printf.
6823 * data/yacc.c: Likewise.
6824 * lib/bitset.c (bitset_print): Likewise.
6825 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
6826 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
6827 to printf.
6828 * lib/lbitset.c (debug_lbitset): Likewise.
6829 * src/closure.c (print_firsts, print_fderives): Likewise.
6830 * src/gram.c (grammar_dump): Likewise.
6831 * src/lalr.c (look_ahead_tokens_print): Likewise.
6832 * src/output.c (escaped_output): Likewise.
6833 (user_actions_output): Coalesce two printfs.
2f4f028d 6834 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
6835 * src/reduce.c (reduce_print): Likewise.
6836 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 6837 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 6838
edb8f44f
PE
6839 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
6840 this confuses xgettext.
6841
b50d2359
AD
68422005-10-02 Akim Demaille <akim@epita.fr>
6843
6844 * bootstrap (gnulib_modules): Add strverscmp.
6845 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
6846 * m4/.cvsignore: Add strverscmp.m4.
6847 * src/parse-gram.y (%require): New token, new rule.
6848 (version_check): New.
6849 * src/scan-gram.l (%require): Adjust.
6850 * tests/input.at (AT_REQUIRE): New.
6851 Use it.
6852 * doc/bison.texinfo (Require Decl): New.
6853 (Calc++ Parser): Use %require.
6854
21667f64
AD
68552005-10-02 Akim Demaille <akim@epita.fr>
6856
6857 * data/location.cc: New.
6858
2b81e969
AD
68592005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
6860 Akim Demaille <akim@epita.fr>
6861
6862 Make sure -odir/foo.cc creates dir/location.hh etc.
6863 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
6864 (spec_file_prefix, spec_verbose_file, spec_graph_file)
6865 (spec_defines_file): Now const.
6866 (dir_prefix): New.
6867 (short_base_name): Remove.
6868 * src/files.c: Adjust.
6869 (dirname.h): Include.
6870 (base_name): Don't prototype it.
6871 (finput): Remove, duplicates gram_in.
6872 (full_base_name, short_base_name): Replace by...
6873 (all_but_ext, all_but_tab_ext): these.
6874 (compute_base_names): Rename as...
6875 (compute_file_name_parts): this.
6876 Update to compute the new variables, including dir_prefix.
6877 Adjust dependencies.
6878 * src/output.c (prepare): Output them.
6879 * src/reader.c: Adjust to use gram_in, not finput.
6880 * src/scan-skel.l (@dir_prefix@): New.
6881
ad6a9b97
JMG
68822005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6883
6884 * lib/subpipe.c: New function end_of_output_subpipe() added
6885 to allow support for non-posix systems. This is a no-op function
6886 for posix systems.
6887
6888 * lib/subpipe.h: New function end_of_output_subpipe() added
6889 to allow support for non-posix systems. This is a no-op function
6890 for posix systems.
6891
6892 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
6893 handle the lack of pipe/fork functionality on non-posix systems.
6894
6895 * djgpp/Makefile.maint: DJGPP specific file.
6896
6897 * djgpp/README.in: DJGPP specific file.
6898
6899 * djgpp/config.bat: DJGPP specific configuration file.
6900
6901 * djgpp/config.sed: DJGPP specific configuration file.
6902
6903 * djgpp/config.site: DJGPP specific configuration file.
6904
6905 * djgpp/config_h.sed: DJGPP specific configuration file.
6906
6907 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
6908
6909 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
6910
fc695704
AD
69112005-10-02 Akim Demaille <akim@epita.fr>
6912
6913 * data/location.cc: New, extract from...
6914 * data/lalr1.cc: here.
6915 (location.hh): Include it after the user prologue, in case the
6916 filename type is defined by the user.
6917 Forward declation location and position before the pre-prologue.
6918 (yyresult_): Rename as...
6919 (yyresult): this, it's a local variable, not an attribute.
6920 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
6921
69222005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
6923
6924 * examples/extexi: Restore the #line generation.
6925
fb9712a9
AD
69262005-09-30 Akim Demaille <akim@epita.fr>,
6927 Alexandre Duret-Lutz <adl@gnu.org>
6928
6929 Move the token type and YYSTYPE in the parser class.
6930 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
6931 (parser::token): New, from the moved free definition of tokens.
6932 (parser::semantic_value): Now a full definition instead of an
6933 indirection to YYSTYPE.
6934 (b4_post_prologue): No longer included in the header file, but
6935 in the implementation file.
6936 * doc/bison.texi (C+ Language Interface): Update.
6937 * src/parse-gram.y: Support unary %define.
6938 * tests/actions.at: Define global_tokens_and_yystype for backward
6939 compatibility until we update the tests.
6940 * tests/calc.at: Idem.
6941 (first_line, first_column, last_line, last_column): Define for lalr1.cc
6942 to simplify the code.
6943
55f0c7b1
PE
69442005-09-29 Paul Eggert <eggert@cs.ucla.edu>
6945
6946 Port to SunOS 4.1.4, which lacks strtoul and strerror.
6947 Ah, the good old days! Problem reported by Peter Klein.
6948 * bootstrap (gnulib_modules): Add strerror, strtoul.
6949 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
6950 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
6951
fb9712a9 69522005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
6953
6954 * data/c.m4 (b4_error_verbose_if): New.
6955 * data/lalr1.cc: Use it.
6956 (YYERROR_VERBOSE_IF): Remove.
6957 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
6958 parser members, replaced by...
6959 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
6960 local variables.
6961 (yysyntax_error_): Takes the state number as argument.
6962 (yyreduce_print_): Use the argument yyrule, not the former
6963 attribute yyn_.
6964
8a6f72f3
PE
69652005-09-26 Paul Eggert <eggert@cs.ucla.edu>
6966
6967 * bootstrap (gnulib_modules): Add verify.
6968 * lib/.cvsignore: Add verify.h.
6969 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
6970 * src/system.h (verify): Remove.
6971 Include verify.h instead.
6972 * src/tables.c (tables_generate): Use new API for 'verify'.
6973
0d50976f
PE
69742005-09-21 Paul Eggert <eggert@cs.ucla.edu>
6975
ebc3737e
PE
6976 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
6977 local variables whose names begin with 'yy'.
6978 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
6979 Trivial changes from Joel E. Denny.
6980
0d50976f
PE
6981 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
6982 it itself.
6983 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
6984 don't use alloca any more.
6985
6986 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
6987 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 6988 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
6989 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
6990 to match yacc.c, to test more hosts.
6991
a05b79df
PE
69922005-09-20 Paul Eggert <eggert@cs.ucla.edu>
6993
55289366
PE
6994 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
6995 doesn't affect behavior.
6996 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
6997 Solaris, AIX, MSC.
6998 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
6999 This works a bit better with glibc, if user code has already included
7000 stdlib.h.
7001 * doc/bison.texinfo (Bison Parser): Document that users can't
7002 arbitrarily use malloc and free for other purposes. Document
7003 that <alloca.h> and <malloc.h> might be included.
7004 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
7005 user must declare alloca.
7006
a05b79df
PE
7007 * HACKING (release): Forwarn the Translation Project about
7008 stable releses.
7009
3ab2ca22
AD
70102005-09-20 Akim Demaille <akim@epita.fr>
7011
7012 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
7013
a9739e7c
PE
70142005-09-19 Paul Eggert <eggert@cs.ucla.edu>
7015
a702593e
PE
7016 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
7017 (YYSTACK_ALLOC_MAXIMUM): Use it.
7018 (yysyntax_error): New function.
7019 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
7020 multiple syntax errors are reported, and alloca is being used.
7021 Instead, reallocate buffers twice as big each time, so that
7022 we waste at most half the allocated memory. Start with a small
7023 (128-byte) buffer that will suffice in most cases anyway.
7024 Use yysyntax_error to do most of the work.
7025
7026 * doc/bison.texinfo (Error Reporting, Table of Symbols):
7027 yynerrs is the number of errors reported, not the number of
7028 errors encountered.
7029
a9739e7c
PE
7030 * tests/glr-regression.at (Duplicated user destructor for lookahead):
7031 Mark it as expected to fail.
7032 Cast result of malloc; problem reported by twlevo@xs4all.nl.
7033 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
7034 Don't start user-code symbols with "yy", to avoid name space problems.
7035
f479c6c6
AD
70362005-09-19 Akim Demaille <akim@epita.fr>
7037
7038 Remove the traits, failed experiment.
7039 It never proved useful, and anyway because of the current
7040 definition, it was not possible to have several specialization of
7041 this traits, making it useless.
7042 * data/lalr1.cc (yy:traits): Remove.
7043 Inline its definitions in the parser class.
7044
e2586f82
AD
70452005-09-19 Akim Demaille <akim@epita.fr>
7046
7047 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
7048 least Mac OSX with a /usr/local install of gettext.
7049
2e8cf949
AD
70502005-09-19 Akim Demaille <akim@epita.fr>
7051
7052 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
7053 and yytoken for similarity with the other skeletons.
7054
c7fb0b90
AD
70552005-09-19 Akim Demaille <akim@epita.fr>
7056
4e26c69e 7057 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 7058
1bd0deda
PE
70592005-09-16 Paul Eggert <eggert@cs.ucla.edu>
7060
7061 * NEWS: Version 2.1.
7062
7063 * NEWS: Remove notice of yytname change, since it was never in an
7064 official release.
7065 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
7066 diagnostic.
7067 * src/output.c (prepare): Likewise.
7068 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
7069 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
7070 is not defined. This is an awful hack, but it's enough for now.
7071 All callers changed.
7072 * tests/glr-regression-at (make_value): Args are const pointers now,
7073 to avoid GCC warning.
7074 (Duplicated user destructor for lookahead): New test. Currently
7075 skipped. It fails on my host but I'm not sure it'll always fail.
7076
70772005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
7078
7079 * src/symtab.h (struct symbol): Declare the printer and destructor
7080 as const, to avoid accidental calls to free.
7081 (symbol_destructor_set, symbol_printer_set): Adjust.
7082 * src/symtab.c: Adjust.
7083
1bd0deda 70842005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
7085
7086 * data/c.m4 (b4_token_enums): New.
7087 (b4_token_defines): Rename as...
7088 (b4_token_enums_defines): this.
7089 (b4_token_defines): New, output only the #defines.
7090 * data/yacc.c, data/glr.c: Adjust.
7091 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
7092 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
7093 as default values.
7094
dbcdae2d
AD
70952005-09-16 Akim Demaille <akim@epita.fr>
7096
7097 * data/lalr1.cc (yylex_): Remove, inline its code.
7098 (yyreport_syntax_error_): Remove, replaced by...
7099 (yysyntax_error_): this which returns a string and leaves to the
7100 caller the call to the users' error function.
7101 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
7102 Move from members of the parser object...
7103 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
7104 to local variables of the parse function.
7105
70d8f291
AD
71062005-09-16 Akim Demaille <akim@epita.fr>
7107
7108 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
7109 since it's in Bison's name space.
7110
b47dbebe
PE
71112005-09-15 Paul Eggert <eggert@cs.ucla.edu>
7112
ae199bf1
PE
7113 * data/glr.c (yyresolveValue): Add default case to pacify
7114 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
7115
b47dbebe
PE
7116 * NEWS: Document when yyparse started to return 2.
7117 * doc/bison.texinfo (Parser Function): Document when yyparse
7118 returns 2.
7119
7120 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
7121 (b4_filename_type): Renamed back from b4_file_name_type. All uses
7122 changed.
7123 (class position): file_name -> filename (reverting). All uses changed.
7124
71252005-09-14 Paul Eggert <eggert@cs.ucla.edu>
7126
7127 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
7128 do anything if $@ exists. This reverts part of the 2005-07-07
7129 patch.
7130
00292f66
PE
71312005-09-11 Paul Eggert <eggert@cs.ucla.edu>
7132
7133 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
7134 contains obsolete information and isn't worth distributing as a
7135 separate file anyway.
7136 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
7137 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
7138 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
7139 (yyparse): Abort if user code uses longjmp to throw an unexpected
7140 value.
7141
a420f962
PE
71422005-09-09 Paul Eggert <eggert@cs.ucla.edu>
7143
00292f66
PE
7144 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
7145 Suggested by twlevo@xs4all.nl.
7146
127287e9
PE
7147 * data/glr.c (YYCHK1): Do not assume YYE is in range.
7148 This avoids a diagnostic from gcc -Wswitch-enum.
7149 Problem reported by twlevo@xs4all.nl.
7150
a420f962
PE
7151 * doc/bison.texinfo: Don't use "filename", as per GNU coding
7152 standards. Use "file name" or "file" or "name", depending on
7153 the context.
7154 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
7155 not to hack/foo.tab.c.
7156 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
7157 * data/glr.c: b4_filename -> b4_file_name.
7158 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
7159 All uses changed.
7160 (class position): filename -> file_name. All uses changed.
7161 * data/yacc.c: b4_filename -> b4_file_name.
7162 * lib/bitset.h: filename -> file_name in local vars.
7163 * lib/bitset_stats.c: Likewise.
7164 * src/files.c: Likewise.
7165 * src/scan-skel.l ("@output ".*\n): Likewise.
7166 * src/files.c (file_name_split): Renamed from filename_split.
7167 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
7168
71692005-09-08 Paul Eggert <eggert@cs.ucla.edu>
7170
7171 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
7172 to accommodate latest gnulib.
7173
7174 * tests/glr-regression.at (Duplicate representation of merged trees):
7175 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
7176
7177 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
7178 needed.
7179
42a6501d
PE
71802005-08-26 Paul Eggert <eggert@cs.ucla.edu>
7181
7182 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
7183 All uses changed. Invoke user destructor after an error during a
7184 split parse (trivial change from Joel E. Denny).
7185
7186 * tests/glr-regression.at
7187 (User destructor after an error during a split parse): New test case.
7188 Problem reported by Joel E. Denny in:
7189 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
7190
ef9a1faf
PE
71912005-08-25 Paul Eggert <eggert@cs.ucla.edu>
7192
5b4aaf78
PE
7193 * README-cvs: Give URLs for recommended tools.
7194 Mention Gzip version problem, and bootstrapping issues.
7195 Remove troubleshooting section, as it's somewhat obsolete.
7196
b5240ba5
PE
7197 * bootstrap (no_cache): New var, to accommodate different wget
7198 variants. Use it instead of '-C off'. Problem reported by
7199 twlevo@xs4all.nl.
7200
ef9a1faf
PE
7201 * data/glr.c (yydestroyStackItem): New function.
7202 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
7203 debugging information. Problem reported by Joel E. Denny.
7204
e6efa9da
AD
72052005-08-25 Akim Demaille <akim@epita.fr>
7206
7207 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
7208
adc90f13
PE
72092005-08-24 Paul Eggert <eggert@cs.ucla.edu>
7210
7211 * data/glr.c (yyrecoverSyntaxError, yyreturn):
7212 Don't invoke destructor on unresolved entries.
7213 * tests/glr-regression.at
7214 (User destructor for unresolved GLR semantic value): New test case.
7215 Problem reported by Joel E. Denny in:
7216 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
7217
f9315de5
PE
72182005-08-21 Paul Eggert <eggert@cs.ucla.edu>
7219
15d29c1f
PE
7220 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
7221 Add strnlen.c.
7222 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
7223 lib-prefix.m4, po.m4.
7224
dd5f2af2
PE
7225 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
7226 in yydestruct diagnostic, since it might not be an error.
7227 Problem reported by Joel Denny near end of
7228 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 7229 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
7230 * data/yacc.c (yyreturn): Likewise.
7231 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
7232
7233 * src/files.c: Remove obsolete FIXME comment.
7234
7235 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
7236 with the other templates, and to fix bogus run-on messages such
7237 as the one reported at the end of
7238 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
7239 All callers changed to avoid the newline.
7240 (yyprocessOneStack): Output two lines rather than one, to accommodate
7241 the above change. This changes the debug output format slightly.
7242
f9315de5
PE
7243 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
7244 reported by Joel E. Denny in
7245 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
7246 (trivial change).
7247 * tests/glr-regression.at (Duplicate representation of merged trees):
7248 New test, from Joel E. Denny in:
7249 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
7250 * THANKS: Add Joel E. Denny.
7251
7252 * configure.ac (AC_INIT): Bump to 2.0c.
7253
04098407
PE
72542005-07-24 Paul Eggert <eggert@cs.ucla.edu>
7255
7256 * NEWS: Version 2.0b.
7257
ca5d2013
PE
7258 * Makefile.am (SUBDIRS): Put examples before tests, so that
7259 "make check" doesn't finish with "All 1 tests passed".
7260
3d54b576
PE
7261 * tests/regression.at (Token definitions): Don't rely on
7262 AT_PARSER_CHECK for data that contains backslashes. It currently
7263 uses 'echo', and 'echo' isn't portable if its argument contains
7264 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
7265 that the byte '\0xff' is not printable in the C locale; it is,
7266 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
7267 not printable, so use '\0x81' to test.
7268
d53ae497
PE
7269 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
7270 version of GCC, since the macro is used with non-GCC compilers.
7271
fc01665e
PE
7272 Fix core dump reported by Pablo De Napoli in
7273 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
7274 * tests/regression.at (Invalid inputs with {}): New test.
7275 * src/parse-gram.y (token_name): Translate type before using
7276 it as an index.
7277
04098407
PE
7278 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
7279 the user's name space. All uses changed to __attribute__
7280 ((__unused__)).
7281 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
7282 Add __attribute__ ((__noreturn__)).
7283
7284 * etc/clcommit: Remove. We weren't using it, and it failed
7285 "make maintainer-distcheck".
7286 * Makefile.maint: Merge from coreutils.
7287 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
7288 (syntax-check-rules): Change list of rules as described below.
7289 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
7290 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
7291 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
7292 (sc_trailing_space): New rules.
7293 (sc_xalloc_h_in_src): Remove.
7294 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
7295 (sc_space_tab, sc_error_exit_success, sc_changelog):
7296 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
7297 (makefile-check, po-check, author_mark_check):
7298 (makefile_path_separator_check, copyright-check):
7299 Use grep -n, to make it easier to find violations.
7300 Use CVS_LIST and CVS_LIST_EXCEPT.
7301 (header_regexp, h_re): Remove.
7302 (dd_c): New macro.
7303 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
7304 (my-distcheck): Use more-modern GCC flags.
7305 (signatures, %.asc): Remove.
7306 (rel-files, announcement): Remove signatures.
7307 Restore old updating code, even though we don't use it, so
7308 that we're the same as coreutils.
7309 (alpha, beta, major): Depend on news-date-check.
7310 Make the upload commands.
7311
7312 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
7313 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
7314 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
7315 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
7316 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
7317 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
7318 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
7319 * tests/sets.at: Likewise.
7320
7321 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
7322 we comment out the Autoconf version number.
7323 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
7324 it's error-prone and "make maintainer-distcheck" rejects it.
7325
7326 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
7327 Indent calls to "error" to pacify "make maintainer-distcheck",
7328 when the calls are not intended to be translated.
7329 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
7330
7331 * src/Makefile.am (DEFS): Use +=, to pacify
7332 "make maintainer-distcheck".
7333 (bison_SOURCES): Add scan-skel.h.
7334 (sc_tight_scope): New rule, from coreutils.
7335
7336 * src/files.c (src_extension, header_extension):
7337 Now static, not extern.
7338 * src/getargs.c (short_options): Likewise.
7339 * src/muscle_tab.c (muscle_table): Likewise.
7340 * src/parse-gram.y (current_class, current_type, current_prec):
7341 Likewise.
7342 * src/reader.c (grammar_end, previous_rule_end): Likewise.
7343 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
7344 * src/main.c (main): Cast bindtextdomain and textdomain calls to
7345 void, to avoid warning when NLS is disabled.
7346 * src/output.c: Include scan-skel.h.
7347 (scan_skel): Remove decl, since scan-skel.h does this.
7348 (output_skeleton):
7349 Indent calls to "error" to pacify "make maintainer-distcheck".
7350 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
7351 * src/reader.h (gram_end, gram_lineno): New decls to pacify
7352 "make maintainer-distcheck".
7353 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
7354 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
7355 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
7356 (skel_lex_destroy, scan_skel): Move these decls to...
7357 * src/scan-skel.h: New file.
7358 * src/uniqstr.c (uniqstr_assert):
7359 Indent calls to "error" to pacify "make maintainer-distcheck".
7360
7361 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
7362 not @VAR@.
7363
7364 * tests/torture.at: Revamp to avoid misuse of atoi that
7365 "make maintainer-distcheck" complained about.
7366
7367 * examples/extexi (message): Don't print a message more than once,
7368 and omit line-number decoration that makes Emacs compile think
7369 that informative messages are worth worrying about.
7370
73712005-07-22 Paul Eggert <eggert@cs.ucla.edu>
7372
7373 * configure.ac: Update version number.
7374
7375 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
7376 accidentally.
7377 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
7378 autogenerated by the maintainer.
7379 * examples/calc++/.cvsignore: Add *.yy.
7380
7381 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
7382 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7383 * lib/bitsetv.c (bitsetv_alloc): Likewise.
7384
7385 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
7386
7387 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
7388 from maintainer-distcheck about casting the argument of 'free'.
7389
7390 * NEWS: Mention recent yytname changes.
7391 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
7392
7393 * bootstrap: For translations that have not yet been upgraded to
7394 the new runtime-po domain, prime the pump by extracting the
7395 relevant strings from the obsolete translations. This code can be
7396 removed once the bison-runtime domain has been translated by each
7397 team.
7398
7399 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
7400 now that token names are already quoted.
7401
7402 Fix problem reported by Anthony Heading.
7403 * data/glr.c (YYTOKEN_TABLE): New macro.
7404 (yytname): Define if YYTOKEN_TABLE.
7405 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
7406 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
7407 (YYERROR_VERBOSE): Define the same way the other skeletons do.
7408 * src/output.c (prepare_symbols): Output token_table_flag.
7409
0ffda363
PE
74102005-07-21 Paul Eggert <eggert@cs.ucla.edu>
7411
7412 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
7413 again if the first call fails.
7414
7415 * data/glr.c (yytnamerr): New function.
7416 (yyreportSyntaxError): Use it to dequote most string literals.
7417 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
7418 with other skeletons. All uses changed.
7419 (yytnameerr_): New function.
7420 (yyreport_syntax_error): Use it to dequote most string literals.
7421 * data/yacc.c (yytnamerr): New function.
7422 (yyerrlab): Use it to decode most string literals.
7423 * doc/bison.texinfo (Decl Summary, Calling Convention):
7424 Clarify quoting convention of yytname.
7425 * src/output.c (prepare_symbols): Quote all names. This undoes
7426 the 2005-04-17 change, which is now accomplished (mostly) via
7427 changes in the parsers as described above.
7428 * tests/regression.at (Token definitions, Web2c Actions):
7429 Undo most 2005-04-17 change here, too.
7430
74312005-07-20 Paul Eggert <eggert@cs.ucla.edu>
7432
7433 Fix more problems reported by twlevo@xs4all.nl.
7434 * tests/cxx-type.at: Don't pipe output of ./types through sed to
7435 remove trailing spaces. This loses the exit status of ./types,
7436 and isn't needed since ./types shouldn't be emitting trailing
7437 spaces.
7438 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
7439 as the stack isn't valid in that case.
7440
7441 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7442 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7443 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7444 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
7445 is used.
7446 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
7447 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7448 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7449 Likewise.
7450
7451 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
7452 overly-picky compilers that reject 'char *foo = "bar";'.
7453
7454 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
7455 to FILE * parameter, not to stderr. This fixes a typo introduced
7456 in the 2005-07-12 change.
7457
7458 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
7459 warnings from GCC 4.
7460
7461 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
7462 (yyglrShiftDefer, yysplitStack):
7463 Remove unused parameters b4_pure_formals. All uses changed.
7464 (yyglrShift): Remove unused parameters b4_user_formals.
7465 All uses changed.
7466 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
7467
6100a9aa
PE
74682005-07-18 Paul Eggert <eggert@cs.ucla.edu>
7469
258b75ca
PE
7470 Destructor cleanups and regularization among the three skeletons.
7471 * NEWS: Document the behavior changes.
7472 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
7473 stack before failing, as the cleanup code will do it for us now.
7474 * data/lalr1.cc (yyerrlab): Likewise.
7475 * data/glr.c (yyparse): Pop everything off the stack before
7476 freeing it, so that destructors get called properly.
7477 * data/lalr1.cc (yyreturn): Likewise.
7478 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
7479 This is more consistent.
7480 * doc/bison.texinfo (Destructor Decl): Mention more reasons
7481 why destructors might be called. 1.875 -> 2.1.
7482 (Destructor Decl, Decl Summary, Table of Symbols):
7483 Some English-language cleanups for %destructor.
7484 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7485 Add output line for destructor of start symbol.
7486 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
7487 because of that same extra output line.
7488
1a059451
PE
7489 * NEWS: Document minor wording changes in diagnostics of
7490 Bison-generated parsers.
7491 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
7492 Remove unused formals. All uses changed.
7493 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
7494 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
7495 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
7496 Rename yyoverflowab to yyexhaustedlab.
7497 When memory exhaustion occurs during syntax-error reporting,
7498 report it separately rather than in a single diagnostic; this
7499 eases translation.
7500 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
7501 (Memory Exhausted): Renamed from Parser Stack Overflow.
7502 Revamp wording slightly to prefer "memory exhaustion".
7503 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
7504
97460c78
PE
7505 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
7506
30757c8c
PE
7507 Add i18n support to the GLR skeleton. Partially fix the C++
7508 skeleton; a C++ expert needs to finish this. Remove debugging
7509 msgids; there's little point to having them translated, since they
7510 can be understood only by someone who can read the
7511 (English-language) source code.
7512
7513 Generate runtime-po/bison-runtime.pot automatically, so that we
7514 don't have to worry about garbage getting in that file. We'll
7515 make sure after the next official release that old msgids don't
7516 get lost. See
7517 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
7518
7519 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
7520 Now auto-generated.
7521 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
7522 Fix typos in explanations of the runtime file.
7523 * bootstrap: Change gettext keyword from YYI18N to YY_.
7524 Use standard Makefile.in.in in runtime-po, since we'll arrange
7525 for backward-compatible bison-runtime.po files in a different way.
7526 * data/glr.c (YY_): New macro, from yacc.c.
7527 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
7528 Translate messages intended for users.
7529 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
7530 the wording in the other skeletons. We don't know that the memory
7531 is virtual.
7532 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
7533 Use same method that yacc.c uses.
7534 Don't translate debugging messages.
7535 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
7536 it doesn't work (yet), and requires C++ expertise to fix.
7537 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
7538 Move defn to a more logical place, to be consistent with other
7539 skeletons.
7540 Don't translate debugging messages.
7541 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
7542 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
7543 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
7544 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
7545
ac8c5689
PE
7546 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
7547 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
7548 void, not int.
7549 * tests/glr-regression.at (Badly Collapsed GLR States):
7550 Likewise.
7551 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7552 yylex should return 0 at EOF rather than aborting.
7553
6100a9aa
PE
7554 Improve tests for stack overflow in GLR parser.
7555 Problem reported by twlevo@xs4all.nl.
7556 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
7557 All uses removed.
7558 (yyStackOverflow): Just longjmp, but with value 2 so that caller
7559 can handle the problem.
7560 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
7561 (yyparse): New local variable yyresult to record the result.
7562 Use result of setjmp to set it, rather than storing itinto
7563 struct.
7564 (yyDone): Remove label.
7565 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
7566 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
7567 if YYABORT is used).
7568 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
7569 yyparse status; put status > 1 into diagnostic.
7570 Check that status==2 works.
7571 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
7572 Use exit status 3 for failure to open (which shouldn't happen).
7573
15f40952
PE
75742005-07-17 Paul Eggert <eggert@cs.ucla.edu>
7575
67fd79c4
PE
7576 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
7577 1 on syntax error; just let yyparse do its thing.
7578 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
7579 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
7580 (Exploding the Stack Size with Alloca):
7581 (Exploding the Stack Size with Malloc):
7582 Expect exit status 2, not 1, since the parser is supposed to blow
7583 its stack. Problem reported by twlevo@xs4all.nl.
7584
15f40952
PE
7585 * data/glr.c (yyparse): Don't assume that the initial calls
7586 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
7587 Print a stack-overflow message and fail instead.
7588 Initialize the line-number information before creating the stack,
7589 so that the stack-overflow message can report line zero safely.
7590
f32c66b5
PE
75912005-07-14 Paul Eggert <eggert@cs.ucla.edu>
7592
a22ff96f 7593 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
7594 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
7595 (yyuserMerge): Provide a default case if b4_mergers is empty.
7596 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
7597 * tests/glr-regression.at
7598 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 7599 Add casts to pacify C++ compilers.
1beb0b24
PE
7600 * tests/glr-regression.at (Improper merging of GLR delayed action
7601 sets): Declare yylex before using it.
f32c66b5 7602 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
7603 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
7604 test for valgrind; valgrind is independent of g++.
7605 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
7606 for compatibility with POSIX 1003.1-2001 (if running coreutils).
7607 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
7608 Use a destructor, so that we can expand the stack. Change
7609 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 7610
d741bd1b
PE
76112005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7612
7613 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
7614 a valgrind failure. Problem reported by twlevo@xs4all.nl.
7615
0410a6e0
PE
76162005-07-13 Paul Eggert <eggert@cs.ucla.edu>
7617
7618 * PACKAGING: New file, suggested by Bruno Haible and taken from
7619 similar wording in gettext's PACKAGING file.
7620 * NEWS: Mention PACKAGING.
7621 * Makefile.am (EXTRA_DIST): Add PACKAGING.
7622
f7ab6a50
PE
76232005-07-12 Paul Eggert <eggert@cs.ucla.edu>
7624
baf785db 7625 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
7626 * bootstrap: Get runtime translations into runtime-po.
7627 Create runtime-po files automatically, if possible.
7628 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
7629 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
7630 does not infringe on the user's name space.
7631 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
7632 * doc/bison.texinfo (Internationalization): Revamp the English
7633 and Texinfo syntax a bit, to try to make it clearer.
7634 (Bison Options, Option Cross Key): Mention --print-localedir.
7635 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
7636 YYENABLE_NLS. Quote a bit more.
7637 * runtime-po/.cvsignore: New file.
7638 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
7639 * runtime-po/Rules-quot: Remove; now created by bootstrap.
7640 * runtime-po/quot.sed: Likewise.
7641 * runtime-po/boldquot.sed: Likewise.
7642 * runtime-po/en@quot.header: Likewise.
7643 * runtime-po/en@boldquot.header: Likewise.
7644 * runtime-po/insert-header.sin: Likewise.
7645 * runtime-po/remove-potcdate.sin: Likewise.
7646 * runtime-po/Makevars: Likewise.
7647 * runtime-po/LINGUAS: Likewise.
7648 * runtime-po/de.po: Likewise; we will rely on the translation project
7649 to maintain this, so "bootstrap" should get it.
0410a6e0 7650 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
7651 its value.
7652 * src/main.c (main): Bind the bison-runtime domain, too.
7653
76542005-07-12 Bruno Haible <bruno@clisp.org>
7655
7656 * data/yacc.c: Include <libintl.h> when NLS is enabled.
7657 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
7658 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
7659 * runtime-po: New directory.
7660 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
7661 $(DOMAIN).pot-update rule, so that old messages are never dropped.
7662 * runtime-po/Rules-quot: New file, copied from po/.
7663 * runtime-po/quot.sed: Likewise.
7664 * runtime-po/boldquot.sed: Likewise.
7665 * runtime-po/en@quot.header: Likewise.
7666 * runtime-po/en@boldquot.header: Likewise.
7667 * runtime-po/insert-header.sin: Likewise.
7668 * runtime-po/remove-potcdate.sin: Likewise.
7669 * runtime-po/Makevars: New file.
7670 * runtime-po/POTFILES.in: New file.
7671 * runtime-po/LINGUAS: New file.
7672 * runtime-po/bison-runtime.pot: New file.
7673 * runtime-po/de.po: New file.
7674 * m4/bison.m4: New file.
7675 * Makefile.am (SUBDIRS): Add runtime-po.
7676 (aclocaldir, aclocal_DATA): New variables.
7677 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
7678 Define aclocaldir.
7679 * src/getargs.c (usage): Document --print-localedir option.
7680 (PRINT_LOCALEDIR_OPTION): New enum item.
7681 (long_options): Add --print-localedir option.
7682 (getargs): Handle --print-localedir option.
7683 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
7684 (Internationalization): New section.
7685
22dda0f0
AD
76862005-07-12 Akim Demaille <akim@epita.fr>
7687
7688 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
7689 for consistency with the rest of the code.
7690 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
7691 Add separators.
7692
82b248ad
AD
76932005-07-12 Akim Demaille <akim@epita.fr>
7694
7695 * src/parse-gram.y: Use %printer instead of YYPRINT.
7696
fa0e9314
AD
76972005-07-12 Akim Demaille <akim@epita.fr>
7698
867a3e00
AD
7699 * src/symtab.h, src/symtab.c (symbol_print): New.
7700 * src/symlist.h, src/symlist.c (symbol_list_print): New.
7701 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
7702
77032005-07-12 Akim Demaille <akim@epita.fr>
7704
7705 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
7706 b4_at_dollar and b4_dollar_dollar.
7707
e054b190
PE
77082005-07-11 Paul Eggert <eggert@cs.ucla.edu>
7709
7710 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
7711 and Pennello's paper.
7712
34160ec4
PE
77132005-07-09 Paul Eggert <eggert@cs.ucla.edu>
7714
407d4a75
PE
7715 * data/yacc.c (yyparse): Undo previous patch. Instead,
7716 set yylsp[0] and yyvsp[0] only if the initial action
7717 sets yylloc and yylval, respectively.
7718
34160ec4
PE
7719 * data/yacc.c (yyparse): In the initial action, set
7720 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
7721 This avoids the use of undefined variables if the initial
7722 action does not set yylloc and/or yylval.
7723
c3d5a4a7
PE
77242005-07-07 Paul Eggert <eggert@cs.ucla.edu>
7725
b34d96c1
PE
7726 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
7727 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
7728 Remove from CVS. These files are automatically generated.
7729 * examples/extexi: Clarify that this file is now part of Bison,
7730 not GNU M4, and that it works with any POSIX-compatible Awk.
7731 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
7732 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
7733 so that we also get calc++-parser.yy. Geneate it.
7734 Use $(AWK), not gawk, since any conforming Awk will do.
7735 Put comment before action, since older 'make' can't handle comment
7736 in action.
7737 $(BUILT_SOURCES): List all built sources, not just some of them.
7738 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
7739 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
7740 $($(calc_sources_generated)): Remove unnecessary test for existence
7741 of target. (This had a shell syntax error anyway; a stray "x".)
7742 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
7743 calc++-parser.yy.
7744 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
7745
c3d5a4a7
PE
7746 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
7747 implied by the other modules.
7748
828c373b
AD
77492005-07-06 Akim Demaille <akim@epita.fr>
7750
7751 Bind examples/calc++ to the package.
7752 * examples/calc++/Makefile: Remove, replaced by...
7753 * examples/calc++/Makefile.am: ... this new file.
7754 * examples/calc++/test: Remove input.
7755 * examples/calc++/compile: Remove.
7756 * examples/Makefile.am: New.
7757 * configure.ac, Makefile.am: Adjust.
7758 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
7759
63cb01d6
PE
77602005-07-05 Paul Eggert <eggert@cs.ucla.edu>
7761
fd2df2ed
PE
7762 * data/glr.c (yyFail): Drastically simplify; since the format argument
7763 never had any % directives, we can simply pass it to yyerror.
7764 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
7765 be modified later, as that is the usual style in glr.c.
7766 Problems reported by Paul Hilfinger.
7767
63cb01d6
PE
7768 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
7769 and size overflow errors.
7770 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
7771 in case the user prolog sets feature-test macros like _GNU_SOURCE.
7772 (YYSIZEMAX): New macro.
7773 (yystpcpy): New function, taken from yacc.c.
7774 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
7775 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
7776 so that we don't have to maintain their signatures.
7777 (yyFail): Check for buffer overflow, by using vsnprintf rather
7778 than vsprintf. Allocate a bigger buffer if possible.
7779 Report an error if buffer allocation fails.
7780 (yyStackOverflow): New function.
7781 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
7782 the initialization was successful. It might fail if storage was
7783 exhausted.
7784 (yyexpandGLRStack): Add more checks for storage allocation failure.
7785 Use yyStackOverflow to report failures.
7786 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
7787 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
7788 Don't assume stack number fits in int.
7789 (yysplitStack): Check for storage allocation failure.
7790 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
7791 can print diagnostics on storage allocation failure. All callers
7792 changed.
7793 (yyresolveValue): Use yybool for boolean.
7794 (yyreportSyntaxError): Check for size-calculation overflow.
7795 This code is taken from yacc.c.
7796 (yyparse): Check for storage allocation errors when allocating
7797 the initial stack.
7798
1c59e0a1
AD
77992005-07-05 Akim Demaille <akim@epita.fr>
7800
7801 Extract calc++ from the documentation.
7802 * doc/bison.texinfo (Calc++): Add the extraction marks.
7803 * examples/extexi: New, from the aborted GNU Programming 2E.
7804 Separate the different paragraph of a file with empty lines.
7805 * examples/Makefile: Use it to extract the whole calc++ example.
7806
8a0adb01
AD
78072005-06-24 Akim Demaille <akim@epita.fr>
7808
7809 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
7810 class typedefs.
7811
12545799
AD
78122005-06-22 Akim Demaille <akim@epita.fr>
7813
7814 * doc/bison.texinfo (C++ Language Interface): First stab.
7815 (C++ Parsers): Remove.
7816
99be0235
AD
78172005-06-22 Akim Demaille <akim@epita.fr>
7818
7819 * data/lalr1.cc (yylex_): Honor %lex-param.
7820
0ffd4fd1
AD
78212005-06-22 Akim Demaille <akim@epita.fr>
7822
7823 Start a set of simple examples.
7824 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
7825 * examples/calc++/calc++-driver.hh,
7826 * examples/calc++/calc++-parser.yy,
7827 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
7828 * examples/calc++/compile, examples/calc++/test: New.
7829
0925ebb4
PE
78302005-06-09 Paul Eggert <eggert@cs.ucla.edu>
7831
7832 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
7833 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
7834 which stems from the 2005-05-27 patch.
7835
43d3b664
PH
78362005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7837
7838 * data/glr.c: Modify treatment of unused parameters to permit use
7839 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
7840
3062864d
PE
78412005-05-30 Paul Eggert <eggert@cs.ucla.edu>
7842
7843 Fix infringement on user name space reported by Janos Zoltan Szabo.
7844 * data/yacc.c (yyparse): strlen -> yystrlen.
7845
989b5b8e
AD
78462005-05-30 Akim Demaille <akim@epita.fr>
7847
7848 * data/lalr1.cc (_): New.
7849 Translate the various messages.
7850
bedf57f5
PE
78512005-05-27 Paul Eggert <eggert@cs.ucla.edu>
7852
7853 Fix infringement on user name space reported by Bruno Haible.
7854 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
7855 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
7856 the user's name space.
7857 (alloca): Include <stdlib.h> to get it, if it's not built in.
7858 (YYMALLOC, YYFREE): Define only if needed.
7859 (malloc, free): Declare, but only if needed, as this infringes on
7860 the user name space.
7861
4d1801f1
PE
78622005-05-25 Paul Eggert <eggert@cs.ucla.edu>
7863
7864 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
7865 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
7866 with %d format.
7867 * lib/ebitset.c (min, max): Undef before defining.
7868 * lib/vbitset.c (min, max): Likewise.
7869 * lib/subpipe.c (create_subpipe): Save local variables in case
7870 vfork clobbers them.
7871
78722005-05-24 Bruno Haible <bruno@clisp.org>
7873
7874 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
7875 error message syntax used by gcc-4.0.
7876
b94a9e1e
PE
78772005-05-23 Paul Eggert <eggert@cs.ucla.edu>
7878
85ac3861
PE
7879 * README: Mention m4 1.4.3. Remove obsolete advice about
7880 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
7881
b94a9e1e
PE
7882 * bootstrap: Remove workaround for problem I encountered with
7883 gettext 0.14.1; it seems to be fixed now.
7884
51c30d21
PE
78852005-05-22 Paul Eggert <eggert@cs.ucla.edu>
7886
009ce67d
PE
7887 * NEWS: Version 2.0a.
7888
f2a97c62
PE
7889 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
7890 the previous change.
7891
c8775f93
PE
7892 Various maintainer cleanups.
7893 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
7894 conftest*, for benefit of CVS commands run at the same time as
7895 "configure". Add build-aux, since "bootstrap" now creates it and
7896 its subfiles.
7897 * Makefile.cfg (move_if_change): Remove.
7898 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
7899 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
7900 (po_repo, do-po-update, po-update, wget_files, get-targets):
7901 (config.guess-url_prefix, config.sub-url_prefix):
7902 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
7903 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
7904 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
7905 Remove.
7906 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
7907 this is now the recommended name.
7908 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
7909 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
7910 ylwrap. These files now go into build-aux.
7911 * config/move-if-change: Remove.
7912 * config/prev-version.txt: Bump from 1.75 to 2.0.
7913
3ea5f0ec
PE
7914 * bootstrap: Add stdio-safer, unistd-safer modules.
7915 Remove m4/glibc2.m4 (introduced by latest gnulib, but
7916 we don't need it).
7917 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
7918 fopen-safer.c, stdio-safer.h, unistd-safer.h.
7919 * lib/subpipe.c: Include "unistd-safer.h".
7920 (create_subpipe): Make sure all the newly-created
7921 file descriptors are > 2, so that diagnostics don't
7922 get sent down them (which might cause Bison to hang, in theory).
7923 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
7924 * src/files.c (xfopen): Use fopen_safer, not fopen.
7925
51c30d21
PE
7926 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
7927 yesterday's yacc.c fix.
7928
cea1469d
PE
79292005-05-21 Paul Eggert <eggert@cs.ucla.edu>
7930
3ea5f0ec
PE
7931 * data/glr.c, data/lalr1.cc: Update copyright date.
7932
cea1469d
PE
7933 Fix a destructor bug reported by Wolfgang Spraul in
7934 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
7935 * data/yacc.c (yyabortlab): Don't call destructor, and
7936 don't set yychar to EMPTY.
7937 (yyoverflowlab): Don't call destructor.
7938 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
7939 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
7940 since we no longer output the message "discarding lookahead token
7941 end of input ()".
7942
5e6f62f2
PH
79432005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7944
7945 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
7946 fix a small glitch in debugging output.
7947 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
7948 after YY_SYMBOL_PRINT where needed.
7949
7950 (struct yyGLRState): Add some comments.
7951 (struct yySemanticOption): Add some comments.
7952 (union yyGLRStackItem): Add comment.
7953
7954 (yymergeOptionSets): Correct this to properly perform the union,
7955 avoiding infinite reported by Michael Rosien.
7956 Update comment.
7957
7958 * tests/glr-regression.at: Add test for GLR merging error reported
7959 by M. Rosien.
cea1469d 7960
0fb669f9
PE
79612005-05-13 Paul Eggert <eggert@cs.ucla.edu>
7962
7963 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
7964 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
7965 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
7966 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
7967 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
7968 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
7969 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
7970 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
7971 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
7972 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
7973 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
7974 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
7975 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
7976 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
7977 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
7978 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
7979 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
7980 src/derives.h, src/files.c, src/files.h, src/getargs.c,
7981 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
7982 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
7983 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
7984 src/output.h, src/parse-gram.c, src/parse-gram.h,
7985 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
7986 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
7987 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
7988 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
7989 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
7990 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
7991 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
7992 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
7993 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
7994 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
7995 tests/reduce.at, tests/regression.at, tests/sets.at,
7996 tests/synclines.at, tests/testsuite.at, tests/torture.at:
7997 Update FSF postal mail address.
7998
51f4735e
PE
79992005-05-11 Paul Eggert <eggert@cs.ucla.edu>
8000
8001 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
8002 Problem reported by Ralf Menzel.
8003
80ce3401
PE
80042005-05-01 Paul Eggert <eggert@cs.ucla.edu>
8005
8006 * tests/actions.at: Test that stack overflow invokes destructors.
8007 From Marcus Holland-Moritz.
8008 * data/yacc.c (yyerrlab): Move the code that destroys the stack
8009 from here....
8010 (yyreturn): to here. That way, destructors are called properly
8011 even if the stack overflows, or the user calls YYACCEPT or
8012 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
8013 (yyoverflowlab): Destroy the lookahead.
8014
80152005-04-24 Paul Eggert <eggert@cs.ucla.edu>
8016
8017 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
8018
72f000b0
PE
80192005-04-17 Paul Eggert <eggert@cs.ucla.edu>
8020
8021 * NEWS: Bison-generated C parsers no longer quote literal strings
8022 associated with tokens.
8023 * src/output.c (prepare_symbols): Don't escape strings,
8024 since users don't want to see C escapes.
8025 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
8026 in diagnostics.
c19683bb 8027 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
8028 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
8029
1094323f
PE
80302005-04-16 Paul Eggert <eggert@cs.ucla.edu>
8031
8032 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
8033 the data size is known to be too small and we can't increase it.
8034 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
8035
ca407bdf
PE
80362005-04-15 Paul Eggert <eggert@cs.ucla.edu>
8037
8038 * src/parse-gram.y: Include quotearg.h.
8039 (string_as_id): Quote $1 before using it as a key, since the
8040 lexer no longer quotes it for us.
8041 (string_content): Don't strip quotes, since lexer no longer
8042 quotes it for us.
8043 * src/scan-gram.l: Include quotearg.h.
8044 ("\""): Omit quote.
8045 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
8046 a key, since the rest of the lexer doesn't quote it.
8047 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
8048 * tests/regression.at (Token definitions): Check for backslashes
8049 in token strings.
8050
8051 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
8052 (YYSIZE_T): Define to unsigned long int when using an older compiler.
8053 (yyparse): Revamp code to generate long syntax error message, to
8054 make it easier to translate, and to avoid problems with arithmetic
8055 overflow. Change "virtual memory" to "memory" in diagnostic, since
8056 we don't know whether the memory is virtual.
8057
1ce59070
PE
80582005-04-13 Paul Eggert <eggert@cs.ucla.edu>
8059
8060 * NEWS: Bison-generated C parsers now use the _ macro to
8061 translate strings.
8062 * data/yacc.c (_) [!defined _]: New macro.
8063 All English strings wrapped inside this macro.
8064 * doc/bison.texinfo (Bison Parser): Document _.
8065 * po/POTFILES.in: Include src/parse-gram.c, since it now
8066 includes translateable strings that parse-gram.y doesn't.
8067
a749a695
PE
80682005-04-12 Paul Eggert <eggert@cs.ucla.edu>
8069
8070 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
8071 reverting the 2004-10-11 change to this function.
8072 (symbol_check_alias_consistency): Don't call symbol_type_set
8073 if the type name is already correct.
8074 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
8075
8fb1053b
PE
80762005-03-25 Paul Eggert <eggert@cs.ucla.edu>
8077
8078 * tests/regression.at (Token definitions): Don't use a token named
8079 c, as that generates a "#define c ..." that runs afoul of buggy
8080 stdlib.h that uses the identifier c as a member of struct
8081 drand48_data. Problem reported by Horst Wente.
8082
ff498c4a
PE
80832005-03-21 Paul Eggert <eggert@cs.ucla.edu>
8084
8085 * bootstrap: Change translation URL from
8086 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
8087 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
8088 redirection glitches. Problem reported by twlevo@xs4all.nl.
8089
65211d70
PE
80902005-03-20 Paul Eggert <eggert@cs.ucla.edu>
8091
8092 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
8093 after operands; POSIX says this isn't portable for the c99 command.
8094
9577fb1f
PE
80952005-03-18 Paul Eggert <eggert@cs.ucla.edu>
8096
8097 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
8098 immediately if a data overrun has occurred; this may help us track
8099 down what may be a spurious failure on MacOS.
8100
78b178f7
PE
81012005-03-17 Paul Eggert <eggert@cs.ucla.edu>
8102
a2599d0f
PE
8103 Respond to problems reported by twlevo@xs4all.nl.
8104
8105 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
8106
78b178f7
PE
8107 * src/vcg.h: Comment fix.
8108 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
8109 (G_CMAX): Change to -1 instead of INT_MAX.
8110
8111 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 8112
7296e729
PE
81132005-03-15 Paul Eggert <eggert@cs.ucla.edu>
8114
8115 * src/tables.c (state_number_to_vector_number): Put it inside an
8116 "#if 0", since it's not currently used. Problem reported by
8117 Roland McGrath.
8118
05ac60f3
PE
81192005-03-06 Paul Eggert <eggert@cs.ucla.edu>
8120
8121 * src/output.c (escaped_output): Renamed from
8122 escaped_file_name_output, since we now use it for symbol tags as
8123 well. All uses changed.
8124 (symbol_destructors_output, symbol_printers_output):
8125 Escape symbol tags too.
8126 Problem reported by Matyas Forstner in
8127 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
8128
8129 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
8130 not needed.
8131 * src/output.c (user_actions_output, token_definitions_output,
8132 symbol_destructors_output, symbol_printers_output): Likewise.
8133 * src/reader.c (prologue_augment): Likewise.
8134 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
8135
8136 * src/vcg.c (output_edge): Don't quote linestyle arg.
8137 Problem reported by twlevo@xs4all.nl.
8138
7eb453ac
PE
81392005-02-28 Paul Eggert <eggert@cs.ucla.edu>
8140
8141 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
8142 example, reported by Derek M Jones. Also, make the example even
8143 more outrageous, to better illustrate how bad the problem is.
8144
4c04c52a
PE
81452005-02-24 Paul Eggert <eggert@cs.ucla.edu>
8146
8147 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
8148 putsym. Typo reported by Sebastian Piping.
8149
a61e1620
PE
81502005-02-23 Paul Eggert <eggert@cs.ucla.edu>
8151
8152 * doc/bison.texinfo (Language and Grammar): some -> same
8153 (Epilogue): int he -> in the
8154 Typos reported by Sebastian Piping via Justin Pence.
8155
9ec93868
PE
81562005-02-07 Paul Eggert <eggert@cs.ucla.edu>
8157
8158 * tests/glr-regression.at (Improper handling of embedded actions
8159 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
8160 embedded actions and $-N in GLR parsers", work around an Autoconf bug
8161 with dollar signs in test names.
8162 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
8163 for a similar reason.
8164
73ce7e7e
PE
81652005-01-28 Paul Eggert <eggert@cs.ucla.edu>
8166
8167 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
8168 wants to redefine G_VIEW.
8169
2e72b98e
PE
81702005-01-27 Paul Eggert <eggert@cs.ucla.edu>
8171
8172 * src/vcg.c (get_view_str): Remove case for normal_view.
8173 Problem reported by twlevo@xs4all.nl.
8174
e0d634e5
PE
81752005-01-24 Paul Eggert <eggert@cs.ucla.edu>
8176
ccf830a4
PE
8177 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
8178 Problem reported by twlevo@xs4all.nl.
8179
e0d634e5
PE
8180 * doc/bison.texinfo: Change @dircategory from "GNU programming
8181 tools" to "Software development". Requested by Richard Stallman
8182 via Karl Berry.
8183
7bbc8cb0
PE
81842005-01-23 Paul Eggert <eggert@cs.ucla.edu>
8185
8186 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
8187 Problem reported by twlevo@xs4all.nl.
8188
08b770bc
PE
81892005-01-21 Paul Eggert <eggert@cs.ucla.edu>
8190
8191 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
8192 keyword; it's not needed with modern compilers, and it doesn't
8193 affect correctness with older compilers. Suggested by
8194 twlevo@xs4all.nl.
8195
95f22ad2
PE
81962005-01-17 Paul Eggert <eggert@cs.ucla.edu>
8197
8198 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
8199 gcc -Wswitch-default.
8200 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8201 * data/yacc.c (yyparse): Likewise.
8202
d229d15c
PE
82032005-01-12 Paul Eggert <eggert@cs.ucla.edu>
8204
8205 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
8206 already. Let config.h define any nonstandard values.
8207
ecadd90f
PE
82082005-01-10 Paul Eggert <eggert@cs.ucla.edu>
8209
8210 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
8211 for the benefit of slower hosts. Problem reported by
8212 Nelson H. F. Beebe.
8213
213744b5
PE
82142005-01-07 Paul Eggert <eggert@cs.ucla.edu>
8215
8216 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
8217 being defined and not used.
8218 * data/lalr1.cc (yyparse): Likewise.
8219 Use "if (false)" rather than "if (0)".
8220
249d3236
PE
82212005-01-05 Paul Eggert <eggert@cs.ucla.edu>
8222
8223 * TODO: Mention that we should allow NUL bytes in tokens.
8224
987cc1fb
PE
82252005-01-02 Paul Eggert <eggert@cs.ucla.edu>
8226
8227 * src/scan-skel.l (<<EOF>>): Don't close standard output.
8228 Problem reported by Hans Aberg.
8229
08fe02d9
PE
82302005-01-01 Paul Eggert <eggert@cs.ucla.edu>
8231
8232 * src/getargs.c (version): Happy new year; update overall
8233 program copyright date from 2004 to 2005.
8234
8235 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
8236 Problem reported by Hans Aberg.
8237 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
8238 (Output file names.): Add a test for the case when standard output
8239 is closed.
8240
010c0266
PE
82412004-12-26 Paul Eggert <eggert@cs.ucla.edu>
8242
8243 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
8244 to fix an oversight in the Bison 2.0 manual.
8245
da12206a
PE
82462004-12-25 Paul Eggert <eggert@cs.ucla.edu>
8247
8248 * NEWS: Version 2.0. Reformat the existing news items since
8249 1.875, so that related items are grouped together.
3a4734aa 8250 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
8251 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
8252
c935d934
PE
8253 * tests/torture.at (Exploding the Stack Size with Alloca): Set
8254 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
8255 otherwise, we're not testing alloca. Unfortunately there's no
8256 simple way to consult HAVE_ALLOCA here.
8257
da12206a
PE
8258 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
8259 for yymsg, too.
8260
8261 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
8262 hand. This avoids a warning about comparing int to size_t when
8263 GCC warnings are enabled.
8264
0a2c5137
PE
82652004-12-22 Paul Eggert <eggert@cs.ucla.edu>
8266
d7e14fc0
PE
8267 * NEWS: Bison-generated parsers no longer default to using the
8268 alloca function (when available) to extend the parser stack, due
8269 to widespread problems in unchecked stack-overflow detection.
8270 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
8271 responsibility to set it to a positive value. This lets the user
8272 specify a value that is not a preprocessor constant.
8273 * data/yacc.c (YYMAXDEPTH): Likewise.
8274 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
8275 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
8276 to be a compile-time constant. However, explain the constraints on it.
8277 Also, explain the constraints on YYINITDEPTH.
8278 (Table of Symbols): Explain that alloca is no longer the default.
8279 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
8280 to 1.
8281
0a2c5137
PE
8282 * doc/bison.texinfo (Location Default Action): Mention that n must
8283 be zero when k is zero. Suggested by Frank Heckenbach.
8284
e019c247
AD
82852004-12-22 Akim Demaille <akim@epita.fr>
8286
8287 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
8288 (parser::state_type, parser::semantic_type, parser::location_type):
8289 Private, not public.
8290 (parser::parse): Return ints, not bool.
8291 Returning a bool introduces a problem: 0 corresponds to false, and
8292 it seems weird to return false on success. Returning true changes
8293 the conventions for yyparse.
8294 Alternatively we could return void and send an exception.
8295 There is no clear consensus (yet?).
8296 (state_stack, semantic_stack, location_stack): Rename as...
8297 (state_stack_type, semantic_stack_type, location_stack_type): these.
8298 Private, not public.
8299 * tests/c++.at: New.
8300 * tests/testsuite.at, tests/Makefile.am: Adjust.
8301
72731bb7
AD
83022004-12-21 Akim Demaille <akim@epita.fr>
8303
8304 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
8305
9a0d8bec
AD
83062004-12-21 Akim Demaille <akim@epita.fr>
8307
8308 Don't impose std::string for filenames.
8309
8310 * data/lalr1.cc (b4_filename_type): New.
8311 (position::filename): Use it.
8312 (parser.hh): Move the inclusion of stack.hh and location.hh below
8313 the user code, so that needed headers for the filename type can be
8314 included first.
72731bb7
AD
8315 Forward declare them before the user code.
8316 * tests/Makefile.am (check-local, installcheck-local): Pass
8317 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 8318
99880de5
AD
83192004-12-20 Akim Demaille <akim@epita.fr>
8320
8321 Use more STL like names: my_class instead of MyClass.
8322
8323 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
8324 (SemanticStack, SemanticType, StateStack, StateType)
8325 (TokenNumberType, Stack, Slice, Traits, Parser::location)
8326 (Parser::value): Rename as...
8327 (location_stack, location_type, rhs_number_type, semantic_stack)
8328 (semantic_type, state_stack, state_type, token_number_type, stack)
8329 (slice, traits, parser::yylloc, parser::yylval): these.
8330
8331 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
8332
9bec482e
PE
83332004-12-19 Paul Eggert <eggert@cs.ucla.edu>
8334
8335 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
8336 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8337
f6fbd3da
PE
83382004-12-17 Paul Eggert <eggert@cs.ucla.edu>
8339
8340 Remove uses of 'short int' and 'unsigned short int'. This raises
8341 some arbitrary limits. It uses more memory but nowadays that's
8342 not much of an issue.
8343
8344 This change does not affect the generated parsers; that's a different
8345 task, as some users will want to conserve memory there.
8346
8347 Ideally we should use size_t to represent all object counts, and
8348 something like ptrdiff_t to represent signed differences of object
8349 counts; but that will require more code-cleanup than I have the
8350 time to do right now.
8351
8352 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
8353 Use size_t, not int or short int, to count objects.
8354 * src/closure.c (nritemset, closure): Likewise.
8355 * src/closure.h (nritemset, closure): Likewise.
8356 * src/nullable.c (nullable_compute): Likewise.
8357 * src/print.c (print_core): Likewise.
8358 * src/print_graph.c (print_core): Likewise.
8359 * src/state.c (state_compare, state_hash): Likewise.
8360 * src/state.h (struct state): Likewise.
8361 * src/tables.c (default_goto, goto_actions): Likewise.
8362
8363 * src/gram.h (rule_number, rule): Use int, not short int.
8364 * src/output.c (prepare_rules): Likewise.
8365 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
8366 errs, reductions): Likewise.
8367 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
8368 Likewise.
8369 * src/tables.c (vector_number, tally, action_number,
8370 ACTION_NUMBER_MINIMUM): Likewise.
8371 * src/output.c (muscle_insert_short_int_table): Remove.
8372
efeed023
AD
83732004-12-17 Akim Demaille <akim@epita.fr>
8374
8375 * data/lalr1.cc: Extensive Doxygenation.
8376 (error_): Rename as...
8377 (error): this, since it is visible to the user.
8378 Adjust callers.
8379 (Parser::message): Now an automatic variable from...
8380 (Parser::yyreport_syntax_error_): here.
8381 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
8382 Parser::error.
8383 * tests/input.at: Escape $.
8384
bc82c5a5
PE
83852004-12-16 Paul Eggert <eggert@cs.ucla.edu>
8386
8387 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
8388 Parenthesize rhs to avoid obscure problems with mistakes like
8389 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
8390 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
8391 b4_rhs_location): Likewise.
8392 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
8393 b4_rhs_location): Likewise.
8394
fd19f271
AD
83952004-12-16 Akim Demaille <akim@epita.fr>
8396
8397 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
8398 yacc.c: be sure to stay within yycheck_.
8399 * tests/actions.at: Re-enable C++ tests.
8400
10454ea4
AD
84012004-12-16 Akim Demaille <akim@epita.fr>
8402
8403 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
8404 real.
8405
c5b95ccf
AD
84062004-12-16 Akim Demaille <akim@epita.fr>
8407
8408 Use #define to handle the %name-prefix.
8409
8410 * data/glr.c, data/yacc.c: Comment changes.
8411 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
8412 so that one can refer to yylex in the parser file, and have it
8413 renamed, as is the case with other skeletons.
8414
617a8f12
AD
84152004-12-16 Akim Demaille <akim@epita.fr>
8416
8417 Move lalr1.cc internals into yy*.
8418
8419 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
8420 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
8421 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
8422 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
8423 (empty_, final_, terror_, errcode_, ntokens_)
8424 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
8425 (looka_, ilooka_, error_range_, nerrs_):
8426 Rename as...
8427 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
8428 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
8429 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
8430 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
8431 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
8432 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
8433 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
8434 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
8435 these.
8436
1e547e6e
PE
84372004-12-15 Paul Eggert <eggert@cs.ucla.edu>
8438
8439 Fix some problems reported by twlevo at xs4all.
8440 * src/symtab.c (symbol_new): Report an error if the input grammar
8441 contains too many symbols. This is better than calling abort() later.
8442 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
8443 (struct node, struct graph):
8444 Rename member expand to stretch. All uses changed.
8445 (struct graph): Remove member layoutalgorithm. All uses removed.
8446 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
8447 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
8448 All uses changed.
8449 (N_STRETCH): Rename from N_EXPAND. All uses changed.
8450
735d6bd4
AD
84512004-12-15 Akim Demaille <akim@epita.fr>
8452
8453 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
8454 Add more Doxygen comments.
8455 (symprint_, stack_print_, reduce_print_, destruct_, pop)
8456 (report_syntax_error_, translate_): Rename as...
8457 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
8458 (yypop_, yyreport_syntax_error_, yytranslate_): this.
8459
2e1f5829
AD
84602004-12-15 Akim Demaille <akim@epita.fr>
8461
8462 * data/lalr1.cc (lex_): Rename as...
8463 (yylex_): this.
8464 Move the trace here.
8465 Take the %name-prefix into account.
8466 Reported by Alexandre Duret-Lutz.
8467
a3cb6248
AD
84682004-12-15 Akim Demaille <akim@epita.fr>
8469
8470 Simplify the C++ parser constructor.
8471
8472 * data/lalr1.cc (debug_): Rename as...
8473 (yydebug_): so that the parser's internals are always in the yy*
8474 pseudo namespace.
8475 Adjust uses.
8476 (b4_parse_param_decl): Remove the leading comma as it is now only
8477 called as unique argument list.
8478 (Parser::Parser): Remove the constructor accepting a location and
8479 an initial debugging level.
8480 Remove from the other ctor the argument for the debugging level.
8481 (debug_level_type, debug_level, set_debug_level): New.
8482
8483 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
8484 constructor calls.
8485
07fed891
AD
84862004-12-15 Akim Demaille <akim@epita.fr>
8487
8488 Remove b4_root related material: failure experiment
a3cb6248 8489 (which goal was to allow to derive from a class).
07fed891
AD
8490
8491 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
8492 definitions and uses.
8493
e603eaa5
PE
84942004-12-14 Paul Eggert <eggert@cs.ucla.edu>
8495
8496 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
8497 not 2, since it's not portable to subtract 1 from the start of an
8498 array. The new item 0 is never set or used. All uses changed.
8499
8500 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
8501 the default definition of YYLLOC_DEFAULT. Problem reported
8502 by Frank Heckenbach.
8503
fafb007d
PE
85042004-12-12 Paul Eggert <eggert@cs.ucla.edu>
8505
8506 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
8507 the normal case and one for the error case. Just use the
8508 first one uniformly. Problem reported by Frank Heckenbach.
8509 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
8510 use exactly the same macro in both places.
8511 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
8512 so that the normal-case YYRHSLOC works for the error case too.
8513 All uses changed.
8514 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
8515 (YYLLOC_DEFAULT): Use the same macro as glr.c.
8516 * doc/bison.texinfo (Location Default Action): Don't claim that
8517 we have an array of locations. Use the same macro for both glr
8518 and lalr parsers. Mention YYRHSLOC. Mention what happens when
8519 the index is 0.
8520
48814dcd
PE
85212004-12-10 Paul Eggert <eggert@cs.ucla.edu>
8522
a4e1a53b
PE
8523 * HACKING: Update email addresses to send announcements to.
8524
48814dcd
PE
8525 * configure.ac (AC_INIT): Bump version to 1.875f.
8526
337116ba
PE
85272004-12-10 Paul Eggert <eggert@cs.ucla.edu>
8528
8529 * NEWS: Version 1.875e.
8530 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
8531
8532 * src/scan-skel.l: Include "complain.h", for "fatal".
8533
8534 * src/relation.h (relation_print, relation_digraph):
8535 Relation sizes are of type relation_node, not size_t (this is
8536 merely a doc fix, since the two types are equivalent).
8537 (relation_transpose): Relation sizes are of type relation_node,
8538 not int.
8539 * src/relation.c: Likewise.
8540 (top, infinity): Now of type relation_node, not int.
8541 (traverse, relation_transpose): Use relation_node, not int.
8542
8543 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
8544 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
8545 (yyparse): Remove unused local introduced in 2004-10-25 patch.
8546
8547 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 8548 specifying whether the test should be skipped. Use it tp
337116ba 8549 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 8550 fail on some hosts, and should be skipped.
337116ba 8551
da2a7671
PE
85522004-12-08 Paul Eggert <eggert@cs.ucla.edu>
8553
8554 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
8555 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
8556 unless otherwise specified below.
8557
8558 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
8559 to allocate kernel_base, kernel_items, kernel_size, since
8560 they needn't be initialized to 0.
8561 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
8562 * src/closure.c (new_closure): Likewise, for itemset.
8563 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
8564 * src/lalr.c (set_goto_map): Likewise, for temp_map.
8565 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
8566 (build_relations): Likewise for edge, states1, includes.
8567 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
8568 * src/reader.c (packgram): Likewise, for ritem, rules.
8569 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
8570 * src/relation.c (relation_digraph): Likewise for VERTICES.
8571 (relation_transpose): Likewise for new_R, end_R.
8572 * src/symtab.c (symbols_token_translations_init): Likewise for
8573 token_translations.
8574 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
8575 (token_actions): Likewise for yydefact, actrow, conflrow,
8576 conflict_list.
8577 (save_column): Likewise for froms[symno], tos[symno].
8578 (goto_actions): Likewise for state_count.
8579 (pack_table): Likewise for base, pos, check.
8580 (tables_generate): Likewise for width.
8581
8582 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
8583 for initial core. Just have a separate core, so we needn't worry
8584 about whether kernel_size and kernel_base are initialized.
8585
8586 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
8587 kernel_size, kernel_items): Remove unnecessary initialization.
8588 * src/conflicts.c (conflicts): Likewise.
8589 * src/derives.c (derives): Likewise.
8590 * src/muscle_tablc (muscle_insert): Likewise.
8591 * src/relation.c (relation_digraph): Likewise.
8592 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
8593 conflrow, conflict_table, conflict_list, table, check):
8594 Likewise.
8595
8596 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
8597 This is because all callers pass unsigned int.
8598 * src/closure.h (new_closure): Likewise.
8599
8600 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
8601 (build_relations): Initialize includes[i] in all cases.
8602 * src/reader.c (packgram): Always initialize rules[ruleno].prec
8603 and rules[ruleno].precsym. Initialize members in order.
8604 * src/relation.c (relation_transpose): Always initialize new_R[i]
8605 and end_R[i].
8606 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
8607
8608 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
8609 conflict_list[0] was always 0, but now it isn't initialized.
8610
8611 * src/table.c (table_grow): When conflict_table grew, the grown
8612 area wasn't cleared. Fix this.
8613
8614 * lib/.cvsignore: Add strdup.c, strdup.h.
8615 * m4/.cvsignore: Add strdup.m4.
8616
00baeeac
PE
86172004-12-07 Paul Eggert <eggert@cs.ucla.edu>
8618
8619 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
8620 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
8621 GOTO_NUMBER_MAXIMUM, since we occasionally compute
8622 ngotos + 1 without checking for overflow.
8623 (build_relations): Use END_NODE, not -1, to denote end of edges.
8624 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
8625 build_relations): Use goto_number, not int, for goto numbers.
8626 * src/tables.c (save_column, default_goto): Likewise.
8627
be3d9d42
AD
86282004-11-23 Akim Demaille <akim@epita.fr>
8629
8630 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
8631 of #defining from yystype.
8632 Don't typedef yystype, C++ does not need it.
8633 This lets it possible to forward declare it as union.
8634
78e526d5
PE
86352004-11-23 Paul Eggert <eggert@cs.ucla.edu>
8636
8637 * bootstrap (gnulib_modules): Add extensions.
8638 Problem reported by Jim Meyering.
8639
afbb696d
PE
86402004-11-22 Paul Eggert <eggert@cs.ucla.edu>
8641
8642 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
8643 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
8644 src/system.h, src/tables.c: XFREE -> free, to accommodate
8645 recent change to gnulib xalloc.h.
78e526d5 8646 Problem reported by Jim Meyering.
afbb696d 8647
c1f8f16a
AD
86482004-11-17 Akim Demaille <akim@epita.fr>
8649
8650 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
8651
db7e5eb5 86522004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
8653 Alexandre Duret-Lutz <adl@gnu.org>
8654
8655 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
8656 changes.
8657 (YYCDEBUG): Adjust.
8658 Use it instead of cdebug_.
8659 (Parser::debug_stream, Parser::set_debug_stream): New.
8660 (Parser::symprint_): Define cdebug_ for temporary backward
8661 compatibility.
8662 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
8663 debug_stream ().
8664
68e11668
AD
86652004-11-17 Akim Demaille <akim@epita.fr>
8666
8667 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
8668 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
8669 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
8670 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8671
97cbc73e
PE
86722004-10-27 Paul Eggert <eggert@cs.ucla.edu>
8673
8674 * data/glr.c (yyloc_default): Remove; not used.
8675 Problem reported by Frank Heckenbach.
8676
e342c3be
AD
86772004-10-25 Akim Demaille <akim@epita.fr>
8678
8679 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
8680 Introduce another definition to address simple location arrays.
8681 (yyGLRStack): New member: yyerror_range.
8682 (yyrecoverSyntaxError, yyparse): Update it.
8683 (yyrecoverSyntaxError): Use it when shifting the error token to
8684 have an accurate range, equivalent to the one computed by both
8685 yacc.c and lalr1.cc.
8686 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
8687 that column numbers start at column 0, as per GNU Coding
8688 Standards, the others tests, and the doc.
8689 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
8690 Adjust to the above change (first column is 0).
8691 And adjust the location of the "<error>", now covering the whole
8692 line.
8693
93602feb 86942004-10-22 Akim Demaille <akim@epita.fr>
04098407 8695 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
8696
8697 Remove some arbitrary limits on goto numbers and relations.
8698 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
8699 initial values, since they're never used.
8700 (set_goto_map): ngotos is now unsigned, so test for overflow
8701 by seeing whether it wraps around to zero.
8702 * src/lalr.h (goto_number): Now size_t, not short int.
8703 (GOTO_NUMBER_MAXIMUM): Remove.
8704 * src/relation.c (relation_print, traverse, relation_transpose):
8705 Check for END_NODE rather than looking at sign.
8706 * src/relation.h (END_NODE): New macro.
8707 (relation_node): Now size_t, not short int.
8708
dba08b04
PE
87092004-10-22 Paul Eggert <eggert@cs.ucla.edu>
8710
8711 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
8712 keyword, not an identifier. Problem reported by Baron Schwartz in
8713 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
8714
df09ef2e
AD
87152004-10-11 Akim Demaille <akim@epita.fr>
8716
8717 * src/symtab.c (symbol_check_alias_consistency): Also check
8718 type names, destructors, and printers.
8719 Reported by Alexandre Duret-Lutz.
8720 Recode the handling of associativity and precedence in terms
8721 of symbol_precedence_set.
8722 Accept no redeclaration at all, not even equal to the previous
8723 value.
8724 (redeclaration): New.
8725 Use it to factor redeclaration complaints.
8726 (symbol_make_alias): Don't set the type of the alias, let
8727 symbol_check_alias_consistency do it as for other features.
8728 * src/symtab.h (symbol): Add new member prec_location, and
8729 type_location.
8730 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
8731 * tests/input.at (Incompatible Aliases): New.
8732
146bc99d
PE
87332004-10-09 Paul Eggert <eggert@cs.ucla.edu>
8734
8735 .cvsignore fixes to accommodate gnulib changes,
8736 and the practice of naming build directories "_build".
8737 * .cvsignore: Add "_*". Sort.
8738 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
8739 * m4/.cvsignore: Add "*_gl.m4".
8740
e503aa60
AD
87412004-10-06 Akim Demaille <akim@epita.fr>
8742
8743 * src/parse-gram.y (add_param): Fix the truncation of trailing
8744 spaces.
8745
b4a20338
AD
87462004-10-05 Akim Demaille <akim@epita.fr>
8747
8748 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
8749 whether the reducion was empty or not. This leaves room to
8750 improve the use of YYLLOC_DEFAULT in such a case.
8751 lalr1.cc is still experimental, so changing this is acceptable.
8752 And finally, there are probably not many users who changed the
8753 handling of locations in GLR, so changing is admissible too.
8754
8755 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
8756 empty reduction, set @$ to an empty location ending the previously
8757 stacked symbol.
8758 Adjust uses to make sure the code is triggered on empty
8759 reductions.
8760 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
8761 expected output: empty reductions have empty locations.
8762
f85a5e6f
AD
87632004-09-29 Akim Demaille <akim@epita.fr>
8764
8765 * data/lalr1.cc: Move towards a more standard C++ coding style
8766 for templates: Class < T > -> Class<T>.
8767
b203fc2c
AD
87682004-09-29 Akim Demaille <akim@epita.fr>
8769
8770 * data/lalr1.cc: Reinstall the former ctor, for sake of
8771 compatibility, but warn it will be removed.
8772 Move towards a more standard C++ coding style (i.e., type *var ->
8773 type* var).
8774
5b7e1e73
PE
87752004-09-27 Paul Eggert <eggert@cs.ucla.edu>
8776
3fee967f
PE
8777 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
8778 since it's less likely to work if NULs are involved in the future.
5b7e1e73 8779
0dcca5c2
AD
87802004-09-27 Akim Demaille <akim@epita.fr>
8781
8782 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
8783
6dde1c82
AD
87842004-09-27 Akim Demaille <akim@epita.fr>
8785
8786 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 8787 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
8788 and argument names.
8789 (b4_cc_constructor_call): Likewise.
8790
b233d555
AD
87912004-09-24 Akim Demaille <akim@epita.fr>
8792
8793 * src/parse-gram.y (add_param): Strip the leading and trailing
8794 blanks from a formal argument declaration.
8795 (YY_LOCATION_PRINT): New.
8796
619404e3
AD
87972004-09-24 Akim Demaille <akim@epita.fr>
8798
8799 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
8800 after the location.
8801
dd8d9022
AD
88022004-09-24 Akim Demaille <akim@epita.fr>
8803
8804 * doc/bison.texinfo (Table of Symbols): Sort.
8805
0092f063
AD
88062004-09-21 Akim Demaille <akim@epita.fr>
8807
8808 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
8809 the useless parentheses.
8810 Suggested by Paul Eggert.
8811
451364ed
AD
88122004-09-20 Akim Demaille <akim@epita.fr>
8813
8814 Let the initial-action act on the look-ahead, and use it for the
8815 "initial push" (corresponding to an hypothetical beginning-of-file).
8816 And let lalr1.cc honor %initial-action.
8817
8818 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
8819 example.
8820 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
8821 (Parser::Parser): Remove the ctor that used to initialize it.
8822 (Parser::parse): Like in the other skeletons, issue the "starting
8823 parse" message before any action.
8824 Honor %initial-action.
8825 Initialize the stacks with the lookahead.
8826 * data/yacc.c: Let $$ and @$ in %initial-action designate the
8827 look-ahead.
8828 Push them in the stacks.
8829 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
8830
18d192f0
AD
88312004-09-20 Akim Demaille <akim@epita.fr>
8832
8833 * doc/bison.texinfo (Initial Action Decl): New.
8834
b8458aa5
AD
88352004-09-20 Akim Demaille <akim@epita.fr>
8836
8837 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
8838 clearer criterion to define it.
8839 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
8840 When reducing on an empty RHS, use the latest stacked location as
8841 location.
8842 yylloc is not always available.
8843 * data/glr.c: Likewise.
8844 Also, honor initial-actions.
8845
3fc16193
AD
88462004-09-20 Akim Demaille <akim@epita.fr>
8847
8848 * data/yacc.c (YY_LOCATION_PRINT): New.
8849 Define when we know YYLTYPE's structure, i.e., when the default
8850 YYLLOC_DEFAULT is used.
8851 * data/c.m4 (b4_yysymprint_generate): Use it.
8852 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
8853 value of the result.
8854 (error_start_): Replace with...
8855 (error_range_): this location array.
8856 This allows to replace code relying on the implementation of
8857 locations by portable code.
8858 * data/yacc.c (yylerrsp): Replace with...
8859 (yyerror_range): this.
8860 Every time a token is popped, update yyerror_range[0], to have an
8861 accurate location for the error token.
8862 * data/glr.c (YY_LOCATION_PRINT): New.
8863 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
8864 deference a pointer.
8865 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
8866 report the location in %printers.
8867
8868 * src/scan-skel.l: Instead of abort, report error messages to ease
8869 understanding skeleton scanning failures.
8870
ecfe33e7
AD
88712004-09-16 Akim Demaille <akim@epita.fr>
8872
8873 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
8874 (iterator, const_iterator): these, to be more in the C++ spirit.
8875 Also, return reverse iterators so that when displaying the stack
8876 we display its bottom first.
8877 (Parser::stack_print_, Parser::reduce_print_): Match the messages
8878 from yacc.c.
8879 We should probably use vector here though.
8880
1576d44d
AD
88812004-09-16 Akim Demaille <akim@epita.fr>
8882
8883 Have more complete shift traces.
8884
8885 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
8886 to report Shifts instead of ad hoc YYDPRINTF invocations,
8887 including for the error token.
8888 * data/lalr1.cc (symprint_): Output the location.
8889 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
8890 output the location within the %printer.
8891 Activate GLR tests, at least to make sure they compile properly.
8892 They still don't pass though.
8893 * tests/calc.at: Adjust expect verbose output, since now "Entering
8894 state..." is on a different line than the "Shifting" message.
8895
9c66f418
AD
88962004-09-08 Akim Demaille <akim@epita.fr>
8897
8898 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
8899 Bison directive from the Bison file to the invocation of this
8900 macro, so that these directives are passed to
8901 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
8902 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
8903 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
8904 the extra Bison directives instead of the whole series.
8905 Change the grammar so that there are recoverable errors, and
8906 unrecoverable errors. Now we can have the parser give up before
8907 consuming the whole input. As a result we now can observe that
8908 the lookahead is freed when needed.
8909 Change the parser source to parse argv[1] instead of a hard coded
8910 string.
8911 Simplify yylex, and give a value and location to EOF.
8912 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
8913 passed directives already coded in the file.
8914 Add some tests to check the location of "error".
8915 For some tests, the C++ parser is correct, and not yacc.c.
8916 For other tests, they provide different, but unsatisfying, values,
8917 so keep the C++ value so that at least one parser is "correct"
8918 according to the test suite.
8919 (Actions after errors): Remove, this is subsumed by the
8920 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
8921
52d5733f
AD
89222004-09-06 Akim Demaille <akim@epita.fr>
8923
8924 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 8925 (Parser::pop): New.
52d5733f
AD
8926 Use it.
8927
a0e68930
AD
89282004-09-06 Akim Demaille <akim@epita.fr>
8929
8930 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
8931 argument, an informative message.
8932 Call YY_SYMBOL_PRINT.
8933 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
8934 * data/lalr1.cc (destruct_): Likewise.
8935 In addition, no longer depend on b4_yysymprint_generate and
8936 b4_yydestruct_generate to generate these functions, do it "by
8937 hand".
8938
e757bb10
AD
89392004-09-03 Akim Demaille <akim@epita.fr>
8940
8941 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
8942 invoked, yydestruct the lookahead.
8943 * tests/calc.at (Calculator $1): Update the expected lengths of
8944 traces: there is an added line for the discarded lookahead.
8945 * doc/bison.texinfo (Destructor Decl): Some rewording.
8946 Define "discarded" symbols.
8947
0fe1f06d
AD
89482004-09-02 Akim Demaille <akim@epita.fr>
8949
8950 * data/lalr1.cc (translate_, destruct_): No reason to be static.
8951
284acc8b
AD
89522004-09-02 Akim Demaille <akim@epita.fr>
8953
8954 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
8955 (YYDSYMPRINTF): Rename as...
8956 (YY_SYMBOL_PRINT): this.
8957 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
8958 two.
8959 Use it instead of direct symprint_ calls.
8960 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
8961 one.
8962
a5eb1ed2
AD
89632004-09-02 Akim Demaille <akim@epita.fr>
8964
b7c72fe1
AD
8965 * data/lalr1.cc (b4_yysymprint_generate): New.
8966 (symprint_): New member function, defined when YYDEBUG.
8967 Use it consistently instead of token/nterm debugging output by
8968 hand.
a5eb1ed2
AD
8969 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
8970 %printer calls to use cdebug_ when using lalr1.cc.
8971
417141dd
AD
89722004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
8973
8974 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
8975 with #ifdef YYDEBUG.
8976
2fa09258
AD
89772004-08-26 Akim Demaille <akim@epita.fr>
8978
8979 * doc/bison.texinfo (Implementing Loops): Rename as...
8980 (Implementing Gotos/Loops): this.
8981
9378b508
PE
89822004-08-13 Paul Eggert <eggert@cs.ucla.edu>
8983
8984 Adjust to latest gnulib.
8985 * bootstrap (gnulib_modules): Add xalloc-die.
8986 Set LC_ALL=C so that file names sort consistently.
8987 Prefer the gnulib copies of gettext.m4, glibc21.m4,
8988 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
8989 uintmax_t.m4, ulonglong.m4.
8990 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
8991 po.m4 since we are now using _gl.m4 instead.
8992
87a8ad5c
PE
89932004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
8994
8995 * src/scan-action.l: Remove. Scanning of semantic actions is
8996 handled in scan-gram.l.
8997
dca81a78
PE
89982004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
8999
9000 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
9001
9002 * src/location.h (struct): The file member is a uniqstr.
9003 (equal_boundaries): Use UNIQSTR_EQ for comparison.
9004
c9cbf7c5
PE
90052004-07-22 Paul Eggert <eggert@cs.ucla.edu>
9006
9007 Fix bug with non-%union parsers that have printers or destructors,
9008 which led to a Bison core dump. Reported by Peter Fales in
9009 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 9010
c9cbf7c5
PE
9011 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
9012 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
9013 not to our own type.
9014 * src/output.c (symbol_destructors_output, symbol_printers_output):
9015 Don't assume %union.
9016 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
9017 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
9018 UNION-FLAG. All callers changed.
9019 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
9020 Use type char, not unsigned int, when declaring an array of char;
9021 this lets us remove a cast.
9022 (Printers and Destructors): Add non-%union test cases.
9023
fa7e68c3
PE
90242004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9025
9026 * doc/bison.texinfo: Minor editorial changes, mostly to the new
9027 GLR writeups. E.g., avoid frenchspacing and the future tense,
9028 change "lookahead" to "look-ahead", and change "wrt" to "with
9029 respect to".
2fa09258 9030
fa7e68c3
PE
90312004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9032
9033 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
9034 New sections, split off from the GLR Parsers section. Put the new
9035 Simple GLR Parser near the start of the GLR section, for clarity.
9036 Rewrite connective text.
9037
99a9344e
PE
90382004-06-21 Frank Heckenbach <frank@g-n-u.de>
9039
9040 * doc/bison.texinfo (Simple GLR Parsers): New section.
9041
8dd162d3
PE
90422004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9043
9044 * NEWS, TODO, doc/bison.texinfo:
9045 Use "look-ahead" instead of "lookahead", to be consistent.
9046 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
9047 while we're fixing "look-ahead".
9048 * src/conflicts.c (shift_set): Renamed from shiftset.
9049 (look_ahead_set): Renamed from lookaheadset.
9050 * src/print.c: Likewise.
9051 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
9052 name for "lookahead".
9053 (report_types, usage): Likewise.
9054 * src/getargs.h (report_look_ahead_tokens): Renamed from
9055 report_lookaheads.
9056 * src/lalr.c (compute_look_ahead_tokens): Renamed from
9057 compute_lookaheads.
9058 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
9059 (look_ahead_tokens_print): Renamed from lookaheads_print.
9060 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
9061 state_rule_lookaheads_print.
9062 * src/state.h: Likewise.
9063 (reductions.look_ahead_tokens): Renamed from lookaheads.
9064 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
9065 AT_DATA_LOOKAHEADS_GRAMMAR.
9066
57a90331
PE
90672004-06-03 Paul Eggert <eggert@cs.ucla.edu>
9068
9069 * README: Update location of patched M4 distribution.
9070
8ed3234a
PE
90712004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
9072
9073 Don't assume the C++ compiler takes the same arguments as the C compiler
9074 (trivial change).
9075 * configure.ac (O0CXXFLAGS): New var.
9076 * tests/atlocal.in (CXXFLAGS): Use it.
9077
07971983
PE
90782004-05-29 Paul Eggert <eggert@cs.ucla.edu>
9079
9080 Fix some "make check" problems with C++ reported by
9081 Albert Chin-A-Young for Tru64 C++ in this thread:
9082 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
9083
9084 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
9085 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9086 Output to a .cc file for C++, not to a .c file.
9087 * tests/calc.at (AT_CHECK_CALC): Likewise.
9088 * tests/regression.at (AT_CHECK_DANCER): Likewise.
9089 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
9090
29058652
PE
90912004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
9092
9093 * tests/calc.at, tests/actions.at: Workaround for SGI
9094 C++ compiler. (trivial change)
9095
62cb8a99
PE
90962004-05-27 Paul Eggert <eggert@cs.ucla.edu>
9097
fd418816
PE
9098 Spent a few hours checking out which prerequisite versions the
9099 current sources actually require. I went all the way back to
9100 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
9101 a seemingly endless set of combinations of versions more recent
9102 than that. The bottom line is that the current sources require
9103 fairly recent versions of the build tools, and it'll be some work
9104 to change this.
9105 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
9106 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
9107 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
9108 Add comments explaining why those particular versions are
9109 currently needed.
2fa09258 9110
62cb8a99
PE
9111 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
9112 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 9113 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
9114
9115 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
9116 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
9117
caa52c10
PE
91182004-05-26 Paul Eggert <eggert@cs.ucla.edu>
9119
9120 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
9121 0.11.5. Suggested by Bruno Haible.
9122 * bootstrap: Remove gettext version checking.
9123
9124 * doc/bison.texinfo (Decl Summary): Also mention that %union
9125 can depend on prerequisite types. Problem reported by Tim
9126 Van Holder.
9127
4bfd5e4e
PE
91282004-05-25 Paul Eggert <eggert@cs.ucla.edu>
9129
2cef3017
PE
9130 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
9131 * README-alpha: Don't tell people not to package this.
9132
b9c85d5c
PE
9133 * bootstrap: Don't assume $(...) works; use `...` instead.
9134 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
9135 gettext better.
9136
4bfd5e4e
PE
9137 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
9138 put into the -d output file, and mention what to do if YYSTYPE is
9139 defined as a macro.
9140
6a36ff94
PE
91412004-05-24 Paul Eggert <eggert@cs.ucla.edu>
9142
6712933e
PE
9143 Undo change made earlier today: it caused autopoint to not bring
9144 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
9145 autopoint's.
9146
9147 * bootstrap: Check that gettext version matches what's in
9148 configure.ac. Warn users to ignore robots.txt ERROR 404.
9149 * bootstrap: Undo today's earlier change (logged below).
9150 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 9151
6a36ff94
PE
9152 The gettext version checking is causing more trouble than it's
9153 curing; remove it. Problem reported by Paul Hilfinger.
9154
9155 * bootstrap: Issue a warning that one can expect a message
9156 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
9157 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
9158
209ea708
PE
91592004-05-23 Paul Eggert <eggert@cs.ucla.edu>
9160
9161 Ensure that the C++ compiler used for testing actually works on a
9162 simple test program; if not, skip the C++-related tests. Problem
9163 reported by Vin Shelton in:
161a71f3 9164 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
9165
9166 * m4/cxx.m4: New file.
9167 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
9168 * tests/atlocal.in (BISON_CXX_WORKS): Add.
9169 * tests/local.at (AT_COMPILE_CXX): Use it.
9170
41ca2549
PE
91712004-05-21 Paul Eggert <eggert@cs.ucla.edu>
9172
383e69dc
PE
9173 * data/glr.c (yylloc): Output this macro even if locations are not
9174 being generated, as the GLR parser needs it even in that case.
9175 Problem reported by Troy A. Johnson
9176 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
9177
41ca2549
PE
9178 * configure.ac (AC_INIT): Update to 1.875e.
9179
e476c87d
PE
91802004-05-21 Paul Eggert <eggert@cs.ucla.edu>
9181
9182 * NEWS: Version 1.875d.
9183 * configure.ac (AC_INIT): Likewise.
9184 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
9185
9186 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
9187 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
9188 lalr1.cc runs afoul of the first, and the last two are no longer
9189 supported by GCC 3.4.0.
9190 * README: Mention GNU m4 1.4 or later; mention m4 patches.
9191 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
9192
233a88ad
PE
91932004-05-06 Paul Eggert <eggert@cs.ucla.edu>
9194
9195 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
9196 unsigned int, for compatibility with latest gnulib hash module.
9197 * src/state.c (state_hash, state_hasher): Likewise.
9198 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
9199 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 9200
12ffdd28
PE
92012004-05-03 Paul Eggert <eggert@cs.ucla.edu>
9202
9203 * NEWS: Unescaped newlines are no longer allowed in char & strings.
9204
9205 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
9206 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
9207 character and string literals.
9208 (unexpected_end): New function.
9209 (unexpected_eof): Use it.
9210 (unexpected_newline): New function.
9211 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
9212 actions.
e476c87d 9213
12ffdd28
PE
9214 * NEWS: Document %expect-rr.
9215
9216 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
9217 Fix typo by replacing $1 with $option.
9218 Remove more 'intl'-related files.
9668e2be 9219 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
9220
9221 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
9222 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
9223 strtoul.c.
9224 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
9225 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
9226 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
9227 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
9228 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
9229 * src/.cvsignore: Add *.output.
9230
9231 * src/parse-gram.y: Put copyright notice inside %{ %} so it
9232 gets copied to the output file.
e476c87d 9233
1f65350a
PE
92342004-04-28 Paul Eggert <eggert@twinsun.com>
9235
9236 Get files from the gnulib and po repositories, instead of relying
9237 on them being in our CVS. Upgrade to latest versions of gnulib
9238 and Automake.
9239
9240 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
9241 * bootstrap: Bootstrap from gnulib and po repositories.
9242 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
9243 * README-cvs: Document these changes. Remove version numbers from
9244 mentions of build tools, since they change so often. Mention Flex.
9245
9246 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
9247 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
9248 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
9249 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 9250 does this for us.
12ffdd28
PE
9251 (AC_ISC_POSIX): Remove; we no longer support this
9252 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
9253 (AC_HEADER_STDC): Remove: we now assume C89 or better.
9254 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
9255 Do not check for C89 headers, except for locale.h which is used
9256 by the Yacc library and must port to K&R hosts.
9257 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
9258 Do not check for C89 functions, except for setlocale which is
9259 used by the Yacc library.
9260 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
9261 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
9262 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
9263 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
9264 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
9265 AM_GNU_GETTEXT): Remove; now done by:
9266 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
9267 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
9268 for us.
9269
9270 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
9271 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
9272 Define to empty, as gnulib.mk will do the rest for us.
9273 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
9274 for us.
9275 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
9276 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
9277
9278 * src/files.c: Include gnulib's xstrndup.h.
9279
9280 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
9281 (REALLOC): Use xnrealloc, for likewise.
9282 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
9283 (strnlen, memrchr): Remove decls; functions no longer used.
9284 Include <stpcpy.h>.
9285
9286 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
9287 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9288 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
9289 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
9290 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
9291 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
9292 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
9293 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
9294 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
9295 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
9296 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
9297 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9298 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
9299 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
9300 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
9301 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
9302 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
9303 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
9304 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
9305 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
9306 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
9307 Remove, as these files are now generated automatically
9308 by bootstrap or automake.
9309
9310 * po/ChangeLog: Remove: all but one entry was a duplicate
9311 of this file, and I moved that 2000-11-02 entry here.
9312
9313 * config/.cvsignore: Add Makefile, depcomp, install-sh.
9314 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
9315 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
9316 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
9317 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
9318 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
9319 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
9320 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
9321 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
9322 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
9323 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
9324 xstrndup.h.
9325 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
9326 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
9327 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
9328 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
9329 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
9330 * src/.cvsignore: Remove *_.c.
9331
9332
9333 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
9334 support it. (The latest stable gzip doesn't.)
9335
93362004-04-27 Paul Eggert <eggert@twinsun.com>
9337
9338 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
9339 case, as stos_ is now used by destructors due to the 2004-02-09
9340 change.
9341
9342 Remove more K&R C support.
9343 * lib/libiberty.y (PARAMS): Remove. All uses removed.
9344 * lib/subpipe.c (errno): Remove decl.
9345 Include <stdlib.h> unconditionally.
9346 (EXIT_FAILURE): Remove macro.
9347 * src/complain.c (vfprintf, strerror): Remove.
9348 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
9349 unconditionally.
9350 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
9351 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
9352 (strchr, strspn, memchr): Remove decls.
9353 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
9354 unconditionally. Do not declare perror.
9355 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
9356 unconditionally.
9357
9358 * src/complain.c (_): Remove useless defn, as system.h defines this.
9359
9360 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
9361 with latest obstack.h.
9362 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
9363 to procedure types, as obstack.h now does that for us.
9364 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
9365
9366 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
9367 so that this include file can stand alone.
9368 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
9369 does this now. Include subpipe.h first after config.h, to
9370 test whether it can stand alone.
9371
9372 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
9373 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
9374 unused declaration.
9375
9376 * tests/synclines.at (%union synch line): Put a dummy member in
9377 the union, because empty unions aren't allowed in C. Caught
9378 by GCC 3.4.0.
9379
4f16766c
PE
93802004-04-13 Jim Meyering <jim@meyering.net>
9381
9382 * src/conflicts.c (conflicts_print): Correct format string typo:
9383 use `%%' to produce literal `%'. (trivial change)
9384
779e7ceb
PE
93852004-03-30 Paul Eggert <eggert@twinsun.com>
9386
9387 * src/getargs.c (version): Update copyright year to 2004.
9388
9389 * data/c.m4 (b4_int_type): Use 'short int' rather than
9390 'short', and similarly for 'long', 'unsigned', etc.
9391 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
9392 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
9393 yy_yypstack, yydumpstack): Likewise.
9394 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
9395 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
9396 Likewise.
9397 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
9398 yy_stack_print, yyparse): Likewise.
9399 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
9400 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
9401 * lib/bitset.c (bitset_print): Likewise.
9402 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
9403 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9404 * lib/bitsetv.c (bitsetv_dump): Likewise.
9405 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
9406 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
9407 Likewise.
9408 * src/LR0.c (allocate_itemsets): Likewise.
9409 * src/gram.h (rule_number, rule): Likewise.
9410 * src/lalr.h (goto_number): Likewise.
9411 * src/nullable.c (nullable_compute): Likewise.
9412 * src/output.c (prepare_rules): Likewise.
9413 * src/relation.c (relation_print, relation_digraph): Likewise.
9414 * src/relation.h (relation_node): Likewise.
9415 * src/state.h (state_number, transitions, errs, reductions,
9416 struct state): Likewise.
9417 * src/symtab.h (symbol_number, struct symbol): Likewise.
9418 * src/tables.c (vector_number, tally, action_number,
9419 default_goto, goto_actions): Likewise.
9420 * tests/existing.at (GNU Cim Grammar): Likewise.
9421 * tests/regression.at (Web2c Actions): Likewise.
9422
9423 * src/output.c (muscle_insert_short_int_table): Renamed from
9424 muscle_insert_short_table. All uses changed.
9425
d6328241
PH
94262004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9427
9428 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
9429 (declaration): Replace expected_conflicts with expected_sr_conflicts.
9430 Add %expect-rr rule.
4f16766c 9431
d6328241
PH
9432 * src/scan-gram.l: Recognize %expect-rr.
9433
4f16766c 9434 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 9435 expected_conflicts.
4f16766c 9436 (expected_rr_conflicts): Declare.
d6328241
PH
9437
9438 * src/conflicts.c (expected_sr_conflicts): Rename from
9439 expected_conflicts.
9440 (expected_rr_conflicts): Define.
9441 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
9442 for GLR parsers.
9443 Use expected_sr_conflicts in place of expected_conflicts.
9444 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 9445
d6328241 9446 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 9447
1452af69
PE
94482004-03-08 Paul Eggert <eggert@gnu.org>
9449
9450 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 9451 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
9452
9453 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
9454 in lalr1.cc.
9455 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
9456 * src/scan-gram.l (scan_integer): New function.
9457 ({int}): Use it.
9458 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
9459 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
9460 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
9461 Say "long int", not "long", for uniformity with GNU style.
9462
006d217d
PE
94632004-02-25 Paul Eggert <eggert@twinsun.com>
9464
9465 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
9466 compilers. This fixes a problem with Intel's C++ compiler being
9467 chatty, reported by Guido Trentalancia in
161a71f3 9468 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 9469
c2729758
ADL
94702004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
9471
9472 Support %destructor and merge error locations in lalr1.cc.
9473
9474 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
9475 (Parser::stos_): Define unconditionally.
9476 (Parser::destruct_): New method. Generate its body with
9477 b4_yydestruct_generate.
9478 (Parser::error_start_): New attribute.
9479 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
9480 token which are discarded.
9481 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
9482 error_start_ when erroneous token are discarded.
9483 (Parser::parse) <yyerrlab1>: Compute the location of the error
9484 token so that it covers all the discarded tokens.
9485 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
9486 it can be called with `%skeleton "lalr1.cc"', and do that.
9487
dd0e0635
PE
94882004-02-02 Paul Eggert <eggert@twinsun.com>
9489
9490 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
9491 $(top_srcdir)/lib and ../lib. This fixes a bug reported
9492 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
9493 There's no need to mention top_builddir since Automake does that
9494 for us.
9495 (INCLUDES): Remove, as Automake says it's obsolescent.
9496 Contents migrated into AM_CPPFLAGS as described above.
9497 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
9498
94992004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9500
9501 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
9502 (yyreportSyntaxError): Handle case where lookahead token is
9503 YYEMPTY.
9504
be16239b
PH
95052004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9506
9507 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
9508 resulting parsers are compilable with C++.
9509
5fa90832
PE
95102003-12-23 Paul Eggert <eggert@twinsun.com>
9511
9512 * config/depcomp, config/install-sh: Sync with Automake 1.8.
9513 * src/output.c (output_skeleton): Rename local var.
9514 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
9515 Bison tokens, as this runs afoul of the 2003-10-07 change that
9516 disallowed NUL bytes in character constants or string literals.
9517
9518 * tests/local.at: Require Autoconf 2.59's Autotest.
9519 * tests/testsuite.at: Don't include local.at, since we now assume
9520 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
9521 including it.
9522 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
9523 multiple inclusion warnings.
dd0e0635 9524
b165c324
AD
95252003-12-02 Akim Demaille <akim@epita.fr>
9526
9527 * doc/bison.texinfo (How Can I Reset the Parser): More about start
9528 conditions.
9529 From Bruno Haible.
9530
26e06a21
ADL
95312003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
9532
9533 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
9534
92ac3705
PE
95352003-10-07 Paul Eggert <eggert@twinsun.com>
9536
6a5ecb38
PE
9537 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
9538 if testsuite doesn't exist.
9539
92ac3705
PE
9540 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
9541 literals, unfortunately.
9542 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
9543 Complain about NUL bytes in character constants or string literals.
9544
91d2c560
PE
95452003-10-05 Paul Eggert <eggert@twinsun.com>
9546
9547 * NEWS: Don't document %no-default-prec, as it's still
9548 too experimental.
9549 * doc/bison.texinfo: Document %no-default-prec only if
9550 the defaultprec flag is set. Normally it's not.
9551
0cc3da3a
PE
95522003-10-04 Paul Eggert <eggert@twinsun.com>
9553
9554 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
9555 non-modifiable lvalue, instead of a modifiable one.
9556 * doc/bison.texinfo (Actions): Document that $$ can
9557 be assigned to. Do not claim that $$ and $N are
9558 array element references: user code should not rely on this.
9559
22fccf95
PE
95602003-10-01 Paul Eggert <eggert@twinsun.com>
9561
9562 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
9563 (grammar_declaration): Use it.
9564 * src/scan-gram.l: New token %no-default-prec.
9565 * tests/conflicts.at: Revamp tests to use %no-default-prec.
9566 * NEWS, doc/bison.texinfo: Document the above.
9567
fc8f2965
AD
95682003-10-01 Akim Demaille <akim@epita.fr>
9569
9570 VCG no longer supports long_straight_phase.
9571
9572 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
9573 * src/print_graph.c (print_graph): Adjust.
9574
39a06c25
PE
95752003-09-30 Frank Heckenbach <frank@g-n-u.de>
9576 and Paul Eggert <eggert@twinsun.com>
9577
9578 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
9579 Table of Symbols): Document %default-prec.
9580 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
9581 (grammar_declaration): Set default_prec on %default-prec.
9582 * src/scan-gram.l (%default-prec): New token.
9583 * src/reader.h (default_prec): New flag.
9584 * src/reader.c: Likewise.
9585 (packgram): Handle it.
9586 * tests/conflicts.at (%default-prec without %prec,
9587 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 9588
39a06c25
PE
95892003-09-30 Paul Eggert <eggert@twinsun.com>
9590
9591 * tests/testsuite.at: Include local.at, not input.at, fixing
9592 a typo in the 2003-08-25 patch.
9593
62b6aef9
AD
95942003-08-27 Akim Demaille <akim@epita.fr>
9595
9596 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
9597 GCC warnings.
9598
89e1cc61
AD
95992003-08-26 Akim Demaille <akim@epita.fr>
9600
9601 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
9602 "<\#" to avoid magic from Gnus when posting parts of this script.
9603
a08460b0
AD
96042003-08-26 Akim Demaille <akim@epita.fr>
9605
9606 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
9607 (Parser::parse): here.
9608 Adjust: nerrs and errstatus is now replaced by...
9609 (Parser::nerrs_, Parser::errstatus_): New.
9610
603f1cfd
AD
96112003-08-25 Akim Demaille <akim@epita.fr>
9612
9613 * config/announce-gen, Makefile.cfg: New.
9614 * Makefile.am: Adjust.
9615 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
9616 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
9617
cd3684cf
AD
96182003-08-25 Akim Demaille <akim@epita.fr>
9619
9620 When reducing initial empty rules, Bison parser read an initial
9621 location that is not defined. This results in garbage, and that
9622 affects Bison's own parser. Therefore we need (i) to extend Bison
9623 to support a means to initialize this location, and (ii) to use
9624 this CVS Bison to fix CVS Bison's parser.
9625
9626 * src/reader.h, reader.c (epilogue_augment): Remove, replace
9627 with...
9628 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
9629 * src/parse-gram.y: Adjust.
9630 (%initial-action): New.
9631 (%error-verbose): Since we require CVS Bison, there is no reason
9632 not to use it.
9633 * src/scan-gram.l: Adjust.
9634 * src/Makefile.am (YACC): New, to make sure we use our own parser.
9635 * data/yacc.c (yyparse): Use b4_initial_action.
9636
4e03e201
AD
96372003-08-25 Akim Demaille <akim@epita.fr>
9638
9639 * doc/bison.texinfo: Don't promote stdout for error messages.
9640
8c182d05
AD
96412003-08-25 Akim Demaille <akim@epita.fr>
9642
9643 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
9644 From Alexandre Duret-Lutz.
9645
6a60c4cf
PE
96462003-08-25 Akim Demaille <akim@epita.fr>
9647
9648 Version 1.875c.
9649
25f66e1a
AD
96502003-08-25 Akim Demaille <akim@epita.fr>
9651
9652 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
9653 Use them.
9654
5348bfbe
AD
96552003-08-25 Akim Demaille <akim@epita.fr>
9656
9657 * data/lalr1.cc (Parser::reduce_print_): New.
9658 Use it.
9659
47301314
AD
96602003-08-25 Akim Demaille <akim@epita.fr>
9661
9662 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
9663 error recovery loops. This patch is based on
161a71f3 9664 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
9665 Also, augment the similarity between lalr1.cc and yacc.c.
9666 Note: the locations of error recovery rules are not correct yet.
9667
9668 * data/lalr1.cc: Comment changes to augment the similarity between
9669 lalr1.cc and yacc.c.
9670 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
9671 (yyerrlab1): Remove, but where it used to be (now the bottom part of
9672 yyerrlab), when hitting EOF, pop the whole stack here instead of
9673 merely falling thru the default error handling mechanism.
9674 (yyerrorlab): New label, with the old contents of YYERROR,
9675 plus the following change: pop the stack of rhs corresponding
9676 to the production that invoked YYERROR. That is how Yacc
9677 behaves (required by POSIX).
9678 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
9679 fail.
9680
1f7a61ff
AD
96812003-08-25 Akim Demaille <akim@epita.fr>
9682
9683 Tune local.at so that people can "autom4te -l autotest calc.at -o
9684 calc" for instance, to extract a sub test suite.
9685
9686 * tests/testsuite.at: Move the initialization, Autotest version
9687 requirement, and AT_TESTED invocation into...
9688 * tests/local.at: here.
9689 * tests/testsuite.at: Include it for compatibility with Autoconf
9690 2.57.
9691 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
9692 be ignore.
9693
327b5b56
PE
96942003-08-04 Paul Eggert <eggert@twinsun.com>
9695
9696 Rework code slightly to avoid gcc -Wtraditional warnings.
9697 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
9698 The returned value is now stored in *YY0. All callers changed.
9699 * src/output.c (merge_output): Adjust to the above change.
9700
0051e3ed
PE
97012003-07-26 Paul Eggert <eggert@twinsun.com>
9702
9703 * data/glr.c (YYASSERT): New macro.
9704 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
9705 yyresolveStates, yyprocessOneStack):
9706 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
9707 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 9708
137437c6
PE
97092003-07-25 Paul Eggert <eggert@twinsun.com>
9710
5b620e06
PE
9711 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
9712 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 9713 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
9714 by Frank Heckenbach, though I have omitted the structure-initialization
9715 part of his glr-knr.diff patch since I recall that the Portable
9716 C Compiler didn't require that change.
9717
137437c6
PE
9718 Let the user specify how to allocate and free memory.
9719 Derived from a suggestion by Frank Heckenbach in
161a71f3 9720 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
9721 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
9722 All uses of free, malloc, realloc changed to use these macros,
9723 and unnecessary casts removed.
9724 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
9725
ddb85ca5
PE
97262003-07-06 Matthias Mann <MatthiasMann@gmx.de>
9727
9728 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
9729 use s.empty() rather than s == "" to test for empty string; see
161a71f3 9730 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
9731 (trivial change)
9732
39910e09
AD
97332003-06-25 Akim Demaille <akim@epita.fr>
9734
9735 * config/depcomp, config/install-sh: Update from masters.
9736
0ae99356
PE
97372003-06-20 Paul Eggert <eggert@twinsun.com>
9738
9739 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
9740 and return properly parenthesized result.
9741 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
9742 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9743 Remove unnecessary parentheses from uses.
9744 * doc/bison.texinfo (Location Default Action): Describe the
9745 conventions for parentheses.
9746
cd05d13c
PE
97472003-06-19 Paul Eggert <eggert@twinsun.com>
9748
81fd08ca
PE
9749 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
9750 yyreportTree): Do not assume that size_t is the same width as int,
9751 when printing sizes. Print sizes using an unsigned format.
9752 Problem reported by Frank Heckenbach in
161a71f3 9753 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 9754
cd05d13c
PE
9755 Port to Forte Developer 7 C compiler.
9756 * data/glr.c (struct YYLTYPE): If locations are not being used,
9757 declare a single dummy member, as empty structs do not conform
9758 to the C standard.
9759 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
9760 the Forte Developer 7 C compiler complains that end-of-loop
9761 code is not reached.
9762
4dcf140b
PE
97632003-06-17 Paul Eggert <eggert@twinsun.com>
9764
9765 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
9766 avoid warnings from picky compilers about redefinition of PARAMS.
9767
8dd76bee
PE
97682003-06-17 Paul Eggert <eggert@twinsun.com>
9769
9770 Version 1.875b.
9771
9772 * NEWS: Document 1.875b.
9773
9774 * lib/bbitset.h: Do not include config.h; that's the includer's job.
9775 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
9776 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
9777 Don't use 'index' in comments, as it's a builtin fn on some hosts.
9778 * lib/bitset_stats.c: Include gettext.h unconditionally, as
9779 per recent gettext manual's suggestion.
9780 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
9781 Use prototypes, not old-style definitions.
9782 * lib/lbitset.c (lbitset_unused_clear): Likewise.
9783 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
9784 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
9785 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
9786 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
9787 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
9788 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
9789 vbitset_or_and_cmp, vbitset_copy): Likewise.
9790
9791 * lib/libiberty.h: Do not include config.h; that's the includer's job.
9792 Do not include <stdlib.h>.
9793 (PARAMS): Define unconditionally for C89.
9794 (ATTRIBUTE_NORETURN): Remove.
9795 (ATTRIBUTE_UNUSED): Define unconditionally.
9796
9797 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 9798 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
9799 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
9800 * lib/vbitset.c, lib/vbitset.h: New files.
9801 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9802 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
9803 from libbitset.
9804
9805 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
9806 `How Can I Reset @code{yyparse}', since texinfo does not allow
9807 arbitrary @ in node names.
9808
9809 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
9810 shouldn't be needed according to the gettext 0.12.1 documentation
9811 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 9812 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 9813 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 9814 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 9815
8dd76bee
PE
9816 * lib/.cvsignore: Add stdbool.h.
9817 * m4/.cvsignore: Add nls.m4, po.m4.
9818
9819 Upgrade to CVS gnulib.
9820 * stdbool_.h: File renamed from stdbool.h.in.
9821 * configure.ac (AM_STDBOOL_H): Invoke this instead of
9822 AC_HEADER_STDBOOL.
9823 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
9824 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
9825 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
9826 (MOSTLYCLEANFILES): New var.
9827 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
9828 (stdbool.h): New rule.
9829 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
9830 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
9831 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
9832 m4/quote.m4: Upgrade to today's gnulib.
9833
9834 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
9835 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
9836 the tests right now.
9837 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
9838 yyerror are declared before use; C99 requires this.
9839
25005f6a
PH
98402003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9841
9842 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
9843 first.
9844 (yyrecoverSyntaxError): Correct the logic for setting and testing
9845 yyerrState.
9846 Correct comment on handling EOF.
9847 Allow states with only a default reduction, rather than failing
8dd76bee 9848 (I can't quite reconstruct why these were not allowed before).
25005f6a 9849
137437c6 9850 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 9851 buffer overruns, corrupting state.
8dd76bee
PE
9852
9853 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
9854 definition.
9855 * src/reader.h (max_left_semantic_context): New variable declaration.
9856 * src/scan-gram.l (max_left_semantic_context): Define.
9857 (handle_action_dollar): Update max_left_semantic_context.
9858 * data/glr.c (YYMAXLEFT): New definition.
9859 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
9860 (yyresolveAction): Ditto.
9861
9862 Fixes to problems with location handling in GLR parsers reported by
9863 Frank Heckenbach (2003/06/05).
9864
9865 * data/glr.c (YYLTYPE): Make trivial if locations not used.
9866 (YYRHSLOC): Add parentheses, and define only if locations used.
9867 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
9868 locations not used.
9869 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
9870 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 9871
25005f6a
PH
9872 * tests/cxx-type.at: Exercise location information; update tests
9873 to differentiate output with and without locations.
8dd76bee 9874 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
9875 because default YYLTYPE not yet defined.
9876 Change semantic actions to compute strings, rather than printing
9877 them directly (to test proper passing of semantics values). Change
9878 output to prefix notation and update test data and expected results.
9879 (yylex): Track locations.
9880 (stmtMerge): Return value rather than printing, and include arguments
9881 in value.
8dd76bee 9882
711f40b7
PE
98832003-06-03 Paul Eggert <eggert@twinsun.com>
9884
9885 Avoid warnings generated by GCC 2.95.4 when Bison is
9886 configured with --enable-gcc-warnings.
9887 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
9888 yy::]b4_parser_class_name[::translate_,
9889 yy::Stack::operator[] (unsigned),
9890 yy::Stack::operator[] (unsigned) const,
9891 yy::Slice::operator[] (unsigned),
9892 yy::Slice::operator[] (unsigned) const):
9893 Rename local vars to avoid warnings.
9894 * tests/glr-regression.at (Improper handling of embedded actions
9895 and $-N in GLR parsers): Remove unused local variable from yylex.
9896 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
9897 (void) as arg when not pure, since we now assume C89 when building
9898 Bison. Pacify GCC by using parameter.
9899
ac695f7d
PE
99002003-06-02 Paul Eggert <eggert@twinsun.com>
9901
9902 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
9903 yy::Location::lines, yy::Location::columns): Rename arguments
9904 to avoid shadowing; this removes a warning generated by GCC 3.3.
9905
26ec81e0
PE
99062003-06-01 Paul Eggert <eggert@twinsun.com>
9907
9908 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
9909 to g++, as GCC 3.3 complains if you do it.
9910 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
9911 everything that WARNING_CFLAGS has, except omit warnings
9912 not suitable for C++.
9913 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
9914 * tests/atlocal.in (CXXFLAGS): New var.
9915 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
9916
9917 Fix a GLR parser bug I reported in February; see
161a71f3 9918 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
9919 The problem was that GLR parsers did not conform to the C standard,
9920 because actions like { $1 = $2 + $3; } expanded to expressions
9921 that invoked YYFILL in separate subexpressions, and YYFILL assigned
9922 to a local variable. The C standard says that expressions
9923 like (var = f ()) + (var = f ()) have undefined behavior.
9924 Another problem was that GCC sometimes issues warnings that
9925 yyfill and its parameters are unused.
9926
9927 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
9928 as possibly unused.
9929 (yyfill): New function.
9930 (YYFILL): Use it.
9931 (yyuserAction): Change type of yynormal to bool, so that it matches
9932 the new yyfill signature. Mark it as possibly unused.
9933
9934
9935 Follow up on a bug I reported in February, where a Bison-generated
9936 parser can loop. Provide a test case and a fix for yacc.c. I
9937 don't have a fix for lalr1.cc or for glr.c, unfortunately.
9938 The original bug report is in:
161a71f3 9939 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
9940
9941 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
9942 macro's size was becoming unwieldy.
9943 (yyerrlab): Do not discard an empty lookahead symbol, as this
9944 might destroy garbage.
9945 (yyerrorlab): New label, with the old contents of YYERROR,
9946 plus the following change: pop the stack of rhs corresponding
9947 to the production that invoked YYERROR. That is how Yacc
9948 behaves, and POSIX requires this behavior.
9949 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
9950 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
9951 Define 'alarm' to do nothing if unistd.h is not available.
9952 Add a new rule "exp: '-' error;" to test the above change to
9953 data/yacc.c. Use 'alarm' to abort any test taking longer than
9954 10 seconds, as it's probably looping.
9955 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
9956 Also, the new yacc.c generates two fewer diagnostics for an
9957 existing test.
9958
d0829076
PE
99592003-05-24 Paul Eggert <eggert@twinsun.com>
9960
c6ae27df
PE
9961 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
9962 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
9963 This fixes a problem reported by John Bowman when the Compaq/HP
9964 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
9965 -ansi -Wall -gall).
9966 * data/yacc.c (union yyalloc): Likewise.
9967 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 9968
d0829076
PE
9969 Switch from 'int' to 'bool' where that makes sense.
9970
9971 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
9972 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
9973 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
9974 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
9975 Return or accept bool, not int. All callers changed.
9976 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
9977 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
9978 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
9979 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
9980 bitset_or_and_cmp_): Likewise.
9981 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
9982 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
9983 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
9984 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
9985 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
9986 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
9987 bitset_stats_or_and_cmp): Likewise.
9988 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
9989 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
9990 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
9991 ebitset_xor_cmp): Likewise.
9992 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
9993 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
9994 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
9995 lbitset_xor_cmp): Likewise.
9996 * lib/bbitset.h: Include <stdbool.h>.
9997 (struct bitset_vtable): The following members now return bool, not
9998 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
9999 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
10000 or_and_cmp).
10001 * src/conflicts.c (count_rr_conflicts): Likewise.
10002 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
10003 All uses changed.
10004 * lib/ebitset.c (ebitset_obstack_init): Likewise.
10005 * lib/lbitset.c (lbitset_obstack_init): Likewise.
10006 * src/getargs.c (debug_flag, defines_flag, locations_flag,
10007 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10008 graph_flag): Likewise.
10009 * src/getargs.h (debug_flag, defines_flag, locations_flag,
10010 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10011 graph_flag): Likewise.
10012 * src/output.c (error_verbose): Likewise.
10013 * src/output.h (error_verbose): Likewise.
10014 * src/reader.c (start_flag, typed): Likewise.
10015 * src/reader.h (typed): Likewise.
10016 * src/getargs.c (LOCATIONS_OPTION): New constant.
10017 (long_options, getargs): Use it.
10018 * src/lalr.c (build_relations): Use bool, not int.
10019 * src/nullable.c (nullable_compute): Likewise.
10020 * src/print.c (print_reductions): Likewise.
10021 * src/tables.c (action_row, pack_vector): Likewise.
10022 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
10023 * src/output.c (prepare): Use it.
10024 * src/output.c (token_definitions_output,
10025 symbol_destructors_output, symbol_destructors_output): Use string,
10026 not boolean integer, to keep track of whether to output separator.
10027 * src/print_graph.c (print_core): Likewise.
10028 * src/state.c (state_rule_lookaheads_print): Likewise.
10029
10030 * config/install-sh: Sync from automake 1.7.5.
10031
6b2584b7
PE
100322003-05-14 Paul Eggert <eggert@twinsun.com>
10033
10034 * src/parse-gram.y (rules_or_grammar_declaration): Require a
10035 semicolon after a grammar declaration, in the interest of possible
10036 future changes to the Bison input language.
10037 Do not allow a stray semicolon at the start of the grammar.
10038 (rhses.1): Allow one or more semicolons after any rule, including
10039 just before "|" as required by POSIX.
10040 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
10041 grammar.
10042
caf37a36
ADL
100432003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
10044
10045 %parse-param support for lalr1.cc.
10046
10047 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
10048 b4_cc_constructor_calls, b4_cc_constructor_call,
10049 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
10050 definitions.
10051 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
10052 parse-param arguments.
10053 (yy::b4_parser_class_name): Declare instance variables to
10054 hold parse-param arguments.
10055 * tests/calc.at: s/value/semantic_value/ because value clashes
10056 with a member of yy::b4_parser_class_name. Adjust C++ code
10057 to handle %parse-param. Enable %parse-param test in C++.
10058
3ab37077
PE
100592003-05-12 Paul Eggert <eggert@twinsun.com>
10060
10061 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
10062 English a bit. Fix fclose typo. Change "const char" to "char
10063 const", and use ANSI C rather than K&R for "main". Suggest
10064 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
10065 and suggest yy_switch_to_buffer.
10066
100672003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
10068
10069 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
10070 C89. This avoids a diagnostic on compilers that define __STDC__
10071 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 10072 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 10073
e743727f
PE
100742003-05-03 Paul Eggert <eggert@twinsun.com>
10075
10076 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
10077 Do not overrun array bounds.
10078 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 10079 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 10080
916708d5
AD
100812003-04-29 Akim Demaille <akim@epita.fr>
10082
10083 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
10084 * src/getargs.c, src/getargs.h: here, as bool, not int.
10085 (nondeterministic_parser): New.
10086 * src/parse-gram.y, src/scan-gram.l: Support
10087 %nondeterministic-parser.
10088 * src/output.c (prepare): Use nondeterministic_parser instead
10089 of glr_parser where appropriate.
10090 * src/tables.c (conflict_row, action_row, save_row)
10091 (token_actions, token_actions, pack_vector): Ditto.
10092
a06ea4aa
AD
100932003-04-29 Akim Demaille <akim@epita.fr>
10094
10095 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
10096
211074ca
AD
100972003-04-29 Akim Demaille <akim@epita.fr>
10098
10099 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
10100 with %pure-parser and %locations to exercise the patch from Yakov
10101 Markovitch below.
10102
6175ffe3
PE
101032003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
10104
10105 * data/yacc.c: (b4_lex_param): Corrected for the case where
10106 %lex-param is provided and %pure-parser isn't.
10107
b1e95857
PE
101082003-04-27 Paul Eggert <eggert@twinsun.com>
10109
10110 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 10111 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
10112 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
10113 if it is not defined.
10114 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
10115
acda9df6
PE
101162003-04-26 Paul Eggert <eggert@twinsun.com>
10117
3470c57b
PE
10118 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
10119 Declare to be of type suitable for the ninf value itself, not of
10120 type suitable for the corresponding table, since the latter might
10121 be unsigned but the ninf value might be negative. This fixes a
10122 bug reported by Alexandre Duret-Lutz in
161a71f3 10123 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 10124
acda9df6
PE
10125 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
10126 invokes it. We shouldn't invoke it twice because it will attempt
10127 to put error.o in the archive twice. This fixes a glitch reported
10128 by Martin Mokrejs in
161a71f3 10129 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 10130
b5250f26
PE
101312003-04-21 Paul Eggert <eggert@twinsun.com>
10132
10133 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
10134 to gnulib.
10135
089ac0f1
PE
101362003-04-21 Yakov Markovitch <Markovitch@iso.ru>
10137
10138 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
10139 Fix obvious typo that results in uncompilable GLR parsers
10140 when both %pure-parser and %locations are used. (trivial change)
10141
5ededac6
PE
101422003-04-17 Paul Eggert <eggert@twinsun.com>
10143
1b8f2fff
PE
10144 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
10145 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
10146 Do not insert the expected token via unput, as this runs afoul
10147 of a POSIX-compatibility bug in flex 2.5.31.
10148 All uses changed to BEGIN the parent state,
10149 since we no longer insert the expected token via unput.
10150 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
10151 that is no longer emitted after the above change.
10152
5ededac6
PE
10153 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
10154 the first one. This change is from Paul Hilfinger, and it fixes
10155 regression reported by Werner Lemberg in
161a71f3 10156 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
10157
10158 (resolve_sr_conflict): Don't invoke state_errs_set
10159 unless one or more tokens have been explicitly made errors.
10160 Otherwise, the above change causes Bison to abort.
10161
10162 * tests/existing.at (GNU pic Grammar): New test case, taken from
10163 Lemberg's email.
10164
b8be9132
AD
101652003-03-31 Akim Demaille <akim@epita.fr>
10166
10167 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
10168
d423d460
AD
101692003-03-31 Akim Demaille <akim@epita.fr>
10170
10171 * src/output.c (prepare_symbols): Avoid trailing spaces in the
10172 output.
10173
c7e441b4
AD
101742003-03-31 Akim Demaille <akim@epita.fr>
10175
10176 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
10177 From Paul Hilfinger.
10178
231897ad
AD
101792003-03-29 Akim Demaille <akim@epita.fr>
10180
10181 * m4/error.m4: Do not put under dynamic conditions some code which
10182 expansion is under static control.
10183
5b066063
AD
101842003-03-29 Akim Demaille <akim@epita.fr>
10185
10186 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
10187
22a74fec
AD
101882003-03-29 Akim Demaille <akim@epita.fr>
10189
10190 * doc/bison.texinfo (Strings are Destroyed): New.
10191
0eee27e7
PE
101922003-03-13 Paul Eggert <eggert@twinsun.com>
10193
10194 * .cvsignore: Add configure.lineno.
10195 * src/.cvsignore: Add yacc.
10196 * tests/.cvsignore: Add testsuite.log.
10197 * doc/fdl.texi: Sync with latest FSF version.
10198
f61aad93
PE
101992003-03-12 Paul Eggert <eggert@twinsun.com>
10200
537636c7
PE
10201 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
10202 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
10203 cursor, instead of leaving it undefined. This fixes a bug
10204 reported by Tim Van Holder in
161a71f3 10205 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
10206 * tests/input.at (Torturing the Scanner): Test the scanner on
10207 an empty input file, which was Tim Van Holder's test case.
10208
10209 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
10210 <sys/resource.h> can be included, include sys/time.h and
10211 sys/times.h first, if available. This works around the SunOS
10212 4.1.4 porting bug reported by Bruce Becker in
161a71f3 10213 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
10214
10215 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
10216 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
10217 AC_HEADER_SYS_WAIT.
10218
f61aad93
PE
10219 Merge changes from gnulib. This was prompted because the CVS
10220 snapshot didn't build on Solaris 7 due to strnlen problems.
10221
10222 These changes need to be merged back into gnulib:
10223 * lib/hash.c: Include <stdbool.h> unconditionally.
10224 * m4/onceonly.m4 (m4_quote): New macro.
10225 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
10226 Quote AC_FOREACH variable-expansions properly.
10227 The 2003-01-03 obstack.h change also needs merging.
10228 {end of changes requiring merging}
5b066063 10229
f61aad93
PE
10230 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10231 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
10232 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
10233 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
10234 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
10235 New files, imported from gnulib.
10236 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
10237 above.
10238
10239 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
10240 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
10241 gnulib sources.
10242
10243 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
10244 Add.
10245 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
10246 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
10247 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
10248 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
10249 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
10250 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
10251 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
10252 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
10253 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
10254 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
10255 (jm_PREREQ_ARGMATCH): Remove.
10256 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
10257 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
10258
10259 * src/system.h: Include <stdbool.h> unconditionally.
10260
10261 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
10262 assuming at least C89 in the bitset code for some time now.
10263
d2ffe116
AD
102642003-03-03 Akim Demaille <akim@epita.fr>
10265
10266 * ro.po: New.
10267
052826fd
AD
102682003-03-02 Akim Demaille <akim@epita.fr>
10269
10270 * doc/bison.texinfo (Table of Symbols): Reactivate the
10271 documentation for %lex-param, and %parse-param.
10272
c4749565
AD
102732003-03-02 Akim Demaille <akim@epita.fr>
10274
10275 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
10276 generate verbose error messages.
10277 Use the number of tokens as an upper bound in yytname, as it
10278 cannot be a non terminal.
10279
d5286af1
AD
102802003-03-02 Akim Demaille <akim@epita.fr>
10281
10282 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
10283 message.
10284
22e304a6
AD
102852003-03-02 Akim Demaille <akim@epita.fr>
10286
22e304a6
AD
10287 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
10288 Use them to exercise yycheck overrun.
10289 Based on Andrew Suffield's grammar.
10290
67a25fed
AD
102912003-03-02 Akim Demaille <akim@epita.fr>
10292
10293 Create tests/local.at for Bison generic testing macros.
10294
10295 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
10296 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
10297 This new file.
10298 * tests/calc.at (AT_CHECK_CALC): Adjust.
10299 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
10300 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
10301 * tests/local.at: here.
10302 (AT_COMPILE_CXX): Tags the tests using it as c++.
10303 Ignore the test if CXX is not functional.
10304
9c2b381f
PE
103052003-03-01 Paul Eggert <eggert@twinsun.com>
10306
10307 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
10308 not loc->end, since loc->end might contain garbage and this leads
10309 to undefined behavior on some platforms.
10310 (id_loc, token_start): Use (IF_LINTed) initial values that do not
10311 depend on *loc, so that the reader doesn't give the the false
10312 impression that *loc is initialized.
10313 (<INITIAL>"%%"): Do not bother setting code_start, since its value
10314 does not survive the return.
10315
0433ba88
AD
103162003-03-01 Akim Demaille <akim@epita.fr>
10317
10318 * src/scan-gram.l (code_start): Always initialize it when entering
10319 into yylex, as SC_EPILOGUE is activated *before* the corresponding
10320 yylex invocation. An alternative would be making it static, but
10321 then it starts with the second %%'s beginning, instead of its end.
10322
b305ea69
PE
103232003-02-28 Paul Eggert <eggert@twinsun.com>
10324
10325 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
10326 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 10327 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 10328
c3d25e01
PE
103292003-02-26 Paul Eggert <eggert@twinsun.com>
10330
10331 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
10332 Remove Sequent/Pyramid discussion (nobody uses them any more).
10333 Merge VMS and MS-DOS discussion; these ports may well be dead
10334 but let's keep mentioning them for now. Put <> around email
10335 addresses. Add copyright notice.
10336
c267ffbc
PE
103372003-02-24 Paul Eggert <eggert@twinsun.com>
10338
10339 * data/glr.c (yy_reduce_print): yylineno -> yylno,
10340 to avoid collision with flex use of yylineno.
10341 Problem reported by Bruce Lilly in
161a71f3 10342 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
10343 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10344 * data/yacc.c (yy_reduce_print): Likewise.
10345
10346 * config/depcomp: Sync with Automake 1.7.3.
10347
f939fc12
AD
103482003-02-21 Akim Demaille <akim@epita.fr>
10349
10350 * data/lalr1.cc: Use temporary variables instead of casts to
10351 change integer types.
10352 Suggested by Paul Eggert.
10353
95923bd6
AD
103542003-02-21 Akim Demaille <akim@epita.fr>
10355
10356 * doc/bison.texinfo: Use "location" consistently to refer to @n,
10357 to avoid confusions with lalr1.cc's notion of Position.
10358 Suggested by Paul Eggert.
10359
2cdc240e
AD
103602003-02-20 Akim Demaille <akim@epita.fr>
10361
10362 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
10363 before initial_columns.
10364 (location.hh): Use consistent variable names when defining the
10365 operator<<.
10366 Use "last" so that we subtract from Positions, not from unsigned.
10367
5d003116
AD
103682003-02-20 Akim Demaille <akim@epita.fr>
10369
10370 * data/lalr1.cc (position.hh): New subfile, including the extended
10371 and Doxygen'ed documentation of class Position.
10372 (location.hh): Use it.
10373 Document a` la Doxygen.
ba1ecc07 10374 With the help of Benoit Perrot.
5d003116 10375
d02b25f9
AD
103762003-02-20 Akim Demaille <akim@epita.fr>
10377
10378 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
10379 AT_YACC_IF.
10380 Redefine AT_YYERROR_SEES_LOC_IF using it.
10381 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
10382 not defined.
10383 Don't use the location in yy::Parser::error_ and
10384 yy::Parser::print_ when not %locations.
10385 Activate more lalr1.cc tests.
10386
0d1c3a04
AD
103872003-02-19 Akim Demaille <akim@epita.fr>
10388
10389 * data/lalr1.cc: When displaying a line number, be sure to make it
10390 an int.
10391
60a777aa
AD
103922003-02-19 Akim Demaille <akim@epita.fr>
10393
10394 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
10395 Remove, useless.
10396 (YYABORT, YYACCEPT, YYERROR): New.
10397 * tests/calc.at: Renable the lalr1.cc test.
10398
0b86fc41
AD
103992003-02-19 Akim Demaille <akim@epita.fr>
10400
10401 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
10402 error recovery, mixing with/without pops and discarding of the
10403 lookahead.
10404 Exercise YYERROR.
10405 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
10406
da99a5dc
PE
104072003-02-17 Paul Eggert <eggert@twinsun.com>
10408
10409 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
10410 * tests/testsuite.at (AT_COMPILE): Use them.
10411 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 10412 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 10413
93b8c255
PE
104142003-02-12 Paul Eggert <eggert@twinsun.com>
10415
10416 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
10417 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 10418 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
10419 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
10420 Check for malloc failure, for consistency with yacc.c.
10421 (yytname_size): Remove, for consistency with yacc.c.
10422
10423 The bug still remains in data/lalr1.cc, as I didn't have time
10424 to fix it there.
10425
7548fed2
AD
104262003-02-06 Akim Demaille <akim@epita.fr>
10427
10428 * configure.ac (GXX): Rename as...
10429 (CXX): this, to keep the original Autoconf semantics.
10430 Require 2.57.
10431 * data/lalr1.cc: Fix b4_copyright invocations.
10432 If YYDEBUG is not defined, don't depend upon name_ being defined.
10433 (location.hh): Include string and iostream.
10434 (Position::filename): New member.
10435 (Position::Position ()): New.
10436 (operator<< (Position)): New.
10437 (operator- (Position, int)): New.
10438 (Location::first, Location::last): Rename as...
10439 (Location::begin, Location::end): these, to mock the conventional
10440 iterator names.
10441 (operator<< (Location)): New.
10442 * tests/atlocal.in (CXX): New.
10443 * tests/testsuite.at (AT_COMPILE_CXX): New.
10444 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
10445 locations in a more synthetic way.
10446 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
10447 lalr1.cc is used.
10448 Adjust the C locations to match those from Emacs: first column is
10449 column 0.
10450 Change all the expected results.
10451 Conform to the GCS: simplify the locations when applicable.
10452 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
10453 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
10454 these CPP macros with the m4 macros new defined by...
10455 (AT_CHECK_PUSHDEFS): this, i.e.:
10456 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 10457 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
10458 New macros.
10459 (AT_CHECK_POPDEFS): Undefine them.
10460 (AT_CHECK_CALC_LALR1_CC): New.
10461 Use it for the first lalr1.cc test.
10462
43a176ef
AD
104632003-02-04 Akim Demaille <akim@epita.fr>
10464
10465 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
10466 Location as is defined.
10467
fc049e9c
AD
104682003-02-04 Akim Demaille <akim@epita.fr>
10469
10470 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
10471 name_ being defined.
10472
a737b216
PE
104732003-02-03 Paul Eggert <eggert@twinsun.com>
10474
10475 * src/gram.h (start_symbol): Remove unused decl.
10476
10477 Use more-consistent naming conventions for local vars.
10478
10479 * src/derives.c (derives_compute): Change type of local var from
10480 int to rule_number.
10481 * src/gram.c (grammar_rules_partial_print): Likewise.
10482 * src/print.c (print_core): Likewise.
10483 * src/reduce.c (reduce_grammar_tables): Likewise.
10484
10485 * src/gram.c (grammar_dump): Change name of item_number *
10486 local var from r to rp.
10487 * src/nullable.c (nullable_compute): Likewise.
10488
10489 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
10490
10491 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
10492 for symbol or symbol_number var.
10493 * src/reader.c (grammar_start_symbol_set): Likewise.
10494 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
10495 Likewise.
10496 * src/state.c (transitions_to): Likewise.
10497 * src/state.h: Likewise.
10498 * src/tables.c (symbol_number_to_vector_number): Likewise.
10499
10500 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
10501 char * var.
10502
10503 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
10504 var.
10505
10506 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
10507 var.
10508
10509 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
10510 Use str, not s, for char * var. Use ch, not c, for character var.
10511 Use size for size var.
10512
10513 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
10514 char * var.
10515 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
10516 uniqstr var.
10517 * src/uniqstr.h: Likewise.
10518
10519 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10520 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10521 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
10522 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
10523 param to have same name as that of enum, so that we don't use
10524 "s" to stand for a non-state.
10525
68e93ad5
AD
105262003-02-02 Akim Demaille <akim@epita.fr>
10527
10528 * src/scan-skel.l: Scan more than one inert character per yylex
10529 invocation.
10530
92898986
PE
105312003-02-01 Paul Eggert <eggert@twinsun.com>
10532
10533 Version 1.875a.
10534
1d9d5d71
PE
10535 * po/LINGUAS: Add ms.
10536
0435d061
AD
105372003-01-30 Akim Demaille <akim@epita.fr>
10538
10539 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
10540
6029a57f
PH
105412003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10542
10543 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
10544 of $1.
0435d061
AD
10545
10546 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 10547 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 10548 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 10549
6029a57f
PH
10550 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
10551 (b4_rhs_location): Ditto.
0435d061 10552 (yyfill): New function to copy from stack tree into array
6029a57f 10553 incrementally.
0435d061
AD
10554 (yyuserAction): Modify to allow incremental move of semantic values
10555 to rhs array when in GLR mode.
10556 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
10557 as needed.
10558 Remove dummy use of yystack, as there is now a guaranteed use.
10559 (yydoAction): Modify to allow incremental move of semantic values
10560 to rhs array when in GLR mode.
10561 (yyresolveAction): Ditto.
10562 (yyglrShiftDefer): Update comment.
0435d061 10563 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
10564 (yyglrReduce): Ditto.
10565 (yydoAction): Ditto
0435d061 10566
6029a57f
PH
10567 * tests/glr-regr1.at: Rename to ...
10568 * tests/glr-regression.at: Add new regression test for the problems
10569 described above (adapted from S. Eken).
10570 Update copyright notice.
10571 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
10572 * tests/Makefile.am: Ditto.
10573
6cee6297
PE
105742003-01-28 Paul Eggert <eggert@twinsun.com>
10575
10576 * data/lalr1.cc: Do not use @output_header_name@ unless
10577 b4_defines_flag is set. This fixes two bugs reported by
10578 Tim Van Holder in
161a71f3
PE
10579 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
10580 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 10581
b2a836b5
PE
105822003-01-21 Paul Eggert <eggert@twinsun.com>
10583
10584 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
10585 we don't need to worry about yyerrlab1 being reported as an
10586 "unused label" by non-GCC C compilers. The downside is that if
10587 locations are used then a couple of statements are duplicated each
10588 time YYERROR is invoked, but the upside is that the warnings
10589 should vanish.
10590 (yyerrlab1): Move code to YERROR.
10591 (yyerrlab2): Remove. Change uses back to yyerrlab1.
10592 This reverts some of the 2002-12-27 change.
10593
4196b931
PE
105942003-01-17 Paul Eggert <eggert@twinsun.com>
10595
10596 * src/output.c (symbol_printers_output): Fix typo that led
10597 to core dump. Problem reported by Antonio Rus in
161a71f3 10598 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 10599
3ae831b4
AD
106002003-01-13 Akim Demaille <akim@epita.fr>,
10601 Quoc Peyrot <chojin@lrde.epita.fr>,
10602 Robert Anisko <anisko_r@lrde.epita.fr>
10603
10604 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
10605 when the stacks contain one element, as the loop would otherwise
10606 free the last state, and then use the top state (the one we just
10607 popped). This means that the initial elements will not be freed
10608 explicitly, as is the case in yacc.c; it is not a problem, as
10609 these elements have fake values.
10610
e3aa65c5
PE
106112003-01-11 Paul Eggert <eggert@twinsun.com>
10612
10613 * NEWS: %expect-violations are now just warnings, reverting
10614 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
10615 bootstrapping problem reported by Matthias Klose; see
161a71f3 10616 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
10617 * src/conflicts.c (conflicts_print): Likewise.
10618 * tests/conflicts.at (%expect not enough, %expect too much,
10619 %expect with reduce conflicts): Likewise.
10620 * doc/bison.texinfo (Expect Decl): Document this. Also mention
10621 that the warning is enabled if the number of conflicts changes
10622 (not necessarily increases).
10623
10624 * src/getargs.c (version): Update copyright year.
10625
f0057011
AD
106262003-01-09 Akim Demaille <akim@epita.fr>
10627
10628 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
10629
1ee6d2a0
PE
106302003-01-08 Paul Eggert <eggert@twinsun.com>
10631
10632 * Makefile.maint (WGETFLAGS):
10633 New macro, containing "-C off" to disable proxy caches.
10634 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
10635 (rel-check): Use $(WGET) instead of wget.
10636
d4fd77c4
PE
106372003-01-06 Paul Eggert <eggert@twinsun.com>
10638
10639 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
10640 the GLR paper of Scott, Johnstone and Hussain.
10641
464c6927
PE
106422003-01-04 Paul Eggert <eggert@twinsun.com>
10643
d600ee67
PE
10644 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
10645 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
10646 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
10647 (EXTRA_LIBRARIES): New var, for liby.a.
10648 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
10649 (EXTRA_SCRIPTS): New var, for yacc.
10650
464c6927
PE
10651 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
10652 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
10653 Problem reported by Nelson H. F. Beebe.
10654
106552003-01-03 Paul Eggert <eggert@twinsun.com>
10656
10657 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
10658 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
10659 when compiling Bison 1.875's `bitset bset = obstack_alloc
10660 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
10661
10662 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
10663 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
10664 grow to a huge size with typical invocation.
d600ee67 10665
464c6927
PE
10666 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
10667 Use the pattern recommended by Autoconf 2.57, except also protect
10668 against double-definition.
10669 * src/system.h: Likewise.
10670 Portability issues reported by Nelson H. F. Beebe.
d600ee67 10671
464c6927
PE
10672 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
10673 All uses changed. Provide a definition in both C and C++.
10674 (yytrue, yyfalse): Define even if defined (__cplusplus).
10675
10676 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
10677 Reported by Nelson H. F. Beebe.
d600ee67 10678
464c6927
PE
10679 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
10680
0f42c7d5
PE
106812003-01-02 Paul Eggert <eggert@twinsun.com>
10682
10683 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
10684 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
10685 Bug reported by Nelson H. F. Beebe.
10686
dc546b0f
PE
106872003-01-01 Paul Eggert <eggert@twinsun.com>
10688
10689 * Version 1.875.
10690
2c09b6a7
PE
106912002-12-30 Paul Eggert <eggert@twinsun.com>
10692
10693 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
10694 Moved here from...
10695 (<INITIAL>","): Here. This causes stray "," to be treated
10696 more uniformly.
10697
dc546b0f 10698 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
10699 last brace in braced code when not in Yacc mode, for compatibility
10700 with Bison 1.35. This resurrects the 2001-12-15 patch to
10701 src/reader.c.
10702
10703 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
10704 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
10705
535c0f63
PE
107062002-12-28 Paul Eggert <eggert@twinsun.com>
10707
10708 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
10709 that of SYM's type. This fixes Debian bug 168069, reported by
10710 Thomas Olsson.
d600ee67 10711
963fcc17
PE
107122002-12-28 Paul Eggert <eggert@twinsun.com>
10713
10714 Version 1.75f.
10715
10716 Switch back to the Yacc style of conflict reports, undoing some
10717 of the 2002-07-30 change.
10718 * doc/bison.texinfo (Understanding): Use Yacc style for
10719 conflict reports. Also, use new way of locating rules.
10720 * src/conflicts.c (conflict_report):
10721 Renamed from conflict_report_yacc, removing the old
10722 'conflict_report'. Translate the entire conflict report at once,
10723 so that we don't assume that "," has the same interpretation in
10724 all languages.
10725 (conflicts_output): Use Yacc-style conflict report for each state,
10726 instead of our more-complicated style.
10727 (conflicts_print): Use Yacc-style conflict report, except print
10728 the input file name when not emulating Yacc.
10729 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
10730 Conflicted Reduction, %expect not enough, %expect too much,
10731 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
10732 * tests/existing.at (GNU Cim Grammar): Likewise.
10733 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
10734
10735 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
10736 fatal): Don't invoke fflush; it's not needed and it might even be
10737 harmful for stdout, as stdout might not be open.
10738 * src/reduce.c (reduce_print): Likewise.
10739
b1efe548
PE
107402002-12-27 Paul Eggert <eggert@twinsun.com>
10741
10742 Fix a bug where error locations were not being recorded correctly.
10743 This problem was originally reported by Paul Hilfinger in
161a71f3 10744 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
10745
10746 * data/yacc.c (yyparse): New local var yylerrsp, to record the
10747 top of the location stack's error locations.
10748 (yyerrlab): Set it. When discarding a token, push its location
10749 onto yylerrsp so that we don't lose track of the error's end.
10750 (yyerrlab1): Now is only the target of YYERROR, so that we can
10751 properly record the location of the action that failed. For GCC
10752 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
10753 GCC warning about yyerrlab1 being unused if YYERROR is unused.
10754 (yyerrlab2): New label, which yyerrlab now falls through to.
10755 Compute the error's location by applying YYLLOC_DEFAULT to
10756 the locations of all the symbols that went into the error.
10757 * doc/bison.texinfo (Location Default Action): Mention that
10758 YYLLOC_DEFAULT is also invoked for syntax errors.
10759 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10760 Error locations include the locations of all the tokens that were
10761 discarded, not just the last token.
d600ee67 10762
983c5c2c
PE
107632002-12-26 Paul Eggert <eggert@twinsun.com>
10764
b1efe548
PE
10765 * src/files.c: Include quote.h.
10766 (compute_output_file_names): Warn if we detect conflicting
10767 outputs to the same file. This should catch the misunderstanding
10768 exemplified by Debian Bug 165349, reported by Bruce Stephens..
10769
10770 * src/conflicts.c (conflicts_print): If the user specifies
10771 "%expect N", report an error if there are any reduce/reduce
10772 conflicts. This is what the manual says should happen.
10773 This fixes Debian bug 130890, reported by Anthony DeRobertis.
10774 * tests/conflicts.at (%expect with reduce conflicts): New test.
10775
983c5c2c
PE
10776 Don't use m4_include on relative file names, as it doesn't work as
10777 desired if there happens to be a file with that name under ".".
d600ee67 10778
983c5c2c
PE
10779 * m4sugar/version.m4: Remove; it was included but it wasn't used.
10780 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
10781 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
10782 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
10783 * src/output.c (output_skeleton): Use full path names when
10784 specifying a file to include; don't rely on include path, as
10785 it's unreliable when the working file contains a file with
10786 that name.
d600ee67 10787
983c5c2c
PE
107882002-12-25 Paul Eggert <eggert@twinsun.com>
10789
10790 Remove obsolete references to bison.simple and bison.hairy.
10791 Problem mentioned by Aubin Mahe in
161a71f3 10792 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
10793 * data/glr.c: Comment fix.
10794 * doc/bison.1: Remove references. Also, mention "yacc".
10795
10796 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
10797 with -g option.
10798
10799 * src/parse-gram.y (declaration): Use enum "report_states" rather
10800 than its numeric value 1.
10801
10802 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
10803 opening a new one. This fixes Debian bug 165349, reported by
10804 Bruce Stephens.
10805
23f2d9dc
PE
108062002-12-24 Paul Eggert <eggert@twinsun.com>
10807
10808 Version 1.75e.
10809
10810 * Makefile.maint (cvs-update): Don't assume that the shell
10811 supports $(...), as Solaris sh doesn't.
10812
10813 * src/parse-gram.y (lloc_default): Remove test for empty
10814 nonterminals at the end, since it didn't change the result.
10815
108162002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
10817
10818 If the user does not define YYSTYPE as a macro, Bison now declares it
10819 using typedef instead of defining it as a macro. POSIX requires this.
10820 For consistency, YYLTYPE is also declared instead of defined.
10821
10822 %union directives can now have a tag before the `{', e.g., the
10823 directive `%union foo {...}' now generates the C code
10824 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
10825 The default union tag is `YYSTYPE', for compatibility with Solaris 9
10826 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
10827 instead of `yyltype'.
10828
10829 `yystype' and `yyltype' are now obsolescent macros instead of being
10830 typedefs or tags; they are no longer documented and will be
10831 withdrawn in a future release.
10832
10833 * data/glr.c (b4_location_type): Remove.
10834 (YYSTYPE): Renamed from yystype.
10835 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
10836 (struct YYLTYPE): Renamed from struct yyltype.
10837 (YYLTYPE): Renamed from yyltype.
10838 (yyltype, yystype): New (and obsolescent) macros,
10839 for backward compatibility.
10840 * data/yacc.c: Likewise.
10841
10842 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
10843 does not specify a union tag. This is for compatibility with
10844 Solaris 9 yacc.
10845
10846 * src/parse-gram.y (add_param): 2nd arg is now char * not char
10847 const *, since it is now modified by stripping surrounding { }.
10848 (current_braced_code): Remove.
10849 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
10850 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
10851 trailing " {...}". Now of type <chars>.
10852 (grammar_declaration): Adjust to bundled tokens.
10853 (code_content): Remove; stripping is now done by add_param.
10854 (print_token_value): Print contents of bundled tokens.
10855 (token_name): New function.
10856
10857 * src/reader.h (braced_code, current_braced_code): Remove.
10858 (token_name): New decl.
10859
10860 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
10861 token_type, not braced_code code_kind. All uses changed.
10862 (SC_PRE_CODE): New state, for scanning after a keyword that
10863 has (or usually has) an immediately-following braced code.
10864 (token_type): New local var, to keep track of which token type
10865 to return when scanning braced code.
10866 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 10867 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
10868 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
10869 instead of returning a token type immediately.
10870 (<INITIAL>"{"): Set token type.
10871 (<SC_BRACED_CODE>"}"): Use it.
10872 (handle_action_dollar, handle_action_at): Now returns bool
10873 indicating success. Fail if ! current_rule; this prevents a core dump.
10874 (handle_symbol_code_dollar, handle_symbol_code_at):
10875 Remove; merge body into caller.
10876 (handle_dollar, handle_at): Complain in invalid contexts.
10877
10878 * NEWS, doc/bison.texinfo: Document the above.
10879 * NEWS: Fix years and program names in copyright notice.
10880
879ca4f8
PE
108812002-12-17 Paul Eggert <eggert@twinsun.com>
10882
10883 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
10884 Reporting, Table of Symbols): Omit mentions of %lex-param and
10885 %parse-param from the documentation for now.
10886
1c5fe69d
PE
108872002-12-15 Paul Eggert <eggert@twinsun.com>
10888
10889 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
10890 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
10891 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
10892 disagreed with the Bison documentation. Bug
10893 reported by Andrew Walrond.
d600ee67 10894
1c5fe69d
PE
10895 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
10896 as the caller now does that.
10897 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
10898 (YYEMPTY): Parenthesize right hand side, since others use it.
10899 (yyparse): Don't assume that our generated code is the only code
10900 that sets yychar.
10901
d1de5372
PE
109022002-12-13 Paul Eggert <eggert@twinsun.com>
10903
10904 Version 1.75d.
10905
10906 POSIX requires a "yacc" command.
10907 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
10908 (MOSTLYCLEANFILES): Add yacc.
10909 (yacc): New rule.
1c5fe69d 10910 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
10911 as an alias for bison y.
10912
10913 * po/LINGUAS: Add da.
d600ee67 10914
d1de5372
PE
10915 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
10916 problem with latest <getopt.h>.
10917 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
10918
10919 * doc/fdl.texi: Upgrade to 1.2.
10920 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
10921 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
10922 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
10923 gnulib.
10924 * config/install-sh: Sync with autotools.
10925
10926 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 10927 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
10928 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
10929 locations are requested.
10930 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
10931 locations are requested.
10932
d0f3fe23
PE
109332002-12-12 Paul Eggert <eggert@twinsun.com>
10934
10935 Remove unportable casts and storage allocation tricks.
10936 While we're at it, remove almost all casts, since they
10937 usually aren't needed and are a sign of trouble.
10938
10939 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
10940
10941 * src/derives.c (derives_compute): Do not subtract NTOKENS from
10942 the pointer DSET returned by malloc; this isn't portable.
10943 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
10944 Similarly for DERIVES.
10945 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
10946 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
10947 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
10948
10949 * src/derives.c (derives_compute): Do not bother invoking
10950 int_of_rule_number, since rule numbers are integers.
10951
10952 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
10953 rather than XMALLOC (char, N).
10954
10955 * src/files.c (filename_split): Rewrite to avoid cast.
10956
10957 * src/gram.h (symbol_number_as_item_number,
10958 item_number_as_symbol_number, rule_number_as_item_number,
10959 item_number_as_rule_number):
10960 Now inline functions rather than macros, to avoid casts.
10961 * src/state.h (state_number_as_int): Likewise.
10962 * src/tables.c (state_number_to_vector_number,
10963 symbol_number_to_vector_number): Likewise.
10964
10965 * src/gram.h (int_of_rule_number): Remove; no longer used.
10966
10967 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
10968 since the resulting storage is always stored into.
10969
10970 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
10971 where it's needed.
10972
10973 * src/muscle_tab.c (muscle_m4_output):
10974 Now inline. Return bool, not int.
10975 * src/state.c (state_compare): Likewise.
10976 * src/symtab.c (symbol_check_defined,
10977 symbol_check_alias_consistency, symbol_pack, symbol_translation,
10978 hash_compare_symbol, hash_symbol):
10979 Likewise.
10980 * src/uniqstr.c (uniqstr_print): Likewise.
10981 * src/muscle_tab.c (muscle_m4_output_processor):
10982 New function, to avoid casts.
10983 * src/state.c (state_comparator, stage_hasher): Likewise.
10984 * src/symtab.c (symbol_check_defined_processor,
10985 symbol_check_alias_consistency_processor, symbol_pack_processor,
10986 symbol_translation_processor, hash_symbol_comparator,
10987 hash_symbol_hasher): Likewise.
10988 * src/uniqstr.c (uniqstr_print_processor): Likewise.
10989 * src/muscle_tab.c (muscles_m4_output):
10990 Use new functions instead of casting old functions unportably.
10991 * src/state.c (state_hash_new): Likewise.
10992 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
10993 symbols_token_translations_init):
10994 Likewise.
10995 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
10996
10997 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
10998 var instead of casting to long, to avoid casts.
10999 (prepare_states): Use MALLOC rather than alloca, so that we don't
11000 have to worry about alloca.
11001 * src/state.c (state_hash_lookup): Likewise.
11002
11003 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
11004 local var instead of casting to unsigned char, to avoid casts.
11005
11006 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
11007 STATE_ALLOC): Remove.
11008 (transitions_new, errs_new, reductions_new, state_new): Use malloc
11009 rather than calloc, and use offsetof to avoid allocating slightly
11010 too much storage.
11011 (state_new): Initialize all members.
11012
11013 * src/state.c (state_hash): Use unsigned accumulator, not signed.
11014
11015 * src/symtab.c (symbol_free): Remove; unused.
11016 (symbol_get): Remove cast in lhs of assignment.
11017 (symbols_do): Now static. Accept generic arguments, not
11018 hashing-related ones.
11019
11020 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
11021 (symbol_processor): Remove.
11022 (symbols_do): Remove decl; now static.
11023
11024 * src/system.h (alloca): Remove; decl no longer needed.
11025 (<stddef.h>): Include, for offsetof.
11026 (<inttypes.>, <stdint.h>): Include if available.
11027 (uintptr_t): New type, if system lacks it.
11028 (CALLOC, MALLOC, REALLOC): New macros.
11029 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
11030 new macros.
11031
11032 * src/tables.c (table_size): Now int, to pacify GCC.
11033 (table_grow, table_ninf_remap): Use signed table size.
11034 (save_row): Don't bother initializing locals when not needed.
11035 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
11036 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
11037
11038 * src/vcg.h: Correct misspellings.
11039
11040 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
11041
11042
11043 * src/getargs.c (getargs): Don't assume EOF == -1.
11044
26b4a969
PE
110452002-12-09 Paul Eggert <eggert@twinsun.com>
11046
11047 Change identifier spellings to avoid collisions with names
11048 that are reserved by POSIX.
11049
11050 Don't use names ending in _t, since POSIX reserves them.
11051 For consistency, remove _e and _s endings -- they're weren't
11052 needed to remove ambiguity. All uses changed.
11053 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
11054 turn was just renamed from struniq_t.
11055 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
11056 which in turn was just renamed from struniq_processor_t.
11057 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
11058 in turn was renamed from hash_compare_struniq_t.
11059 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
11060 (state_list): Renamed from state_list_t.
11061 * src/assoc.h (assoc): Renamed from assoc_t.
11062 * src/conflicts.c (enum conflict_resolution): Renamed from
11063 enum conflict_resolution_e.
11064 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
11065 (rule_list): Renamed from rule_list_t.
11066 * src/getargs.h (enum trace): Renamed from enum trace_e.
11067 (enum report): Renamed from enum report_e.
11068 * src/gram.h (item_number): Renamed from item_number_t.
11069 (rule_number): Renamed from rule_number_t.
11070 (struct rule_s): Remove the "rule_s" part; not used.
11071 (rule): Renamed from rule_t.
11072 (rule_filter): Renamed from rule_filter_t.
11073 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
11074 (goto_list): Renamed from goto_list_t.
11075 * src/lalr.h (goto_number): Renamed from goto_number_t.
11076 * src/location.h (location): Renamed from location_t.
11077 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
11078 and moved here from:
11079 * src/muscle_tab.h (muscle_entry_t): here.
11080 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
11081 (rule_list): Renamed from rule_list_t.
11082 * src/print_graph.c (static_graph): Renamed from graph.
11083 * src/reader.h (braced_code): Renamed from braced_code_t.
11084 Remove brace_code_e tag.
11085 * src/relation.h (relation_node): Renamed from relation_node_t.
11086 (relation_nodes): Renamed from relation_nodes_t.
11087 (relation): Renamed from relation_t.
11088 * src/state.h (state_number): Renamed from state_number_t.
11089 (struct state): Renamed from struct state_s.
11090 (state): Renamed from state_t.
11091 (transitions): Renamed from transitions_t. Unused (and
11092 misspelled) transtion_s tag removed.
11093 (errs): Renamed from errs_t. Unused errs_s tag removed.
11094 (reductions): Renamed from reductions_t. Unused tag
11095 reductions_s removed.
11096 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
11097 (struct symbol_list): Renamed from struct symbol_list_s.
11098 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
11099 (struct symbol): Renamed from struct symbol_s.
11100 (symbol): Renamed from symbol_t.
11101 * src/tables.c (vector_number): Renamed from vector_number_t.
11102 (action_number): Renamed from action_t.
11103 * src/tables.h (base_number): Renamed from base_t.
11104 * src/vcg.h (enum color): Renamed from enum color_e.
11105 (enum textmode): Renamed from enum textmode_e.
11106 (enum shape): Renamed from enum shape_e.
11107 (struct colorentry): Renamed from struct colorentry_s.
11108 (struct classname): Renamed from struct classname_s.
11109 (struct infoname): Renamed from struct infoname_s.
11110 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
11111 (enum decision): Renamed from enum decision_e.
11112 (enum orientation): Renamed from enum orientation_e.
11113 (enum alignment): Renamed from enum alignment_e.
11114 (enum arrow_mode): Renamed from enum arrow_mode_e.
11115 (enum crossing_type): Renamed from enum crossing_type_e.
11116 (enum view): Renamed from enum view_e.
11117 (struct node): Renamed from struct node_s.
11118 (node): Renamed from node_t.
11119 (enum linestyle): Renamed from enum linestyle_e.
11120 (enum arrowstyle): Renamed from enum arrowstyle_e.
11121 (struct edge): Renamed from struct edge.
11122 (edge): Renamed from edge_t.
11123 (struct graph): Renamed from struct graph_s.
11124 (graph): Renamed from graph_t.
11125 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
11126 Rename value_t -> value.
11127 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
11128 value_t_as_yystype -> value_as_yystype.
11129
11130 Don't include <errno.h> in the mainstream code, since it
11131 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
11132 * lib/get-errno.c, lib/get-errno.h: New files.
11133 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
11134 get-errno.c.
11135 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
11136 * src/output.c (output_skeleton): Likewise.
11137 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
11138 instead of errno.
11139 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
11140 Likewise.
11141 (handle_action_dollar, handle_action_at): Likewise.
11142 * src/system.h: Do not include <errno.h>.
11143 (TAB_EXT): Renamed from EXT_TAB.
11144 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
11145
11146 Avoid str[a-z]*, since <string.h> reserves that name space.
11147 Change all instances of "struniq" in names to "uniqstr", and
11148 likewise for "STRUNIQ" and "UNIQSTR".
11149 * src/uniqstr.c: Renamed from src/struniq.c.
11150 * src/uniqstr.h: Renamed from src/struniq.h.
11151 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
11152 * src/files.c (strsuffix): Remove; unused.
11153 (concat2): Renamed from stringappend. Now static.
11154 * src/files.h (strsuffix, stringappend): Remove; unused.
11155 * src/parse-gram.y (<chars>): Renamed from <string>.
11156 (<uniqstr>): Renamed from <struniq>.
11157 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
11158 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
11159 (struct graph_s.expand): Renamed from struct graph_s.stretch.
11160 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
11161 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
11162 (N_EXPAND): Renamed from N_STRETCH.
11163
11164 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
11165 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
11166 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
11167 Remove; unused.
11168 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
11169 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
11170 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
11171 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
11172 (BASE_MAXIMUM): Renamed from BASE_MAX.
11173 (BASE_MINIMUM): Renamed from BASE_MIN.
11174 (ACTION_MAX): Remove; unused.
11175 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
11176 Unnecessary casts removed from above defines.
11177
11178
11179 Fix misspelling in names.
11180 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
11181 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
11182 G_NODE_ALIGNEMENT.
11183
11184
11185 * lib/timevar.c (timevar_report): Renamed from time_report,
11186 for consistency with other names.
11187 * lib/timevar.h (timevar_report): New decl.
11188 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
11189
11190
11191 Sort include-file uses.
11192
11193 Reorder all include files under src to be in the order "system.h".
11194 then the ../lib include files in angle brackets (alphabetized),
11195 then the . include files in double-quotes (alphabetized). Fix
11196 dependency breakages encountered in this process, as follows:
11197 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
11198 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
11199 * src/state.h: Include "symtab.h".
11200
996b1c7e
PE
112012002-12-08 Paul Eggert <eggert@twinsun.com>
11202
11203 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
11204 since this causes problems when __file__ contains character
11205 sequences like "@" that are treated specially by src/scan-skel.l.
11206 Instead, just use the file's basename. This fixes the bug
11207 reported by Martin Mokrejs in
161a71f3 11208 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 11209
e19c4e5d
PE
112102002-12-06 Paul Eggert <eggert@twinsun.com>
11211
11212 Add support for rules that do not have trailing semicolons, as
11213 POSIX requires. Improve the quality of locations in Bison
11214 diagnostics.
26b4a969 11215
e19c4e5d
PE
11216 * src/location.c: Include <quotearg.h>.
11217 (empty_location): Now const.
11218 (location_print): New function. Follow the recommendation of the
11219 GNU Coding Standards for locations that span file boundaries.
11220 * src/location.h: Do not include <quotearg.h>; no longer needed.
11221 (boundary): New type.
11222 (location_t): Use it. This allows locations to span file boundaries.
11223 All member uses changed: file -> start.file or end.file (as needed),
11224 first_line -> start.line, first_column -> start.column,
11225 last_line -> end.line, last_column -> end.column.
11226 (equal_boundaries): New function.
11227 (LOCATION_RESET, LOCATION_STEP): Remove.
11228 (LOCATION_PRINT): Remove. All callers changed to use location_print.
11229 (empty_location): Now const.
11230 (location_print): New decl.
11231 * src/parse-gram.y (lloc_default): New function, which handles
11232 empty locations more accurately.
11233 (YYLLOC_DEFAULT): Use it.
11234 (%token COLON): Remove.
11235 (%token ID_COLON): New token.
26b4a969 11236 (rules): Use it.
e19c4e5d
PE
11237 (declarations, rules): Remove trailing semicolon.
11238 (declaration, rules_or_grammar_declaration):
11239 Allow empty (";") declaration.
11240 (symbol_def): Remove empty actions; no longer needed.
11241 (rules_or_grammar_declaration): Remove trailing semicolon.
11242 (semi_colon.opt): Remove.
11243 * src/reader.h: Include location.h.
11244 (scanner_cursor): New decl.
11245 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
11246 rolling our own.
11247 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
11248 of *loc.
11249 (STEP): Remove. No longer needed, now that adjust_location does
11250 the work. All uses removed.
11251 (scanner_cursor): New var.
11252 (adjust_location): Renamed from extend_location. It now sets
11253 *loc and adjusts the scanner cursor. All uses changed.
11254 Don't bother testing for CR.
11255 (handle_syncline): Remove location arg; now updates scanner cursor.
11256 All callers changed.
11257 (unexpected_end_of_file): Now accepts start boundary of token or
11258 comment, not location. All callers changed. Update scanner cursor,
11259 not the location.
11260 (SC_AFTER_IDENTIFIER): New state.
11261 (context_state): Renamed from c_context. All uses changed.
11262 (id_loc, code_start, token_start): New local vars.
11263 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
11264 processing of Yacc white space and equivalents here.
11265 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
11266 instead of returning ID immediately, since we need to search for
11267 a subsequent colon.
11268 (<INITIAL>"'", "\""): Save token_start.
11269 (<INITIAL>"%{", "{", "%%"): Save code_start.
11270 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
11271 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
11272 BEGIN context_state at end, not INITIAL.
11273 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
11274 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
11275 Return correct token start.
11276 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
11277 the start of a character, string or multiline comment is found.
11278 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
11279 Reduction): Adjust reported locations to match the more-precise
11280 results now expected.
11281 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
11282 * tests/reduce.at (Useless Rules, Reduced Automaton,
11283 Underivable Rules): Likewise.
11284 * tests/regression.at (Invalid inputs): No longer `expecting ";"
11285 or "|"' now that so many other tokens are allowed by the new grammar.
11286
11287 * src/complain.h (current_file): Remove duplicate decl;
11288 current_file is now owned by files.h.
11289 * src/complain.c, src/scan-gram.l: Include files.h.
11290
112912002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 11292
e19c4e5d
PE
11293 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
11294 promotes to int; it might be unsigned int.
11295 * data/yacc.c (yy_reduce_print): Likewise.
11296
11297 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
11298 be #defined in the prologue, not in the Bison declarations.
11299 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 11300
b64755e3
PE
113012002-12-02 Paul Eggert <eggert@twinsun.com>
11302
11303 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
11304 * lib/strtoul.c: New file, from gnulib.
11305 This fixes a porting bug reported by Peter Klein in
161a71f3 11306 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 11307
6e746484
PE
113082002-11-30 Paul Eggert <eggert@twinsun.com>
11309
b64755e3
PE
11310 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
11311 and put only a forward declaration in the prologue. This is for
11312 consistency with the other scanner helper functions.
11313
6ba55592
PE
11314 Type clashes now generate warnings, not errors, since it
11315 appears that POSIX may allow some grammars with type clashes.
11316 * src/reader.c (grammar_current_rule_check): Warn about
11317 type clashes instead of complaining.
11318 * tests/input.at (Type Clashes): Expect warnings, not complaints.
11319
6e746484
PE
11320 Add Yacc library, since POSIX requires it.
11321 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
11322 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
11323 * lib/main.c, lib/yyerror.c: New files.
11324
11325 gram_error can be static; it need not be extern.
11326 * src/reader.h (gram_error): Remove decl.
11327 * src/parse-gram.y (gram_error): Now static. Add static decl.
11328 (print_token_value): Omit parameter names from forward decl,
11329 for consistency.
11330
88510f9c
PE
113312002-11-29 Paul Eggert <eggert@twinsun.com>
11332
6e746484
PE
11333 * doc/bison.texinfo: Emphasize that yylex and yyerror must
11334 be declared before being used. E.g., one should typically
11335 declare them in the prologue. Use GNU coding style in examples.
11336 Put "const" consistently after the type it modifies. Mention
11337 that C99 supports "inline". Mention that yyerror traditionally
11338 returns "int".
11339
88510f9c
PE
11340 %parse-param and %lex-param now take just one argument, the
11341 declaration; the argument name is deduced from the declaration.
11342
11343 * doc/bison.texinfo (Parser Function, Pure Calling, Error
11344 Reporting, Table of Symbols): Document this.
11345 * src/parse-gram.y (add_param): New function.
11346 (COMMA): Remove.
11347 (declaration): Implement new rule for %parse-param and %lex-param.
11348 * src/scan-gram.l: "," now elicits a warning, rather than being
11349 a token; this is more compatible with byacc.
11350 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
11351
bb92250c
PE
113522002-11-27 Paul Eggert <eggert@twinsun.com>
11353
11354 Rename identifiers to avoid real and potential collisions.
11355
11356 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
11357 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 11358 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
11359 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11360 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
11361 * src/parse-gram.y (print_token_value): Renamed from yyprint.
11362 All uses changed.
11363 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
11364 The name "yycontrol" violates the name space rules, and this stuff
11365 wasn't being used anyway.
11366 (input): Remove action; this stuff wasn't being used.
11367 (gram_error): Rename local variable yylloc -> loc.
11368 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
11369 (YY_DECL): Don't use "yy" at start of local variables.
11370 All uses changed, e.g., yylloc -> loc.
11371 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
11372 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
11373 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
11374 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
11375
11376 * src/parse-gram.y (gram_error): loc is now const *.
11377 * src/reader.h (gram_error): Likewise.
11378
3af4feb2
PE
113792002-11-24 Paul Eggert <eggert@twinsun.com>
11380
11381 Version 1.75c.
11382
11383 * tests/actions.at (Actions after errors): Use an output format
11384 more similar to that of the Printers and Destructors test.
11385 Test the position of the ';' token too.
11386 (Printers and Destructors): Likewise.
11387 (Printers and Destructors: %glr-parser): Remove for now, to avoid
11388 unnecessarily alarming people when the test fails.
11389
11390 * data/yacc.c (yyerrlab1): Move this label down, so that the
11391 parser does not discard the lookahead token if the user code
11392 invokes YYERROR. This change is required for POSIX conformance.
11393
11394 * lib/error.c: Sync with gnulib.
11395
113962002-11-22 Paul Eggert <eggert@twinsun.com>
11397
11398 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
11399 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
11400 * lib/xmalloc.c: Likewise.
26b4a969 11401
58004308
PE
114022002-11-20 Paul Eggert <eggert@twinsun.com>
11403
11404 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
11405
114062002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 11407
58004308
PE
11408 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
11409 should use `if (! x) abort ();' rather than `assert (x);', and
11410 anyway it's one less thing to worry about configuring.
11411
11412 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
11413 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
11414 and replace all instances of assert with abort.
11415 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11416 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
11417
11418 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
11419 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
11420 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
11421 hash_find_entry, hash_rehash, hash_insert): Likewise.
11422 * src/conflicts.c (resolve_sr_conflict): Likewise.
11423 * src/lalr.c (set_goto_map, map_goto): Likewise.
11424 * src/nullable.c (nullable_compute): Likewise.
11425 * src/output.c (prepare_rules, token_definitions_output): Likewise.
11426 * src/reader.c (packgram, reader): Likewise.
11427 * src/state.c (state_new, state_free, state_transitions_set,
11428 state_reduction_find): Likewise.
11429 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
11430 symbol_pack): Likewise.
11431 * src/tables.c (conflict_row, pack_vector): Likewise.
11432 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11433 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11434 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
11435 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
11436
11437 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
11438 (ARGMATCH_CONSTRAINT): New macro.
11439 (ARGMATCH_ASSERT): Use it.
11440
11441 * src/system.h (verify): New macro.
11442 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
11443 rather than assert.
11444 * src/tables.c (tables_generate): Likewise.
11445
11446 * src/struniq.c (struniq_assert): Now returns void, and aborts
11447 if the assertion is false.
11448 (struniq_assert_p): Remove.
11449 * src/struniq.h: Likewise.
11450
76ae8198
PE
114512002-11-18 Paul Eggert <eggert@twinsun.com>
11452
11453 * data/glr.c (yygetLRActions): Replace `yyindex' with
11454 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
11455 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 11456 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 11457
d3c4e709
AD
114582002-11-18 Akim Demaille <akim@epita.fr>
11459
11460 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
11461 space.
11462 From Tim Van Holder.
11463
8d8a7238
PE
114642002-11-17 Paul Eggert <eggert@twinsun.com>
11465
11466 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
11467 to "SyntaxError" for consistency with my 2002-11-15 change.
11468
11469 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
11470 not define to {}, since this breaks the common use of `YYDPRINTF
11471 ((...));' if a single statement is desired (e.g. before `else').
11472 Work around GCC warnings by surrounding corresponding calls with
11473 {} if needed.
11474 (yyhasResolvedValue): Remove unused function.
11475 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
11476 loop body.
11477 (yyreportSyntaxError): Renamed from yyreportParseError.
11478 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
11479 All uses changed.
11480 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
11481 extern when possible. Remove unused initializations.
11482
b0937b22
AD
114832002-11-16 Akim Demaille <akim@epita.fr>
11484
11485 Augment the similarity between GLR and LALR traces.
11486
11487 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
11488 (YY_REDUCE_PRINT): New.
11489 (yyparse): Use them.
11490 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
11491 YYDPRINT here.
11492 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
11493 state reached after the reduction/recovery, since...
11494 (yyparse, yyprocessOneStack): Report the state we are entering in.
11495
c5e3e510
AD
114962002-11-16 Akim Demaille <akim@epita.fr>
11497
11498 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
11499 Add support for --trace=skeleton.
11500 * src/scan-skel.l: %option debug.
11501 Scan strings of non-@ or \n instead of character by character.
11502 (scan_skel): Handle trace_skeleton.
11503 (QPUTS): New.
11504 (@output_parser_name@, @output_header_name@): ``Restore'' their
11505 support (used to be M4 macros).
11506 * data/yacc.c: Quote larger chunks, a la glr.c.
11507 * data/lalr1.cc: Likewise.
11508 The header guards are no longer available, so use some other
11509 string than `YYLSP_NEEDED'.
11510
4c6cc1db
AD
115112002-11-16 Akim Demaille <akim@epita.fr>
11512
11513 Make the ``Printers and Destructors'' test more verbose, taking
11514 `yacc.c''s behavior as (possibly wrong) reference.
11515
11516 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
11517 instead of fprint on stdout.
11518 Set and report the last_line of the symbols.
11519 Consistently display values and locations.
11520
6d9e8019
PE
115212002-11-16 Paul Eggert <eggert@twinsun.com>
11522
11523 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
11524
6e649e65
PE
115252002-11-15 Paul Eggert <eggert@twinsun.com>
11526
b25d88f6
PE
11527 * tests/actions.at (Actions after errors): New test case.
11528
6e649e65
PE
11529 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
11530 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
11531 tests/action.at, tests/calc.at, tests/conflicts.at,
11532 tests/cxx-type.at, tests/regression.at:
11533 "parse error" -> "syntax error" for POSIX compatibility.
11534 "parsing stack overflow..." -> "parser stack overflow" so
11535 that code matches Bison documentation.
11536
0f39aab9
AD
115372002-11-15 Akim Demaille <akim@epita.fr>
11538
11539 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
11540 take two BRACED_CODE, not two string_content.
11541 Free the scanner's obstack when we are done.
11542 (code_content): New.
11543 * tests/calc.at: Adjust.
11544 * doc/bison.texinfo: Adjust.
11545 Also, make sure to include the `,' for these declarations.
11546
761c1926
AD
115472002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
11548
11549 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
11550 definition; avoids potential autoreconf problems.
11551
b0f98b10
AD
115522002-11-15 Akim Demaille <akim@epita.fr>
11553
11554 Always check the value returned by yyparse.
11555
11556 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
11557 returned by yyparse.
11558 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
11559 Adjust calls.
11560 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
11561 returned by yyparse.
11562
970785f1
PH
115632002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11564
11565 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
11566 on input.at test.
11567
8fcc7db1
PE
115682002-11-14 Paul Eggert <eggert@twinsun.com>
11569
7ec1b48e
PE
11570 * src/output.c (output_skeleton): Call xfopen instead of
11571 duplicating xfopen's body.
11572
cfff7583 11573 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 11574 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 11575
8fcc7db1
PE
11576 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
11577 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
11578 Group compiler. Instead, use "$CC -E bar.c". Include the .h
11579 file twice in the grammar, as an extra check.
11580
11581 * tests/input.at (Torturing the Scanner): Surround the
11582 backslash-newline tests with "#if 0", to make it less likely that
11583 we'll run into compiler bugs. Bring back solitary \ inside
11584 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 11585 test backslash-newline in C character constant.
8fcc7db1 11586
4e8d992c
AD
115872002-11-14 Akim Demaille <akim@epita.fr>
11588
11589 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
11590 status of the compiler.
f32b346d 11591 Calling `exit 1' is no longer needed.
4e8d992c
AD
11592 Reported by Nelson H. F. Beebe.
11593
9501dc6e
AD
115942002-11-14 Akim Demaille <akim@epita.fr>
11595
11596 * tests/atlocal.in (CPPFLAGS): We have config.h.
11597 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
11598 New.
11599 * tests/actions.at, tests/calc.at, tests/conflicts.at,
11600 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
11601 * tests/regression.at, tests/torture.at: Use them for all the
11602 grammars that are to be compiled.
11603 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
11604 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
11605 * doc/bison.texinfo (GLR Parsers): Document `inline'.
11606
18b519c0
AD
116072002-11-14 Akim Demaille <akim@epita.fr>
11608
11609 * doc/bison.texinfo: Various formatting changes (alignments in
11610 samples, additional @group/@end group, GCS in samples.
11611 Use @deffn instead of simple @table to define the directives,
11612 macros, variables etc.
11613
9a86cdb9
PE
116142002-11-13 Paul Eggert <eggert@twinsun.com>
11615
daa33def 11616 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 11617 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 11618
daa33def 11619 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 11620 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
11621 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
11622 * tests/headers.at (export YYLTYPE): Likewise.
11623
11624 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 11625 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 11626
9a86cdb9
PE
11627 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
11628 comments, since they're not portable. Use GNU coding style.
11629
9c1e26bd
AD
116302002-11-13 Akim Demaille <akim@epita.fr>
11631
11632 * data/yacc.c: Leave bigger chunks of quoted text.
11633 (YYDSYMPRINTF): New.
11634 Use it to report symbol activities.
11635 * data/glr.c (YYDSYMPRINTF): New.
11636 Use it.
11637
87f721cc
PE
116382002-11-12 Paul Eggert <eggert@twinsun.com>
11639
11640 Version 1.75b.
11641
11642 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
11643 (yyglrReduce): Return yyok, not 0.
11644 This should avoid the enumerated-type warnings reported
464c6927 11645 by Nelson H. F. Beebe in
161a71f3 11646 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
11647
11648 * lib/bbitset.h (BITSET_INLINE): Remove.
11649 * lib/bitset.h [! BITSET_INLINE]: Remove.
11650 (bitset_set, bitset_reset, bitset_test): Rename local vars
11651 to avoid shadowing warnings by GCC.
11652
11653 * data/glr.c (inline): Remove #define. It's the user's
11654 responsibility to #define it away, just like 'const'.
464c6927 11655 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 11656 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 11657
87f721cc
PE
11658 * Makefile.maint (po-check): Scan .l and .y files instead of the
11659 .c and the .h files that they generate. This fixes the bug
11660 reported by Tim Van Holder in:
161a71f3 11661 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
11662 Look for N_ as well as for _. Try to avoid matching #define for
11663 N_ and _.
11664 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
11665 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
11666 * src/scan-gram.l: Revamp regular expressions so that " and '
11667 do not confuse xgettext.
11668
11669 * src/struniq.h (struniq_new): Do not declare the return type
11670 to be 'const'; this violates the C standard.
11671 * src/struniq.c (struniq_new): Likewise.
11672
be14ade5
AD
116732002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
11674
11675 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
11676 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
11677 linker.
11678
05291fbc
AD
116792002-11-12 Akim Demaille <akim@epita.fr>
11680
11681 * Makefile.maint: Sync with Autoconf:
11682 (local_updates): New.
11683
1f5fd52e
AD
116842002-11-12 Akim Demaille <akim@epita.fr>
11685
11686 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
11687
283f1e64
AD
116882002-11-12 Akim Demaille <akim@epita.fr>
11689
11690 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
11691 locations.
11692
886b69d1
AD
116932002-11-12 Akim Demaille <akim@epita.fr>
11694
11695 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
11696 not yyvalue.
11697
3df37415
AD
116982002-11-12 Akim Demaille <akim@epita.fr>
11699
11700 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
11701 Use it to test the GLR parser.
11702
7bd6c77e
AD
117032002-11-12 Akim Demaille <akim@epita.fr>
11704
11705 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
11706 defines it.
11707 * data/glr.c (yystos): New.
11708 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
11709 (YYDSYMPRINT): New.
11710 (yyval): Don't define it, it is handled via M4.
11711 (yyrecoverParseError): Free verbosely the discarded symbols.
11712 * data/yacc.c (yysymprint): Remove, rather...
11713 (b4_yysymprint_generate): invoke.
11714 * data/c.m4 (b4_yysymprint_generate): New.
11715 Accept pointers as arguments, as opposed to the version from
11716 yacc.c.
11717 (b4_yydestruct_generate): Likewise.
11718 * tests/cations.at (Printers and Destructors): Use Bison directives
11719 instead of CPP macros.
11720 Don't rely on internal details.
11721
b0400cc6
AD
117222002-11-12 Akim Demaille <akim@epita.fr>
11723
11724 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
11725 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
11726 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
11727 it against YYEMPTY and so forth), work on yytoken (i.e., set
11728 it to YYEMPTY etc.).
11729 (yydestruct): Replace with a b4_yydestruct_generate invocation.
11730 (b4_symbol_actions): Remove.
11731 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
11732 for 0, end-of-input.
11733
72f889cc
AD
117342002-11-12 Akim Demaille <akim@epita.fr>
11735
11736 * doc/bison.texinfo (Destructor Decl): New.
11737
b1ae9233
AD
117382002-11-12 Akim Demaille <akim@epita.fr>
11739
11740 * src/tables.c (tables_generate): Use free for pointers that
11741 cannot be NULL, not XFREE.
11742 (pack_vector): Use assert, not fatal, for bound violations.
11743 * src/state.c (state_new): Likewise.
11744 * src/reader.c (reader): Likewise.
11745 * src/lalr.c (set_goto_map): Likewise.
72f889cc 11746 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
11747 the file name.
11748
7ec2d4cd
AD
117492002-11-12 Akim Demaille <akim@epita.fr>
11750
11751 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
11752 Restore.
11753 * src/scan-gram.l (last_string): Is global to the file, not to
11754 yylex.
11755 * src/parse-gram.y (input): Don't append the epilogue here,
11756 (epilogue.opt): do it here, and free the scanner's obstack.
11757 * src/reader.c (epilogue_set): Rename as...
11758 (epilogue_augment): this.
11759 * data/c.m4 (b4_epilogue): Defaults to empty.
11760
573a6cd3
AD
117612002-11-12 Akim Demaille <akim@epita.fr>
11762
11763 * src/getargs.c (long_options): Remove duplicates.
11764 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
11765 Remove.
11766 * doc/bison.rnh: Remove.
11767 * doc/bison.texinfo (VMS Invocation): Remove.
11768
95612cfa
AD
117692002-11-12 Akim Demaille <akim@epita.fr>
11770
11771 * src/struniq.h, src/struniq.c (struniq_t): Is const.
11772 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
11773
11774 Use struniq for symbols.
11775
11776 * src/symtab.h (symbol_t): The tag member is a struniq.
11777 (symbol_type_set): Adjust.
11778 * src/symtab.c (symbol_new): Takes a struniq.
11779 (symbol_free): Don't free the tag member.
11780 (hash_compare_symbol_t, hash_symbol_t): Rename as...
11781 (hash_compare_symbol, hash_symbol): these.
11782 Use the fact that tags as struniqs.
11783 (symbol_get): Use struniq_new.
11784 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
11785 Returns a strniq.
11786 * src/reader.h (merger_list, grammar_currentmerge_set): The name
11787 and type members are struniqs.
11788 * src/reader.c (get_merge_function)
11789 (grammar_current_rule_merge_set): Adjust.
11790 (TYPE, current_type): Are struniq.
11791
11792 Use struniq for file names.
11793
11794 * src/files.h, src/files.c (infile): Split into...
11795 (grammar_file, current_file): these.
11796 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
11797 * src/reduce.c (reduce_print): Likewise.
11798 * src/getargs.c (getargs): Likewise.
11799 * src/complain.h, src/complain.c: Likewise.
11800 * src/main.c (main): Call struniqs_new early enough to use it for
11801 file names.
11802 Don't free the input file name.
11803
3e6656f9
AD
118042002-11-12 Akim Demaille <akim@epita.fr>
11805
11806 * src/symtab.c (symbol_free): Remove dead deactivated code:
11807 type_name are properly removed.
11808 Don't use XFREE to free items that cannot be NULL.
11809 * src/struniq.h, src/struniq.c: New.
11810 * src/main.c (main): Initialize/free struniqs.
11811 * src/parse-gram.y (%union): Add astruniq member.
11812 (yyprint): Adjust.
11813 * src/scan-gram.l (<{tag}>): Return a struniq.
11814 Free the obstack bit that used to store it.
11815 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
11816
7672019c
PE
118172002-11-11 Paul Eggert <eggert@twinsun.com>
11818
11819 Revamp to fix many (but not all) of the C- and M4-related quoting
11820 problems. Among other things, this fixes the Bison bug reported
11821 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 11822 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
11823
11824 Use new @ escapes consistently. Represent brackets with @{ and @}
11825 rather than @<:@ and @:>@, since this works a bit better with dumb
11826 editors like vi. Represent @ with @@, since @ is now consistently
11827 an escape. Use @oline@ and @ofile@ rather than __oline__ and
11828 __ofile__, to avoid unexpected expansions. Similarly, use @output
11829 rather than #output.
11830
11831 * data/c.m4 (b4_copyright): Omit file name from comment, since
11832 the file name could contain "*/".
11833 (b4_synclines_flag): Don't quote the 2nd argument; it should already
11834 be quoted. All uses changed.
11835
11836 * data/glr.c: Use new @ escapes consistently.
11837 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
11838 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
11839 Remove, since they couldn't handle arbitrary characters in file
11840 names.
11841 * data/lalr1.cc: Likewise.
11842 * data/yacc.c: Likewise.
11843
11844 * src/files.c (output_infix): Remove; all uses removed.
11845 * src/files.h: Likewise.
11846
11847 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
11848 mishandled funny characters in file names, and anyway it isn't
11849 needed any more.
11850 * data/yacc.c: Likewise.
11851 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
11852
11853 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
11854 * data/yacc.c: Likewise.
11855
11856 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
11857 strings now.
11858 (muscle_init): Quote filename as a C string.
11859 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
11860 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
11861 * src/output.c (escaped_file_name_output): New function.
11862 (prepare_symbols): Quote tokens for M4.
11863 (prepare): Don't insert output_infix, output_prefix,
11864 output_parser_name, output_header_name; this is now down by scan-skel.
11865 Insert skeleton as a C string.
11866
11867 * src/output.c (user_actions_output, symbol_destructors_output,
11868 symbol_printers_output): Quote filenames for C and M4.
11869 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11870
11871 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
11872 escapes other than \\ and \'; this simplifies the code.
11873 (<SC_STRING>): Likewise, for \\ and \".
11874 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
11875 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
11876 Use new escapes @{ and @} for [ and ].
11877
11878 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
11879 them with auto vars.
11880 Switch to new escape scheme, where @ is the escape character uniformly.
11881 Abort if a stray escape character is found. Avoid unbounded input
11882 buffer when parsing non-escaped text.
11883
11884 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
11885 __oline__, #output, $@, and @{ do not have unintended meanings.
11886
acea4f3b
PE
118872002-11-09 Paul Eggert <eggert@twinsun.com>
11888
11889 Fix the test failure due to GCC warnings described in
161a71f3 11890 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
11891 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
11892 evaluate to 0 if it's impossible for NINF to be in the respective
11893 table.
11894 (yygetLRActions, yyrecoverParseError): Use them.
11895
11896 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
11897 counted in the token inserted at end of file. Now takes
11898 location_t *, not location_t, so that the location can be
11899 adjusted. All uses changed.
11900
11901 * tests/regression.at (Invalid inputs): Adjust wording in
11902 diagnostic to match the new behavior.
11903
11904 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
11905 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
11906 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
11907 abort ();'. This reduces the runtime of the "Many lookaheads"
11908 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
11909 GCC 3.2.
11910
20ef1ad5
PE
119112002-11-07 Paul Eggert <eggert@twinsun.com>
11912
11913 * src/parse-gram.y (CHARACTER): Remove unused token.
11914 All uses removed.
11915
11916 * src/scan-gram.l: Remove stack option. We no longer use the
11917 stack, since the stack was never deeper than 1; instead, use the
11918 new auto var c_context to record the stacked value.
11919
11920 Remove nounput option. At an unexpected end of file, we now unput
11921 the minimal input necessary to end cleanly; this simplifies the
11922 code.
11923
11924 Avoid unbounded token sizes where this is easy.
11925
11926 (unexpected_end_of_file): New function.
11927 Use it to systematize the error message on unexpected EOF.
11928 (last-string): Now auto, not static.
11929 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
11930 (scanner_last_string_free): Remove; not used.
11931 (percent_percent_count): Move decl to just before use.
11932 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
11933 not the (never otherwised-used) CHARACTER.
11934
93724f13
AD
119352002-11-07 Akim Demaille <akim@epita.fr>
11936
11937 Let yyerror always receive the msg as last argument, so that
11938 yyerror can be variadic.
11939
11940 * data/yacc.c (b4_yyerror_args): New.
11941 Use it when calling yyerror.
11942 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
11943 Use it when calling yyerror.
11944 * doc/bison.texinfo (Error Reporting): Adjust.
11945 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
11946 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
11947
6e40b4eb
AD
119482002-11-06 Akim Demaille <akim@epita.fr>
11949
11950 #line should have quoted strings.
11951 Ideally, this should be done by m4_quotearg.
11952
11953 * src/scan-skel.l: Include quotearg.h.
11954 Quote __ofile__.
11955 * src/output.c (symbol_printers_output)
11956 (symbol_destructors_output): Quote the file name.
11957
2dfbfc12
AD
119582002-11-06 Akim Demaille <akim@epita.fr>
11959
11960 * tests/regression.at (Invalid inputs): Adjust to the recent
11961 messages.
11962
437c2d80
AD
119632002-11-06 Akim Demaille <akim@epita.fr>
11964
11965 Restore --no-lines.
11966 Reported by Jim Kent.
11967
11968 * data/c.m4 (b4_syncline): New.
11969 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
11970 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
11971 * src/output.c (user_actions_output): Likewise.
11972 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 11973 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 11974
900c5db5
AD
119752002-11-06 Akim Demaille <akim@epita.fr>
11976
11977 * src/main.c (main): Free `infile'.
11978 * src/scan-gram.l (handle_syncline): New.
11979 Recognize `#line'.
11980 * src/output.c (user_actions_output, symbol_destructors_output)
11981 (symbol_printers_output): Use the location's file name, not
11982 infile.
11983 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11984
e183b123 119852002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 11986
e183b123 11987 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 11988 either has GLR conflict entries.
e183b123 11989
193eb6b7
PE
119902002-11-05 Paul Eggert <eggert@twinsun.com>
11991
e183b123
PE
11992 * src/scan-gram.l: Use more accurate diagnostics, e.g.
11993 "integer out of range" rather than "invalid value".
11994 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
11995 accordingly.
11996
193eb6b7
PE
11997 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
11998 Also, remove one static variable in the scanner.
11999
12000 * src/scan-gram.l (braces_level): Now auto, not static.
12001 Initialize to zero if the compiler is being picky.
12002 (INITIAL): Clear braces_level instead of incrementing it.
12003 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
12004 as POSIX 1003.1-2001 requires.
12005 * src/system.h (IF_LINT): New macro, taken from coreutils.
12006 * configure.ac: Define "lint" if --enable-gcc-warnings.
12007
29c01725
AD
120082002-11-05 Akim Demaille <akim@epita.fr>
12009
12010 * src/scan-gram.l: When it starts with `%', complain about the
12011 whole directive, not just that `invalid character: %'.
12012
8aeac3ca
AD
120132002-11-04 Akim Demaille <akim@epita.fr>
12014
12015 * Makefile.maint: Update from Autoconf.
12016 (update, cvs-update, po-update, do-po-update): New.
12017
793a58bb
AD
120182002-11-04 Akim Demaille <akim@epita.fr>
12019
12020 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
12021 and yyerror.
12022 Have yyerror `use' its arguments.
12023 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
12024 returns true when location & yacc & pure & parse-param.
12025 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
12026
c4d720cd
AD
120272002-11-04 Akim Demaille <akim@epita.fr>
12028
12029 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
12030 clashes.
12031 * src/scan-gram.l: Use [\'] instead of ['] to pacify
12032 font-lock-mode.
12033 Use complain_at.
12034 Use quote, not quote_n since LOCATION_PRINT no longer uses the
12035 slot 0.
12036
613a0dc5
PE
120372002-11-03 Paul Eggert <eggert@twinsun.com>
12038
12039 * src/reader.c (get_merge_function, grammar_current_rule_check):
12040 Use consistent diagnostics for reporting type name clashes.
12041 Quote the types with <>, for consistency with Yacc.
12042 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
12043
2a8d363a
AD
120442002-11-03 Akim Demaille <akim@epita.fr>
12045
12046 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
12047 New.
12048 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
12049 (b4_parse_param): Remove.
12050 Use b4_identification.
12051 Propagate b4_pure_args where needed to pass them to yyerror.
12052 * data/glr.m4 (b4_parse_param): Remove.
12053 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
12054 (b4_lpure_formals): New.
12055 Use b4_identification.
12056 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
12057 b4_user_formals and b4_user_args.
12058 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
12059 (yyreportAmbiguity): When using a pure parser, also need
12060 the location, and the parse-params.
12061 Adjust callers.
12062 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
12063 When using a pure parser, also need the parse-params.
12064 Adjust callers.
12065 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
12066 (%pure-parser + %parse-param) LALR and GLR parsers.
12067 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
12068 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
12069 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
12070 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
12071 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
12072 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
12073 * doc/bison.texinfo: Untabify the whole file.
12074 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
12075 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
12076 (Error Reporting): Adjust to these new directives.
12077 Document %error-verbose, deprecate YYERROR_VERBOSE.
12078
9e32add8
AD
120792002-11-03 Akim Demaille <akim@epita.fr>
12080
12081 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
12082 AT_CHECK_CALC_GLR invocations to use % directives, instead of
12083 command line options.
12084 * tests/cxx-type.at: Formatting changes.
12085
b02d90a5
PE
120862002-11-03 Paul Eggert <eggert@twinsun.com>
12087
12088 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
12089 to count columns correctly, and to check for invalid inputs.
9e32add8 12090
b02d90a5
PE
12091 Use mbsnwidth to count columns correctly. Account for tabs, too.
12092 Include mbswidth.h.
12093 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
12094 (extend_location): New function.
12095 (YY_LINES): Remove.
12096
12097 Handle CRLF in C code rather than in Lex code.
12098 (YY_INPUT): New macro.
12099 (no_cr_read): New function.
12100
12101 Scan UCNs, even though we don't fully handle them yet.
12102 (convert_ucn_to_byte): New function.
12103
12104 Handle backslash-newline correctly in C code.
12105 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
12106 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
12107 all uses changed.
12108 (tag, splice): New EREs. Do not allow NUL or newline in tags.
12109 Use {splice} wherever C allows backslash-newline.
12110 YY_STEP after space, newline, vertical-tab.
12111 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 12112
b02d90a5
PE
12113 (letter, id): Don't assume ASCII; e.g., spell out a-z.
12114
12115 ({int}, handle_action_dollar, handle_action_at): Check for integer
12116 overflow.
9e32add8 12117
b02d90a5
PE
12118 (YY_STEP): Omit trailing semicolon, so that it's more like C.
12119
12120 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
12121 as well as \000. Check for UCHAR_MAX, not 255.
12122 Allow \x with an arbitrary positive number of digits, as in C.
12123 Check for overflow here.
12124 Allow \? and UCNs, for compatibility with C.
12125
12126 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
12127 with quote slot used by complain_at.
12128
12129 * tests/input.at: Add tests for backslash-newline, m4 quotes
12130 in symbols, long literals, and funny escapes in strings.
12131
12132 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
12133 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
12134 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
12135 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
12136 * m4/mbswidth.m4: New file, from GNU coreutils.
12137
12138 * doc/bison.texinfo (Grammar Outline): Document // comments.
12139 (Symbols): Document that trigraphs have no special meaning in Bison,
12140 nor is backslash-newline allowed.
12141 (Actions): Document that trigraphs have no special meaning.
12142
12143 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
12144 no longer used.
12145
121462002-11-02 Paul Eggert <eggert@twinsun.com>
12147
12148 * src/reader.c: Don't include quote.h; not needed.
12149 (get_merge_function): Reword warning to be consistent with
12150 type clash diagnostic in grammar_current_rule_check.
12151
12152 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
12153 bug in trigraph handling.
12154
12155 * src/output.c (prepare_symbols): When printing token names,
12156 escape "[" as "@<:@" and likewise for "]".
12157
12158 * src/system.h (errno): Remove declaration, as we are now
12159 assuming C89 or better, and C89 guarantees errno.
12160
762b212b
PE
121612002-10-30 Paul Eggert <eggert@twinsun.com>
12162
12163 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
12164 Check for close failures.
12165 * src/files.h (xfclose): Return void, not int, since it always
12166 returned zero.
12167 * src/files.c (xfclose): Likewise. Report I/O error if ferror
12168 indicates one.
12169 * src/output.c (output_skeleton): Use xfclose rather than fclose
12170 and ferror. xfclose now checks ferror.
12171
12172 * data/glr.c (YYLEFTMOST_STATE): Remove.
12173 (yyreportTree): Use a stack-based leftmost state. This avoids
12174 our continuing battles with bogus warnings about initializers.
12175
56100c60
AD
121762002-10-30 Akim Demaille <akim@epita.fr>
12177
12178 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
12179 #if.
12180
51b4a04c
PH
121812002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12182
12183 * tests/glr-regr1.at: New test for reported regressions.
12184 * tests/testsuite.at: Add glr-regr1.at test.
12185 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 12186
bf1ebda2
PE
121872002-10-24 Paul Eggert <eggert@twinsun.com>
12188
5c16c6b1
PE
12189 Version 1.75a.
12190
bf1ebda2
PE
12191 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
12192 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
12193 we use malloc. Don't assume 'A' through 'Z' are contiguous.
12194 Don't assume strdup exists; POSIX says its an XSI extension.
12195 Check for buffer overflow on input.
12196
b526ee61
AD
121972002-10-24 Akim Demaille <akim@epita.fr>
12198
12199 * src/output.c (output_skeleton): Don't disable M4sugar comments
12200 too soon: it results in comments being expanded.
12201 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
12202 first output.
12203
f1886bb2
AD
122042002-10-24 Akim Demaille <akim@epita.fr>
12205
12206 * data/yacc.c (m4_int_type): New.
12207 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
12208 char' as only yacc.c wants K&R portability.
12209 * data/glr.c (yysigned_char): Remove.
12210 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
12211 Reported by Quoc Peyrot.
12212
c5576256
PE
122132002-10-23 Paul Eggert <eggert@twinsun.com>
12214
12215 * src/main.c (main): With --trace=time, report times even if a
12216 non-fatal error occurs. Formerly, the times were reported in some
12217 such cases but not in others.
12218 * src/reader.c (reader): Just return if a complaint has been issued,
12219 instead of exiting, so that 'main' can report times.
12220
27b0ffea
AD
122212002-10-22 Akim Demaille <akim@epita.fr>
12222
12223 * src/system.h: Include sys/types.
12224 Reported by Bert Deknuydt.
12225
223a7883
PE
122262002-10-23 Paul Eggert <eggert@twinsun.com>
12227
12228 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
12229 Suggested by Art Haas.
12230
122312002-10-22 Paul Eggert <eggert@twinsun.com>
12232
12233 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
12234 decl; not needed any more.
12235 * src/main.c (main): Use return to exit, undoing yesterday's change.
12236 The last OS that we could find where this wouldn't work is
12237 SunOS 3.5, and that's too old to worry about now.
12238
12239 * data/glr.c (struct yyltype): Define members even when not
12240 doing locations. This is more consistent with yacc.c, and it
12241 works around the following bug reports:
161a71f3
PE
12242 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
12243 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 12244
223a7883
PE
12245 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
12246 @acronym consistently. Standardize on "Yacc" instead of "YACC",
12247 "Algol" instead of "ALGOL". Give a bit more history about BNF.
12248
8b76775a
AD
122492002-10-22 Akim Demaille <akim@epita.fr>
12250
12251 * data/README: New.
12252
6db10d14
PE
122532002-10-21 Paul Eggert <eggert@twinsun.com>
12254
12255 Be consistent about 'bool'; the old code used an enum in one
12256 module and an int in another, and this violates the C standard.
12257 * m4/stdbool.m4: New file, from coreutils 4.5.3.
12258 * configure.ac (AC_HEADER_STDBOOL): Add.
12259 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
12260 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
12261 * src/symtab.c (hash_compare_symbol_t): Likewise.
12262 * src/system.h (bool, false, true): Use a definition consistent
12263 with ../lib/hash.c. All uses changed.
12264
12265 * src/complain.c (warning_issued): Renamed from warn_message_count,
12266 so that we needn't worry about integer overflow (!).
12267 Now of type bool. All uses changed.
12268 (complaint_issued): Renamed from complain_message_count; likewise.
12269
12270 * src/main.c (main): Use exit to exit with failure.
27b0ffea 12271
6db10d14
PE
12272 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
12273 rather than 1 and 0.
12274 * src/main.c (main): Likewise.
12275 * src/getargs.c (getargs): Likewise.
12276 * src/reader.c (reader): Likewise.
12277
12278 * src/getarg.c (getargs): Remove duplicate code for
12279 "Try `bison --help'".
12280
12281 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
12282 What was that "2" for?
12283
12284 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
12285 * src/getargs.c (usage): Likewise.
12286
12287 * src/getargs.c (getargs): When there are too few operands, report
12288 the last one. When there are too many, report the first extra
12289 one. This is how diffutils does it.
12290
92a060fd
PE
122912002-10-20 Paul Eggert <eggert@twinsun.com>
12292
12293 Remove K&R vestiges.
12294 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
12295 * src/complain.c (VA_START): Remove. Assume prototypes.
12296 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
12297 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
12298 fatal): Assume prototypes.
12299 * src/complain.h: Assume prototypes.
12300 * src/system.h (PARAMS): Remove.
12301 Include <limits.h> unconditionally, since it's guaranteeed even
12302 for a freestanding C89 compiler.
12303 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
12304 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 12305
e7cb57c0
AD
123062002-10-20 Akim Demaille <akim@epita.fr>
12307
12308 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
12309 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
12310 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
12311 (yyresolveStates, yyresolveAction, yyresolveStack)
12312 (yyprocessOneStack): Use them.
12313 (yy_reduce_print): New.
12314 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
12315
0245f82d
AD
123162002-10-20 Akim Demaille <akim@epita.fr>
12317
12318 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
12319 arguments and output `void'.
12320 (b4_c_function): Rename as...
12321 (b4_c_function_def): this.
12322 (b4_c_function_decl, b4_c_ansi_function_def)
12323 (b4_c_ansi_function_decl): New.
12324 Change the interpretation of the arguments: before `int, foo', now
12325 `int foo, foo'.
12326 * data/yacc.c (yyparse): Prototype and define thanks to these.
12327 Adjust b4_c_function_def uses.
12328 * data/glr.c (yyparse): Likewise, but ANSI only.
12329
39912f52
AD
123302002-10-20 Akim Demaille <akim@epita.fr>
12331
12332 * src/output.c (prepare): Move the definition of `tokens_number',
12333 `nterms_number', `undef_token_number', `user_token_number_max'
12334 to...
12335 (prepare_tokens): Here.
12336 (prepare_tokens): Rename as...
12337 (prepare_symbols): this.
12338 (prepare): Move the definition of `rules_number' to...
12339 (prepare_rules): here.
12340 (prepare): Move the definition of `last', `final_state_number',
12341 `states_number' to...
12342 (prepare_states): here.
12343 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
12344
20c1e2ad
AD
123452002-10-20 Akim Demaille <akim@epita.fr>
12346
12347 * src/tables.h, src/tables.c, src/output.c: Comment changes.
12348
21964f43
AD
123492002-10-20 Akim Demaille <akim@epita.fr>
12350
12351 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
12352 * data/c.m4: here.
12353
66d30cd4
AD
123542002-10-20 Akim Demaille <akim@epita.fr>
12355
12356 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
12357 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
12358 `pair'.
12359 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
12360 `name' to...
12361 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
12362 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
12363 These.
12364
95f2c9fe
PE
123652002-10-19 Paul Eggert <eggert@twinsun.com>
12366
12367 Do not create a temporary file, as that involves security and
12368 cleanup headaches. Instead, use a pair of pipes.
12369 Derived from a suggestion by Florian Krohm.
12370 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
12371 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
12372 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
12373 (BISON_PREREQ_SUBPIPE): Add.
12374 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
12375 Add subpipe.h, subpipe.c.
12376 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
12377 * po/POTFILES.in: Add lib/subpipe.c.
12378 * src/output.c: Include "subpipe.h".
12379 (m4_invoke): Remove decl.
12380 (scan_skel): New decl.
12381 (output_skeleton): Use pipe rather than temporary file for m4 input.
12382 Check that m4sugar.m4 is readable, to avoid deadlock.
12383 Check for pipe I/O error.
12384 * src/scan-skel.l (readpipe): Remove decl.
12385 (scan_skel): New function, to be used in place of m4_invoke.
12386 Read from stream rather than file.
66d30cd4 12387
95f2c9fe
PE
12388 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
12389 float, as this generates a warning on Solaris 8 + GCC 3.2 with
12390 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
12391 this generates a more-accurate value anyway.
12392
12393 * lib/timevar.c (timervar_accumulate): Rename locals to
12394 avoid confusion with similarly-named more-global.
12395 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
12396
12397 * src/output.c (prepare): Use xstrdup to convert char const *
12398 to char *, to avoid GCC warning.
12399
c19988b7
AD
124002002-10-19 Akim Demaille <akim@epita.fr>
12401
12402 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
12403 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
12404 Use them to have `calc.y' ready for %pure-parser.
12405 * data/yacc.c (YYLEX): Pass a yylex return type to
12406 b4_c_function_call.
12407
ae7453f2
AD
124082002-10-19 Akim Demaille <akim@epita.fr>
12409
12410 Prototype support of %lex-param and %parse-param.
12411
12412 * src/parse-gram.y: Add the definition of the %lex-param and
12413 %parse-param tokens, plus their rules.
12414 Drop the `_' version of %glr-parser.
12415 Add the "," token.
12416 * src/scan-gram.l (INITIAL): Scan them.
12417 * src/muscle_tab.c: Comment changes.
12418 (muscle_insert, muscle_find): Rename `pair' as `probe'.
12419 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
12420 (muscle_entry_s): The `value' member is no longer const.
12421 Adjust all dependencies.
12422 * src/muscle_tab.c (muscle_init): Adjust: use
12423 MUSCLE_INSERT_STRING.
12424 Initialize the obstack earlier.
12425 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
12426 (muscle_pair_list_grow): New.
12427 * data/c.m4 (b4_c_function_call, b4_c_args): New.
12428 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
12429 * tests/calc.at: Use %locations, not --locations.
12430 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
12431
0e575721
AD
124322002-10-19 Akim Demaille <akim@epita.fr>
12433
12434 * src/getargs.c (usage): Take status as argument and exit
12435 accordingly.
12436 Report the traditional `Try ... --help' message when status != 0.
12437 (usage, version): Don't take a FILE * as arg, it is pointless.
12438 (getargs): When there is an incorrect number of arguments, make it
12439 an error, and report it GNUlically thanks to `usage ()'.
12440
724ce7f5
PE
124412002-10-18 Paul Eggert <eggert@twinsun.com>
12442
3a781eb2
PE
12443 * data/glr.c (yyreportParseError): Don't assume that sprintf
12444 yields the length of the printed string, as this is not true
12445 on SunOS 4.1.4. Reported by Peter Klein.
12446
724ce7f5
PE
12447 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
12448 * tests/conflicts.at (%nonassoc and eof): Likewise.
12449 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
12450
473d0a75
AD
124512002-10-17 Akim Demaille <akim@epita.fr>
12452
12453 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
12454 * src/getargs.c (trace_types, trace_args): Adjust.
12455 * src/reader.c (grammar_current_rule_prec_set)
12456 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
12457 Standardize error messages.
12458 And s/@prec/%prec/!
12459 (reader): Use trace_flag to enable scanner/parser debugging,
12460 instead of an adhoc scheme.
12461 * src/scan-gram.l: Remove trailing debugging code.
12462
e76d2469
PE
124632002-10-16 Paul Eggert <eggert@twinsun.com>
12464
93e2236a
PE
12465 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
12466 MUSCLE_TAB_H.
12467
e76d2469
PE
12468 * NEWS: Officially drop support for building Bison with K&R C,
12469 since it didn't work anyway and it's not worth worrying about.
12470 * Makefile.maint (wget_files): Remove ansi2knr.c.
12471 (ansi2knr.c-url_prefix): Remove.
12472 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
12473 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12474 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12475
5bd1c419
PE
124762002-10-15 Paul Eggert <eggert@twinsun.com>
12477
12478 Stop using the "enum_" trick for K&R-style function definitions;
12479 it confused me, and I was the author! Instead, assume that people
12480 who want to use K&R C compilers (when using these modules in GCC,
12481 perhaps?) will run ansi2knr.
12482
12483 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
12484 All uses of "enum_" changed to "enum ".
12485 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
12486 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 12487
5bd1c419
PE
12488 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
12489 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
12490 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
12491 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
12492 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
12493 abitset_not, abitset_ones, abitset_or, abitset_or_and,
12494 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
12495 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
12496 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
12497 Use function prototypes; this removes the need for declaring
12498 static functions simply to provide their prototypes.
12499 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
12500 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
12501 bitset_count_, bitset_create, bitset_dump, bitset_first,
12502 bitset_free, bitset_init, bitset_last, bitset_next,
12503 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
12504 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
12505 bitset_print, bitset_release_memory, bitset_toggle_,
12506 bitset_type_choose, bitset_type_get, bitset_type_name_get,
12507 debug_bitset): Likewise.
12508 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
12509 * lib/bitset_stats.c (bitset_log_histogram_print,
12510 bitset_percent_histogram_print, bitset_stats_and,
12511 bitset_stats_and_cmp, bitset_stats_and_or,
12512 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
12513 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
12514 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
12515 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
12516 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
12517 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
12518 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
12519 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
12520 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
12521 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
12522 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
12523 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
12524 bitset_stats_zero): Likewise.
12525 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12526 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12527 bitsetv_dump, debug_bitsetv): Likewise.
12528 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
12529 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
12530 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
12531 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
12532 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
12533 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
12534 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
12535 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
12536 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
12537 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
12538 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
12539 Likewise.
12540 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
12541 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
12542 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
12543 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
12544 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
12545 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
12546 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
12547 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
12548 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
12549 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
12550 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 12551
ae26e1f0
AD
125522002-10-14 Akim Demaille <akim@epita.fr>
12553
12554 Version 1.75.
12555
d43baf71
AD
125562002-10-14 Akim Demaille <akim@epita.fr>
12557
12558 * tests/Makefile.am (maintainer-check-posix): New.
12559
7ebc83e3
AD
125602002-10-14 Akim Demaille <akim@epita.fr>
12561
12562 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
12563 member.
12564
05846dae
AD
125652002-10-14 Akim Demaille <akim@epita.fr>
12566
12567 * src/tables.c (table_ninf_remap): base -> tab.
12568 Reported by Matt Rosing.
12569
1318e37d
PE
125702002-10-14 Paul Eggert <eggert@twinsun.com>
12571
447fbb17
PE
12572 * tests/action.at, tests/calc.at, tests/conflicts.at,
12573 tests/cxx-type.at, tests/headers.at, tests/input.at,
12574 tests/regression.at, tests/synclines.at, tests/torture.at:
12575 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
12576 so that the tests still work even if POSIXLY_CORRECT is set.
12577 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 12578
1318e37d
PE
12579 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
12580 for portability to K&R hosts. Fix typo: signed char is guaranteed
12581 only to 127, not to 128.
12582 * data/glr.c (yysigned_char): New type.
12583 * data/yacc.c (yysigned_char): Likewise.
12584 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
12585
cc0f0794
PE
125862002-10-13 Paul Eggert <eggert@twinsun.com>
12587
5038f418
PE
12588 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
12589 true due to limited range of data type" warning from GCC.
12590
cc0f0794
PE
12591 * data/c.m4 (b4_token_defines): Protect against double-inclusion
12592 by wrapping enum yytokentype's definition inside #ifndef
12593 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
12594
6fed0802
AD
125952002-10-13 Akim Demaille <akim@epita.fr>
12596
12597 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
12598 Un yy- yyrhs to avoid the name clash with the global YYRHS.
12599
32f0598d
AD
126002002-10-13 Akim Demaille <akim@epita.fr>
12601
12602 * Makefile.maint: Update from Autoconf 2.54.
12603 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
12604
7ea9a33f
AD
126052002-10-13 Akim Demaille <akim@epita.fr>
12606
12607 * src/print.c (print_state): Separate the list of solved conflicts
12608 from the other items.
12609 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
12610
ea99527d
AD
126112002-10-13 Akim Demaille <akim@epita.fr>
12612
12613 Let nondeterministic skeletons be usable with deterministic
12614 tables.
12615
12616 With the patch, GAWK compiled by GCC without -O2 passes its test
12617 suite using a GLR parser driven by LALR tables. It fails with -O2
12618 because `struct stat' gives two different answers on my machine:
12619 88 (definition of an auto var) and later 96 (memset on this var).
12620 Hence the stack is badly corrumpted. The headers inclusion is to
12621 blame: if I move the awk.h inclusion before GLR's system header
12622 inclusion, the two struct stat have the same size.
12623
12624 * src/tables.c (pack_table): Always create conflict_table.
12625 (token_actions): Always create conflict_list.
12626 * data/glr.c (YYFLAG): Remove, unused.
12627
f377f69f
AD
126282002-10-13 Akim Demaille <akim@epita.fr>
12629
12630 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
12631 (O0FLAGS): New.
12632 (VALGRIND, GXX): New.
12633 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
12634 * tests/bison.in: Run $PREBISON a pre-command.
12635 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
12636 (maintainer-check-g++): New.
12637 * Makefile.am (maintainer-check): New.
12638
2a1fe6ed
AD
126392002-10-13 Akim Demaille <akim@epita.fr>
12640
12641 * data/glr.c: Formatting changes.
12642 Tweak some trace messages to match yacc.c's.
12643
f50adbbd
AD
126442002-10-13 Akim Demaille <akim@epita.fr>
12645
12646 GLR parsers sometimes raise parse errors instead of performing the
12647 default reduction.
12648 Reported by Charles-Henry de Boysson.
12649
12650 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 12651 check the length of the traces when %glr.
f50adbbd
AD
12652 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
12653 GLR's traces.
12654 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
12655 Test GLR parsers.
12656 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
12657 (yyltype): Remove the yy prefix from the member names.
12658 (yytable): Complete its comment.
12659 (yygetLRActions): Map error action number from YYTABLE from
12660 YYTABLE_NINF to 0.
12661 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
12662 (which was a bug: it should have been YYTABEL_NINF, and yet it was
12663 not satisfying as we could compare an YYACTION computed from
12664 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
12665 only value for error actions.
12666 (yyreportParseError): In verbose parse error messages, don't issue
12667 `error' in the list of expected tokens.
12668 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
12669 next action to perform to match glr.c's decoding.
12670 (yytable): Complete its comment.
12671
bcbad5b9
PE
126722002-10-13 Paul Eggert <eggert@twinsun.com>
12673
12674 Fix problem reported by Henrik Grubbstroem in
161a71f3 12675 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
12676 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
12677 because the Bison parser reads the second action before reducing
12678 the first one.
12679 * src/scan-gram.l (rule_length): New static var.
12680 Use it to keep track of the rule length in the scanner, since
12681 we can't expect the parser to be in lock-step sync with the scanner.
12682 (handle_action_dollar, handle_action_at): Use this var.
12683 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 12684
14904b89
PE
126852002-10-12 Paul Eggert <eggert@twinsun.com>
12686
1fe611e5
PE
12687 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
12688 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
12689 Include <sys/time.h> when checking for clock_t and struct tms.
12690 Use same include order as source.
12691 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 12692 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 12693
1fe611e5
PE
12694 * lib/timevar.c: Update copyright date and clarify comments.
12695 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 12696
1fe611e5
PE
12697 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
12698 GCC version as of today, then merge Bison's changes.
12699 Change "GCC" to "Bison" in copyright notice. timevar.def's
12700 author is Akim, so change that too.
12701
98194095
PE
12702 * src/reader.c (grammar_current_rule_check):
12703 Don't worry about the default action if $$ is untyped.
12704 Prevents bogus warnings reported by Jim Gifford in
161a71f3 12705 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 12706
14904b89
PE
12707 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
12708 * data/glr.c, data/lalr1.cc, data/yacc.c:
12709 Output token definitions before the first part of user declarations.
12710 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 12711 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 12712
ff6dca18
PE
127132002-10-11 Paul Eggert <eggert@twinsun.com>
12714
12715 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
12716 (yyparse): here. This undoes some of the 2002-07-25 change.
12717 Compatibility problem reported by Ralf S. Engelschall with
12718 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
12719
eb714592
AD
127202002-10-11 Akim Demaille <akim@epita.fr>
12721
12722 * tests/regression.at Characters Escapes): New.
12723 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
12724 characters.
12725 Reported by Jan Nieuwenhuizen.
12726
b7195100
AD
127272002-10-11 Akim Demaille <akim@epita.fr>
12728
12729 * po/id.po: New.
12730
f28a0f2d
PE
127312002-10-10 Paul Eggert <eggert@twinsun.com>
12732
12733 Portability fixes for bitsets; this also avoids several GCC
12734 warnings.
12735
12736 * lib/abitset.c: Include <stddef.h>, for offsetof.
12737 * lib/lbitset.c: Likewise.
12738
12739 * lib/abitset.c (abitset_bytes): Return a size that is aligned
12740 properly for vectors of objects. Do not assume that adding a
12741 header size to a multiple of a word size yields a value that is
12742 properly aligned for the whole union.
12743 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12744
12745 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
12746 unique names for structures.
12747 * lib/ebitset.c (ebitset_bytes): Likewise.
12748 * lib/lbitset.c (lbitset_bytes): Likewise.
12749
12750 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
12751 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
12752 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
12753 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
12754 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
12755 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
12756 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
12757 to improve the type-checking that GCC can do.
12758 * lib/bitset.c (bitset_op4_cmp): Likewise.
12759 * lib/bitset_stats.c (bitset_stats_count,
12760 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
12761 bitset_stats_copy, bitset_stats_disjoint_p,
12762 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
12763 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
12764 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
12765 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
12766 bitset_stats_and_or_cmp, bitset_stats_andn_or,
12767 bitset_stats_andn_or_cmp, bitset_stats_or_and,
12768 bitset_stats_or_and_cmp): Likewise.
12769 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
12770 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
12771 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
12772 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
12773
12774 * lib/abitset.h: Include bitset.h, not bbitset.h.
12775 * lib/ebitset.h: Likewise.
12776 * lib/lbitset.h: Likewise.
12777
12778 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
12779 All instances of parameters of type enum bitset_opts are now of
12780 type enum_bitset_opts, to conform to the C Standard, and similarly
12781 for enum_bitset_type.
12782 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
12783 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
12784
12785 Do not use "struct bitset_struct" to mean different things in
12786 different modules. Not only is this confusing, it violates
12787 the C Standard, which requires that structure types in different
12788 modules must be compatible if one is to be passed to the other.
12789 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
12790 All instances of "struct bitset_struct *" replaced with "bitset".
12791 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
12792 (union bitset_union, struct abitset_struct, struct ebitset_struct,
12793 struct lbitset_struct, struct bitset_stats_struct): New types.
12794 All uses of struct bitset_struct changed to union bitset_union,
12795 etc.
ba0fe3c7 12796 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
12797 struct bitset_struct): Remove.
12798 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
12799 struct bitset_struct): Remove.
12800 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
12801 bitset_struct): Remove.
12802 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
12803 Likewise.
12804
12805 Do not call a function of type T using a call that assumes the
12806 function is of a different type U. Standard C requires that a
12807 function must be called with a type that is compatible with its
12808 definition.
12809 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12810 New decls.
12811 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12812 New functions.
12813 * lib/ebitset.c (PFV): Remove.
12814 * lib/lbitset.c (PFV): Likewise.
12815 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
12816 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
12817 decls.
12818 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
12819 (ebitset_vtable): Use them.
12820 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
12821 lbitset_xor): New functions.
12822 (lbitset_vtable): Use them.
12823
12824 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
12825 Declare.
12826
12827 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
12828 GCC warning.
12829 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
12830 Use offsetof, for simplicity.
12831
6fbe4984
PE
128322002-10-06 Paul Eggert <eggert@twinsun.com>
12833
12834 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
12835 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 12836 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
12837 which was inadvertently undone by the 2002-09-30 patch.
12838 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
12839 the same width as int.
12840
420f93c8
PE
128412002-10-04 Paul Eggert <eggert@twinsun.com>
12842
12843 Version 1.50.
12844
12845 * configure.ac (AC_INIT), NEWS: Increment version number.
12846
12847 * doc/bison.texinfo: Minor spelling, grammar, and white space
12848 fixes.
12849 (Symbols): Mention that any negative value returned from yylex
12850 signifies end-of-input. Warn about negative chars. Mention
12851 the portable Standard C character set.
12852
12853 The GNU coding standard says CFLAGS and YFLAGS are reserved
12854 for the installer to set.
12855 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
12856 * src/Makefile.am (AM_CFLAGS): Likewise.
12857 (AM_YFLAGS): Renamed from YFLAGS.
12858
12859 Fix some MAX and MIN problems.
12860 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
12861 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
12862 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
12863 * src/reader.c (reader): Use it.
12864
12865 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
12866 POSIX 1003.1-2001 has removed fgrep.
12867
128682002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
12869
12870 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
12871 interpreted as signed.
12872 * lib/ebitset.c (ebitset_list): Fix bug.
12873
ff68026d
PE
128742002-10-01 Paul Eggert <eggert@twinsun.com>
12875
12876 More fixes for 64-bit hosts and large bitsets.
12877
12878 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
12879 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
12880 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
12881 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
12882 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
12883 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
12884 bitset_count_): Likewise.
12885 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
12886 bitset_first, bitset_last): Likewise.
12887 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
12888 bitset_stats_list_reverse, bitset_stats_size,
12889 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
12890 Likewise.
12891 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12892 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12893 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12894 bitsetv_reflexive_transitive_closure): Likewise.
12895 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
12896 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
12897 Likewise.
12898 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
12899 Likewise.
420f93c8 12900
ff68026d
PE
12901 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
12902 Use size_t, not unsigned int, to count bytes.
12903 * lib/abitset.h (abitset_bytes): Likewise.
12904 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
12905 Likewise.
12906 * lib/bitset.h (bitset_bytes): Likewise.
12907 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
12908 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
12909 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12910 * lib/ebitset.c (ebitset_bytes): Likewise.
12911 * lib/ebitset.h (ebitset_bytes): Likewise.
12912 * lib/lbitset.c (lbitset_bytes): Likewise.
12913 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 12914
ff68026d
PE
12915 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
12916 abitset_subset_p, abitset_disjoint_p, abitset_and,
12917 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
12918 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
12919 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
12920 abitset_or_and, abitset_or_and_cmp):
12921 Use bitset_windex instead of unsigned int.
12922 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12923 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
12924 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
12925 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
12926 Likewise.
12927 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 12928
ff68026d
PE
12929 * lib/bitset.c (bitset_print):
12930 Use proper printf formats for widths of integer types.
12931 * lib/bitset_stats.c (bitset_percent_histogram_print,
12932 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
12933 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12934 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12935 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 12936
ff68026d
PE
12937 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
12938 BITSET_SIZE_MAX): New macros.
12939 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
12940 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
12941 to BITSET_WINDEX_MAX.
12942
12943 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
12944 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
12945 since we now return the bitset_bindex type (not int).
12946
12947 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
12948 when computing sizes.
12949 * lib/ebitset.c (ebitset_elts_grow): Likewise.
12950
12951 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
12952 and avoid cast to unsigned.
12953
6aa452a6
AD
129542002-09-30 Akim Demaille <akim@epita.fr>
12955
12956 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12957 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
12958 Updates from Michael Hayes.
12959
927f7817
AD
129602002-09-30 Art Haas <ahaas@neosoft.com>
12961
12962 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
12963 invocations.
12964 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
12965 defined.
12966
9738f41e
AD
129672002-09-27 Akim Demaille <akim@epita.fr>
12968
12969 Version 1.49c.
12970
a5c75d7f
AD
129712002-09-27 Akim Demaille <akim@epita.fr>
12972
12973 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
12974 (Because of AC_LIBSOURCE).
12975
8280e179
AD
129762002-09-27 Akim Demaille <akim@epita.fr>
12977
12978 Playing with Autoscan.
12979
12980 * configure.ac: Remove the old LIBOBJ tweaks.
12981 (AC_REPLACE_FUNCS): Add strrchr and strtol.
12982 * lib/strrchr.c: New.
12983 * lib/strtol.c: New, from the Coreutils 4.5.1.
12984
ae64af35
AD
129852002-09-27 Akim Demaille <akim@epita.fr>
12986
12987 Playing with Autoscan.
12988
12989 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
12990 * lib/Makefile.am (libbison_a_SOURCES): No longer include
12991 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
12992 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
12993 Coreutils 4.5.1.
12994
d1a1114f
AD
129952002-09-24 Akim Demaille <akim@epita.fr>
12996
12997 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
12998 (Frequently Asked Questions, Parser Stack Overflow): New.
12999
b906441c
AD
130002002-09-13 Akim Demaille <akim@epita.fr>
13001
13002 Playing with autoscan.
13003
13004 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
13005 * src/files.c (skeleton_find): Remove, unused.
13006 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
13007 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
13008
bd701811
AD
130092002-09-13 Akim Demaille <akim@epita.fr>
13010
13011 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
13012 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
13013
e0a13e7b
AD
130142002-09-13 Akim Demaille <akim@epita.fr>
13015
13016 * configure.ac: Require 2.54.
13017 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
13018 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
13019 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
13020 Remove, provided by Autoconf macros.
13021
c97011bf
AD
130222002-09-12 Akim Demaille <akim@epita.fr>
13023
13024 * m4/prereq.m4: Update, from Coreutils 4.5.1.
13025
d862b1be
AD
130262002-09-12 Akim Demaille <akim@epita.fr>
13027
13028 * m4/prereq.m4: Update, from Fileutils 4.1.5.
13029 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
13030 Reported by Martin Mokrejs.
13031
3d38c03a
AD
130322002-09-10 Akim Demaille <akim@epita.fr>
13033
13034 * src/parse-gram.y: Associate a human readable string to each
13035 token type.
13036 * tests/regression.at (Invalid inputs): Adjust.
13037
b6347355
AD
130382002-09-10 Gary V. Vaughan <gary@gnu.org>
13039
13040 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
13041 with an Autoconf-2.5x style configure.ac.
13042
09ba4ab2
PE
130432002-09-06 Paul Eggert <eggert@twinsun.com>
13044
13045 * doc/bison.texinfo (Conditions): Make explicit that the GPL
13046 exception applies only to yacc.c. This is a modification of a
13047 patch originally suggested by Akim Demaille.
13048
21846f69
AD
130492002-09-06 Akim Demaille <akim@epita.fr>
13050
09ba4ab2
PE
13051 * data/c.m4 (b4_copyright): Move the GPL exception comment from
13052 here to...
13053 * data/yacc.c: here.
13054
21846f69
AD
13055 * data/lalr1.cc (struct yyltype): Don't define it, since we use
13056 LocationType.
13057 (b4_ltype): Default to yy::Location from location.hh.
13058
c0ad8bf3
AD
130592002-09-04 Jim Meyering <jim@meyering.net>
13060
13061 * data/yacc.c: Guard the declaration of yytoknum also with
13062 `#ifdef YYPRINT', so it is declared only when used.
13063
3a93251e
AD
130642002-09-04 Akim Demaille <akim@epita.fr>
13065
13066 * configure.in: Rename as...
13067 * configure.ac: this.
13068 Bump to 1.49c.
13069
427c0dda
AD
130702002-09-04 Akim Demaille <akim@epita.fr>
13071
13072 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
13073 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
13074 translate maintainer only messages.
13075
6a254321
PE
130762002-08-12 Paul Eggert <eggert@twinsun.com>
13077
645e30d1
PE
13078 Version 1.49b.
13079
6a254321
PE
13080 * Makefile.am (SUBDIRS): Remove intl.
13081 (DISTCLEANFILES): Remove.
13082 * NEWS: Mention that GNU M4 is now required. Clarify what is
13083 meant by "larger grammars". Mention the pt_BR translation.
13084 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
13085 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
13086 Bump version from 0.11.2 to 0.11.5.
13087 (BISON_PREREQ_STAGE): Remove.
13088 (AM_GNU_GETTEXT): Use external gettext.
13089 (AC_OUTPUT): Remove intl/Makefile.
13090
13091 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
13092
13093 * data/glr.c: Include string.h, for strlen.
13094 (yyreportParseError): Use size_t for yysize.
13095 (yy_yypstack): No longer nested inside yypstates, as nested
13096 functions are not portable. Do not assume size_t is the
13097 same width as int.
13098 (yypstates): Do not assume that ptrdiff_t is the same width
13099 as int, and similarly for yyposn and YYINDEX.
13100
13101 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
13102
13103 * lib/Makefile.am (INCLUDES): Do not include from the intl
13104 directory, which has been removed.
13105 * src/Makefile.am (INCLUDES): Likewise.
13106
13107 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
13108 (bitsets_sources, additional_bitsets_sources, timevars_sources):
13109 New vars.
13110
13111 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
13112 * tests/Makefile.am (EXTRA_DIST): Likewise.
13113
13114 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
13115 Do not assume that bitset_windex is the same width as unsigned.
13116
13117 * lib/abitset.c (abitset_unused_clear): Do not assume that
13118 bitset_word is the same width as int.
13119 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
13120 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
13121 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
13122 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
13123 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
13124
13125 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
13126 portability to one's complement hosts!).
13127 * lib/ebitset.c (ebitset_op1): Likewise.
13128 * lib/lbitset.c (lbitset_op1): Likewise.
13129
13130 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
13131 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13132 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
13133 Sync with fileutils.
13134 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
13135 lib/gettext.h: Sync with diffutils.
13136
13137 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
13138 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
13139
13140 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
13141 PROTOTYPES to check for prototypes, and "defined __STDC__" to
13142 check for void *.
13143
13144 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
13145 size_t; the old version tried to do this but casted improperly.
13146 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
13147 (bitset_test): Now returns int, not unsigned long.
13148
13149 * lib/bitset_stats.c: Include "gettext.h".
13150 (_): New macro.
13151 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
13152 name locals "index", as it generates unnecessary warnings on some
13153 hosts that have an "index" function.
13154
13155 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
13156 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
13157 they need translation.
13158 * src/LR0.c (state_list_append, new_itemsets, get_state,
13159 append_states, generate_states): Likewise.
13160 * src/assoc.c (assoc_to_string): Likewise.
13161 * src/closure.c (print_closure, set_firsts, closure): Likewise.
13162 * src/gram.c (grammar_dump): Likewise.
13163 * src/injections.c (injections_compute): Likewise.
13164 * src/lalr.c (lookaheads_print): Likewise.
13165 * src/relation.c (relation_transpose): Likewise.
13166 * src/scan-gram.l: Likewise.
13167 * src/tables.c (table_grow, pack_vector): Likewise.
13168
13169 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
13170 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
13171 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
13172 * m4/mbstate_t.m4: Sync with fileutils.
13173 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
13174
13175 * po/LINGUAS: Add pt_BR.
13176 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
13177 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
13178 lib/timevar.c.
13179 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
13180 manual recommends.
13181 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
13182
13183 * src/complain.c (strerror_r): Remove decl; not needed.
13184 (strerror): Use same pattern as ../lib/error.c.
13185
13186 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
13187
13188 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
13189
13190 * src/main.c (main): Cast result of bindtextdomain and textdomain
13191 to void, to avoid a GCC warning when --disable-nls is in effect.
13192
13193 * src/scan-gram.l: Use strings rather than escapes when possible,
13194 to minimize the number of warnings from xgettext.
13195 (handle_action_dollar, handle_action_at): Don't use isdigit,
13196 as it mishandles negative chars and it may not work as expected
13197 outside the C locale.
13198
13199 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
13200 this is a GCC extension and is not portable to other compilers.
13201
13202 * src/system.h (alloca): Use same pattern as ../lib/error.c.
13203 Do not include <ctype.h>; no longer needed.
13204 Do not include <malloc.h>; no longer needed (and generates
13205 warnings on OpenBSD 3.0).
13206
13207 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
13208 it's not portable.
13209
13210 * tests/regression.at: Do not use 'cc -c input.c -o input';
13211 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
13212
13213 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
13214 exit status as failure, not just exit status 1. Sun C exits
13215 with status 2 sometimes.
13216
13217 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
13218 Use it for the two large tests.
13219
c8f002c7
AD
132202002-08-02 Akim Demaille <akim@epita.fr>
13221
13222 * src/conflicts.c (conflicts_output): Don't output rules never
13223 reduced here, since anyway that computation doesn't work.
13224 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
13225 (rule_useless_p, rule_never_reduced_p): New.
13226 (grammar_rules_partial_print): Use a filter instead of a range.
13227 Display the title only if needed.
13228 (grammar_rules_print): Adjust.
13229 (grammar_rules_never_reduced_report): New.
13230 * src/tables.c (action_row): Move the computation of rules never
13231 reduced to...
13232 (token_actions): here.
13233 * src/main.c (main): Make the parser before making the report, so
13234 that rules never reduced are computed.
13235 Call grammar_rules_never_reduced_report.
13236 * src/print.c (print_results): Report rules never reduced.
13237 * tests/conflicts.at, tests/reduce.at: Adjust.
13238
cd08e51e
AD
132392002-08-01 Akim Demaille <akim@epita.fr>
13240
13241 Instead of attaching lookaheads and duplicating the rules being
13242 reduced by a state, attach the lookaheads to the reductions.
13243
13244 * src/state.h (state_t): Remove the `lookaheads',
13245 `lookaheads_rule' member.
13246 (reductions_t): Add a `lookaheads' member.
13247 Use a regular array for the `rules'.
13248 * src/state.c (reductions_new): Initialize the lookaheads member
13249 to 0.
13250 (state_rule_lookaheads_print): Adjust.
13251 * src/state.h, src/state.c (state_reductions_find): New.
13252 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
13253 (count_rr_conflicts): Adjust.
13254 * src/lalr.c (LArule): Remove.
13255 (add_lookback_edge): Adjust.
13256 (state_lookaheads_count): New.
13257 (states_lookaheads_initialize): Merge into...
13258 (initialize_LA): this.
13259 (lalr_free): Adjust.
13260 * src/main.c (main): Don't free nullable and derives too early: it
13261 is used by --verbose.
13262 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
13263
bb0027a9
AD
132642002-08-01 Akim Demaille <akim@epita.fr>
13265
13266 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
13267 `rule_number_t**'.
13268 (set_derives, free_derives): Rename as...
13269 (derives_compute, derives_free): this.
13270 Adjust all dependencies.
13271 * src/nullable.c (set_nullable, free_nullable): Rename as...
13272 (nullable_compute, nullable_free): these.
13273 (rule_list_t): Store rule_t *, not rule_number_t.
13274 * src/state.c (state_rule_lookaheads_print): Directly compare rule
13275 pointers, instead of their numbers.
13276 * src/main.c (main): Call nullable_free, and derives_free earlier,
13277 as they were lo longer used.
13278
3325ddc4
AD
132792002-08-01 Akim Demaille <akim@epita.fr>
13280
13281 * lib/timevar.c (get_time): Include children time.
13282 * src/lalr.h (LA, LArule): Don't export them: used with the
13283 state_t.
13284 * src/lalr.c (LA, LArule): Static.
13285 * src/lalr.h, src/lalr.c (lalr_free): New.
13286 * src/main.c (main): Call it.
13287 * src/tables.c (pack_vector): Check whether loc is >= to the
13288 table_size, not >.
13289 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
13290 (tables_generate): do it, since that's also it which allocates
13291 them.
13292 Don't free LA and LArule, main does.
13293
c6f1a33c
AD
132942002-07-31 Akim Demaille <akim@epita.fr>
13295
13296 Separate parser tables computation and output.
13297
13298 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
13299 (conflict_list, conflict_list_cnt, table, check, table_ninf)
13300 (yydefgoto, yydefact, high): Move to...
13301 * src/tables.h, src/tables.c: here.
13302 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
13303 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
13304 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
13305 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
13306 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
13307 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
13308 (action_row, save_row, token_actions, save_column, default_goto)
13309 (goto_actions, sort_actions, matching_state, pack_vector)
13310 (table_ninf_remap, pack_table, prepare_actions): Move to...
13311 * src/tables.c: here.
13312 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
13313 * src/output.c (token_actions, output_base, output_conflicts)
13314 (output_check): Merge into...
13315 (prepare_actions): this.
13316 (actions_output): Rename as...
13317 (user_actions_output): this.
13318 * src/main.c (main): Call tables_generate and tables_free.
13319
1509d42f
AD
133202002-07-31 Akim Demaille <akim@epita.fr>
13321
13322 Steal GCC's --time-report support.
13323
13324 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
13325 stolen/adjusted from GCC.
13326 * m4/stage.m4: Remove time related checks.
13327 * m4/timevar.m4: New.
13328 * configure.in: Adjust.
13329 * src/system.h: Adjust to using timevar.h.
13330 * src/getargs.h, src/getargs.c: Support trace_time for
13331 --trace=time.
13332 * src/main.c (stage): Remove.
13333 (main): Replace `stage' invocations with timevar calls.
13334 * src/output.c: Insert pertinent timevar calls.
13335
273a74fa
AD
133362002-07-31 Akim Demaille <akim@epita.fr>
13337
13338 Let --trace have arguments.
13339
13340 * src/getargs.h (enum trace_e): New.
13341 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
13342 (long_options, short_options): --trace/-T takes an optional
13343 argument.
13344 Change all the uses of trace_flag to reflect the new flags.
13345 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
13346
13347 Strengthen `stage' portability.
13348
13349 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
13350 * configure.in: Use it.
13351 Don't check for malloc.h and sys/times.h.
13352 * src/system.h: Include them when appropriate.
13353 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
13354 times and struct tms are available.
13355
217598da
AD
133562002-07-30 Akim Demaille <akim@epita.fr>
13357
13358 In verbose parse error message, don't report `error' as an
13359 expected token.
13360 * tests/actions.at (Printers and Destructors): Adjust.
13361 * tests/calc.at (Calculator $1): Adjust.
13362 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
13363 error message, do not report the parser accepts the error token in
13364 that state.
13365
52489d44
AD
133662002-07-30 Akim Demaille <akim@epita.fr>
13367
13368 Normalize conflict related messages.
13369
13370 * src/complain.h, src/complain.c (warn, complain): New.
13371 * src/conflicts.c (conflicts_print): Use them.
13372 (conflict_report_yacc): New, extracted from...
13373 (conflicts_print): here.
13374 * tests/conflicts.at, tests/existing.at: Adjust.
13375
e8832397
AD
133762002-07-30 Akim Demaille <akim@epita.fr>
13377
13378 Report rules which are never reduced by the parser: those hidden
13379 by conflicts.
13380
13381 * src/LR0.c (save_reductions): Don't make the final state too
13382 different: save its reduction (accept) instead of having a state
13383 without any action (no shift or goto, no reduce).
13384 Note: the final state is now a ``regular'' state, i.e., the
13385 parsers now contain `reduce 0' as default reduction.
13386 Nevertheless, since they decide to `accept' when yystate =
13387 final_state, they still will not reduce rule 0.
13388 * src/print.c (print_actions, print_reduction): Adjust.
13389 * src/output.c (action_row): Track reduced rules.
13390 (token_actions): Report rules never reduced.
13391 * tests/conflicts.at, tests/regression.at: Adjust.
13392
caf23d24
AD
133932002-07-30 Akim Demaille <akim@epita.fr>
13394
13395 `stage' was accidently included in a previous patch.
13396 Initiate its autoconfiscation.
13397
13398 * configure.in: Look for malloc.h and sys/times.h.
13399 * src/main.c (stage): Adjust.
13400 Report only when trace_flag.
13401
640748ee
AD
134022002-07-29 Akim Demaille <akim@epita.fr>
13403
13404 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
13405 state_number_t.
13406 (errs_t): symbol_t*, not symbol_number_t.
13407 (reductions_t): rule_t*, not rule_number_t.
13408 (FOR_EACH_SHIFT): New.
13409 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
13410 * src/print.c, src/print_graph.c: Adjust.
13411
88bce5a2
AD
134122002-07-29 Akim Demaille <akim@epita.fr>
13413
13414 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
13415
13416 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
13417 (endtoken, accept): these.
13418 * src/reader.c (reader): Set endtoken's default tag to "$end".
13419 Set undeftoken's tag to "$undefined" instead of "$undefined.".
13420 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
13421 Adjust.
13422
1bfb97db
AD
134232002-07-29 Akim Demaille <akim@epita.fr>
13424
13425 * src/reduce.c (reduce_grammar): When the language is empty,
13426 complain about the start symbol, not the axiom.
13427 Use its location.
13428 * tests/reduce.at (Empty Language): New.
13429
fc5734fe
AD
134302002-07-26 Akim Demaille <akim@epita.fr>
13431
13432 * src/reader.h, src/reader.c (gram_error): ... can't get
13433 yycontrol without making too strong assumptions on the parser
13434 itself.
13435 * src/output.c (prepare_tokens): Use the real 0th value of
13436 token_translations instead of `0'.
13437 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
13438 visible here.
13439 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
13440 for the time being: %locations ought to provide it to yyerror.
13441
3650b4b8
AD
134422002-07-25 Akim Demaille <akim@epita.fr>
13443
13444 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
13445 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
13446 * tests/regression.at (Web2c Actions): Adjust.
13447
4b3d3a8e
AD
134482002-07-25 Akim Demaille <akim@epita.fr>
13449
13450 Stop storing rules from 1 to nrules + 1.
13451
13452 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
13453 * src/nullable.c, src/output.c, src/print.c, src/reader.c
13454 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
13455 Iterate from 0 to nrules.
13456 Use rule_number_as_item_number and item_number_as_rule_number.
13457 Adjust to `derive' now containing possibly 0.
13458 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
13459 Handle the `- 1' part in rule numbers from/to item numbers.
13460 * src/conflicts.c (log_resolution): Fix the message which reversed
13461 shift and reduce.
13462 * src/output.c (action_row): Initialize default_rule to -1.
13463 (token_actions): Adjust.
13464 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
13465 expected output.
13466 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
13467
4a2a22f4
AD
134682002-07-25 Akim Demaille <akim@epita.fr>
13469
13470 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
13471 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
13472 (b4_c_knr_arg_decl): New.
13473 * data/yacc.c: Use it to define yysymprint, yydestruct, and
13474 yyreport_parse_error.
13475
b8df3223
AD
134762002-07-25 Akim Demaille <akim@epita.fr>
13477
13478 * data/yacc.c (yyreport_parse_error): New, extracted from...
13479 (yyparse): here.
13480 (yydestruct, yysymprint): Move above yyparse.
13481 Be K&R compliant.
13482
a762e609
AD
134832002-07-25 Akim Demaille <akim@epita.fr>
13484
13485 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
13486 replace...
13487 (b4_sint_type, b4_uint_type): these.
13488 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
13489 * tests/regression.at (Web2c Actions): Adjust.
13490
12b0043a
AD
134912002-07-25 Akim Demaille <akim@epita.fr>
13492
13493 * src/gram.h (TIEM_NUMBER_MAX): New.
13494 (item_number_of_rule_number, rule_number_of_item_number): Rename
13495 as...
13496 (rule_number_as_item_number, item_number_as_rule_number): these.
13497 Adjust dependencies.
13498 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
13499 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
13500 (symbol_number_to_vector_number): New.
13501 (order): Of vector_number_t* type.
13502 (base_t, BASE_MAX, BASE_MIN): New.
13503 (froms, tos, width, pos, check): Of base_t type.
13504 (action_number_t, ACTION_MIN, ACTION_MAX): New.
13505 (actrow): Of action_number_t type.
13506 (conflrow): Of unsigned int type.
13507 (table_ninf, base_ninf): New.
13508 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
13509 (muscle_insert_int_table, muscle_insert_base_table)
13510 (muscle_insert_rule_number_table): New.
13511 (prepare_tokens): Output `toknum' as int_table.
13512 (action_row): Returns a rule_number_t.
13513 Use ACTION_MIN, not SHRT_MIN.
13514 (token_actions): yydefact is rule_number_t*.
13515 (table_ninf_remap): New.
13516 (pack_table): Use it for `base' and `table'.
13517 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
13518 replaced with...
13519 (YYPACT_NINF, YYTABLE_NINF): these.
13520 (yypact, yytable): Compute their types instead of hard-coded
13521 `short'.
13522 * tests/regression.at (Web2c Actions): Adjust.
13523
5dde258a
AD
135242002-07-19 Akim Demaille <akim@epita.fr>
13525
13526 * src/scan-gram.l (id): Can start with an underscore.
13527
a945ec39
AD
135282002-07-16 Akim Demaille <akim@epita.fr>
13529
13530 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
13531 Adjust all former `associativity' dependencies.
13532 * src/symtab.c (symbol_new): Default associativity is `undef', not
13533 `right'.
13534 (symbol_check_alias_consistence): Adjust.
13535
fae437e8
AD
135362002-07-09 Akim Demaille <akim@epita.fr>
13537
13538 * doc/bison.texinfo: Properly set the ``header'' part.
13539 Use @dircategory ``GNU programming tools'' as per Texinfo's
13540 documentation.
13541 Use @copying.
13542
1a715ef2
AD
135432002-07-09 Akim Demaille <akim@epita.fr>
13544
13545 * lib/quotearg.h: Protect against multiple inclusions.
13546 * src/location.h (location_t): Add a `file' member.
13547 (LOCATION_RESET, LOCATION_PRINT): Adjust.
13548 * src/complain.c (warn_at, complain_at, fatal_at): Drop
13549 `error_one_per_line' support.
13550
a5d50994
AD
135512002-07-09 Akim Demaille <akim@epita.fr>
13552
13553 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
13554 * src/reader.c (lineno): Remove.
13555 Adjust all dependencies.
13556 (get_merge_function): Take a location and use complain_at.
13557 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
13558 * tests/regression.at (Invalid inputs, Mixing %token styles):
13559 Adjust.
13560
b275314e
AD
135612002-07-09 Akim Demaille <akim@epita.fr>
13562
13563 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
13564 recovery rule, and forbid extensions when --yacc.
13565 (gram_error): Use complain_at.
13566 * src/reader.c (reader): Exit if there were parse errors.
13567
865b9df1
AD
135682002-07-09 Akim Demaille <akim@epita.fr>
13569
13570 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
13571 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
13572 Reported by R Blake <blakers@mac.com>.
13573
c76e14da
AD
135742002-07-09 Akim Demaille <akim@epita.fr>
13575
13576 * data/yacc.c: Output the copyright notive in the header.
13577
7db2ed2d
AD
135782002-07-03 Akim Demaille <akim@epita.fr>
13579
13580 * src/output.c (froms, tos): Are state_number_t.
13581 (save_column): sp, sp1, and sp2 are state_number_t.
13582 (prepare): Rename `final' as `final_state_number', `nnts' as
13583 `nterms_number', `nrules' as `rules_number', `nstates' as
13584 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
13585 unused.
13586 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
13587 * data/lalr1.cc (nsym_): Remove, unused.
13588
e68e0410
AD
135892002-07-03 Akim Demaille <akim@epita.fr>
13590
13591 * src/lalr.h, src/lalr.c (goto_number_t): New.
13592 * src/lalr.c (goto_list_t): New.
13593 Propagate them.
13594 * src/nullable.c (rule_list_t): New.
13595 Propagate.
13596 * src/types.h: Remove.
13597
e1a4f3a4
AD
135982002-07-03 Akim Demaille <akim@epita.fr>
13599
13600 * src/closure.c (print_fderives): Use rule_rhs_print.
13601 * src/derives.c (print_derives): Use rule_rhs_print.
13602 (rule_list_t): New, replaces `shorts'.
13603 (set_derives): Add comments.
13604 * tests/sets.at (Nullable, Firsts): Adjust.
13605
536545f3
AD
136062002-07-03 Akim Demaille <akim@epita.fr>
13607
13608 * src/output.c (prepare_actions): Free `tally' and `width'.
13609 (prepare_actions): Allocate and free `order'.
13610 * src/symtab.c (symbols_free): Free `symbols'.
13611 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
13612 * src/output.c (m4_invoke): Move to...
13613 * src/scan-skel.l: here.
13614 (<<EOF>>): Close yyout, and free its name.
13615
8b752b00
AD
136162002-07-03 Akim Demaille <akim@epita.fr>
13617
13618 Fix some memory leaks, and fix a bug: state 0 was examined twice.
13619
13620 * src/LR0.c (new_state): Merge into...
13621 (state_list_append): this.
13622 (new_states): Merge into...
13623 (generate_states): here.
13624 (set_states): Don't ensure a proper `errs' state member here, do it...
13625 * src/conflicts.c (conflicts_solve): here.
13626 * src/state.h, src/state.c: Comment changes.
13627 (state_t): Rename member `shifts' as `transitions'.
13628 Adjust all dependencies.
13629 (errs_new): For consistency, also take the values as argument.
13630 (errs_dup): Remove.
13631 (state_errs_set): New.
13632 (state_reductions_set, state_transitions_set): Assert that no
13633 previous value was assigned.
13634 (state_free): New.
13635 (states_free): Use it.
13636 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
13637 temporary storage: use `errs' and `nerrs' as elsewhere.
13638 (set_conflicts): Allocate and free this `errs'.
13639
613f5e1a
AD
136402002-07-02 Akim Demaille <akim@epita.fr>
13641
13642 * lib/libiberty.h: New.
13643 * lib: Update the bitset implementation from upstream.
13644 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
13645 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
13646 * src/main.c: Adjust bitset stats calls.
13647
26e0cadc
PE
136482002-07-01 Paul Eggert <eggert@twinsun.com>
13649
13650 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
13651 char, so that negative chars don't collide with $.
13652
1154cced
AD
136532002-06-30 Akim Demaille <akim@epita.fr>
13654
13655 Have the GLR tests be `warning' checked, and fix the warnings.
13656
13657 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
13658 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
13659 (yyremoveDeletes): `yyi' and `yyj' are size_t.
13660 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
13661 (yyaddDeferredAction): static.
13662 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
13663 (yyreportParseError): yyprefix is const.
13664 yytokenp is used only when verbose.
13665 (yy__GNUC__): Replace with __GNUC__.
13666 (yypdumpstack): yyi is size_t.
13667 (yypreference): Un-yy local variables and arguments, to avoid
13668 clashes with `yyr1'. Anyway, we are not in the user name space.
13669 (yytname_size): be an int, as is compared with ints.
13670 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
13671 Use them.
13672 * tests/cxx-gram.at: Use quotation to protect $1.
13673 Use AT_COMPILE to enable warnings hunts.
13674 Prototype yylex and yyerror.
13675 `Use' argc.
13676 Include `string.h', not `strings.h'.
13677 Produce and prototype stmtMerge only when used.
13678 yylex takes a location.
13679
97650f4e
AD
136802002-06-30 Akim Demaille <akim@epita.fr>
13681
13682 We spend a lot of time in quotearg, in particular when --verbose.
13683
13684 * src/symtab.c (symbol_get): Store a quoted version of the key.
13685 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
13686 Adjust all callers.
13687
d2576365
AD
136882002-06-30 Akim Demaille <akim@epita.fr>
13689
13690 * src/state.h (reductions_t): Rename member `nreds' as num.
13691 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
13692 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
13693
ccaf65bc
AD
136942002-06-30 Akim Demaille <akim@epita.fr>
13695
13696 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
13697 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
13698 (shifts_to): Rename as...
13699 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
13700 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
13701 (TRANSITION_IS_DISABLED, transitions_to): these.
13702
87675353
AD
137032002-06-30 Akim Demaille <akim@epita.fr>
13704
13705 * src/print.c (print_shifts, print_gotos): Merge into...
13706 (print_transitions): this.
13707 (print_transitions, print_errs, print_reductions): Align the
13708 lookaheads columns.
13709 (print_core, print_transitions, print_errs, print_state,
13710 print_grammar): Output empty lines separator before, not after.
13711 (state_default_rule_compute): Rename as...
13712 (state_default_rule): this.
13713 * tests/conflicts.at (Defaulted Conflicted Reduction),
13714 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
13715 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
13716
ce4ccb4b
AD
137172002-06-30 Akim Demaille <akim@epita.fr>
13718
13719 Display items as we display rules.
13720
13721 * src/gram.h, src/gram.c (rule_lhs_print): New.
13722 * src/gram.c (grammar_rules_partial_print): Use it.
13723 * src/print.c (print_core): Likewise.
13724 * tests/conflicts.at (Defaulted Conflicted Reduction),
13725 (Unresolved SR Conflicts): Adjust.
13726 (Unresolved SR Conflicts): Adjust and rename as...
13727 (Resolved SR Conflicts): this, as was meant.
13728 * tests/regression.at (Web2c Report): Adjust.
13729
bc933ef1
AD
137302002-06-30 Akim Demaille <akim@epita.fr>
13731
13732 * src/print.c (state_default_rule_compute): New, extracted from...
13733 (print_reductions): here.
13734 Pessimize, but clarify the code.
13735 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
13736
53d4308d
AD
137372002-06-30 Akim Demaille <akim@epita.fr>
13738
13739 * src/output.c (action_row): Let default_rule be always a rule
13740 number.
13741
574fb2d5
AD
137422002-06-30 Akim Demaille <akim@epita.fr>
13743
13744 * src/closure.c (print_firsts, print_fderives, closure):
13745 Use BITSET_EXECUTE.
13746 * src/lalr.c (lookaheads_print): Likewise.
13747 * src/state.c (state_rule_lookaheads_print): Likewise.
13748 * src/print_graph.c (print_core): Likewise.
13749 * src/print.c (print_reductions): Likewise.
13750 * src/output.c (action_row): Likewise.
13751 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
13752
05811fd7
AD
137532002-06-30 Akim Demaille <akim@epita.fr>
13754
13755 * src/print_graph.c: Use report_flag.
13756
0e4d5753
AD
137572002-06-30 Akim Demaille <akim@epita.fr>
13758
13759 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
13760 to...
13761 * src/relation.h, src/relation.c (traverse, relation_digraph)
13762 (relation_print, relation_transpose): New.
13763
24c7d800
AD
137642002-06-30 Akim Demaille <akim@epita.fr>
13765
13766 * src/state.h, src/state.c (shifts_to): New.
13767 * src/lalr.c (build_relations): Use it.
13768
9222837b
AD
137692002-06-30 Akim Demaille <akim@epita.fr>
13770
13771 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
13772 (item_number_of_rule_number, rule_number_of_item_number): New.
13773 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
13774 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
13775 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
13776 Propagate their use.
13777 Much remains to be done, in particular wrt `shorts' from types.h.
13778
260008e5
AD
137792002-06-30 Akim Demaille <akim@epita.fr>
13780
13781 * src/symtab.c (symbol_new): Initialize the `printer' member.
13782
8a731ca8
AD
137832002-06-30 Akim Demaille <akim@epita.fr>
13784
13785 * src/LR0.c (save_reductions): Remove, replaced by...
13786 * src/state.h, src/state.c (state_reductions_set): New.
13787 (reductions, errs): Rename as...
13788 (reductions_t, errs_t): these.
13789 Adjust all dependencies.
13790
32e1e0a4
AD
137912002-06-30 Akim Demaille <akim@epita.fr>
13792
13793 * src/LR0.c (state_list_t, state_list_append): New.
13794 (first_state, last_state): Now symbol_list_t.
13795 (this_state): Remove.
13796 (new_itemsets, append_states, save_reductions): Take a state_t as
13797 argument.
13798 (set_states, generate_states): Adjust.
13799 (save_shifts): Remove, replaced by...
13800 * src/state.h, src/state.c (state_shifts_set): New.
13801 (shifts): Rename as...
13802 (shifts_t): this.
13803 Adjust all dependencies.
13804 * src/state.h (state_t): Remove the `next' member.
13805
e5fb6710
AD
138062002-06-30 Akim Demaille <akim@epita.fr>
13807
13808 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
13809 escaped in slot 0.
13810
c7ca99d4
AD
138112002-06-30 Akim Demaille <akim@epita.fr>
13812
13813 Use hash.h for the state hash table.
13814
13815 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
13816 (allocate_storage): Use state_hash_new.
13817 (free_storage): Use state_hash_free.
13818 (new_state, get_state): Adjust.
13819 * src/lalr.h, src/lalr.c (states): Move to...
13820 * src/states.h (state_t): Remove the `link' member, no longer
13821 used.
13822 * src/states.h, src/states.c: here.
13823 (state_hash_new, state_hash_free, state_hash_lookup)
13824 (state_hash_insert, states_free): New.
13825 * src/states.c (state_table, state_compare, state_hash): New.
13826 * src/output.c (output_actions): Do not free states now, since we
13827 still need to know the final_state number in `prepare', called
13828 afterwards. Do it...
13829 * src/main.c (main): here: call states_free after `output'.
13830
df0e7316
AD
138312002-06-30 Akim Demaille <akim@epita.fr>
13832
13833 * src/state.h, src/state.c (state_new): New, extracted from...
13834 * src/LR0.c (new_state): here.
13835 * src/state.h (STATE_ALLOC): Move to...
13836 * src/state.c: here.
13837 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
13838 * src/state.h, src/state.c: here.
13839
39f41916
AD
138402002-06-30 Akim Demaille <akim@epita.fr>
13841
13842 * src/reader.c (gensym): Rename as...
13843 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
13844 (getsym): Rename as...
13845 (symbol_get): this.
13846
d57650a5
AD
138472002-06-30 Akim Demaille <akim@epita.fr>
13848
13849 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
13850 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
13851 * src/output.c, src/print.c, src/print_graph.c: Propagate.
13852 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
13853
5a08f1ce
AD
138542002-06-30 Akim Demaille <akim@epita.fr>
13855
13856 Make the test suite pass with warnings checked.
13857
13858 * tests/actions.at (Printers and Destructors): Improve.
13859 Avoid unsigned vs. signed issues.
13860 * tests/calc.at: Don't exercise the scanner here, do it...
13861 * tests/input.at (Torturing the Scanner): here.
13862
720623af
PH
138632002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13864
88e7e941 13865 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
13866 reorganize first lines parallel to yacc.c.
13867
fb8135fa
AD
138682002-06-28 Akim Demaille <akim@epita.fr>
13869
13870 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
13871 (b4_token_enum, b4_token_defines): New, factored from...
13872 * data/lalr1.cc, data/yacc.c, glr.c: here.
13873
41442480
AD
138742002-06-28 Akim Demaille <akim@epita.fr>
13875
13876 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
13877 unused variables.
13878 * src/output.c (merger_output): static.
13879
e0e5bf84
AD
138802002-06-28 Akim Demaille <akim@epita.fr>
13881
ba0fe3c7 13882 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
13883 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
13884 pacify GCC.
13885 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 13886
676385e2
PH
138872002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13888
13889 Accumulated changelog for new GLR parsing features.
13890
6a254321 13891 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
13892 conflicts_total_count.
13893 * src/conflicts.h: Ditto.
13894 * src/output.c (token_actions): Use the new name.
13895 (output_conflicts): Change conflp => conflict_list_heads, and
13896 confl => conflict_list for better readability.
13897 * data/glr.c: Use the new names.
13898 * NEWS: Add self to GLR announcement.
e0e5bf84 13899
676385e2
PH
13900 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
13901
13902 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
13903 Akim Demaille.
13904
13905 * data/bison.glr: Change name to glr.c
13906 * data/glr.c: Renamed from bison.glr.
13907 * data/Makefile.am: Add glr.c
e0e5bf84
AD
13908
13909 * src/getargs.c:
13910
676385e2 13911 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 13912 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 13913
676385e2
PH
13914 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13915
13916 * data/bison.glr: Be sure to restore the
13917 current #line when returning to the skeleton contents after having
13918 exposed the input file's #line.
13919
13920 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13921
13922 * data/bison.glr: Bring up to date with changes to bison.simple.
13923
13924 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13925
13926 * data/bison.glr: Correct definitions that use b4_prefix.
13927 Various reformatting.
13928 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
13929 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
13930 yytokenp argument; now part of stack.
13931 (yychar): Define to behave as documented.
13932 (yyclearin): Ditto.
e0e5bf84 13933
676385e2
PH
13934 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13935
13936 * src/reader.h: Add declaration for free_merger_functions.
13937
13938 * src/reader.c (merge_functions): New variable.
13939 (get_merge_function): New function.
13940 (free_merger_functions): New function.
13941 (readgram): Check for %prec that is not followed by a symbol.
13942 Handle %dprec and %merge declarations.
13943 (packgram): Initialize dprec and merger fields in rules array.
13944
13945 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
13946 conflict_list_cnt, conflict_list_free): New variables.
13947 (table_grow): Also grow conflict_table.
e0e5bf84 13948 (prepare_rules): Output dprec and merger tables.
676385e2 13949 (conflict_row): New function.
e0e5bf84 13950 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
13951 default reduction in conflicted states for GLR parser so that there
13952 are spaces for the conflict lists.
13953 (save_row): Also save conflict information.
13954 (token_actions): Allocate conflict list.
13955 (merger_output): New function.
13956 (pack_vector): Pack conflict table, too.
13957 (output_conflicts): New function to output yyconflp and yyconfl.
13958 (output_check): Allocate conflict_tos.
13959 (output_actions): Output conflict tables, also.
13960 (output_skeleton): Output b4_mergers definition.
13961 (prepare): Output b4_max_rhs_length definition.
13962 Use 'bison.glr' as default skeleton for GLR parsers.
13963
13964 * src/gram.c (glr_parser): New flag.
13965 (grammar_free): Call free_merger_functions.
13966
13967 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
13968 all pairs of conflicting reductions, rather than just all tokens
13969 causing conflicts. Needed to size conflict tables.
e0e5bf84 13970 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
13971 interface.
13972 (conflicts_print): Ditto.
13973 (count_total_conflicts): New function.
13974
13975 * src/reader.h (merger_list): New type.
13976 (merge_functions): New variable.
13977
13978 * src/lex.h (tok_dprec, tok_merge): New token types.
13979
13980 * src/gram.h (rule_s): Add dprec and merger fields.
13981 (glr_parser): New flag.
13982
13983 * src/conflicts.h (count_total_conflicts): New function.
13984
13985 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
13986
13987 * doc/bison.texinfo (Generalized LR Parsing): New section.
13988 (GLR Parsers): New section.
13989 (Language and Grammar): Mention GLR parsing.
13990 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
13991 Correct typo ("tge" -> "the").
13992
13993 * data/bison.glr: New skeleton for GLR parsing.
13994
13995 * tests/cxx-gram.at: New tests for GLR parsing.
13996
13997 * tests/testsuite.at: Include cxx-gram.at.
13998
13999 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 14000
676385e2
PH
14001 * src/parse-gram.y:
14002
14003 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
14004
14005 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 14006
b5480d74 140072002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
14008
14009 * src/options.h, src/options.c: Remove.
14010 * src/getargs.c (short_options, long_options): New.
14011
60491a94
AD
140122002-06-27 Akim Demaille <akim@epita.fr>
14013
14014 * data/bison.simple, data/bison.c++: Rename as...
14015 * data/yacc.c, data/lalr1.cc: these.
14016 * doc/bison.texinfo (Environment Variables): Remove.
14017
9be0c25b
AD
140182002-06-25 Raja R Harinath <harinath@cs.umn.edu>
14019
14020 * src/getargs.c (report_argmatch): Initialize strtok().
14021
1ae72863
AD
140222002-06-20 Akim Demaille <akim@epita.fr>
14023
14024 * data/bison.simple (b4_symbol_actions): New, replaces...
14025 (b4_symbol_destructor, b4_symbol_printer): these.
14026 (yysymprint): Be sure to call YYPRINT only for tokens, and using
14027 user token numbers.
14028
87542d29
AD
140292002-06-20 Akim Demaille <akim@epita.fr>
14030
14031 * data/bison.simple (yydestructor): Rename as...
14032 (yydestruct): this.
14033
1a31ed21
AD
140342002-06-20 Akim Demaille <akim@epita.fr>
14035
14036 * src/symtab.h, src/symtab.c (symbol_type_set)
14037 (symbol_destructor_set, symbol_precedence_set): The location is
14038 the last argument.
14039 Adjust all callers.
14040
e776192e
AD
140412002-06-20 Akim Demaille <akim@epita.fr>
14042
14043 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
14044 internals.
14045 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
14046 Takes a location.
14047 * src/symtab.h, src/symtab.c (symbol_class_set)
14048 (symbol_user_token_number_set): Likewise.
14049 Adjust all callers.
14050 Promote complain_at.
14051 * tests/input.at (Type Clashes): Adjust.
14052
5c1180b3
AD
140532002-06-20 Akim Demaille <akim@epita.fr>
14054
14055 * data/bison.simple (YYLEX): Fix the declaration when
14056 %pure-parser.
14057
e3170060
AD
140582002-06-20 Akim Demaille <akim@epita.fr>
14059
14060 * data/bison.simple (yysymprint): Don't print the token number,
14061 just its name.
14062 * tests/actions.at (Destructors): Rename as...
14063 (Printers and Destructors): this.
14064 Also exercise %printer.
14065
253862fd
AD
140662002-06-20 Akim Demaille <akim@epita.fr>
14067
14068 * data/bison.simple (YYDSYMPRINT): New.
14069 Use it to remove many of the #if YYDEBUG/if (yydebug).
14070
366eea36
AD
140712002-06-20 Akim Demaille <akim@epita.fr>
14072
14073 * src/symtab.h, src/symtab.c (symbol_t): printer and
14074 printer_location are new members.
14075 (symbol_printer_set): New.
14076 * src/parse-gram.y (PERCENT_PRINTER): New token.
14077 Handle its associated rule.
14078 * src/scan-gram.l: Adjust.
14079 (handle_destructor_at, handle_destructor_dollar): Rename as...
14080 (handle_symbol_code_at, handle_symbol_code_dollar): these.
14081 * src/output.c (symbol_printers_output): New.
14082 (output_skeleton): Call it.
14083 * data/bison.simple (yysymprint): New. Cannot be named yyprint
14084 since there are already many grammar files with a user `yyprint'.
14085 Replace the calls to YYPRINT to calls to yysymprint.
14086 * tests/calc.at: Adjust.
14087 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
14088 taking advantage of parser very internal details (stack size!).
14089
4f25ebb0
AD
140902002-06-20 Akim Demaille <akim@epita.fr>
14091
14092 * src/scan-gram.l: Complete the scanner with the missing patterns
14093 to pacify Flex.
14094 Use `quote' and `symbol_tag_get' where appropriate.
14095
93b68a0e
AD
140962002-06-19 Akim Demaille <akim@epita.fr>
14097
14098 * tests/actions.at (Destructors): Augment to test locations.
14099 * data/bison.simple (yydestructor): Pass it the current location
14100 if locations are enabled.
14101 Prototype only when __STDC__ or C++.
14102 Change the argument names to move into the yy name space: there is
14103 user code here.
14104
58612f1d
AD
141052002-06-19 Akim Demaille <akim@epita.fr>
14106
74310291
AD
14107 * data/bison.simple (b4_pure_if): New.
14108 Use it instead of #ifdef YYPURE.
14109
141102002-06-19 Akim Demaille <akim@epita.fr>
14111
14112 * data/bison.simple (b4_location_if): New.
58612f1d
AD
14113 Use it instead of #ifdef YYLSP_NEEDED.
14114
f25bfb75
AD
141152002-06-19 Akim Demaille <akim@epita.fr>
14116
14117 Prepare @$ in %destructor, but currently don't bind it in the
14118 skeleton, as %location use is not cleaned up yet.
14119
14120 * src/scan-gram.l (handle_dollar, handle_destructor_at)
14121 (handle_action_at): New.
14122 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
14123 a braced_code_t and a location as additional arguments.
14124 (handle_destructor_dollar): Instead of requiring `b4_eval', just
14125 unquote one when outputting `b4_dollar_dollar'.
14126 Adjust callers.
14127 * data/bison.simple (b4_eval): Remove.
14128 (b4_symbol_destructor): Adjust.
14129 * tests/input.at (Invalid @n): Adjust.
14130
c732d2c6
AD
141312002-06-19 Zack Weinberg <zack@codesourcery.com>
14132
14133 * doc/bison.texinfo: Document ability to have multiple
14134 prologue sections.
14135
8c165d89
AD
141362002-06-18 Akim Demaille <akim@epita.fr>
14137
14138 * src/files.c (compute_base_names): When computing the output file
14139 names from the input file name, strip the directory part.
14140
ca98bf57
AD
141412002-06-18 Akim Demaille <akim@epita.fr>
14142
14143 * data/bison.simple.new: Comment changes.
14144 Reported by Andreas Schwab.
14145
0bfb02ff
AD
141462002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
14147
14148 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
14149 there are no `label `yyoverflowlab' defined but not used' warnings
14150 when yyoverflow is defined.
14151
24c0aad7
AD
141522002-06-18 Akim Demaille <akim@epita.fr>
14153
14154 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
14155 new member.
14156 (symbol_destructor_set): Adjust.
14157 * src/output.c (symbol_destructors_output): Output the destructor
14158 locations.
14159 Output the symbol name.
14160 * data/bison.simple (b4_symbol_destructor): Adjust.
14161
5719c109
AD
141622002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
14163 and Akim Demaille <akim@epita.fr>
14164
14165 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
14166 what's left on the stack when the error recovery hits EOF.
14167 * tests/actions.at (Destructors): Complete to exercise this case.
14168
9280d3ef
AD
141692002-06-17 Akim Demaille <akim@epita.fr>
14170
14171 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
14172 arguments is really empty, not only equal to `[]'.
14173 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
14174 member.
14175 (symbol_destructor_set): New.
14176 * src/output.c (symbol_destructors_output): New.
14177 * src/reader.h (brace_code_t, current_braced_code): New.
14178 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
14179 (handle_dollar): Rename as...
14180 (handle_action_dollar): this.
14181 (handle_destructor_dollar): New.
14182 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
14183 (grammar_declaration): Use it.
14184 * data/bison.simple (yystos): Is always defined.
14185 (yydestructor): New.
14186 * tests/actions.at (Destructors): New.
14187 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
14188
dafdc66f
AD
141892002-06-17 Akim Demaille <akim@epita.fr>
14190
14191 * src/symlist.h, src/symlist.c (symbol_list_length): New.
14192 * src/scan-gram.l (handle_dollar, handle_at): Compute the
14193 rule_length only when needed.
14194 * src/output.c (actions_output, token_definitions_output): Output
14195 the full M4 block.
14196 * src/symtab.c: Don't access directly to the symbol tag, use
14197 symbol_tag_get.
14198 * src/parse-gram.y: Use symbol_list_free.
14199
56c47203
AD
142002002-06-17 Akim Demaille <akim@epita.fr>
14201
14202 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
14203 (symbol_list_prepend, get_type_name): Move to...
14204 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
14205 (symbol_list_prepend, symbol_list_n_type_name_get): here.
14206 Adjust all callers.
14207 (symbol_list_free): New.
14208 * src/scan-gram.l (handle_dollar): Takes a location.
14209 * tests/input.at (Invalid $n): Adjust.
14210
1e0bab92
AD
142112002-06-17 Akim Demaille <akim@epita.fr>
14212
14213 * src/reader.h, src/reader.c (symbol_list_new): Export it.
14214 (symbol_list_prepend): New.
14215 * src/parse-gram.y (%union): `list' is a new member.
14216 (symbols.1): New, replaces...
14217 (terms_to_prec.1, nterms_to_type.1): these.
14218 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
14219 Take a location as additional argument.
14220 Adjust all callers.
14221
04e60654
AD
142222002-06-15 Akim Demaille <akim@epita.fr>
14223
14224 * src/parse-gram.y: Move %token in the declaration section so that
14225 we don't depend upon CVS Bison.
14226
10e5b8bd
AD
142272002-06-15 Akim Demaille <akim@epita.fr>
14228
14229 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
14230 * src/print.c (print_core): Use it.
14231
9801d40c
AD
142322002-06-15 Akim Demaille <akim@epita.fr>
14233
14234 * src/conflicts.c (log_resolution): Accept the rule involved in
14235 the sr conflicts instead of the lookahead number that points to
14236 that rule.
14237 (flush_reduce): Accept the current lookahead vector as argument,
14238 instead of the index in LA.
14239 (resolve_sr_conflict): Accept the current number of lookahead
14240 bitset to consider for the STATE, instead of the index in LA.
14241 (set_conflicts): Adjust.
14242 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
14243
c0263492
AD
142442002-06-15 Akim Demaille <akim@epita.fr>
14245
14246 * src/state.h (state_t): Replace the `lookaheadsp' member, a
14247 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
14248 Adjust all dependencies.
14249 * src/lalr.c (initialize_lookaheads): Split into...
14250 (states_lookaheads_count, states_lookaheads_initialize): these.
14251 (lalr): Adjust.
14252
9757c359
AD
142532002-06-15 Akim Demaille <akim@epita.fr>
14254
14255 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
14256 out of...
14257 (grammar_rules_print): here.
14258 * src/reduce.c (reduce_output): Use it.
14259 * tests/reduce.at (Useless Rules, Reduced Automaton)
14260 (Underivable Rules): Adjust.
14261
6b98e4b5
AD
142622002-06-15 Akim Demaille <akim@epita.fr>
14263
14264 Copy BYacc's nice way to report the grammar.
14265
14266 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
14267 New.
14268 Don't print the rules' location, it is confusing and useless.
14269 (rule_print): Use grammar_rhs_print.
14270 * src/print.c (print_grammar): Use grammar_rules_print.
14271
6b98e4b5
AD
142722002-06-15 Akim Demaille <akim@epita.fr>
14273
14274 Complete and rationalize `useless thing' warnings.
14275
14276 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
14277 (symbol_tag_print): New.
14278 Use them everywhere in place of accessing directly the tag member.
14279 * src/gram.h, src/gram.c (rule_print): New.
14280 Use it where a rule used to be printed `by hand'.
14281 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
14282 (reduce_grammar_tables): Report the useless rules.
14283 (reduce_print): Useless things are a warning, not an error.
14284 Report it as such.
14285 * tests/reduce.at (Useless Nonterminals, Useless Rules):
14286 (Reduced Automaton, Underivable Rules): Adjust.
14287 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
14288 * tests/conflicts.at (Unresolved SR Conflicts)
14289 (Solved SR Conflicts): Adjust.
14290
ee000ba4
AD
142912002-06-15 Akim Demaille <akim@epita.fr>
14292
14293 Let symbols have a location.
14294
14295 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
14296 (getsym): Adjust.
14297 Adjust all callers.
14298 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
14299 Use location_t, not int.
14300 * src/symtab.c (symbol_check_defined): Take advantage of the
14301 location.
14302 * tests/regression.at (Invalid inputs): Adjust.
14303
8efe435c
AD
143042002-06-15 Akim Demaille <akim@epita.fr>
14305
14306 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
14307 (input): Don't try to initialize yylloc here, do it in the
14308 scanner.
14309 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
14310 * src/gram.h (rule_t): Change line and action_line into location
14311 and action_location, of location_t type.
14312 Adjust all dependencies.
14313 * src/location.h, src/location.c (empty_location): New.
14314 * src/reader.h, src/reader.c (grammar_start_symbol_set)
14315 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
14316 (grammar_current_rule_symbol_append)
14317 (grammar_current_rule_action_append): Expect a location as argument.
14318 * src/reader.c (grammar_midrule_action): Adjust to attach an
14319 action's location as dummy symbol location.
14320 * src/symtab.h, src/symtab.c (startsymbol_location): New.
14321 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
14322 the line numbers.
14323
1921f1d7
AD
143242002-06-14 Akim Demaille <akim@epita.fr>
14325
14326 Grammar declarations may be found in the grammar section.
14327
14328 * src/parse-gram.y (rules_or_grammar_declaration): New.
14329 (declarations): Each declaration may end with a semicolon, not
14330 just...
14331 (grammar_declaration): `"%union"'.
14332 (grammar): Branch to rules_or_grammar_declaration.
14333
4515534c
AD
143342002-06-14 Akim Demaille <akim@epita.fr>
14335
14336 * src/main.c (main): Invoke scanner_free.
14337
f958596b
AD
143382002-06-14 Akim Demaille <akim@epita.fr>
14339
14340 * src/output.c (m4_invoke): Extracted from...
14341 (output_skeleton): here.
14342 Free tempfile.
14343
2c569025
AD
143442002-06-14 Akim Demaille <akim@epita.fr>
14345
14346 * src/parse-gram.y (directives, directive, gram)
14347 (grammar_directives, precedence_directives, precedence_directive):
14348 Rename as...
14349 (declarations, declaration, grammar, grammar_declaration)
14350 (precedence_declaration, precedence_declarator): these.
14351 (symbol_declaration): New.
14352
592e8d4d
AD
143532002-06-14 Akim Demaille <akim@epita.fr>
14354
14355 * src/files.c (action_obstack): Remove, unused.
14356 (output_obstack): Remove it, and all its dependencies, as it is no
14357 longer needed.
14358 * src/reader.c (epilogue_set): Build the epilogue in the
14359 muscle_obstack.
14360 * src/output.h, src/output.c (muscle_obstack): Move to...
14361 * src/muscle_tab.h, src/muscle_tab.h: here.
14362 (muscle_init): Initialize muscle_obstack.
14363 (muscle_free): New.
14364 * src/main.c (main): Call it.
14365
0c15323d
AD
143662002-06-14 Akim Demaille <akim@epita.fr>
14367
14368 * src/location.h: New, extracted from...
14369 * src/reader.h: here.
14370 * src/Makefile.am (noinst_HEADERS): Merge into
14371 (bison_SOURCES): this.
14372 Add location.h.
14373 * src/parse-gram.y: Use location_t instead of Bison's.
14374 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
14375 Use location_t instead of ints.
14376
e96c9728
AD
143772002-06-14 Akim Demaille <akim@epita.fr>
14378
14379 * data/bison.simple, data/bison.c++: Be sure to restore the
14380 current #line when returning to the skeleton contents after having
14381 exposed the input file's #line.
14382
75d1fe16
AD
143832002-06-12 Akim Demaille <akim@epita.fr>
14384
14385 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
14386 eager.
14387 * tests/actions.at (Exotic Dollars): New.
14388
6c35d22c
AD
143892002-06-12 Akim Demaille <akim@epita.fr>
14390
14391 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
14392 ['"/] too eagerly.
14393 * tests/input.at (Torturing the Scanner): New.
14394
1d6412ad
AD
143952002-06-11 Akim Demaille <akim@epita.fr>
14396
14397 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
14398 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
14399 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
14400 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
14401 * src/reader.c (reader): Use it.
14402
4cdb01db
AD
144032002-06-11 Akim Demaille <akim@epita.fr>
14404
14405 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
14406 Adjust all callers.
14407 (scanner_last_string_free): New.
14408
44995b2e
AD
144092002-06-11 Akim Demaille <akim@epita.fr>
14410
14411 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
14412 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
14413 (last_string, YY_OBS_FREE): New.
14414 Use them when returning an ID.
14415
e9955c83
AD
144162002-06-11 Akim Demaille <akim@epita.fr>
14417
14418 Have Bison grammars parsed by a Bison grammar.
14419
14420 * src/reader.c, src/reader.h (prologue_augment): New.
14421 * src/reader.c (copy_definition): Remove.
14422
14423 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
14424 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
14425 (grammar_current_rule_prec_set, grammar_current_rule_check)
14426 (grammar_current_rule_symbol_append)
14427 (grammar_current_rule_action_append): Export.
14428 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
14429 (symbol_list_action_append): Remove.
14430 Hook the routines from reader.
14431 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
14432 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
14433
14434 * src/reader.c (read_declarations): Remove, unused.
14435
14436 * src/parse-gram.y: Handle the epilogue.
14437 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
14438 (grammar_start_symbol_set): this.
14439 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
14440 * src/reader.c (readgram): Remove, unused.
14441 (reader): Adjust to insert eoftoken and axiom where appropriate.
14442
14443 * src/reader.c (copy_dollar): Replace with...
14444 * src/scan-gram.h (handle_dollar): this.
14445 * src/parse-gram.y: Remove `%thong'.
14446
14447 * src/reader.c (copy_at): Replace with...
14448 * src/scan-gram.h (handle_at): this.
14449
14450 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
14451 New.
14452
14453 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
14454 time being.
14455
14456 * src/reader.h, src/reader.c (grammar_rule_end): New.
14457
14458 * src/parse.y (current_type, current_class): New.
14459 Implement `%nterm', `%token' support.
14460 Merge `%term' into `%token'.
14461 (string_as_id): New.
14462 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
14463 type name.
14464
14465 * src/parse-gram.y: Be sure to handle properly the beginning of
14466 rules.
14467
14468 * src/parse-gram.y: Handle %type.
14469 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
14470
14471 * src/parse-gram.y: More directives support.
14472 * src/options.c: No longer handle source directives.
14473
14474 * src/parse-gram.y: Fix %output.
14475
14476 * src/parse-gram.y: Handle %union.
14477 Use the prologue locations.
14478 * src/reader.c (parse_union_decl): Remove.
14479
14480 * src/reader.h, src/reader.c (epilogue_set): New.
14481 * src/parse-gram.y: Use it.
14482
14483 * data/bison.simple, data/bison.c++: b4_stype is now either not
14484 defined, then default to int, or to the contents of %union,
14485 without `union' itself.
14486 Adjust.
14487 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
14488
14489 * src/output.c (actions_output): Don't output braces, as they are
14490 already handled by the scanner.
14491
14492 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
14493 characters to themselves.
14494
14495 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
14496 that the epilogue has a proper #line.
14497
14498 * src/parse-gram.y: Handle precedence/associativity.
14499
14500 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
14501 a terminal.
14502 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
14503 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
14504 at all to define terminals that cannot be emitted.
14505
14506 * src/scan-gram.l: Escape M4 characters.
14507
14508 * src/scan-gram.l: Working properly with escapes in user
14509 strings/characters.
14510
14511 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
14512 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
14513 grammar.
14514 Use more modest sizes, as for the time being the parser does not
14515 release memory, and therefore the process swallows a huge amount
14516 of memory.
14517
14518 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
14519 stricter %token grammar.
14520
14521 * src/symtab.h (associativity): Add `undef_assoc'.
14522 (symbol_precedence_set): Do nothing when passed an undef_assoc.
14523 * src/symtab.c (symbol_check_alias_consistence): Adjust.
14524
14525 * tests/regression.at (Invalid %directive): Remove, as it is now
14526 meaningless.
14527 (Invalid inputs): Adjust to the new error messages.
14528 (Token definitions): The new grammar doesn't allow too many
14529 eccentricities.
14530
14531 * src/lex.h, src/lex.c: Remove.
14532 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
14533 (copy_character, copy_string2, copy_string, copy_identifier)
14534 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
14535 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
14536 (parse_action): Remove.
14537 * po/POTFILES.in: Adjust.
14538
2e047461
AD
145392002-06-11 Akim Demaille <akim@epita.fr>
14540
cd05d13c 14541 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
14542 rule's action member: return the action as a string.
14543 Don't require `rule_length' as an argument: compute it.
14544 (grammar_current_rule_symbol_append)
14545 (grammar_current_rule_action_append): New, eved out from
14546 (readgram): here.
14547 Remove `action_flag', `rulelength', unused now.
14548
9af3fbce
AD
145492002-06-11 Akim Demaille <akim@epita.fr>
14550
14551 * src/reader.c (grammar_current_rule_prec_set).
14552 (grammar_current_rule_check): New, eved out from...
14553 (readgram): here.
14554 Remove `xaction', `first_rhs': useless.
14555 * tests/input.at (Type clashes): New.
14556 * tests/existing.at (GNU Cim Grammar): Adjust.
14557
1485e106
AD
145582002-06-11 Akim Demaille <akim@epita.fr>
14559
14560 * src/reader.c (grammar_midrule_action): New, Eved out from
14561 (readgram): here.
14562
da4160c3
AD
145632002-06-11 Akim Demaille <akim@epita.fr>
14564
14565 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
14566 New.
14567 (readgram): Use them as replacement of inlined code, crule and
14568 crule1.
14569
f6d0f937
AD
145702002-06-11 Akim Demaille <akim@epita.fr>
14571
14572 * src/reader.c (grammar_end, grammar_symbol_append): New.
14573 (readgram): Use them.
14574 Make the use of `p' as local as possible.
14575
69078d4b
AD
145762002-06-10 Akim Demaille <akim@epita.fr>
14577
14578 GCJ's parser requires the tokens to be defined before the prologue.
14579
14580 * data/bison.simple: Output the token definition before the user's
14581 prologue.
14582 * tests/regression.at (Braces parsing, Duplicate string)
14583 (Mixing %token styles): Check the output from bison.
14584 (Early token definitions): New.
14585
5e424082
AD
145862002-06-10 Akim Demaille <akim@epita.fr>
14587
14588 * src/symtab.c (symbol_user_token_number_set): Don't complain when
14589 assigning twice the same user number to a token, so that we can
14590 use it in...
14591 * src/lex.c (lex): here.
14592 Also use `symbol_class_set' instead of hand written code.
14593 * src/reader.c (parse_assoc_decl): Likewise.
14594
44536b35
AD
145952002-06-10 Akim Demaille <akim@epita.fr>
14596
14597 * src/symtab.c, src/symtab.c (symbol_class_set)
14598 (symbol_user_token_number_set): New.
14599 * src/reader.c (parse_token_decl): Use them.
14600 Use a switch instead of ifs.
14601 Use a single argument.
14602
8b9f2372
AD
146032002-06-10 Akim Demaille <akim@epita.fr>
14604
14605 Remove `%thong' support as it is undocumented, unused, duplicates
14606 `%token's job, and creates useless e-mail traffic with people who
14607 want to know what it is, why it is undocumented, unused, and
14608 duplicates `%token's job.
14609
14610 * src/reader.c (parse_thong_decl): Remove.
14611 * src/options.c (option_table): Remove "thong".
14612 * src/lex.h (tok_thong): Remove.
14613
3ae2b51f
AD
146142002-06-10 Akim Demaille <akim@epita.fr>
14615
14616 * src/symtab.c, src/symtab.c (symbol_type_set)
14617 (symbol_precedence_set): New.
14618 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
14619 (value_components_used): Remove, unused.
14620
2f1afb73
AD
146212002-06-09 Akim Demaille <akim@epita.fr>
14622
14623 Move symbols handling code out of the reader.
14624
14625 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
14626 (axiom): Move to...
14627 * src/symtab.h, src/symtab.c: here.
14628
14629 * src/gram.c (start_symbol): Remove: use startsymbol->number.
14630 * src/reader.c (startval): Rename as...
14631 * src/symtab.h, src/symtab.c (startsymbol): this.
14632 * src/reader.c: Adjust.
14633
14634 * src/reader.c (symbol_check_defined, symbol_make_alias)
14635 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14636 (token_translations_init)
14637 Move to...
14638 * src/symtab.c: here.
14639 * src/reader.c (packsymbols): Move to...
14640 * src/symtab.h, src/symtab.c (symbols_pack): here.
14641 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
14642 argument.
14643
e9bca3ad
AD
146442002-06-03 Akim Demaille <akim@epita.fr>
14645
14646 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
14647 then statements.
14648
86eff183
AD
146492002-06-03 Akim Demaille <akim@epita.fr>
14650
14651 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
14652 structs with non literals.
14653 * src/scan-skel.l: never-interactive.
14654 * src/conflicts.c (enum conflict_resolution_e): No trailing
14655 comma.
14656 * src/getargs.c (usage): Split long literal strings.
14657 Reported by Hans Aberg.
14658
717be197
AD
146592002-05-28 Akim Demaille <akim@epita.fr>
14660
14661 * data/bison.c++: Use C++ ostreams.
14662 (cdebug_): New member.
14663
670ddffd
AD
146642002-05-28 Akim Demaille <akim@epita.fr>
14665
14666 * src/output.c (output_skeleton): Be sure to allocate enough room
14667 for `/' _and_ for `\0' in full_skeleton.
14668
769b430f
AD
146692002-05-28 Akim Demaille <akim@epita.fr>
14670
14671 * data/bison.c++: Catch up with bison.simple:
14672 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14673 and Paul Eggert <eggert@twinsun.com>: `error' handing.
14674 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
14675 and popping traces.
14676
7067cb36
PH
146772002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14678
14679 * src/output.c (output_skeleton): Put an explicit path in front of
14680 the skeleton file name, rather than relying on the -I directory,
14681 to partially alleviate effects of having a skeleton file lying around
14682 in the current directory.
769b430f 14683
4a713ec2
PH
146842002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14685
769b430f 14686 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
14687 obstack_printf should be obstack_fgrow1.
14688
b408954b
AD
146892002-05-26 Akim Demaille <akim@epita.fr>
14690
14691 * src/state.h (state_t): `solved_conflicts' is a new member.
14692 * src/LR0.c (new_state): Set it to 0.
14693 * src/conflicts.h, src/conflicts.c (print_conflicts)
14694 (free_conflicts, solve_conflicts): Rename as...
14695 (conflicts_print, conflicts_free, conflicts_solve): these.
14696 Adjust callers.
14697 * src/conflicts.c (enum conflict_resolution_e)
14698 (solved_conflicts_obstack): New, used by...
14699 (log_resolution): this.
14700 Adjust to attach the conflict resolution to each state.
14701 Complete the description with the precedence/associativity
14702 information.
14703 (resolve_sr_conflict): Adjust.
14704 * src/print.c (print_state): Output its solved_conflicts.
14705 * tests/conflicts.at (Unresolved SR Conflicts)
14706 (Solved SR Conflicts): Exercise --report=all.
14707
a49aecd5
AD
147082002-05-26 Akim Demaille <akim@epita.fr>
14709
14710 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14711 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14712 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
14713 (token_number_t, item_number_as_token_number)
14714 (token_number_as_item_number, muscle_insert_token_number_table):
14715 Rename as...
14716 (symbol_number_t, item_number_as_symbol_number)
14717 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
14718 these, since it is more appropriate.
14719
5504898e
AD
147202002-05-26 Akim Demaille <akim@epita.fr>
14721
14722 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
14723 `Error:' lines.
14724 * data/bison.simple (yystos) [YYDEBUG]: New.
14725 (yyparse) [YYDEBUG]: Display the symbols which are popped during
14726 error recovery.
14727 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
14728
ec3bc396
AD
147292002-05-25 Akim Demaille <akim@epita.fr>
14730
14731 * doc/bison.texinfo (Debugging): Split into...
14732 (Tracing): this new section, its former contents, and...
14733 (Understanding): this new section.
14734 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
14735 by...
14736 (report_flag): this.
14737 Adjust all dependencies.
14738 (report_args, report_types, report_argmatch): New.
14739 (usage, getargs): Report/support -r, --report.
14740 * src/options.h
14741 (struct option_table_struct): Rename as..,
14742 (struct option_table_s): this.
14743 Rename the `set_flag' member to `flag' to match with getopt_long's
14744 struct.
14745 * src/options.c (option_table): Split verbose into an entry for
14746 %verbose, and another for --verbose.
14747 Support --report/-r, so remove -r from the obsolete --raw.
14748 * src/print.c: Attach full item sets and lookaheads reports to
14749 report_flag instead of trace_flag.
14750 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
14751
78df8250
PE
147522002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14753 and Paul Eggert <eggert@twinsun.com>
769b430f 14754
78df8250
PE
14755 * data/bison.simple (yyparse): Correct error handling to conform to
14756 POSIX and yacc. Specifically, after syntax error is discovered,
14757 do not reduce further before shifting the error token.
14758 Clean up the code a bit by removing the labels yyerrdefault,
14759 yyerrhandle, yyerrpop.
14760 * NEWS: Document the above.
14761
c0c9ea05
PH
147622002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14763
14764 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
14765 type; it isn't always big enough, since it doesn't necessarily
14766 include non-terminals.
769b430f 14767 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
14768 the latter can be removed.
14769 (yy_token_number_type): Remove, only one use.
14770 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
14771 don't use TokenNumberType as element type.
769b430f 14772
c0c9ea05
PH
14773 * tests/regression.at: Modify expected output to agree with change
14774 to yyr1 and yytranslate.
769b430f 14775
6390a83f
FK
147762002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
14777
14778 * src/reader.c (parse_action): Use copy_character instead of
14779 obstack_1grow.
14780
db7c8e9a
AD
147812002-05-13 Akim Demaille <akim@epita.fr>
14782
14783 * tests/regression.at (Token definitions): Prototype yylex and
14784 yyerror.
14785
fcc61800
PH
147862002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14787
158c687b 14788 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
14789 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
14790 32-bit arithmetic.
14791 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
14792
5683e9b2
AD
147932002-05-07 Akim Demaille <akim@epita.fr>
14794
14795 * tests/synclines.at: Be sure to prototype yylex and yyerror to
14796 avoid GCC warnings.
14797
0c2d3f4c
AD
147982002-05-07 Akim Demaille <akim@epita.fr>
14799
14800 Kill GCC warnings.
14801
14802 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
14803 over the RHS of each rule.
14804 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
14805 * src/state.h (state_t): Member `nitems' is unsigned short.
14806 * src/LR0.c (get_state): Adjust.
14807 * src/reader.c (packgram): Likewise.
14808 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
14809 `Type'.
14810 (muscle_insert_int_table): Remove, unused.
14811 (prepare_rules): Remove `max'.
14812
1565b720
AD
148132002-05-06 Akim Demaille <akim@epita.fr>
14814
14815 * src/closure.c (print_firsts): Display of the symbol tags.
14816 (bitmatrix_print): Move to...
14817 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
14818 here.
14819 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
14820
cfaee611
AD
148212002-05-06 Akim Demaille <akim@epita.fr>
14822
14823 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
14824 hash_do_for_each.
14825
458be8e0
AD
148262002-05-06 Akim Demaille <akim@epita.fr>
14827
14828 * src/LR0.c (new_state, get_state): Instead of using the global
14829 `kernel_size' and `kernel_base', have two new arguments:
14830 `core_size' and `core'.
14831 Adjust callers.
14832
a900a624
AD
148332002-05-06 Akim Demaille <akim@epita.fr>
14834
14835 * src/reader.c (packgram): No longer end `ritem' with a 0
14836 sentinel: it is not used.
14837
d4e7d3a1
AD
148382002-05-05 Akim Demaille <akim@epita.fr>
14839
14840 New experimental feature: display the lookaheads in the report and
14841 graph.
14842
14843 * src/print (print_core): When --trace-flag, display the rules
14844 lookaheads.
14845 * src/print_graph.c (print_core): Likewise.
14846 Swap the arguments.
14847 Adjust caller.
14848
39ceb25b
AD
148492002-05-05 Akim Demaille <akim@epita.fr>
14850
14851 * tests/torture.at (Many lookaheads): New test.
14852
5372019f
AD
148532002-05-05 Akim Demaille <akim@epita.fr>
14854
14855 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
14856 (GENERATE_MUSCLE_INSERT_TABLE): this.
14857 (output_int_table, output_unsigned_int_table, output_short_table)
14858 (output_token_number_table, output_item_number_table): Replace with...
14859 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
14860 (muscle_insert_short_table, muscle_insert_token_number_table)
14861 (muscle_insert_item_number_table): these.
14862 Adjust all callers.
14863 (prepare_tokens): Don't free `translations', since...
14864 * src/reader.h, src/reader.c (grammar_free): do it.
14865 Move to...
14866 * src/gram.h, src/gram.c (grammar_free): here.
14867 * data/bison.simple, data/bison.c++: b4_token_number_max is now
14868 b4_translate_max.
14869
5df5f6d5
AD
148702002-05-05 Akim Demaille <akim@epita.fr>
14871
14872 * src/output.c (output_unsigned_int_table): New.
14873 (prepare_rules): `i' is unsigned.
14874 `prhs', `rline', `r2' are unsigned int.
14875 Rename muscle `rhs_number_max' as `rhs_max'.
14876 Output muscles `prhs_max', `rline_max', and `r2_max'.
14877 Free rline and r1.
14878 * data/bison.simple, data/bison.c++: Adjust to use these muscles
14879 to compute types instead of constant types.
14880 * tests/regression.at (Web2c Actions): Adjust.
14881
b87f8b21
AD
148822002-05-04 Akim Demaille <akim@epita.fr>
14883
14884 * src/symtab.h (SALIAS, SUNDEF): Rename as...
14885 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
14886 Adjust dependencies.
14887 * src/output.c (token_definitions_output): Be sure not to output a
14888 `#define 'a'' when fed with `%token 'a' "a"'.
14889 * tests/regression.at (Token definitions): New.
14890
8bb936e4
PE
148912002-05-03 Paul Eggert <eggert@twinsun.com>
14892
14893 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
14894 for K&R C.
14895
148962002-05-03 gettextize <bug-gnu-gettext@gnu.org>
14897
14898 * Makefile.am (SUBDIRS): Remove intl.
14899 (EXTRA_DIST): Add config/config.rpath.
14900
53c71a12
AD
149012002-05-03 Akim Demaille <akim@epita.fr>
14902
14903 * data/bison.simple (m4_if): Don't output empty enums.
14904 And actually, output valid enum definitions :(.
14905
289dd0cf
AD
149062002-05-03 Akim Demaille <akim@epita.fr>
14907
14908 * configure.bat: Remove, completely obsolete.
14909 * Makefile.am (EXTRA_DIST): Adjust.
14910 Don't distribute config.rpath...
14911 * config/Makefile.am (EXTRA_DIST): Do it.
14912
db85e524
AD
149132002-05-03 Akim Demaille <akim@epita.fr>
14914
14915 * configure.in (GETTEXT_VERSION): New.
14916 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
14917
83ccf991
AD
149182002-05-03 Akim Demaille <akim@epita.fr>
14919
14920 * data/bison.simple (b4_token_enum): New.
14921 (b4_token_defines): Use it to output tokens both as #define and
14922 enums.
14923 Suggested by Paul Eggert.
14924 * src/output.c (token_definitions_output): Don't output spurious
14925 white spaces.
14926
1f418995
AD
149272002-05-03 Akim Demaille <akim@epita.fr>
14928
14929 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14930
45119f04
RA
149312002-05-02 Robert Anisko <robert@lrde.epita.fr>
14932
14933 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
14934 Update the stack class, give a try to deque as the default container.
14935
b2d52318
AD
149362002-05-02 Akim Demaille <akim@epita.fr>
14937
14938 * data/bison.simple (yyparse): Do not implement @$ = @1.
14939 (YYLLOC_DEFAULT): Adjust to do it.
14940 * doc/bison.texinfo (Location Default Action): Fix.
14941
3a8b4109
AD
149422002-05-02 Akim Demaille <akim@epita.fr>
14943
14944 * src/reader.c (parse_braces): Merge into...
14945 (parse_action): this.
14946
84614e13
AD
149472002-05-02 Akim Demaille <akim@epita.fr>
14948
14949 * configure.in (ALL_LINGUAS): Remove.
14950 * po/LINGUAS, hr.po: New.
14951
fdbcd8e2
AD
149522002-05-02 Akim Demaille <akim@epita.fr>
14953
14954 Remove the so called hairy (semantic) parsers.
14955
14956 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
14957 * src/gram.h, src/gram.c (semantic_parser): Remove.
14958 (rule_t): Remove the guard and guard_line members.
14959 * src/lex.h (token_t): remove tok_guard.
14960 * src/options.c (option_table): Remove %guard and %semantic_parser
14961 support.
14962 * src/output.c, src/output.h (guards_output): Remove.
14963 (prepare): Adjust.
14964 (token_definitions_output): Don't output the `T'
14965 tokens (???).
14966 (output_skeleton): Don't output the guards.
14967 * src/files.c, src/files.c (attrsfile): Remove.
14968 * src/reader.c (symbol_list): Remove the guard and guard_line
14969 members.
14970 Adjust dependencies.
14971 (parse_guard): Remove.
14972 * data/bison.hairy: Remove.
14973 * doc/bison.texinfo (Environment Variables): Remove occurrences of
14974 BISON_HAIRY.
14975
82b6cb3f
AD
149762002-05-02 Akim Demaille <akim@epita.fr>
14977
14978 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
14979 (parse_guard): Rename the formal argument `stack_offset' as
14980 `rule_length', which is more readable.
14981 Adjust callers.
14982 (copy_at, copy_dollar): Instead of outputting the hard coded
14983 values of $$, $n and so forth, output invocation to b4_lhs_value,
14984 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
14985 Note: this patch partially drops `semantic-parser' support: it
14986 always does `rule_length - n', where semantic parsers ought to
14987 always use `-n'.
82b6cb3f
AD
14988 * data/bison.simple, data/bison.c++ (b4_lhs_value)
14989 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
14990
6cbfbcc5
AD
149912002-05-02 Akim Demaille <akim@epita.fr>
14992
14993 * configure.in (AC_INIT): Bump to 1.49b.
14994 (AM_INIT_AUTOMAKE): Short invocation.
14995
b8548114
AD
149962002-05-02 Akim Demaille <akim@epita.fr>
14997
14998 Version 1.49a.
14999
c20cd1fa
AD
150002002-05-01 Akim Demaille <akim@epita.fr>
15001
15002 * src/skeleton.h: Remove.
15003
8a9566d4
AD
150042002-05-01 Akim Demaille <akim@epita.fr>
15005
15006 * src/skeleton.h: Fix the #endif.
15007 Reported by Magnus Fromreide.
15008
8c6d399a
PE
150092002-04-26 Paul Eggert <eggert@twinsun.com>
15010
15011 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
15012 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 15013 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 15014
2b7ed18a
RA
150152002-04-25 Robert Anisko <robert@lrde.epita.fr>
15016
15017 * src/scan-skel.l: Postprocess quadrigraphs.
15018
15019 * src/reader.c (copy_character): New function, used to output
15020 single characters while replacing `[' and `]' with quadrigraphs, to
15021 avoid troubles with M4 quotes.
15022 (copy_comment): Output characters with copy_character.
15023 (read_additionnal_code): Likewise.
15024 (copy_string2): Likewise.
15025 (copy_definition): Likewise.
15026
15027 * tests/calc.at: Exercise M4 quoting.
15028
34a89c50
AD
150292002-04-25 Akim Demaille <akim@epita.fr>
15030
15031 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
15032 between `!' and the command.
15033 Reported by Paul Eggert.
15034
0dd1580a
RA
150352002-04-24 Robert Anisko <robert@lrde.epita.fr>
15036
15037 * tests/calc.at: Exercise prologue splitting.
15038
15039 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
15040 `b4_post_prologue' instead of `b4_prologue'.
15041
15042 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
15043 muscles.
15044 (output): Free pre_prologue_obstack and post_prologue_obstack.
15045 * src/files.h, src/files.c (attrs_obstack): Remove.
15046 (pre_prologue_obstack, post_prologue_obstack): New.
15047 * src/reader.c (copy_definition): Add a parameter to specify the
15048 obstack to fill, instead of using attrs_obstack unconditionally.
15049 (read_declarations): Pass pre_prologue_obstack to copy_definition if
15050 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
15051
83c1796f
PE
150522002-04-23 Paul Eggert <eggert@twinsun.com>
15053
15054 * data/bison.simple: Remove unnecessary commentary and white
15055 space differences from 1_29-branch.
15056 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
15057
15058 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
15059 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
15060 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
15061 constructors or destructors.
15062
15063 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
15064
1207eeac
AD
150652002-04-23 Akim Demaille <akim@epita.fr>
15066
15067 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
15068 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
15069 location with columns.
15070 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
15071 All reported by Paul Eggert.
15072
78ab8f67
AD
150732002-04-22 Akim Demaille <akim@epita.fr>
15074
15075 * src/reduce.c (dump_grammar): Move to...
15076 * src/gram.h, src/gram.c (grammar_dump): here.
15077 Be sure to separate long item numbers.
15078 Don't read the members of a rule's prec if its nil.
15079
133c20e2
AD
150802002-04-22 Akim Demaille <akim@epita.fr>
15081
15082 * src/output.c (table_size, table_grow): New.
15083 (MAXTABLE): Remove, replace uses with table_size.
15084 (pack_vector): Instead of dying when the table is too big, grow it.
15085
9515e8a7
AD
150862002-04-22 Akim Demaille <akim@epita.fr>
15087
15088 * data/bison.simple (yyr1): Its type is that of a token number.
15089 * data/bison.c++ (r1_): Likewise.
15090 * tests/regression.at (Web2c Actions): Adjust.
15091
23c5a174
AD
150922002-04-22 Akim Demaille <akim@epita.fr>
15093
15094 * src/reader.c (token_translations_init): 256 is now the default
15095 value for the error token, i.e., it will be assigned another
15096 number if the user assigned 256 to one of her tokens.
15097 (reader): Don't force 256 to error.
15098 * doc/bison.texinfo (Symbols): Adjust.
15099 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
15100 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
15101 etc. instead of 10, 20, 30 (which was used to `jump' over error
15102 (256) and undefined (2)).
15103
5fbb0954
AD
151042002-04-22 Akim Demaille <akim@epita.fr>
15105
15106 Propagate more token_number_t.
15107
15108 * src/gram.h (token_number_as_item_number)
15109 (item_number_as_token_number): New.
15110 * src/output.c (GENERATE_OUTPUT_TABLE): New.
15111 Use it to create output_item_number_table and
15112 output_token_number_table.
15113 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15114 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
15115 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
15116 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
15117
4f940944
AD
151182002-04-22 Akim Demaille <akim@epita.fr>
15119
15120 * src/output.h, src/output.c (get_lines_number): Remove.
15121
3ded9a63
AD
151222002-04-19 Akim Demaille <akim@epita.fr>
15123
15124 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
15125 as Lex/Flex'.
15126 (Debugging): More details about enabling the debugging features.
15127 (Table of Symbols): Describe $$, $n, @$, and @n.
15128 Suggested by Tim Josling.
15129
e0c471a9
AD
151302002-04-19 Akim Demaille <akim@epita.fr>
15131
15132 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
15133
fecc10cd
AD
151342002-04-10 Akim Demaille <akim@epita.fr>
15135
15136 * src/system.h: Rely on HAVE_LIMITS_H.
15137 Suggested by Paul Eggert.
15138
51dec47b
AD
151392002-04-09 Akim Demaille <akim@epita.fr>
15140
15141 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
15142 full stderr, and strip it according to the bison options, instead
15143 of composing the error message from different bits.
15144 This makes it easier to check for several error messages.
15145 Adjust all the invocations.
15146 Add an invocation exercising the error token.
15147 Add an invocation demonstrating a stupid error message.
15148 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
15149 Adjust the tests.
15150 Error message are for stderr, not stdout.
15151
007a50a4
AD
151522002-04-09 Akim Demaille <akim@epita.fr>
15153
15154 * src/gram.h, src/gram.c (error_token_number): Remove, use
15155 errtoken->number.
15156 * src/reader.c (reader): Don't specify the user token number (2)
15157 for $undefined, as it uselessly prevents using it.
15158 * src/gram.h (token_number_t): Move to...
15159 * src/symtab.h: here.
15160 (state_t.number): Is a token_number_t.
15161 * src/print.c, src/reader.c: Use undeftoken->number instead of
15162 hard coded 2.
15163 (Even though this 2 is not the same as above: the number of the
15164 undeftoken remains being 2, it is its user token number which
15165 might not be 2).
15166 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
15167 `user_token_number_max'.
15168 Output `undef_token_number'.
15169 * data/bison.simple, data/bison.c++: Use them.
15170 Be sure to map invalid yylex return values to
15171 `undef_token_number'. This saves us from gratuitous SEGV.
15172
15173 * tests/conflicts.at (Solved SR Conflicts)
15174 (Unresolved SR Conflicts): Adjust.
15175 * tests/regression.at (Web2c Actions): Adjust.
15176
06446ccf
AD
151772002-04-08 Akim Demaille <akim@epita.fr>
15178
15179 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
15180 Adding #line.
15181 Remove the duplicate `typedefs'.
15182 (RhsNumberType): Fix the declaration and various other typos.
15183 Use __ofile__.
15184 * data/bison.simple: Use __ofile__.
15185 * src/scan-skel.l: Handle __ofile__.
15186
62a3e4f0
AD
151872002-04-08 Akim Demaille <akim@epita.fr>
15188
15189 * src/gram.h (item_number_t): New, the type of item numbers in
15190 RITEM. Note that it must be able to code symbol numbers as
15191 positive number, and the negation of rule numbers as negative
15192 numbers.
15193 Adjust all dependencies (pretty many).
15194 * src/reduce.c (rule): Remove this `short *' pointer: use
15195 item_number_t.
15196 * src/system.h (MINSHORT, MAXSHORT): Remove.
15197 Include `limits.h'.
15198 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
15199 (shortcpy): Remove.
15200 (MAXTABLE): Move to...
15201 * src/output.c (MAXTABLE): here.
15202 (prepare_rules): Use output_int_table to output rhs.
15203 * data/bison.simple, data/bison.c++: Adjust.
15204 * tests/torture.at (Big triangle): Move the limit from 254 to
15205 500.
15206 * tests/regression.at (Web2c Actions): Ajust.
15207
15208 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
15209 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
15210 passes, but produces negative #line number, once fixed, GCC is
15211 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
15212 C), it passes.
15213 * src/state.h (state_h): Code input lines on ints, not shorts.
15214
bb88b0fc
AD
152152002-04-08 Akim Demaille <akim@epita.fr>
15216
15217 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
15218 and then the grammar.
15219
9a636f47
AD
152202002-04-08 Akim Demaille <akim@epita.fr>
15221
15222 * src/system.h: No longer using strndup.
15223
680e8701
AD
152242002-04-07 Akim Demaille <akim@epita.fr>
15225
15226 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
15227 * src/output.c (output_table_data): Return the longest number.
15228 (prepare_tokens): Output `token_number_max').
15229 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
15230 New.
15231 Use them to define yy_token_number_type/TokenNumberType.
15232 Use this type for yytranslate.
15233 * tests/torture.at (Big triangle): Push the limit from 124 to
15234 253.
15235 * tests/regression.at (Web2c Actions): Adjust.
15236
817e9f41
AD
152372002-04-07 Akim Demaille <akim@epita.fr>
15238
15239 * tests/torture.at (Big triangle): New.
15240 (GNU AWK Grammar, GNU Cim Grammar): Move to...
15241 * tests/existing.at: here.
15242
5123689b
AD
152432002-04-07 Akim Demaille <akim@epita.fr>
15244
15245 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
15246 nritems.
15247 Adjust dependencies.
15248
f3849179
AD
152492002-04-07 Akim Demaille <akim@epita.fr>
15250
15251 * src/reader.c: Normalize increments to prefix form.
15252
bd02036a
AD
152532002-04-07 Akim Demaille <akim@epita.fr>
15254
15255 * src/reader.c, symtab.c: Remove debugging code.
15256
db8837cb
AD
152572002-04-07 Akim Demaille <akim@epita.fr>
15258
15259 Rename all the `bucket's as `symbol_t'.
15260
15261 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
15262 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
15263 * src/symtab.c, src/symtab.h (bucket): Rename as...
15264 (symbol_t): this.
15265 (symbol_list_new, bucket_check_defined, bucket_make_alias)
15266 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
15267 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
15268 (buckets_new, buckets_free, buckets_do): Rename as...
15269 (symbol_list_new, symbol_check_defined, symbol_make_alias)
15270 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15271 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
15272 (symbols_new, symbols_free, symbols_do): these.
15273
72a23c97
AD
152742002-04-07 Akim Demaille <akim@epita.fr>
15275
15276 Use lib/hash for the symbol table.
15277
15278 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
15279 EOF.
15280 * src/lex.c (lex): Set the `number' member of new terminals.
15281 * src/reader.c (bucket_check_defined, bucket_make_alias)
15282 (bucket_check_alias_consistence, bucket_translation): New.
15283 (reader, grammar_free, readgram, token_translations_init)
15284 (packsymbols): Adjust.
15285 (reader): Number the predefined tokens.
15286 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
15287 for predefined tokens.
15288 * src/symtab.h (bucket): Remove all the hash table related
15289 members.
15290 * src/symtab.c (symtab): Replace by...
15291 (bucket_table): this.
15292 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
15293 (buckets_new, buckets_do): New.
15294
280a38c3
AD
152952002-04-07 Akim Demaille <akim@epita.fr>
15296
15297 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
15298 (start_symbol, max_user_token_number, semantic_parser)
15299 (error_token_number): Initialize.
15300 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
15301 Initialize.
15302 (reader): Don't.
15303 (errtoken, eoftoken, undeftoken, axiom): Extern.
15304
03b31c0c
AD
153052002-04-07 Akim Demaille <akim@epita.fr>
15306
15307 * src/gram.h (rule_s): prec and precsym are now pointers
15308 to the bucket giving the priority/associativity.
15309 Member `associativity' removed: useless.
15310 * src/reduce.c, src/conflicts.c: Adjust.
15311
8b3df748
AD
153122002-04-07 Akim Demaille <akim@epita.fr>
15313
15314 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
15315 Properly escape the symbols' TAG when outputting them.
15316
e601aa1d
AD
153172002-04-07 Akim Demaille <akim@epita.fr>
15318
15319 * src/lalr.h (LA): Is a bitsetv, not bitset*.
15320
b0299a2e
AD
153212002-04-07 Akim Demaille <akim@epita.fr>
15322
15323 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
15324 (LArule): this, which is an array to rule_t*.
15325 * src/print.c, src/conflicts.c: Adjust.
15326
d7e1f00c
AD
153272002-04-07 Akim Demaille <akim@epita.fr>
15328
15329 * src/gram.h (rule_t): Rename `number' as `user_number'.
15330 `number' is a new member.
15331 Adjust dependencies.
15332 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
15333
cc9305dd
AD
153342002-04-07 Akim Demaille <akim@epita.fr>
15335
15336 As a result of the previous patch, it is no longer needed
15337 to reorder ritem itself.
15338
15339 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
15340
b0940840
AD
153412002-04-07 Akim Demaille <akim@epita.fr>
15342
15343 Be sure never to walk through RITEMS, but use only data related to
15344 the rules themselves. RITEMS should be banished.
15345
15346 * src/output.c (output_token_translations): Rename as...
15347 (prepare_tokens): this.
15348 In addition to `translate', prepare the muscles `tname' and
15349 `toknum', which were handled by...
15350 (output_rule_data): this.
15351 Remove, and move the remainder of its outputs into...
15352 (prepare_rules): this new routines, which also merges content from
15353 (output_gram): this.
15354 (prepare_rules): Be sure never to walk through RITEMS.
15355 (output_stos): Rename as...
15356 (prepare_stos): this.
15357 (output): Always invoke prepare_states, after all, just don't use it
15358 in the output if you don't need it.
15359
643a5994
AD
153602002-04-07 Akim Demaille <akim@epita.fr>
15361
15362 * src/LR0.c (new_state): Display `nstates' as the name of the
15363 newly created state.
15364 Adjust to initialize first_state and last_state if needed.
15365 Be sure to distinguish the initial from the final state.
15366 (new_states): Create the itemset of the initial state, and use
15367 new_state.
15368 * src/closure.c (closure): Now that the initial state has its
15369 items properly set, there is no need for a special case when
15370 creating `ruleset'.
15371
15372 As a result, now the rule 0, reducing to $axiom, is visible in the
15373 outputs. Adjust the test suite.
15374
15375 * tests/conflicts.at (Solved SR Conflicts)
15376 (Unresolved SR Conflicts): Adjust.
15377 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
15378 * tests/conflicts.at (S/R in initial): New.
15379
b4c4ccc2
AD
153802002-04-07 Akim Demaille <akim@epita.fr>
15381
15382 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
15383 the RHS of the rules.
15384 * src/output.c (output_gram): Likewise.
15385
bba97eb2
AD
153862002-04-07 Akim Demaille <akim@epita.fr>
15387
15388 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
15389 bucket.
15390 Adjust all dependencies.
15391 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
15392 `number' of the buckets too.
15393 * src/gram.h: Include `symtab.h'.
15394 (associativity): Move to...
15395 * src/symtab.h: here.
15396 No longer include `gram.h'.
15397
c3b407f4
AD
153982002-04-07 Akim Demaille <akim@epita.fr>
15399
15400 * src/gram.h, src/gram.c (rules_rhs_length): New.
15401 (ritem_longest_rhs): Use it.
15402 * src/gram.h (rule_t): `number' is a new member.
15403 * src/reader.c (packgram): Set it.
15404 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
15405 the end of `rules', and count them out of `nrules'.
15406 (reduce_output, dump_grammar): Adjust.
15407 * src/print.c (print_grammar): It is no longer needed to check for
15408 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
15409 * tests/reduce.at (Reduced Automaton): New test.
15410
11652ab3
AD
154112002-04-07 Akim Demaille <akim@epita.fr>
15412
15413 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
15414 lacking `+ 1' to nrules, Bison reported as useless a token if it
15415 was used solely to set the precedence of the last rule...
15416
26b23c1a
AD
154172002-04-07 Akim Demaille <akim@epita.fr>
15418
15419 * data/bison.c++, data/bison.simple: Don't output the current file
15420 name in #line, to avoid useless diffs between two identical
15421 outputs under different names.
15422
18bcecb0
AD
154232002-04-07 Akim Demaille <akim@epita.fr>
15424
15425 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
15426 Normalize loops to using `< nrules + 1', not `<= nrules'.
15427
fa770c86
AD
154282002-04-07 Akim Demaille <akim@epita.fr>
15429
15430 * TODO: Update.
15431
d9b739c3
AD
154322002-04-07 Akim Demaille <akim@epita.fr>
15433
15434 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
15435 bucket.value as bucket.number.
15436
99013900
AD
154372002-04-07 Akim Demaille <akim@epita.fr>
15438
15439 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
15440 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15441 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
15442 RHS, instead of being an index in RITEMS.
15443
e966383b
PE
154442002-04-04 Paul Eggert <eggert@twinsun.com>
15445
15446 * doc/bison.texinfo: Update copyright date.
15447 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
15448 (Symbols): Warn about running Bison in one character set,
15449 but compiling and/or running in an incompatible one.
15450 Warn about character code 256, too.
15451
154522002-04-03 Paul Eggert <eggert@twinsun.com>
15453
15454 * src/bison.data (YYSTACK_ALLOC): Depend on whether
15455 YYERROR_VERBOSE is nonzero, not whether it is defined.
15456
15457 Merge changes from bison-1_29-branch.
c307773e 15458
8d6c48b9
PE
154592002-03-20 Paul Eggert <eggert@twinsun.com>
15460
15461 Merge fixes from Debian bison_1.34-1.diff.
15462
15463 * configure.in (AC_PREREQ): 2.53.
15464
e53c6322
AD
154652002-03-20 Akim Demaille <akim@epita.fr>
15466
15467 * src/conflicts.c (log_resolution): Argument `resolution' is const.
15468
9ffbeca7
PE
154692002-03-19 Paul Eggert <eggert@twinsun.com>
15470
21db0b2a
PE
15471 * src/bison.simple (YYCOPY): New macro.
15472 (YYSTACK_RELOCATE): Use it.
15473 Remove Type arg; no longer needed. All callers changed.
15474 (yymemcpy): Remove; no longer needed.
15475
9ffbeca7
PE
15476 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
15477 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15478
642cb8f8
AD
154792002-03-19 Akim Demaille <akim@epita.fr>
15480
15481 Test and fix the #line outputs.
15482
15483 * tests/atlocal.at (GCC): New.
15484 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 15485 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
15486 (Action synch line, Epilogue synch line): New tests.
15487 * src/reader.c (parse_union_decl): Define the muscle stype_line.
15488 * data/bison.simple, data/bison.c++: Use it.
15489
3c31a486
AD
154902002-03-19 Akim Demaille <akim@epita.fr>
15491
15492 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
15493 (Solved SR Conflicts, %expect not enough, %expect right)
15494 (%expect too much): Move to...
15495 * tests/conflicts.at: this new file.
15496
0d8bed56
AD
154972002-03-19 Akim Demaille <akim@epita.fr>
15498
15499 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15500 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
15501 that we can move to enums for instance.
15502 * src/output.c (token_definitions_output): Output a list of
15503 `token-name, token-number' instead of the #define.
15504 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
15505
9208d17f
AD
155062002-03-14 Akim Demaille <akim@epita.fr>
15507
15508 Use Gettext 0.11.1.
15509
af27eacb
RA
155102002-03-09 Robert Anisko <robert@lrde.epita.fr>
15511
15512 * data/bison.c++: Make the user able to add members to the generated
15513 parser by subclassing.
15514
9101a310
RA
155152002-03-05 Robert Anisko <robert@lrde.epita.fr>
15516
15517 * src/reader.c (read_additionnal_code): `c' should be an integer, not
15518 a character.
15519 Reported by Nicolas Tisserand and Nicolas Burrus.
15520
fff9bf0b
RA
155212002-03-04 Robert Anisko <robert@lrde.epita.fr>
15522
15523 * src/reader.c: Warn about lacking semi-colons, do not complain.
15524
64dba31e
RA
155252002-03-04 Robert Anisko <robert@lrde.epita.fr>
15526
15527 * data/bison.c++: Remove a debug line.
15528
374f5a14
RA
155292002-03-04 Robert Anisko <robert@lrde.epita.fr>
15530
15531 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
15532 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
15533 provide a default implementation.
15534
bfcf1f3a
AD
155352002-03-04 Akim Demaille <akim@epita.fr>
15536
15537 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
15538 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
15539 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
15540 * tests/semantic.at (Parsing Guards): Similarly.
15541 * src/reader.at (readgram): Complain if the last rule is not ended
15542 with a semi-colon.
15543
65ccf9fc
AD
155442002-03-04 Akim Demaille <akim@epita.fr>
15545
15546 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
15547 * src/closure.c: here.
15548 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
15549 RTC.
15550 * src/warshall.h, src/warshall.c: Remove.
15551 * tests/sets.at (Broken Closure): Adjust.
15552
d0039cbc
AD
155532002-03-04 Akim Demaille <akim@epita.fr>
15554
15555 * src/output.c (output_skeleton): tempdir is const.
15556 bytes_read is unused.
15557
345cea78
AD
155582002-03-04 Akim Demaille <akim@epita.fr>
15559
15560 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
15561 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
15562 Update.
15563 From Michael Hayes.
15564
564801f7
AD
155652002-03-04 Akim Demaille <akim@epita.fr>
15566
15567 * src/closure.c (closure): `r' is unused.
15568
e5352bc7
AD
155692002-03-04 Akim Demaille <akim@epita.fr>
15570
15571 * tests/sets.at (Broken Closure): Add the ending `;'.
15572 * src/reader.at (readgram): Complain if a rule is not ended with a
15573 semi-colon.
15574
914feea9
AD
155752002-03-04 Akim Demaille <akim@epita.fr>
15576
15577 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
15578 (count_sr_conflicts): Use bitset_count.
15579 * src/reduce.c (inaccessable_symbols): Ditto.
15580 (bits_size): Remove.
15581 * src/warshall.h, src/warshall.c: Convert to bitsetv.
15582
f0250de6
AD
155832002-03-04 Akim Demaille <akim@epita.fr>
15584
15585 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
15586 * src/reduce.c: Remove the `bitset_zero's following the
15587 `bitset_create's, as now it is performed by the latter.
15588
ef017502
AD
155892002-03-04 Akim Demaille <akim@epita.fr>
15590
15591 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
15592 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
15593 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
15594 latest sources from Michael.
15595
76514394
AD
155962002-03-04 Akim Demaille <akim@epita.fr>
15597
15598 * src/output.c (output): Don't free the grammar.
15599 * src/reader.c (grammar_free): New.
15600 * src/main.c (main): Call it and don't free symtab here.
15601
55024580
AD
156022002-03-04 Akim Demaille <akim@epita.fr>
15603
15604 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
15605 before returning.
15606 Reported by Benoit Perrot.
15607
f9abaa2c
AD
156082002-03-04 Akim Demaille <akim@epita.fr>
15609
15610 Use bitset operations when possible, not loops over bits.
15611
15612 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
15613 bitset_or.
15614 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
15615 * src/reduce.c (useless_nonterminals): Formatting changes.
15616 * src/warshall.c (TC): Use bitset_or.
15617
0e721e75
AD
156182002-03-04 Akim Demaille <akim@epita.fr>
15619
15620 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
15621 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
15622 Ditto.
15623
0fb1ffb1
AD
156242002-03-04 Akim Demaille <akim@epita.fr>
15625
15626 * src/lalr.c (F): Now a bitset*.
15627 Adjust all dependencies.
15628
b86796bf
AD
156292002-03-04 Akim Demaille <akim@epita.fr>
15630
15631 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
15632 Adjust all dependencies.
15633
602bbf31
AD
156342002-03-04 Akim Demaille <akim@epita.fr>
15635
15636 * src/L0.c, src/LR0.h (nstates): Be size_t.
15637 Adjust comparisons (signed vs unsigned).
15638 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
15639 bitset*.
15640 Adjust all dependencies.
15641
d8a0245c
AD
156422002-03-04 Akim Demaille <akim@epita.fr>
15643
15644 * src/closure.c (firsts): Now, also a bitset.
15645 Adjust all dependencies.
15646 (varsetsize): Remove, now unused.
15647 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
15648
34ba9743
AD
156492002-03-04 Akim Demaille <akim@epita.fr>
15650
15651 * src/print.c: Convert to use bitset.h, not hand coded iterations
15652 over ints.
15653
ed86e78c
AD
156542002-03-04 Akim Demaille <akim@epita.fr>
15655
15656 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
15657
dfdb1797
AD
156582002-03-04 Akim Demaille <akim@epita.fr>
15659
15660 * src/closure.c (ruleset): Be a bitset.
15661 (rulesetsize): Remove.
15662
7086e707
AD
156632002-03-04 Akim Demaille <akim@epita.fr>
15664
15665 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
15666 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
15667 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
15668 * src/closure.c (fderives): Be an array of bitsets.
15669
98254360
RA
156702002-02-28 Robert Anisko <robert@lrde.epita.fr>
15671
15672 * data/bison.c++: Merge the two generated headers. Insert a copyright
15673 notice in each output file.
15674
a75c057f
AD
156752002-02-28 Akim Demaille <akim@epita.fr>
15676
15677 * data/bison.c++: Copy the prologue of bison.simple to fetch
15678 useful M4 definitions, such as b4_header_guard.
15679
06b00abc
AD
156802002-02-25 Akim Demaille <akim@epita.fr>
15681
15682 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
15683 translator friendly scheme for the bgr
15684 copyright notice.
06b00abc 15685
70e7d534
AD
156862002-02-25 Akim Demaille <akim@epita.fr>
15687
15688 * src/output.c (header_output): Remove, now handled completely via
15689 M4.
15690
abe017f6
AD
156912002-02-25 Akim Demaille <akim@epita.fr>
15692
15693 * m4/m4.m4: New, from CVS Autoconf.
15694 * configure.in: Invoke it.
15695 * src/output.c (output_skeleton): Use its result instead of the
15696 hard coded name.
15697
381fb12e
AD
156982002-02-25 Akim Demaille <akim@epita.fr>
15699
15700 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
15701 Fileutils 4.1.5.
15702 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
15703 * src/output.c (output_skeleton): Use mkstemp to create a real
15704 temporary file.
15705 Move the filling of `skeleton' and its muscle to...
15706 (prepare): here.
15707 (output): Move the definition of the prologue muscle to...
15708 (prepare): here.
15709 * src/system.h (DEFAULT_TMPDIR): New.
15710
6f38107f
PE
157112002-02-14 Paul Eggert <eggert@twinsun.com>
15712
15713 Remove the support for C++ namespace cleanliness; it was
15714 causing more problems than it was curing, since it didn't work
15715 properly on some nonstandard C++ compilers. This can wait
15716 for a proper C++ parser.
15717
15718 * NEWS: Document this.
15719 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
15720 of C++, as it's treated like C now.
15721 * src/bison.simple (YYSTD): Remove.
15722 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
15723 Treat C++ just like Standard C instead of trying to support
15724 namespace cleanliness.
15725
80cce3da
AD
157262002-02-14 Akim Demaille <akim@epita.fr>
15727
15728 * tests/regression.at (else): Adjust to Andreas' change.
15729
842e8679
AD
157302002-02-14 Akim Demaille <akim@epita.fr>
15731
15732 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
15733
4bda3f10
AD
157342002-02-13 Andreas Schwab <schwab@suse.de>
15735
15736 * src/output.c (output_rule_data): Don't output NULL, it might
15737 not be defined yet.
15738
4162fa07 157392002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 15740
4162fa07
RA
15741 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
15742 (Copyright notice): Update.
b418ecd8 15743
bd16a5dc
AD
157442002-02-11 Akim Demaille <akim@epita.fr>
15745
15746 * tests/regression.at (%nonassoc and eof): Don't include
15747 nonportable headers.
15748
8d69a1a3
RA
157492002-02-08 Robert Anisko <robert@lrde.epita.fr>
15750
15751 * data/bison.c++: Correct error recovery. Make the user able to
15752 initialize the starting location.
15753
9b2d0677
AD
157542002-02-07 Akim Demaille <akim@epita.fr>
15755
15756 * tests/input.at: New.
15757
69e2658b
RA
157582002-02-07 Robert Anisko <robert@lrde.epita.fr>
15759
15760 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 15761 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
15762 directives around tables only needed for debugging.
15763
4aacc3a7
RA
157642002-02-07 Robert Anisko <robert@lrde.epita.fr>
15765
15766 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
15767 C++ parsers.
15768 (yy::b4_name::parse): Use print_.
15769
762a801e
RA
157702002-02-07 Robert Anisko <robert@lrde.epita.fr>
15771
15772 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
15773
4bb2bc3f
RA
157742002-02-07 Robert Anisko <robert@lrde.epita.fr>
15775
15776 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
15777 C++ parsers.
15778 (yy::b4_name::parse): Build verbose error messages, and use error_.
15779
6b45a3ca
RA
157802002-02-06 Robert Anisko <robert@lrde.epita.fr>
15781
15782 * data/bison.c++: Fix m4 quoting in comments.
15783
50997c6e
RA
157842002-02-06 Robert Anisko <robert@lrde.epita.fr>
15785
15786 * data/bison.c++: Adjust the parser code. Fix some muscles that were
15787 not expanded by m4.
15788
3f3eed27
AD
157892002-02-05 Akim Demaille <akim@epita.fr>
15790
15791 * data/bison.c++: Adjust to the M4 back end.
15792 More is certainly needed.
15793
be2a1a68
AD
157942002-02-05 Akim Demaille <akim@epita.fr>
15795
15796 Give a try to M4 as a back end.
15797
15798 * lib/readpipe.c: New, from wdiff.
15799 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
15800 BISON_HAIRY.
15801 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
15802 specific values. Now it is m4 that performs the lookup.
15803 * src/parse-skel.y: Remove.
15804 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
15805 * src/output.c (actions_output, guards_output)
15806 (token_definitions_output): No longer keeps track of the output
15807 line number, hence remove the second argument.
15808 (guards_output): Check against the guard member of a rule, not the
15809 action member.
15810 Adjust callers.
15811 (output_skeleton): Don't look for the skeleton location, let m4 do
15812 that.
15813 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
15814 file will be used.
15815 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
15816 (prepare): Given that for the time being changesyntax is not
15817 usable in M4, rename the muscles using `-' to `_'.
15818 Define `defines_flag', `output_parser_name' and `output_header_name'.
15819 * src/output.h (actions_output, guards_output)
15820 (token_definitions_output): Adjust prototypes.
15821 * src/scan-skel.l: Instead of scanning the skeletons, it now
15822 processes the output of m4: `__oline__' and `#output'.
15823 * data/bison.simple: Adjust to be used by M4(sugar).
15824 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
15825 to date.
15826 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
15827 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
15828 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
15829 shamelessly stolen from CVS Autoconf.
15830
beda758b
AD
158312002-02-05 Akim Demaille <akim@epita.fr>
15832
15833 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
15834 * configure.in: Check for the declarations of free and malloc.
15835 * src/muscle_tab.c: Adjust.
15836
5ece6d43
AD
158372002-02-05 Akim Demaille <akim@epita.fr>
15838
15839 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
15840 which have no values.
15841
5bb18f9a
AD
158422002-02-05 Akim Demaille <akim@epita.fr>
15843
15844 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
15845 * data/: here.
15846
894dd62e
PE
158472002-01-29 Paul Eggert <eggert@twinsun.com>
15848
15849 * src/bison.simple (YYSIZE_T): Do not define merely because
15850 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
15851 On some platforms, <alloca.h> does not declare YYSTD (size_t).
15852
82841af7
AD
158532002-01-27 Akim Demaille <akim@epita.fr>
15854
15855 Fix `%nonassoc and eof'.
15856
15857 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
15858 which were not properly copied! Replace
15859 memcpy (res->errs, src->errs, src->nerrs);
15860 with
15861 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
15862 !!!
15863 * tests/regression.at (%nonassoc and eof): Adjust to newest
15864 Autotest: `.' is not in the PATH.
15865
318b76e9
AD
158662002-01-27 Akim Demaille <akim@epita.fr>
15867
15868 * tests/sets.at (AT_EXTRACT_SETS): New.
15869 (Nullable): Use it.
15870 (Firsts): New.
15871
30d2f3d5
AD
158722002-01-26 Akim Demaille <akim@epita.fr>
15873
15874 * tests/actions.at, tests/calc.at, tests/headers.at,
15875 * tests/torture.at: Adjust to the newest Autotest which no longer
15876 forces `.' in the PATH.
15877
30f8c395
AD
158782002-01-25 Akim Demaille <akim@epita.fr>
15879
15880 * tests/regression.at (%nonassoc and eof): New.
15881 Suggested by Robert Anisko.
15882
29ae55f1
AD
158832002-01-24 Akim Demaille <akim@epita.fr>
15884
15885 Bison dumps core when trying to complain about broken input files.
15886 Reported by Cris van Pelt.
15887
15888 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
15889 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
15890 into...
15891 (Invalid inputs): Strengthen: exercise parse_percent_token.
15892
2b548aa6
RA
158932002-01-24 Robert Anisko <robert.anisko@epita.fr>
15894
15895 * src/Makefile.am: Add bison.c++.
15896 * src/bison.c++: New skeleton.
15897
bb0146c2
AD
158982002-01-21 Paolo Bonzini <bonzini@gnu.org>
15899
15900 * po/it.po: New.
15901
bec30531
AD
159022002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
15903
15904 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
15905
fc6edc45
MA
159062002-01-20 Marc Autret <marc@gnu.org>
15907
15908 * src/files.c (compute_output_file_names): Fix
15909
5e5d5415
MA
159102002-01-20 Marc Autret <marc@gnu.org>
15911
15912 * tests/output.at: New test.
15913 * src/files.c (compute_base_names): Don't map extensions when
15914 the YACC flag is set, use defaults.
15915 Reported by Evgeny Stambulchik.
15916
44ea3fbd
MA
159172002-01-20 Marc Autret <marc@gnu.org>
15918
ba0fe3c7
PE
15919 * src/system.h: Need to define __attribute__ away for non-GCC
15920 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
15921 Suggested by Albert Chin-A-Young.
15922
338963d1
TVH
159232002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
15924
15925 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
15926 canonical definition.
15927 * src/system.h: Use the canonical definition for PARAMS (avoids
15928 a conflict with the macro from lib/hash.h).
15929
c57b2479
AD
159302002-01-11 Akim Demaille <akim@epita.fr>
15931
15932 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 15933 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 15934
b85810ae
AD
159352002-01-09 Akim Demaille <akim@epita.fr>
15936
15937 * src/files.c, src/files.h (output_infix): New.
15938 (tab_extension): Remove.
15939 (compute_base_names): Compute the former, drop the latter.
15940 * src/output.c (prepare): Insert the muscles `output-infix', and
15941 `output-suffix'.
15942 * src/parse-skel.y (string, string.1): New.
15943 (section.header): Use it.
15944 (section.yacc): Remove.
15945 (prefix): Remove too.
15946 * src/scan-skel.l: Adjust.
15947 * src/bison.simple, src/bison.hairy: Adjust.
15948
cae60122
AD
159492002-01-09 Akim Demaille <akim@epita.fr>
15950
15951 * configure.in (WERROR_CFLAGS): Compute it.
15952 * src/Makefile.am (CFLAGS): Pass it.
15953 * tests/atlocal.in (CFLAGS): Idem.
15954 * src/files.c: Fix a few warnings.
15955 (get_extension_index): Remove, unused.
15956
ae404801
AD
159572002-01-08 Akim Demaille <akim@epita.fr>
15958
15959 * src/getargs.c (AS_FILE_NAME): New.
15960 (getargs): Use it to convert DOSish file names.
15961 * src/files.c (base_name): Rename as full_base_name to avoid
15962 clashes with `base_name ()'.
15963 (filename_split): New.
15964 (compute_base_names): N-th rewrite, using filename_split.
15965
22312b71
AD
159662002-01-08 Akim Demaille <akim@epita.fr>
15967
15968 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
15969 New, stolen from the Fileutils 4.1.
15970 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15971 * configure.in: Check for the presence of memrchr, and of its
15972 prototype.
15973
a67cef01
TVH
159742002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
15975
15976 * lib/hash.h (__P): Added definition for this macro.
15977 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
15978 BUILT_SOURCES, to ensure they are generated first.
15979 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
15980 %error-verbose to allow bootstrapping with bison 1.30x.
15981
2b25d624
AD
159822002-01-06 Akim Demaille <akim@epita.fr>
15983
15984 * src/reader.c (parse_braces): Don't fetch the next char, the
15985 convention is to fetch on entry.
15986 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
15987 'switch' without a following semicolon.
15988 * tests/regression.at (braces parsing): New.
15989
3460813b
AD
159902002-01-06 Akim Demaille <akim@epita.fr>
15991
15992 Bison is dead wrong in its RR conflict reports.
15993
15994 * tests/torture.at (GNU Cim Grammar): New.
15995 * src/conflicts.c (count_rr_conflicts): Fix.
15996
73784c64
AD
159972002-01-06 Akim Demaille <akim@epita.fr>
15998
15999 Creating package.m4 from configure.ac causes too many problems.
16000
16001 * tests/Makefile.am (package.m4): Create it by hand,
16002 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
16003
25d81090
AD
160042002-01-06 Akim Demaille <akim@epita.fr>
16005
16006 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
16007 skeleton.h.
16008
a9b8959e
PE
160092002-01-04 Paul Eggert <eggert@twinsun.com>
16010
16011 * doc/bison.texinfo (Debugging):
16012 Remove YYSTDERR; it's no longer defined or used.
16013 Also, s/cstdio.h/cstdio/.
16014
25d81090
AD
160152002-01-03 Akim Demaille <akim@epita.fr>
16016
16017 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
16018
1109455c
AD
160192002-01-03 Akim Demaille <akim@epita.fr>
16020
16021 * src/parse-skel.y (process_skeleton): Don't bind the parser's
16022 tracing code to --trace, wait for a better --trace option, with
16023 args.
16024
7ea5e977
AD
160252002-01-03 Akim Demaille <akim@epita.fr>
16026
16027 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
16028 The ISO C++ standard is extremely clear about it: stderr is
16029 considered a macro, not a regular symbol (see table 94 `Header
16030 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
16031 Therefore std:: does not apply to it. It still does with fprintf.
16032 Also, s/cstdio.h/cstdio/.
16033
fab5b110
AD
160342002-01-03 Akim Demaille <akim@epita.fr>
16035
16036 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
16037 for non system headers.
16038
aed7fd9b
AD
160392002-01-02 Akim Demaille <akim@epita.fr>
16040
16041 Equip the skeleton chain with location tracking, runtime trace,
16042 pure parser and scanner.
16043
16044 * src/parse-skel.y: Request a pure parser, locations, and prefix
16045 renaming.
16046 (%union): Having several members with the same type does not help
16047 type mismatches, simplify.
16048 (YYPRINT, yyprint): New.
16049 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
16050 (skel_error): this.
16051 Handle locations.
16052 * src/scan-skel.l: Adjust to these changes.
16053 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
16054 (LOCATION_PRINT, skel_control_t): New.
16055
24fad99e
AD
160562001-12-30 Akim Demaille <akim@epita.fr>
16057
16058 * src/parse-skel.y: Get rid of the shift/reduce conflict:
16059 replace `gb' with BLANKS.
16060 * src/scan-skel.l: Adjust.
16061
a4b36db4
AD
160622001-12-30 Akim Demaille <akim@epita.fr>
16063
16064 * src/system.h: We don't need nor want bcopy.
16065 Throw away MS-DOS crap: we don't need getpid.
16066 * configure.in: We don't need strndup. It was even causing
16067 problems: because Flex includes the headers *before* us,
16068 _GNU_SOURCE is not defined by config.h, and therefore strndup was
16069 not visible.
16070 * lib/xstrndup.c: New.
16071 * src/scan-skel.l: Use it.
16072 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
16073 * src/parse-skel.y: Use %directives instead of #defines.
16074
1239777d
AD
160752001-12-30 Akim Demaille <akim@epita.fr>
16076
16077 * src/skeleton.h: New.
16078 * src/output.c (output_parser, output_master_parser): Remove, dead
16079 code.
16080 * src/output.h (get_lines_number, actions_output, guards_output)
16081 (token_definitions_output): Prototype them.
16082 * src/parse-skel.y: Add the license notice.
16083 Include output.h and skeleton.h.
16084 (process_skeleton): Returns void, and takes a single parameter.
16085 * src/scan-skel.l: Add the license notice.
16086 Include skeleton.h.
16087 Don't use %option yylineno: it seems that then Flex imagines
16088 REJECT has been used, and therefore it won't reallocate its
16089 buffers (which makes no other sense to me than a bug). It results
16090 in warnings for `unused: yy_flex_realloc'.
16091
9b3add5b
RA
160922001-12-30 Robert Anisko <robert.anisko@epita.fr>
16093
16094 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16095 (MUSCLE_INSERT_PREFIX): ...to there.
16096 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16097 (MUSCLE_INSERT_PREFIX): Move from here...
16098
16099 * src/bison.hairy: Add a section directive. Put braces around muscle
16100 names. This parser skeleton is still broken, but Bison should not
16101 choke on a bad muscle 'syntax'.
16102 * src/bison.simple: Add a section directive. Put braces around muscle
16103 names.
16104
16105 * src/files.h (strsuffix, stringappend): Add declarations.
16106 (tab_extension): Add declaration.
16107 (short_base_name): Add declaration.
16108
16109 * src/files.c (strsuffix, stringappend): No longer static. These
16110 functions are used in the skeleton parser.
16111 (tab_extension): New.
16112 (compute_base_names): Use the computations done in this function
fab5b110 16113 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
16114 names.
16115 (short_base_name): No longer static.
16116
16117 * src/output.c (output_skeleton): New.
16118 (output): Disable call to output_master_parser, and give a try to
16119 a new skeleton handling system.
16120 (guards_output, actions_output): No longer static.
16121 (token_definitions_output, get_lines_number): No longer static.
16122
16123 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
16124
fab5b110 16125 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
16126 parse-skel.y.
16127
16128 * src/parse-skel.y: New file.
16129 * src/scan-skel.l: New file.
16130
b5b61c61
AD
161312001-12-29 Akim Demaille <akim@epita.fr>
16132
16133 %name-prefix is broken.
16134
16135 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
16136 Adjust all dependencies.
16137 * tests/headers.at (export YYLTYPE): Strengthen this test: use
16138 %name-prefix.
16139
16140 Renaming yylval but not yylloc is not consistent. Now we do.
16141
16142 * src/bison.simple: Prefix yylloc if used.
16143 * doc/bison.texinfo (Decl Summary): Document that.
16144
8c9a50be
AD
161452001-12-29 Akim Demaille <akim@epita.fr>
16146
16147 * doc/bison.texinfo: Promote `%long-directive' over
16148 `%long_directive'.
16149 Remove all references to fixed-output-files, yacc is enough.
16150
d99361e6
AD
161512001-12-29 Akim Demaille <akim@epita.fr>
16152
16153 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
16154 user prologue. These are defaults.
16155 * tests/actions.at (Mid-rule actions): Make sure the user can
16156 define YYDEBUG and YYERROR_VERBOSE.
16157
b9cecb91
AD
161582001-12-29 Akim Demaille <akim@epita.fr>
16159
16160 * src/output.c (header_output): Don't forget to export YYLTYPE and
16161 yylloc.
16162 * tests/headers.at (export YYLTYPE): New, make sure it does.
16163 * tests/regression.at (%union and --defines, Invalid CPP headers):
16164 Move to...
16165 * tests/headers.at: here.
16166
aea13e97
AD
161672001-12-29 Akim Demaille <akim@epita.fr>
16168
16169 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
16170
931394cb
AD
161712001-12-29 Akim Demaille <akim@epita.fr>
16172
16173 * tests/actions.at (Mid-rule actions): Output on a single line
16174 instead of several.
16175
704a47c4
AD
161762001-12-29 Akim Demaille <akim@epita.fr>
16177
16178 * doc/bison.texinfo: Formatting changes.
16179
091e20bb
AD
161802001-12-29 Akim Demaille <akim@epita.fr>
16181
16182 Don't store the token defs in a muscle, just be ready to output it
16183 on command. Now possible via `symbols'. Fixes a memory leak.
16184
16185 * src/output.c (token_definitions_output): New.
16186 (output_parser, header_output): Use it.
16187 * src/reader.c (symbols_save): Remove.
16188
cce71710
AD
161892001-12-29 Akim Demaille <akim@epita.fr>
16190
16191 * src/bison.simple: Do not provide a default for YYSTYPE and
16192 YYLTYPE before the user's prologue. Otherwise it's hardly... a
16193 default.
16194
82c035a8
AD
161952001-12-29 Akim Demaille <akim@epita.fr>
16196
16197 Mid-rule actions are simply... ignored!
16198
16199 * src/reader.c (readgram): Be sure to attach mid-rule actions to
16200 the empty-rule associated to the dummy symbol, not to the host
16201 rule.
16202 * tests/actions.at (Mid-rule actions): New.
16203
8419d367
AD
162042001-12-29 Akim Demaille <akim@epita.fr>
16205
16206 Memory leak.
16207
16208 * src/reader.c (reader): Free grammar.
16209
375d5806
AD
162102001-12-29 Akim Demaille <akim@epita.fr>
16211
16212 Memory leak.
16213
16214 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
16215 since it allocates it for each state, although only one is needed.
16216 (allocate_storage): Do it here.
16217
f51cb8ff
AD
162182001-12-29 Akim Demaille <akim@epita.fr>
16219
16220 * src/options.h, src/options.c (create_long_option_table): Rename
16221 as...
16222 (long_option_table_new): this, with a clearer prototype.
16223 (percent_table): Remove, unused,
16224 * src/getargs.c (getargs): Adjust.
16225
29e88316
AD
162262001-12-29 Akim Demaille <akim@epita.fr>
16227
16228 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
16229 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
16230 as states.
16231
b9f71f19
AD
162322001-12-29 Akim Demaille <akim@epita.fr>
16233
16234 * src/lalr.c (build_relations): Rename `states' as `states1'.
16235 Sorry, I don't understand exactly what it is, no better name...
16236
1a2b5d37
AD
162372001-12-29 Akim Demaille <akim@epita.fr>
16238
16239 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
16240 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
16241 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
16242 as rules.
16243
1cca533e
AD
162442001-12-29 Akim Demaille <akim@epita.fr>
16245
16246 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
16247 ago.
16248
c03ae966
AD
162492001-12-29 Akim Demaille <akim@epita.fr>
16250
16251 * src/reader.c, src/reader.h (user_toknums): Remove.
16252 Adjust all users to use symbols[i]->user_token_number.
16253
5a670b1e
AD
162542001-12-29 Akim Demaille <akim@epita.fr>
16255
16256 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
16257 Adjust all users to use symbols[i]->prec or ->assoc.
16258
ad949da9
AD
162592001-12-29 Akim Demaille <akim@epita.fr>
16260
16261 * src/reader.c, src/reader.h (tags): Remove.
16262 Adjust all users to use symbols[i]->tag.
16263
0e78e603
AD
162642001-12-29 Akim Demaille <akim@epita.fr>
16265
16266 * src/gram.h, src/gram.c (symbols): New, similar to state_table
16267 and rule_table.
16268 * src/reader.c (packsymbols): Fill this table.
16269 Drop sprec.
16270 * src/conflicts.c (resolve_sr_conflict): Adjust.
16271 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
16272 single table.
16273 Use symbols[i]->tag instead of tags[i].
16274
213e640e
AD
162752001-12-29 Akim Demaille <akim@epita.fr>
16276
16277 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
16278 In addition, put a comment in there, to replace...
16279 * tests/regression.at (%union and C comments): Remove.
16280
e7b8bef1
AD
162812001-12-29 Akim Demaille <akim@epita.fr>
16282
16283 * tests/regression.at (Web2c Actions): Blindly move the actual
16284 output as expected output. The contents *seem* right to me, but I
16285 can't pretend reading perfectly parser tables... Nonetheless, all
16286 the other tests pass correctly, the table look OK, even though the
16287 presence of `$axiom' is to be noted: AFAICS it is useless (but
16288 harmless).
16289
b68e7744
AD
162902001-12-29 Akim Demaille <akim@epita.fr>
16291
16292 * src/reader.c (readgram): Don't add the rule 0 if there were no
16293 rules read. In other words, add it _after_ having performed
16294 grammar sanity checks.
16295 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
16296
78d5bae9
AD
162972001-12-29 Akim Demaille <akim@epita.fr>
16298
16299 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
16300 visible, and some states have now a different number.
16301
ff442794
AD
163022001-12-29 Akim Demaille <akim@epita.fr>
16303
16304 * src/reader.c (readgram): Bind the initial rule's lineno to that
16305 of the first rule.
16306 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
16307 (Solved SR Conflicts): Adjust rule 0's line number.
16308
610ab194
AD
163092001-12-29 Akim Demaille <akim@epita.fr>
16310
16311 Fix the `GAWK Grammar' failure.
16312
16313 * src/LR0.c (final_state): Initialize to -1 so that we do compute
16314 the reductions of the first state which was mistakenly confused
16315 with the final state because precisely final_state was initialized
16316 to 0.
16317 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
16318 now noticed by Bison.
16319 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
16320 have a reduction on $default.
16321
29d29c8f
AD
163222001-12-29 Akim Demaille <akim@epita.fr>
16323
16324 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
16325 rule line numbers.
16326 * src/closure.c (print_closure): Likewise.
16327 * src/derives.c (print_derives): Likewise.
16328 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
16329 now.
16330
7c6b64d0
AD
163312001-12-29 Akim Demaille <akim@epita.fr>
16332
16333 * src/lalr.c (lookaheads_print): New.
16334 (lalr): Call it when --trace-flag.
16335 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
16336 are dumped.
16337
3d4daee3
AD
163382001-12-29 Akim Demaille <akim@epita.fr>
16339
16340 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
16341 when walking through ritem, even via rule->rhs.
16342 * src/reduce.c (dump_grammar, useful_production, reduce_output)
16343 (useful_production, useless_nonterminals): Likewise.
16344 (reduce_grammar_tables): Likewise, plus update nritems.
16345 * src/nullable.c (set_nullable): Likewise.
16346 * src/lalr.c (build_relations): Likewise.
16347 * tests/sets.at (Nullable): Adjust.
16348 Fortunately, now, the $axiom is no longer nullable.
16349
9e7f6bbd
AD
163502001-12-29 Akim Demaille <akim@epita.fr>
16351
16352 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
16353 the 0-sentinel.
16354 * src/gram.c (ritem_longest_rhs): Likewise.
16355 * src/reduce.c (nonterminals_reduce): Likewise.
16356 * src/print_graph.c (print_graph): Likewise.
16357 * src/output.c (output_rule_data): Likewise.
16358 * src/nullable.c (set_nullable): Likewise.
16359
255ef638
AD
163602001-12-29 Akim Demaille <akim@epita.fr>
16361
16362 * src/output.c: Comment changes.
16363
0d8a7363
AD
163642001-12-27 Paul Eggert <eggert@twinsun.com>
16365
16366 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
16367 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
16368 Sparc, as they were causing more porting problems than the
16369 (minor) performance improvement was worth.
16370
16371 Also, catch up with 1.31's YYSTD.
16372
3db472b9
AD
163732001-12-27 Akim Demaille <akim@epita.fr>
16374
16375 * src/output.c (output_gram): Rely on nritems, not the
16376 0-sentinel. See below.
16377 Use -1 as separator, not 0.
16378 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
16379 Rely on -1 as separator in yyrhs, instead of 0.
16380 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
16381 twice `Now at end of input', therefore there are two lines less to
16382 expect.
16383
b365aa05
AD
163842001-12-27 Akim Demaille <akim@epita.fr>
16385
16386 * tests/regression.at (Unresolved SR Conflicts):
16387 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
16388 below.
16389
30171f79
AD
163902001-12-27 Akim Demaille <akim@epita.fr>
16391
16392 * src/LR0.c (new_state): Recognize the final state by the fact it
16393 is reached by eoftoken.
16394 (insert_start_shifting_state, insert_eof_shifting_state)
16395 (insert_accepting_state, augment_automaton): Remove, since now
16396 these states are automatically computed from the initial state.
16397 (generate_states): Adjust.
16398 * src/print.c: When reporting a rule number to the user, substract
16399 1, so that the axiom rule is rule 0, and the first user rule is 1.
16400 * src/reduce.c: Likewise.
16401 * src/print_graph.c (print_core): For the time being, just as for
16402 the report, depend upon --trace-flags to dump the full set of
16403 items.
16404 * src/reader.c (readgram): Once the grammar read, insert the rule
16405 0: `$axiom: START-SYMBOL $'.
16406 * tests/set.at: Adjust: rule 0 is now displayed, and since the
16407 number of the states has changed (the final state is no longer
16408 necessarily the last), catch up.
16409
75142d45
AD
164102001-12-27 Akim Demaille <akim@epita.fr>
16411
16412 Try to make the use of the eoftoken valid. Given that its value
16413 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
16414 is used instead of > 0 where appropriate, (ii), depend upon nritems
16415 instead of the 0-sentinel.
16416
16417 * src/gram.h, src/gram.c (nritems): New.
16418 Expected to be duplication of nitems, but for the time being...
16419 * src/reader.c (packgram): Assert nritems and nitems are equal.
16420 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
16421 * src/closure.c (print_closure, print_fderives): Likewise.
16422 * src/gram.c (ritem_print): Likewise.
16423 * src/print.c (print_core, print_grammar): Likewise.
16424 * src/print_graph.c: Likewise.
16425
b7c49edf
AD
164262001-12-27 Akim Demaille <akim@epita.fr>
16427
16428 * src/main.c (main): If there are complains after grammar
16429 reductions, then output the report anyway if requested, then die.
16430 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
16431 * src/reader.c (eoftoken): New.
16432 (parse_token_decl): If the token being defined has value `0', it
16433 is the eoftoken.
16434 (packsymbols): No longer hack `tags' to insert `$' by hand.
16435 Be sure to preserve the value of the eoftoken.
16436 (reader): Make sure eoftoken is defined.
16437 Initialize nsyms to 0: now eoftoken is created just like the others.
16438 * src/print.c (print_grammar): Don't special case the eof token.
16439 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
16440 lie anyway, albeit pleasant.
16441 * tests/calc.at: Exercise error messages with eoftoken.
16442 Change the grammar so that empty input is invalid.
16443 Adjust expectations.
16444 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
16445
ec2da99f
AD
164462001-12-27 Akim Demaille <akim@epita.fr>
16447
16448 * configure.in: Check the protos of strchr ans strspn.
16449 Replace strchr if needed.
16450 * src/system.h: Provide the protos of strchr, strspn and memchr if
16451 missing.
16452 * lib/strchr.c: New.
16453 * src/reader.c (symbols_save): Use strchr.
16454
8adfa272
AD
164552001-12-27 Akim Demaille <akim@epita.fr>
16456
16457 * src/print.c, src/print_graph.c (escape): New.
16458 Use it to quote the TAGS outputs.
16459 * src/print_graph.c (print_state): Now errors are in red, and
16460 reductions in green.
16461 Prefer high to wide: output the state number on a line of its own.
16462
80dac38c
AD
164632001-12-27 Akim Demaille <akim@epita.fr>
16464
16465 * src/state.h, src/state.c (reductions_new): New.
16466 * src/LR0.c (set_state_table): Let all the states have a
16467 `reductions', even if reduced to 0.
16468 (save_reductions): Adjust.
16469 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
16470 * src/print.c (print_reductions, print_actions): Adjust.
16471 * src/output.c (action_row): Adjust.
16472
2cec70b9
AD
164732001-12-27 Akim Demaille <akim@epita.fr>
16474
16475 * src/state.h, src/state.c (errs_new, errs_dup): New.
16476 * src/LR0.c (set_state_table): Let all the states have an errs,
16477 even if reduced to 0.
16478 * src/print.c (print_errs, print_reductions): Adjust.
16479 * src/output.c (output_actions, action_row): Adjust.
16480 * src/conflicts.c (resolve_sr_conflict): Adjust.
16481
13ca549a
AD
164822001-12-27 Akim Demaille <akim@epita.fr>
16483
16484 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
16485
5092aba5
AD
164862001-12-27 Akim Demaille <akim@epita.fr>
16487
16488 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
16489 * src/print.c: here.
16490 (lookaheadset, shiftset): New, used as additional storage by
16491 print_reductions.
16492 (print_results): Adjust.
16493 (print_shifts, print_gotos, print_errs): New, extracted from...
16494 (print_actions): here.
16495 * src/print_graph.c (print_actions): Remove dead code.
16496
11e2beca
AD
164972001-12-27 Akim Demaille <akim@epita.fr>
16498
16499 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
16500 `$n' and `@n'.
16501
dac3c910
AD
165022001-12-27 Akim Demaille <akim@epita.fr>
16503
16504 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
16505 (build_relations): Adjust.
16506
d0b0fefa
AD
165072001-12-27 Akim Demaille <akim@epita.fr>
16508
16509 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
16510 duplication.
16511
adc8c848
AD
165122001-12-27 Akim Demaille <akim@epita.fr>
16513
16514 * src/reader.c (packgram): Catch nitems overflows.
16515
14d293ac
AD
165162001-12-27 Akim Demaille <akim@epita.fr>
16517
16518 * src/files.c, src/files.h (guard_obstack): Remove.
16519 * src/output.c (output): Adjust.
16520 * src/reader.c (parse_braces): New, factoring...
16521 (copy_action, copy_guard): these two which are renamed as...
16522 (parse_action, parse_guard): these.
16523 As a voluntary consequence, using braces around guards is now
16524 mandatory.
16525
f499b062
AD
165262001-12-27 Akim Demaille <akim@epita.fr>
16527
16528 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
16529 * src/reader.c (symbol_list): `guard' and `guard_line' are new
16530 members.
16531 (symbol_list_new): Adjust.
16532 (copy_action): action_line is the first line, not the last.
16533 (copy_guard): Just as for actions, store the `action' only, not
16534 the switch/case/break flesh.
16535 Don't parse the user action that might follow the guard, let...
16536 (readgram): do it, i.e., now, there can be an action after a
16537 guard.
16538 In other words the guard is just explicitly optional.
16539 (packgram): Adjust.
16540 * src/output.c (guards_output): New.
16541 (output_parser): Call it when needed.
16542 (output): Also free the guard and attrs obstacks.
16543 * src/files.c, src/files.h (obstack_save): Remove.
16544 (output_files): Remove.
16545 As a result, if one needs the former `.act' file, using an
16546 appropriate skeleton which requires actions and guards is now
16547 required.
16548 * src/main.c (main): Adjust.
16549 * tests/semantic.at: New.
16550 * tests/regression.at: Use `input.y' as input file name.
16551 Avoid 8+3 problems by requiring input.c when the test needs the
16552 parser.
16553
d945f5cd
AD
165542001-12-27 Akim Demaille <akim@epita.fr>
16555
16556 * src/reader.c (symbol_list_new): Be sure to initialize all the
16557 fields.
16558
d200e455
AD
165592001-12-27 Akim Demaille <akim@epita.fr>
16560
16561 All the hacks using a final pseudo state are now useless.
16562
16563 * src/LR0.c (set_state_table): state_table holds exactly nstates.
16564 * src/lalr.c (nLA): New.
16565 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
16566 instead of lookaheadsp from the pseudo state (nstate + 1).
16567
f9507c28
AD
165682001-12-27 Akim Demaille <akim@epita.fr>
16569
16570 * src/output.c (action_row, token_actions): Use a state_t instead
16571 of a integer, and nlookaheads instead of the following state's
16572 lookaheadsp.
16573
065fbd27
AD
165742001-12-27 Akim Demaille <akim@epita.fr>
16575
16576 * src/conflicts.c (log_resolution, flush_shift)
16577 (resolve_sr_conflict, set_conflicts, solve_conflicts)
16578 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
16579 (conflicts_print, print_reductions): Use a state_t instead of an
16580 integer when referring to a state.
16581 As much as possible, depend upon nlookaheads, instead of the
16582 `lookaheadsp' member of the following state (since lookaheads of
16583 successive states are successive, the difference between state n + 1
16584 and n served as the number of lookaheads for state n).
16585 * src/lalr.c (add_lookback_edge): Likewise.
16586 * src/print.c (print_core, print_actions, print_state)
16587 (print_results): Likewise.
16588 * src/print_graph.c (print_core, print_actions, print_state)
16589 (print_graph): Likewise.
16590 * src/conflicts.h: Adjust.
16591
1b177bd7
AD
165922001-12-27 Akim Demaille <akim@epita.fr>
16593
16594 * src/bison.hairy: Formatting/comment changes.
16595 ANSIfy.
16596 Remove `register' indications.
16597 Add plenty of `static'.
16598
7742ddeb
AD
165992001-12-27 Akim Demaille <akim@epita.fr>
16600
16601 * src/output.c (prepare): Drop the muscle `ntbase' which
16602 duplicates ntokens.
16603 * src/bison.simple: Formatting/comment changes.
16604 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
16605 is an undocumented synonym.
16606
1fa14068
AD
166072001-12-22 Akim Demaille <akim@epita.fr>
16608
16609 * src/output.c (output_table_data): Change the prototype to use
16610 `int' for array ranges: some invocations do pass an int, not a
16611 short.
16612 Reported by Wayne Green.
16613
b9752825
AD
166142001-12-22 Akim Demaille <akim@epita.fr>
16615
16616 Some actions of web2c.y are improperly triggered.
16617 Reported by Mike Castle.
16618
16619 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
16620 * tests/regression.at (Web2c): Rename as...
16621 (Web2c Report): this.
16622 (Web2c Actions): New.
16623
776209d6
AD
166242001-12-22 Akim Demaille <akim@epita.fr>
16625
16626 Reductions in web2c.y are improperly reported.
16627 Reported by Mike Castle.
16628
16629 * src/conflicts.c (print_reductions): Fix.
16630 * tests/regression.at (Web2c): New.
16631
275fc3ad
AD
166322001-12-18 Akim Demaille <akim@epita.fr>
16633
16634 Some host fail on `assert (!"foo")', which expands to
16635 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
16636 Reported by Nelson Beebee.
16637
16638 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
16639 `#define it_succeeded 0' and `assert (it_succeeded)'.
16640
897668ee
MA
166412001-12-17 Marc Autret <autret_m@epita.fr>
16642
16643 * src/bison.simple: Don't hard code the skeleton line and filename.
16644 * src/output.c (output_parser): Rename 'line' as 'output_line'.
16645 New line counter 'skeleton_line' (skeleton-line muscle).
16646
ab3399e0
PE
166472001-12-17 Paul Eggert <eggert@twinsun.com>
16648
16649 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
16650 YYDEBUG must be defined to a nonzero value.
16651
16652 * src/bison.simple (yytname): Do not assume that the user defines
16653 YYDEBUG to a properly parenthesized expression.
16654
3877f72b
AD
166552001-12-17 Akim Demaille <akim@epita.fr>
16656
16657 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
16658 nlookaheads is a new member.
16659 Adjust all users.
16660 * src/lalr.h (nlookaheads): Remove this orphan declaration.
16661 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
16662 state.
776209d6 16663
331dbc1b
AD
166642001-12-17 Akim Demaille <akim@epita.fr>
16665
16666 * src/files.h, src/files.c (open_files, close_files): Remove.
16667 * src/main.c (main): Don't open/close files, nor invoke lex_free,
16668 let...
16669 * src/reader.c (reader): Do it.
776209d6 16670
be750e4c
AD
166712001-12-17 Akim Demaille <akim@epita.fr>
16672
16673 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 16674
709ae8c6
AD
166752001-12-17 Akim Demaille <akim@epita.fr>
16676
16677 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
16678 (flush_reduce): New.
16679 (resolve_sr_conflict): Adjust.
776209d6 16680
f87685c3
AD
166812001-12-17 Akim Demaille <akim@epita.fr>
16682
16683 * src/output.c (output_obstack): Be static and rename as...
16684 (format_obstack): this, to avoid any confusion with files.c's
16685 output_obstack.
16686 * src/reader.h (muscle_obstack): Move to...
16687 * src/output.h: here, since it's defined in output.c.
16688
837491d8
AD
166892001-12-17 Akim Demaille <akim@epita.fr>
16690
16691 * src/output.c (action_row, save_column, default_goto)
16692 (sort_actions, matching_state, pack_vector): Better variable
16693 locality.
16694
796d61fb
AD
166952001-12-17 Akim Demaille <akim@epita.fr>
16696
16697 * src/output.c: Various formatting changes.
776209d6 16698
64d15509
AD
166992001-12-17 Akim Demaille <akim@epita.fr>
16700
16701 * src/files.c (output_files): Free the output_obstack.
16702 * src/main.c (main): Call print and print_graph conditionally.
16703 * src/print.c (print): Work unconditionally.
16704 * src/print_graph.c (print_graph): Work unconditionally.
16705 * src/conflicts.c (log_resolution): Output only if verbose_flag.
16706
fbc8ecb7
MA
167072001-12-16 Marc Autret <autret_m@epita.fr>
16708
16709 * src/output.c (actions_output): Fix. When we use %no-lines,
16710 there is one less line per action.
16711
f0440388
MA
167122001-12-16 Marc Autret <autret_m@epita.fr>
16713
16714 * src/bison.simple: Remove a useless #line directive.
16715 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
16716 * src/output.c (get_lines_number): New.
776209d6 16717 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
16718 output muscles.
16719 Fix line numbering.
16720 (actions_output): Computes the number of lines taken by actions.
16721 (output_master_parser): Insert new skeleton which is the name of
16722 the output parser file name.
16723
a79986b8
MA
167242001-12-15 Marc Autret <autret_m@epita.fr>
16725
16726 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
16727
4ec8e00f
MA
167282001-12-15 Marc Autret <autret_m@epita.fr>
16729
16730 * src/output.c (output_gram): Keep track of the hairy one.
16731
1a4648ff
AD
167322001-12-15 Akim Demaille <akim@epita.fr>
16733
16734 Make `make distcheck' work.
16735
16736 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
16737 system.h which uses libgettext.h.
16738
9c2c67e6
AD
167392001-12-15 Akim Demaille <akim@epita.fr>
16740
16741 * src/nullable.c (set_nullable): Useless rules must be skipped,
16742 otherwise, since we range over their symbols, we might look at a
16743 nonterminal which no longer ``exists'', i.e., it is not counted in
16744 `nvars', hence we overflow our arrays.
16745
93ede233
AD
167462001-12-15 Akim Demaille <akim@epita.fr>
16747
16748 The header can also be produced directly, without any obstack!
16749 Yahoo!
16750
16751 * src/files.c, src/files.h (defines_obstack): Remove.
16752 (compute_header_macro): Global.
16753 (defines_obstack_save): Remove.
16754 * src/reader.c (parse_union_decl): No longer output to
16755 defines_obstack: its content can be found in the `stype' muscle
16756 anyway.
16757 (output_token_translations): Merge into...
16758 (symbols_output): this.
16759 Rename as...
16760 (symbols_save): this.
16761 (reader): Adjust.
16762 * src/output.c (header_output): New.
16763 (output): Call it.
16764
2666f928
AD
167652001-12-15 Akim Demaille <akim@epita.fr>
16766
16767 * src/reader.c (parse_union_decl): Instead of handling two obstack
16768 simultaneously, use one to define the `stype' muscle, and use the
16769 value of the latter to fill defines_obstack.
16770 (copy_comment): Remove.
16771 (copy_comment2): Work for a single obstack.
16772 Rename as...
16773 (copy_comment): this.
16774
428046f8
AD
167752001-12-15 Akim Demaille <akim@epita.fr>
16776
16777 * src/lex.c, src/lex.h (xgetc): No longer static.
16778 * src/reader.c (parse_union_decl): Revamp.
16779
ea52d706
AD
167802001-12-15 Akim Demaille <akim@epita.fr>
16781
16782 Still making progress in separating Bison into (i) input, (ii)
16783 process, (iii) output: now we can directly output the parser file
16784 without using table_obstack at all.
16785
16786 * src/files.c, src/files.h (table_obstack): Bye bye.
16787 (parser_file_name): New.
16788 * src/files.c (compute_output_file_names): Compute it.
16789 * src/output.c (actions_output, output_parser)
16790 (output_master_parser): To a file instead of an obstack.
16791
3f96f4dc
AD
167922001-12-15 Akim Demaille <akim@epita.fr>
16793
16794 Attach actions to rules, instead of pre-outputting them to
16795 actions_obstack.
16796
16797 * src/gram.h (rule_t): action and action_line are new members.
16798 * src/reader.c (symbol_list): Likewise.
16799 (copy_action): Save the actions within the rule.
16800 (packgram): Save them in rule_table.
16801 * src/output.c (actions_output): New.
16802 (output_parser): Use it on `%%actions'.
16803 (output_rule_data): Don't free rule_table.
16804 (output): Do it.
16805 (prepare): Don't save the `action' muscle.
16806 * src/bison.simple: s/%%action/%%actions/.
16807
51576fb3
AD
168082001-12-15 Akim Demaille <akim@epita.fr>
16809
16810 * src/reader.c (copy_action): When --yacc, don't append a `;'
16811 to the user action: let it fail if lacking.
dee049eb 16812 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 16813
2648a72d
AD
168142001-12-14 Akim Demaille <akim@epita.fr>
16815
16816 * src/lex.c (literalchar): Simply return the char you decoded, non
16817 longer mess around with obstacks and int pointers.
16818 Adjust all callers.
16819
92790e5b
AD
168202001-12-14 Akim Demaille <akim@epita.fr>
16821
16822 * src/lex.c (literalchar): Don't escape the special characters,
16823 just decode them, and keep them as char (before, eol was output as
16824 the 2 char string `\n' etc.).
16825 * src/output.c (output_rule_data): Use quotearg to output the
16826 token strings.
16827
927c1557
PE
168282001-12-13 Paul Eggert <eggert@twinsun.com>
16829
16830 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
16831 Do not infringe on the global user namespace when using C++.
16832 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
16833 All uses of `fprintf' and `stderr' changed.
16834
16835 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
16836
ed8e1f68
AD
168372001-12-13 Akim Demaille <akim@epita.fr>
16838
16839 The computation of nullable is broken: it doesn't handle empty
16840 RHS's properly.
16841
16842 * tests/torture.at (GNU AWK Grammar): New.
16843 * tests/sets.at (Nullable): New.
16844 * src/nullable.c (set_nullable): Instead of blindly looping over
16845 `ritems', loop over the rules, and then over their rhs's.
16846
16847 Work around Autotest bugs.
16848
16849 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
16850 frame, because Autotest understand lines starting with a `+' as
16851 traces from the shell. Then, they are not processed properly.
16852 Admittedly an Autotest bug, but we don't have time to wait for
16853 Autotest to catch up.
16854 * tests/regression.at (Broken Closure): Adjust to the new table
16855 frames.
16856 Move to...
16857 * tests/sets.at: here.
16858
cb581495
AD
168592001-12-13 Akim Demaille <akim@epita.fr>
16860
16861 * src/closure.c (closure): Use nrules instead of playing tricks
16862 with BITS_PER_WORD.
16863
2e729273
AD
168642001-12-13 Akim Demaille <akim@epita.fr>
16865
16866 * src/print.c (print_actions): Output the handling of `$' as the
16867 traces do: shifting the token EOF. Before EOF was treated as a
16868 nonterminal.
16869 * tests/regression.at: Adjust some tests.
16870 * src/print_graph.c (print_core): Complete the set of items via
16871 closure. The next-to-final and final states are still unsatisfying,
16872 but that's to be addressed elsewhere.
16873 No longer output the rule numbers, but do output the state number.
16874 A single loop for the shifts + gotos is enough, but picked a
16875 distinct color for each.
16876 (print_graph): Initialize and finalize closure.
16877
107f7dfb
AD
168782001-12-13 Akim Demaille <akim@epita.fr>
16879
16880 * src/reader.c (readgram): Remove dead code, an strip useless
16881 braces.
16882 (get_type): Remove, unused.
16883
9b53a24f
AD
168842001-12-12 Akim Demaille <akim@epita.fr>
16885
16886 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
16887 on that of lib/error.c.
16888
dbfb6dcd
AD
168892001-12-12 Akim Demaille <akim@epita.fr>
16890
16891 Some hosts don't like `/' in includes.
16892
16893 * src/system.h: Include libgettext.h without qualifying the path.
16894 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
16895 $(top_srcdir).
16896
c25fb648
MA
168972001-12-11 Marc Autret <autret_m@epita.fr>
16898
16899 * src/output.c (output_parser): Remove useless muscle.
16900
710ddc4f
MA
169012001-12-11 Marc Autret <autret_m@epita.fr>
16902
16903 * src/bison.simple: Remove #line just before %%epilogue. It
16904 is now handled in ...
16905 * src/reader.c (read_additionnal_code): Add the output of a
16906 #line for the epilogue.
16907
e83d80b8
MA
169082001-12-10 Marc Autret <autret_m@epita.fr>
16909
927c1557 16910 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
16911 replace precedent remove.
16912 * src/bison.simple: Remove #line before %%prologue because
16913 %%input-line is wrong at this time.
16914
971d5158
MA
169152001-12-10 Marc Autret <autret_m@epita.fr>
16916
16917 * src/reader.c (symbols_output): Clean up.
927c1557 16918 * src/output.c (output_gram, output): Clean up.
971d5158 16919
5edafffd
AD
169202001-12-10 Akim Demaille <akim@epita.fr>
16921
16922 * src/lalr.c (initialize_lookaheads): New. Extracted from...
16923 * src/LR0.c (set_state_table): here.
16924 * src/lalr.c (lalr): Call it.
16925
0279f8e9
AD
169262001-12-10 Akim Demaille <akim@epita.fr>
16927
16928 * src/state.h (shifts): Remove the `number' member: shifts are
16929 attached to state, hence no longer need to be labelled with a
16930 state number.
16931
190c4f5f
AD
169322001-12-10 Akim Demaille <akim@epita.fr>
16933
16934 Now that states have a complete set of members, the linked list of
16935 shifts is useless: just fill directly the state's shifts member.
16936
16937 * src/state.h (shifts): Remove the `next' member.
16938 * src/LR0.c (first_state, last_state): Remove.
16939 Adjust the callers.
16940 (augment_automaton): Don't look for the shifts that must be added
16941 a shift on EOF: it is those of the state we looked for! But now,
16942 since shifts are attached, it is no longer needed to looking
16943 merely by its id: its number.
16944
2a73b93d
AD
169452001-12-10 Akim Demaille <akim@epita.fr>
16946
16947 * src/LR0.c (augment_automaton): Better variable locality.
16948 Remove an impossible branch: if there is a state corresponding to
16949 the start symbol being shifted, then there is shift for the start
16950 symbol from the initial state.
16951
74392f6a
AD
169522001-12-10 Akim Demaille <akim@epita.fr>
16953
16954 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
16955 only when appropriate: when insert_start_shifting_state' is not
16956 invoked.
16957 * tests/regression.at (Rule Line Numbers): Adjust.
16958
37c82725
AD
169592001-12-10 Akim Demaille <akim@epita.fr>
16960
16961 * src/LR0.c (augment_automaton): Now that all states have shifts,
16962 merge the two cases addition shifts to the initial state.
16963
6a164e0c
AD
169642001-12-10 Akim Demaille <akim@epita.fr>
16965
16966 * src/lalr.c (set_state_table): Move to...
16967 * src/LR0.c: here.
16968 * src/lalr.c (lalr): Don't call it...
16969 * src/LR0.c (generate_states): do it.
16970 * src/LR0.h (first_state): Remove, only the table is used.
16971
7215de24
AD
169722001-12-10 Akim Demaille <akim@epita.fr>
16973
16974 * src/LR0.h (first_shift, first_reduction): Remove.
16975 * src/lalr.c: Don't use first_shift: find shifts through the
16976 states.
16977
80e25d4d
AD
169782001-12-10 Akim Demaille <akim@epita.fr>
16979
16980 * src/LR0.c: Attach shifts to states as soon as they are
16981 computed.
16982 * src/lalr.c (set_state_table): Instead of assigning shifts to
16983 state, just assert that the mapping was properly done.
16984
0ab3728b
AD
169852001-12-10 Akim Demaille <akim@epita.fr>
16986
16987 * src/LR0.c (insert_start_shift): Rename as...
16988 (insert_start_shifting_state): this.
16989 (insert_eof_shifting_state, insert_accepting_state): New.
16990 (augment_automaton): Adjust.
16991 Better locality of the variables.
16992 When looking if the start_symbol is shifted from the initial
16993 state, using `while (... symbol != start_symbol ...)' sounds
16994 better than `while (... symbol < start_symbol ...)': If fail
16995 to see how the order between symbols could be relevant!
16996
78af9bbc
AD
169972001-12-10 Akim Demaille <akim@epita.fr>
16998
16999 * src/getargs.h: Don't declare `spec_name_prefix' and
17000 `spec_file_prefix', declared by src/files.h.
17001 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
17002 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
17003 * src/output.c (prepare): Adjust.
17004 * src/reader.c (symbols_output): Likewise.
17005 * src/vmsgetargs.c: Vaguely adjust, but who cares?
17006
bdef2a41
AD
170072001-12-10 Akim Demaille <akim@epita.fr>
17008
17009 * src/muscle_tab.c (muscle_init): NULL is a better default than
17010 `"0"'.
17011
3735969c
AD
170122001-12-10 Akim Demaille <akim@epita.fr>
17013
17014 * src/reader.c (reader): Calling symbols_output once is enough.
17015
49701457
AD
170162001-12-10 Akim Demaille <akim@epita.fr>
17017
17018 Now that states have a complete set of members, the linked list of
17019 reductions is useless: just fill directly the state's reductions
17020 member.
17021
17022 * src/state.h (struct reductions): Remove member `number' and
17023 `next'.
17024 * src/LR0.c (first_reduction, last_reduction): Remove.
17025 (save_reductions): Don't link the new reductions, store them in
17026 this_state.
17027 * src/lalr.c (set_state_table): No need to attach reductions to
17028 states, it's already done.
17029 * src/output.c (output_actions): No longer free the shifts, then
17030 the reductions, then the states: free all the states and their
17031 members.
17032
0edad749
AD
170332001-12-10 Akim Demaille <akim@epita.fr>
17034
17035 * src/options.c (OPTN, DRTV, BOTH): New.
17036 (option_table): Use them.
17037
0edad749
AD
17038 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
17039 the job of system.h.
17040 * src/options.c: Don't include stdio.h and xalloc.h for the same
17041 reasons.
17042
5449dd0f
AD
170432001-12-10 Akim Demaille <akim@epita.fr>
17044
17045 * src/output.c (output, prepare): Make sure the values of the
17046 muscles `action' and `prologue' are 0-terminated.
17047
a870c567
AD
170482001-12-10 Akim Demaille <akim@epita.fr>
17049
17050 Clean up GCC warnings.
17051
17052 * src/reader.c (copy_action): `buf' is not used.
17053 (parse_skel_decl): Be static.
17054 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
17055 * src/options.h (create_long_option_table): Have a real prototype.
17056 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
17057 (hash_delete_at): Return const void *.
17058 Adjust casts to preserve the const.
17059
80df8768
AD
170602001-12-10 Akim Demaille <akim@epita.fr>
17061
17062 * configure.in: Require 2.52g.
17063 M4 is not needed, but AUTOM4TE is.
17064 * m4/m4.m4: Remove.
17065 * tests/Makefile.am: Adjust.
17066
f693ad14
AD
170672001-12-10 Akim Demaille <akim@epita.fr>
17068
17069 One structure for states is enough, even though theoretically
17070 there are LR(0) states and LALR(1) states.
17071
17072 * src/lalr.h (state_t): Remove.
17073 (state_table): Be state_t **, not state_t *.
17074 * src/state.h (core, CORE_ALLOC): Rename as...
17075 (state_t, STATE_ALLOC): this.
17076 Add the LALR(1) members: shifts, reductions, errs.
17077 * src/LR0.c (state_table): Rename as...
17078 (state_hash): this, to avoid name clashes with the global
17079 `state_table'.
17080 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
17081 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
17082
74ffbcb6
AD
170832001-12-10 Akim Demaille <akim@epita.fr>
17084
17085 Bison dumps core on bash.y.
17086 Reported by Pascal Bart.
17087
17088 * src/warshall.c (bitmatrix_print): New.
17089 (TC): Use it.
ba0fe3c7 17090 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
17091 j must be the outer loop.
17092 * tests/regression.at (Broken Closure): New.
17093
07708e19
AD
170942001-12-05 Akim Demaille <akim@epita.fr>
17095
17096 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
17097 its argument.
ba1ecc07 17098 Reported by Peter Hamorsky.
07708e19 17099
92b16366
AD
171002001-12-05 Akim Demaille <akim@epita.fr>
17101
17102 * src/conflicts.c (err_table): Remove.
17103 (resolve_sr_conflict): Adjust.
17104 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
17105 Rename as...
17106 (state_t.reductions, state_t.shifts): this.
17107
076ab033
AD
171082001-12-05 Akim Demaille <akim@epita.fr>
17109
17110 * src/reduce.c (reduce_grammar_tables): No longer disable the
17111 removal of useless rules via CPP but via `if (0)', so that the
17112 compiler still check the code is valid.
17113 For instance, it should have noticed `rline' no longer exists: use
17114 the `line' member of rule_t.
17115 * src/gram.c (dummy, rline): Remove, unused.
17116
3843c413
AD
171172001-12-05 Akim Demaille <akim@epita.fr>
17118
17119 * src/output.c (pack_vector): Use assert, not berror.
17120 * src/main.c (berror): Remove, unused.
17121
43168960
AD
171222001-12-05 Akim Demaille <akim@epita.fr>
17123
17124 New experimental feature: if --verbose --trace output all the
17125 items of a state, not only its kernel.
17126
17127 * src/print.c (print_core): If `trace_flag', then invoke closure
17128 before outputting the items of the state (print_core is no longer
17129 a correct name them).
17130 (print_results): Invoke new_closure/free_closure if needed.
17131
b2872512
AD
171322001-12-05 Akim Demaille <akim@epita.fr>
17133
17134 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
17135 * src/closure.c, src/closure.h (itemsetsize): Rename as...
17136 (nitemset): for consistency with the rest of the project.
17137
23cbcc6c
AD
171382001-12-05 Akim Demaille <akim@epita.fr>
17139
17140 * src/closure.c (print_closure): Improve.
17141 (closure): Use it for printing input and output.
17142
03ec521c
AD
171432001-12-05 Akim Demaille <akim@epita.fr>
17144
17145 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
17146 indexed by nonterminals.
17147
3a7456dd
AD
171482001-12-05 Akim Demaille <akim@epita.fr>
17149
17150 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
17151 what it was!).
17152 * src/warshall.h: Remove accidental duplication of the content.
17153
1cbcf2e7
AD
171542001-12-05 Akim Demaille <akim@epita.fr>
17155
17156 * src/closure.c (set_fderives): De-obfuscate.
17157
84182270
AD
171582001-12-05 Akim Demaille <akim@epita.fr>
17159
17160 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
17161
3f6f053c
AD
171622001-12-05 Akim Demaille <akim@epita.fr>
17163
17164 * src/closure.c (set_firsts): De-obfuscate.
17165
7a5350ba
AD
171662001-12-05 Akim Demaille <akim@epita.fr>
17167
17168 * src/output.c (action_row): De-obfuscate
17169 using the good o' techniques: arrays not pointers, variable
17170 locality, BITISSET, RESETBIT etc.
17171
d954473d
AD
171722001-12-05 Akim Demaille <akim@epita.fr>
17173
17174 Pessimize the code to simplify it: from now on, all the states
17175 have a valid SHIFTS, which NSHIFTS is possibly 0.
17176
17177 * src/LR0.c (shifts_new): Be global and move to..
17178 * src/state.c, src/state.h: here.
17179 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
17180 * src/print_graph: Adjust.
17181
9839bbe5
AD
171822001-12-05 Akim Demaille <akim@epita.fr>
17183
17184 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
17185 * src/conflicts.c: Use it.
17186 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
17187 incorrectly ``simplified''.
17188
9f136c07
AD
171892001-12-05 Akim Demaille <akim@epita.fr>
17190
17191 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
17192 using the good o' techniques: arrays not pointers, variable
17193 locality, BITISSET, RESETBIT etc.
17194
b608206e
AD
171952001-12-05 Akim Demaille <akim@epita.fr>
17196
17197 * src/state.h (SHIFT_SYMBOL): New.
17198 * src/conflicts.c: Use it to deobfuscate.
17199
52afa962
AD
172002001-12-05 Akim Demaille <akim@epita.fr>
17201
17202 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
17203 (print_reductions): De-obfuscate using the good o' techniques:
17204 arrays not pointers, variable locality, BITISSET.
17205
e74dc321
AD
172062001-12-05 Akim Demaille <akim@epita.fr>
17207
17208 * src/conflicts.c (print_reductions): Arrays, not pointers.
17209 Use BITISSET.
17210
768fca83
AD
172112001-12-05 Akim Demaille <akim@epita.fr>
17212
17213 * src/conflicts.c (print_reductions): Pessimize, but clarify.
17214
a17e599f
AD
172152001-12-05 Akim Demaille <akim@epita.fr>
17216
17217 * src/conflicts.c (print_reductions): Improve variable locality.
17218
a04bc341
AD
172192001-12-05 Akim Demaille <akim@epita.fr>
17220
17221 * src/conflicts.c (print_reductions): Pessimize, but clarify.
17222
c8ea038e
AD
172232001-12-05 Akim Demaille <akim@epita.fr>
17224
17225 * src/conflicts.c (print_reductions): Improve variable locality.
17226
aa2aab3c
AD
172272001-12-05 Akim Demaille <akim@epita.fr>
17228
17229 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
17230 * src/lalr.c: Use them.
17231
b178c8cc
AD
172322001-12-05 Akim Demaille <akim@epita.fr>
17233
17234 * src/LR0.c (augment_automaton): Formatting changes.
17235 Better variable locality.
17236
f67d13aa
AD
172372001-12-05 Akim Demaille <akim@epita.fr>
17238
17239 * src/lalr.c (matrix_print): New.
17240 (transpose): Use it.
17241 Use arrays instead of pointers.
17242
c2713865
AD
172432001-12-05 Akim Demaille <akim@epita.fr>
17244
17245 * src/lalr.c (maxrhs): Move to...
17246 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
17247 * src/lalr.c (build_relations): Adjust.
17248
9887c18a
AD
172492001-12-05 Akim Demaille <akim@epita.fr>
17250
17251 * src/lalr.c (transpose): Free the memory allocated to the
17252 argument, as it is replaced by the results by the unique caller.
17253 (build_relations): Merely invoke transpose: it handles the memory
17254 deallocation.
17255 Improve variable locality.
17256 Avoid variables used as mere abbreviations.
17257 (compute_lookaheads): Use arrays instead of pointers.
17258
4d4f699c
AD
172592001-12-05 Akim Demaille <akim@epita.fr>
17260
17261 * src/lalr.c (initialize_F): Improve variable locality.
17262 Avoid variables used as mere abbreviations.
17263
80a69750
AD
172642001-12-05 Akim Demaille <akim@epita.fr>
17265
17266 * src/derives.c (print_derives): Display the ruleno.
17267 * src/lalr.c (initialize_F, transpose): Better variable locality
17268 to improve readability.
17269 Avoid variables used as mere abbreviations.
17270
fe961097
AD
172712001-12-05 Akim Demaille <akim@epita.fr>
17272
17273 * src/lalr.c (traverse): Use arrays instead of pointers.
17274
e3e4e814
AD
172752001-12-05 Akim Demaille <akim@epita.fr>
17276
17277 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
17278 the handling of squeue.
17279 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
17280
630e182b
AD
172812001-12-05 Akim Demaille <akim@epita.fr>
17282
17283 Because useless nonterminals are now kept alive (instead of being
17284 `destroyed'), we now sometimes examine them, and store information
17285 related to them. Hence we need to know their number, and adjust
17286 memory allocations.
17287
17288 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
17289 static.
17290 * src/LR0.c (allocate_itemsets): The memory allocated to
17291 `symbol_count' was used for two different purpose: once to count
17292 the number of occurrences of each symbol, and later reassigned to
17293 `shift_symbol', containing the symbol that can be shifted from a
17294 given state.
17295 Deobfuscate, i.e., allocate, use and free `symbol_count' here
17296 only, and...
17297 (new_itemsets): Allocate `shift_symbol' here.
17298 (allocate_itemsets): symbol_count includes useless nonterminals.
17299 Make room for them.
17300 (free_storage): Use `free', not `XFREE', for pointers that cannot
17301 be null.
17302
81b51460
AD
173032001-12-05 Akim Demaille <akim@epita.fr>
17304
17305 * src/nullable.c (set_nullable): Deobfuscate the handling of
17306 ritem.
17307 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
17308
3067fbef
AD
173092001-12-05 Akim Demaille <akim@epita.fr>
17310
17311 * src/gram.c, src/gram.h (ritem_print): New.
17312 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
17313 (This useless function was defined only to work around VMS linkers
17314 that can't handle compilation units with variables only).
17315 * src/reduce.c (dump_grammar): Use it to trace the construction of
17316 ritem.
17317
c2bea5f9
PE
173182001-12-04 Paul Eggert <eggert@twinsun.com>
17319
7d27c823
PE
17320 * src/bison.simple (union yyalloc): Change member names
17321 to be the same as the stack names.
17322 (yyparse): yyptr is now union yyalloc *, not char *.
17323 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
17324 and may generate better code on some machines.
c2bea5f9
PE
17325 (yystpcpy): Use prototype if __STDC__ is defined, not just
17326 if __cplusplus is defined.
35687a9d 17327
2c8a9dfa
AD
173282001-11-30 Akim Demaille <akim@epita.fr>
17329
17330 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
17331 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
17332 Gettext doesn't compile cleanly, and dies with -Werror.
17333 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
17334 Include WARNING_CFLAGS here.
17335 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
17336 before being defined.
17337
f4e421e6
AD
173382001-11-27 Paul Eggert <eggert@twinsun.com>
17339
17340 * lib/quotearg.h (quotearg_n, quotearg_n_style):
17341 First arg is int, not unsigned.
17342 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
17343 (SIZE_MAX, UINT_MAX): New macros.
17344 (quotearg_n_options): Abort if N is negative.
17345 Avoid overflow check on hosts where size_t is 64 bits and int
17346 is 32 bits, as overflow is impossible there.
17347 Fix off-by-one typo that caused unnecessary reallocation.
17348
7093d0f5
AD
173492001-11-29 Paul Eggert <eggert@twinsun.com>
17350
17351 Name space cleanup in generated parser.
17352
17353 * doc/bison.texinfo (Bison Parser): Discuss system headers
17354 and their effect on the user name space.
17355
17356 * src/bison.simple:
17357 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
17358 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
17359 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
17360
17361 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
17362 on user names when possible.
17363
17364 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
17365 Simplify test for whather <alloca.h> exists.
17366
17367 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
17368
17369 (<stdio.h>): Include if YYDEBUG.
17370
17371 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
17372 ! defined (yyoverflow) && ! defined (yymemcpy).
17373
17374 (yymemcpy, yyparse): Rename local variables as needed so that
17375 they all begin with 'yy'.
17376
17377 (yystrlen, yystpcpy): New functions.
17378
17379 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
17380 All uses changed.
17381
17382 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
17383 instead of relying on string.h functions. Use YYSTACK_ALLOC
17384 and YYSTACK_FREE instead of malloc and free.
17385
fd51e5ff
AD
173862001-11-30 Akim Demaille <akim@epita.fr>
17387
17388 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
17389 before their first uses.
17390 (YYBISON, YYPURE): Move to the top of the output.
17391
7d13ff5f
AD
173922001-11-30 Akim Demaille <akim@epita.fr>
17393
17394 * tests/reduce.at (Useless Nonterminals): Fix.
17395
892a3995
AD
173962001-11-30 Akim Demaille <akim@epita.fr>
17397
17398 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
17399 if body instead of `;' to pacify GCC's warnings.
17400
68f1e3ed
AD
174012001-11-30 Akim Demaille <akim@epita.fr>
17402
17403 Instead of mapping the LHS of unused rules to -1, keep the LHS
17404 valid, but flag the rules as invalid.
17405
17406 * src/gram.h (rule_t): `useful' is a new member.
17407 * src/print.c (print_grammar): Adjust.
17408 * src/derives.c (set_derives): Likewise.
17409 * src/reader.c (packgram, reduce_output): Likewise.
17410 * src/reduce.c (reduce_grammar_tables): Likewise.
17411 * tests/reduce.at (Underivable Rules, Useless Rules): New.
17412
d2d1b42b
AD
174132001-11-30 Akim Demaille <akim@epita.fr>
17414
17415 * src/reduce.c (reduce_output): Formatting changes.
17416 * src/print.c (print_results, print_grammar): Likewise.
17417 * tests/regression.at (Rule Line Numbers)
17418 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
17419
760b53a8
AD
174202001-11-30 Akim Demaille <akim@epita.fr>
17421
17422 * src/reduce.c (nonterminals_reduce): Instead of throwing away
17423 useless nonterminals, move them at the end of the symbol arrays.
17424 (reduce_output): Adjust.
17425 * tests/reduce.at (Useless Nonterminals): Adjust.
17426
00238958
AD
174272001-11-30 Akim Demaille <akim@epita.fr>
17428
17429 * src/reduce.c: Various comment/formatting changes.
17430 (nonterminals_reduce): New, extracted from...
17431 (reduce_grammar_tables): here.
17432 (reduce_grammar): Call nonterminals_reduce.
17433
396452de
PE
174342001-11-29 Paul Eggert <eggert@twinsun.com>
17435
17436 * src/bison.simple (YYSTACK_REALLOC): Remove.
17437 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
17438 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
17439 New macros.
17440 (union yyalloc): New type.
17441 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
17442 an arbitrary restriction on hosts where size_t is wider than int.
17443
17444 (yyparse): Don't dump core if alloca or malloc fails; instead, report
17445 a parser stack overflow. Allocate just one block of memory for all
17446 three stacks, instead of allocating three blocks; this typically is
17447 faster and reduces fragmentation.
17448
17449 Do not limit the number of items in the stack to a value that fits
17450 in 'int', as this is an arbitrary limit on hosts with 64-bit
17451 size_t and 32-bit int.
17452
147e184c
MA
174532001-11-29 Marc Autret <autret_m@epita.fr>
17454
17455 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
17456 of defining YYERROR_VERBOSE.
17457 [AT_DATA]: $4 is now out of C declarations in the prologue.
17458
426cf563
MA
174592001-11-28 Marc Autret <autret_m@epita.fr>
17460
17461 * src/reader.c (parse_dquoted_param): New.
17462 (parse_skel_decl): Use it.
17463 * src/lex.h: Add its prototype.
17464 * src/lex.c (literalchar): Become not static.
17465
c7925b99
MA
174662001-11-28 Marc Autret <autret_m@epita.fr>
17467
17468 * src/output.h: And put its extern declaration here.
17469 * src/output.c (error_verbose): Define here.
17470 (prepare): Echo name modification.
17471 * src/getargs.h: Clean its extern declaration.
17472 * src/getargs.c (error_verbose_flag): Remove.
17473 (getargs): Remove case 'e'.
17474 * src/options.c (option_table): 'error-verbose' is now seen as simple
17475 percent option.
17476 Include output.h.
17477
17478 * src/reader.c (read_declarations): Remove case tok_include.
17479 (parse_include_decl): Remove.
17480 * src/lex.h (token_t): Remove tok_include.
17481 * src/options.c (option_table): 'include' is now a simple command line
17482 option.
17483
5b5d1929
MA
174842001-11-28 Marc Autret <autret_m@epita.fr>
17485
17486 * src/bison.simple: Adjust muscle names.
17487 * src/muscle_tab.c (muscle_init): Also rename the muscles.
17488 * src/output.c (prepare): s/_/-/ for the muscles names.
17489 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
17490
8850be4b
MA
174912001-11-28 Marc Autret <autret_m@epita.fr>
17492
17493 * src/bison.simple: Fix debug.
17494 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
17495
4a38e613
AD
174962001-11-28 Akim Demaille <akim@epita.fr>
17497
17498 * src/LR0.c (shifts_new): New.
17499 (save_shifts, insert_start_shift, augment_automaton): Use it.
17500
4b35e1c1
AD
175012001-11-28 Akim Demaille <akim@epita.fr>
17502
17503 * src/closure.c (closure): `b' and `ruleno' denote the same value:
17504 keep ruleno only.
17505
d2b04478
AD
175062001-11-28 Akim Demaille <akim@epita.fr>
17507
17508 * src/closure.c (closure): Instead of looping over word in array
17509 then bits in words, loop over bits in array.
17510
2c4c30aa
AD
175112001-11-28 Akim Demaille <akim@epita.fr>
17512
17513 * src/closure.c (closure): No longer optimize the special case
17514 where all the bits of `ruleset[r]' are set to 0, to make the code
17515 clearer.
17516
576890b7
AD
175172001-11-28 Akim Demaille <akim@epita.fr>
17518
17519 * src/closure.c (closure): `r' and `c' are new variables, used to
17520 de-obfuscate accesses to RULESET and CORE.
17521
cb487d7d
AD
175222001-11-28 Akim Demaille <akim@epita.fr>
17523
17524 * src/reduce.c (reduce_print): Use ngettext.
17525 (dump_grammar): Improve the trace accuracy.
17526
6013d43f
AD
175272001-11-28 Akim Demaille <akim@epita.fr>
17528
17529 * src/reduce.c (dump_grammar): Don't translate trace messages.
17530
cb4956ee
AD
175312001-11-28 Akim Demaille <akim@epita.fr>
17532
17533 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
17534 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
17535 as all tags are free'ed afterwards.
17536 From Enrico Scholz.
17537
648185ab
PE
175382001-11-27 Paul Eggert <eggert@twinsun.com>
17539
17540 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
17541 use alloca when we didn't want to, and vice versa.
17542
68254a03
MA
175432001-11-27 Marc Autret <autret_m@epita.fr>
17544
9113b58f
AD
17545 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
17546 initialization.
68254a03
MA
17547 * src/output.c (prepare): Remove its update.
17548
04d843a2
MA
175492001-11-27 Marc Autret <autret_m@epita.fr>
17550
17551 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
17552 Use %error-verbose.
17553
d2079671 175542001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
17555
17556 * src/bison.simple: Remove YYERROR_VERBOSE using.
17557 Use %%error_verbose.
17558 (yyparse): Likewise.
17559 * src/output.c (prepare): Give its final value.
17560 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
17561 * src/getargs.h: Add its extern declaration.
17562 * src/getargs.c (error_verbose_flag): New int.
17563 (getargs): Update to catch new case.
17564 * src/options.c (option_table): 'error-verbose' is a new option.
17565 (shortopts): Update.
17566
e0327bc8
AD
175672001-11-27 Akim Demaille <akim@epita.fr>
17568
17569 * src/system.h: Use intl/libgettext.h.
17570 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
17571
000f1a3c
AD
175722001-11-27 Akim Demaille <akim@epita.fr>
17573
17574 * tests/torture.at (Exploding the Stack Size with Malloc):
17575 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
17576
26cfe0be
AD
175772001-11-27 Akim Demaille <akim@epita.fr>
17578
17579 * src/files.c: Include error.h.
17580 Reported by Hans Aberg.
17581
f6bd5427
MA
175822001-11-26 Marc Autret <autret_m@epita.fr>
17583
d2079671 17584 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
17585 (read_declarations): Add case tok_include.
17586 * src/getargs.h (include): Add its extern definition.
17587 * src/getargs.c (include): New const char *.
17588 (getargs): Add case '-I'.
17589 * src/options.c (option_table): Add include as command line and
17590 percent option.
17591 * src/lex.h (token_t): Add tok_include.
17592
2ca209c1
AD
175932001-11-26 Akim Demaille <akim@epita.fr>
17594
17595 * src/reader.c (readgram): Make sure rules for mid-rule actions
17596 have a lineno equal to that of their host rule.
17597 Reported by Hans Aberg.
17598 * tests/regression.at (Rule Line Numbers): New.
17599
0e41b407
AD
176002001-11-26 Akim Demaille <akim@epita.fr>
17601
17602 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
17603 size_ts.
17604
176052001-11-26 Akim Demaille <akim@epita.fr>
17606
17607 * src/complain.c, src/complain.h (error): Remove, provided by
17608 lib/error.[ch].
17609
e0c40012
AD
176102001-11-26 Akim Demaille <akim@epita.fr>
17611
17612 * src/reader.c (read_declarations): Don't abort on tok_illegal,
17613 issue an error message.
17614 * tests/regression.at (Invalid %directive): New.
17615 Reported by Hans Aberg.
17616
5e147124
AD
176172001-11-26 Akim Demaille <akim@epita.fr>
17618
17619 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
17620 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17621
a034c8b8
AD
176222001-11-26 Akim Demaille <akim@epita.fr>
17623
17624 * src/conflicts.c (conflicts_print): Don't complain at all when
17625 there are no reduce/reduce conflicts, and as many shift/reduce
17626 conflicts as expected.
17627 * tests/regression.at (%expect right): Adjust.
17628
c64a20f3
AD
176292001-11-23 Akim Demaille <akim@epita.fr>
17630
17631 * lib/alloca.c: Update, from fileutils.
17632
5b0d29bb
AD
176332001-11-23 Akim Demaille <akim@epita.fr>
17634
17635 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
17636
722c4bfe
AD
176372001-11-23 Akim Demaille <akim@epita.fr>
17638
17639 * src/system.h: Include alloca.h.
17640 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
17641
6255b435
AD
176422001-11-23 Akim Demaille <akim@epita.fr>
17643
17644 * src/print_graph.c (print_actions): Remove `rule', unused.
17645 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
17646 pacify GCC's signed < unsigned warnings.
17647 * src/closure.c (itemsetsize): Likewise.
17648 * src/reader.c (symbol_list_new): Static.
17649
b29b2ed5
AD
176502001-11-23 Akim Demaille <akim@epita.fr>
17651
17652 Attaching lineno to buckets is stupid, since only one copy of each
17653 symbol is kept, only the line of the first occurrence is kept too.
17654
17655 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
17656 * src/reader.c (rline_allocated): Remove, unused.
17657 (symbol_list): Have a `line' member.
17658 (symbol_list_new): New.
17659 (readgram): Use it.
17660 * src/print.c (print_grammar): Output the rule line numbers.
17661 * tests/regression.at (Solved SR Conflicts)
17662 (Unresolved SR Conflicts): Adjust.
17663 Reported by Hans Aberg.
17664
a81b1d4a
MA
176652001-11-22 Marc Autret <autret_m@epita.fr>
17666
17667 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
17668
c1ecb3c1
MA
176692001-11-22 Marc Autret <autret_m@epita.fr>
17670
17671 * src/muscle_tab.c (muscle_init): Remove initialization of
17672 skeleton muscle.
17673 * src/output.c (output_master_parser): Do it here.
17674
fbe01355
AD
176752001-11-20 Akim Demaille <akim@epita.fr>
17676
17677 * po/sv.po: New.
17678 * configure.in (ALL_LINGUAS): Adjust.
17679 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
17680 longer contains strings to translate.
17681
81e895c0
AD
176822001-11-19 Akim Demaille <akim@epita.fr>
17683
17684 * src/conflicts.c (conflicts_print): Add a missing \n.
17685
6bb1878b
AD
176862001-11-19 Akim Demaille <akim@epita.fr>
17687
17688 * src/nullable.c (nullable_print): New.
17689 (set_nullable): Call it when tracing.
17690 Better locality of variables.
17691
d9ec2d07
AD
176922001-11-19 Akim Demaille <akim@epita.fr>
17693
17694 * src/print.c (print_actions): Better locality of variables.
17695
720e5c1b
AD
176962001-11-19 Akim Demaille <akim@epita.fr>
17697
17698 * src/derives.c (print_derives): Fix and enrich.
17699 * src/closure.c (print_fderives): Likewise.
17700
fb908786
AD
177012001-11-19 Akim Demaille <akim@epita.fr>
17702
17703 * src/closure.c (itemsetend): Remove, replaced with...
17704 (itemsetsize): new.
17705
125ecb56
AD
177062001-11-19 Akim Demaille <akim@epita.fr>
17707
17708 * src/LR0.c (kernel_end): Remove, replaced with...
17709 (kernel_size): new.
17710
d8cf039f
AD
177112001-11-19 Akim Demaille <akim@epita.fr>
17712
17713 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
17714 to clarify.
17715
7bec0760
AD
177162001-11-19 Akim Demaille <akim@epita.fr>
17717
17718 * src/closure.c (closure): Use arrays instead of pointers to clarify.
17719
c87d4863
AD
177202001-11-19 Akim Demaille <akim@epita.fr>
17721
17722 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
17723 trace messages.
17724 * src/LR0.c: Likewise.
17725 (allocate_itemsets): Use arrays instead of pointers to clarify.
17726
9bfe901c
AD
177272001-11-19 Akim Demaille <akim@epita.fr>
17728
17729 * src/getargs.c (statistics_flag): Replace with...
17730 (trace_flag): New.
17731 (longopts): Accept --trace instead of --statistics.
17732 * src/getargs.h, src/options.c: Adjust.
17733 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
17734 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
17735
97db7bd4
AD
177362001-11-19 Akim Demaille <akim@epita.fr>
17737
cc72668c 17738 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
17739 pointers to clarify the code.
17740 (save_reductions, save_shifts): Factor common parts of alternatives.
17741
2c5f66ed
AD
177422001-11-19 Akim Demaille <akim@epita.fr>
17743
17744 * src/LR0.c (new_state, get_state): Complete TRACE code.
17745 * src/closure.c: Include `reader.h' to get `tags', needed by the
17746 trace code.
17747 Rename the conditional DEBUG as TRACE.
17748 Output consistently TRACEs to stderr, not stdout.
17749 * src/derives.c: Likewise.
17750 * src/reduce.c: (inaccessable_symbols): Using if is better style
17751 than goto.
17752 Use `#if TRACE' instead of `#if 0' for tracing code.
17753
300f275f
AD
177542001-11-19 Akim Demaille <akim@epita.fr>
17755
17756 * src/system.h (LIST_FREE, shortcpy): New.
17757 * src/LR0.c: Use them.
17758 * src/output.c (free_itemsets, free_reductions, free_shifts):
17759 Remove, replaced by LIST_FREE.
17760
f59c437a
AD
177612001-11-19 Akim Demaille <akim@epita.fr>
17762
17763 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
17764 (REDUCTIONS_ALLOC): New.
17765 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
17766 allocation.
17767
6986fd9e
AD
177682001-11-19 Akim Demaille <akim@epita.fr>
17769
17770 * src/LR0.c (new_state): Complete trace code.
17771 * src/nullable.c (set_nullable): Don't translate traces.
17772
4bc30f78
AD
177732001-11-19 Akim Demaille <akim@epita.fr>
17774
17775 * src/print_graph.c (print_core): Better locality of variables.
17776 * src/print.c (print_core): Likewise.
17777
08a946e0
AD
177782001-11-19 Akim Demaille <akim@epita.fr>
17779
17780 * src/vcg.c: You do the output, so you are responsible of the
17781 handling of VCG syntax, in particular: use quotearg.
17782 * src/print_graph.c: Don't.
17783 (print_actions): Don't output the actions as part of the nodes,
17784 since that's the job of the edges.
17785 (print_state): Don't output by hand: fill the node description,
9bfe901c 17786 and ask for its output.
08a946e0 17787
f0473484
AD
177882001-11-19 Akim Demaille <akim@epita.fr>
17789
cc72668c
AD
17790 * src/bison.simple (yyparse): When verbosely reporting an error,
17791 no longer put additional quotes around token names.
f0473484
AD
17792 * tests/calc.at: Adjust.
17793
e41dc700
AD
177942001-11-19 Akim Demaille <akim@epita.fr>
17795
17796 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
17797 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
17798 * src/output.c: Adjust.
17799
652a871c
AD
178002001-11-19 Akim Demaille <akim@epita.fr>
17801
17802 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
17803 (rule_t): this.
17804 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
17805
b2ed6e58
AD
178062001-11-19 Akim Demaille <akim@epita.fr>
17807
17808 * src/gram.h (rule_t): New.
17809 (rule_table): New.
17810 (rrhs, rlhs): Remove, part of state_t.
17811 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
17812 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17813 * src/reader.c, src/reduce.c: Adjust.
17814
edad7067
AD
178152001-11-19 Akim Demaille <akim@epita.fr>
17816
17817 * src/reader.c (symbols_output): New, extracted from...
17818 (packsymbols): Here.
17819 (reader): Call it.
17820
3feec034
AD
178212001-11-19 Akim Demaille <akim@epita.fr>
17822
17823 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
17824 (maxrhs): this new function.
17825
ddcd5fdf
AD
178262001-11-19 Akim Demaille <akim@epita.fr>
17827
cc72668c 17828 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
17829 Adjust.
17830
bb527fc2
AD
178312001-11-19 Akim Demaille <akim@epita.fr>
17832
cc72668c 17833 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
17834 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17835 * src/lalr.c: Adjust.
17836
a845a697
AD
178372001-11-19 Akim Demaille <akim@epita.fr>
17838
17839 * src/lalr.c (initialize_LA): Only initialize LA. Let...
17840 (set_state_table): handle the `lookaheads' members.
17841
f004bf6a
AD
178422001-11-19 Akim Demaille <akim@epita.fr>
17843
cc72668c
AD
17844 * src/lalr.h (lookaheads): Removed array, whose contents is now
17845 a member of...
f004bf6a
AD
17846 (state_t): this structure.
17847 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17848 Adjust.
17849
de326cc0
AD
178502001-11-19 Akim Demaille <akim@epita.fr>
17851
cc72668c
AD
17852 * src/lalr.h (consistent): Removed array, whose contents is now
17853 a member of...
de326cc0
AD
17854 (state_t): this structure.
17855 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17856 Adjust.
17857
90b4416b
AD
178582001-11-19 Akim Demaille <akim@epita.fr>
17859
cc72668c
AD
17860 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
17861 contents are now members of...
90b4416b
AD
17862 (state_t): this structure.
17863 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17864 Adjust.
17865
9703cc49
AD
178662001-11-19 Akim Demaille <akim@epita.fr>
17867
17868 * src/lalr.h (state_t): New.
17869 (state_table): Be a state_t * instead of a core **.
17870 (accessing_symbol): Remove, part of state_t.
17871 * src/lalr.c: Adjust.
17872 (set_accessing_symbol): Merge into...
17873 (set_state_table): this.
17874 * src/print_graph.c, src/conflicts.c: Adjust.
17875
d803322e
AD
178762001-11-14 Akim Demaille <akim@epita.fr>
17877
17878 * tests/calc.at, tests/output.at, tests/regression.at,
17879 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
17880 now the tests are run in private dirs, therefore AC_CLEANUP and
17881 family can be simplified to 0-ary.
17882 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
17883 use abs. path to find config.h.
17884 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
17885 stderr, there can be way too much random noise.
17886 Instead pass -Werror to GCC and rely on the exit status.
17887 Reported by Wolfram Wagner.
17888
3d76b07d
AD
178892001-11-14 Akim Demaille <akim@epita.fr>
17890
17891 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
17892 defined only if yyoverflow is defined, to avoid `warning: unused
17893 variable `yyvs1''.
17894 Reported by The Test Suite.
17895
09b503c8
AD
178962001-11-14 Akim Demaille <akim@epita.fr>
17897
17898 * src/print.c: Include reduce.h.
17899 Reported by Hans Aberg.
17900
179012001-11-14 Akim Demaille <akim@epita.fr>
17902
17903 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
17904 Revert a previous patch: these are really const.
17905 * src/conflicts.c (conflict_report): Additional useless pair of
17906 braces to pacify GCC's warnings for `if () if () {} else {}'.
17907 * src/lex.c (parse_percent_token): Replace equal_offset with
17908 arg_offset.
17909 arg is const.
17910 Be sure to strdup `arg' when used, since there is no reason for
17911 token_buffer not to change.
17912
0f37a994
AD
179132001-11-14 Akim Demaille <akim@epita.fr>
17914
17915 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
17916 definition.
17917 * src/main.c (main): Use them.
17918 Suggested by Hans Aberg.
17919
d39d93b8
AD
179202001-11-12 Akim Demaille <akim@epita.fr>
17921
17922 * src/system.h (ngettext): Now that we use ngettext, be sure to
17923 provide a default definition when NLS are not used.
17924
9edcd895
AD
179252001-11-12 Akim Demaille <akim@epita.fr>
17926
17927 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
17928 Use @kbd to denote user input.
17929 (Language and Grammar): ANSIfy the example.
17930 Adjust its layout for info/notinfo.
17931 (Location Tracking Calc): Output error messages to stderr.
17932 Output locations in a more GNUtically correct way.
17933 Fix a couple of Englishos.
17934 Adjust @group/@end group pairs.
17935
7da99ede
AD
179362001-11-12 Akim Demaille <akim@epita.fr>
17937
e3aa65c5 17938 %expect was not functioning at all.
7da99ede
AD
17939
17940 * src/conflicts.c (expected_conflicts): Set to -1.
17941 (conflict_report): Use ngettext.
17942 (conflicts_print): Check %expect and make its violation an error.
17943 * doc/bison.texinfo (Expect Decl): Adjust.
17944 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
17945 * tests/regression.at (%expect not enough, %expect right)
17946 (%expect too much): New.
17947
ba9dda1a
AD
179482001-11-12 Akim Demaille <akim@epita.fr>
17949
17950 * tests/regression.at (Conflicts): Rename as...
17951 (Unresolved SR Conflicts): this.
17952 (Solved SR Conflicts): New.
17953
337c5bd1
AD
179542001-11-12 Akim Demaille <akim@epita.fr>
17955
17956 * src/reduce.c (print_results): Rename as...
17957 (reduce_output): This.
17958 Output to OUT, passed as argument, instead of output_obstack.
17959 (dump_grammar): Likewise.
17960 (reduce_free): New.
17961 Also free V1.
17962 (reduce_grammar): No longer call reduce_output, since...
17963 * src/print.c (print_results): do it.
17964 * src/main.c (main): Call reduce_free;
17965
c73a41af
AD
179662001-11-12 Akim Demaille <akim@epita.fr>
17967
17968 * src/conflicts.c (print_reductions): Accept OUT as argument.
17969 Output to it, not to output_obstack.
17970 * src/print.c (print_actions): Adjust.
17971
0df87bb6
AD
179722001-11-12 Akim Demaille <akim@epita.fr>
17973
17974 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
17975 the result instead of using...
17976 (src_total, rrc_total, src_count, rrc_count): Remove.
17977 (any_conflicts): Remove.
17978 (print_conflicts): Split into...
17979 (conflicts_print, conflicts_output): New.
17980 * src/conflicts.h: Adjust.
17981 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 17982 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
17983 * tests/regression.at (Conflicts): New.
17984 Reported by Tom Lane.
17985
e4d3d4de
AD
179862001-11-12 Akim Demaille <akim@epita.fr>
17987
17988 * tests/regression.at (Invalid input): Remove, duplicate with
17989 ``Invalid input: 1''.
17990
6d7d248e
AD
179912001-11-12 Akim Demaille <akim@epita.fr>
17992
17993 * tests/torture.at (AT_DATA_STACK_TORTURE)
17994 (Exploding the Stack Size with Alloca)
17995 (Exploding the Stack Size with Malloc): New.
17996
e9e4c321
AD
179972001-11-12 Akim Demaille <akim@epita.fr>
17998
17999 * src/bison.simple (YYSTACK_REALLOC): New.
18000 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 18001 Reported by Per Allansson.
e9e4c321 18002
5f7e0832
AD
180032001-11-12 Pascal Bart <pascal.bart@epita.fr>
18004
18005 * src/bison.simple: Define type yystype instead of YYSTYPE, and
18006 define CPP macro, which substitute YYSTYPE by yystype.
18007 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
18008 with yyltype/YYLTYPE. This allows inclusion of the generated
18009 header within the parser if the compiler, such as GGC, accepts
18010 multiple equivalent #defines.
18011 From Akim.
18012
e3f1699f
AD
180132001-11-05 Akim Demaille <akim@epita.fr>
18014
18015 * src/reader.c (symbols_output): New, extracted from...
18016 (packsymbols): here.
18017 (reader): Adjust.
18018
65be0866
AD
180192001-11-05 Akim Demaille <akim@epita.fr>
18020
18021 * src/lex.c (parse_percent_token): s/quotearg/quote/.
18022
e4d910bf
AD
180232001-11-05 Akim Demaille <akim@epita.fr>
18024
18025 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
18026 pattern.
18027
951366c1
AD
180282001-11-05 Akim Demaille <akim@epita.fr>
18029
18030 * src/options.h (struct option_table_struct): set_flags is void*.
18031 * src/options.c (longopts): Support `--output' and `%output'.
18032 (usage): Adjust.
18033 * src/lex.h (tok_setopt): Remove, replaced with...
18034 (tok_intopt, tok_stropt): these new guys.
18035 * src/lex.c (getopt.h): Not needed.
18036 (token_buffer, unlexed_token_buffer): Not const.
18037 (percent_table): Promote `-' over `_' in directive names.
18038 Active `%name-prefix', `file-prefix', and `output'.
18039 (parse_percent_token): Accept possible arguments to directives.
18040 Promote `-' over `_' in directive names.
18041
d8988b2f
AD
180422001-11-04 Akim Demaille <akim@epita.fr>
18043
18044 * doc/bison.texinfo (Decl Summary): Split the list into
18045 `directives for grammars' and `directives for bison'.
18046 Sort'em.
18047 Add description of `%name-prefix', `file-prefix', and `output'.
18048 Promote `-' over `_' in directive names.
18049 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
18050 Simplify the description of `--name-prefix'.
18051 Promote `-' over `_' in directive names.
18052 Promote `--output' over `--output-file'.
18053 Fix the description of `--defines'.
18054 * tests/output.at: Exercise %file-prefix and %output.
18055
6468d18e
AD
180562001-11-02 Akim Demaille <akim@epita.fr>
18057
18058 * doc/refcard.tex: Update.
18059
6b7e85b9
AD
180602001-11-02 Akim Demaille <akim@epita.fr>
18061
18062 * src/symtab.h (SUNDEF): New.
18063 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
18064 stand for `uninitialized', instead of 0.
18065 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
18066 * src/lex.c (lex): Adjust.
18067
18068 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
18069 Number it 0.
18070 Let yylex return it instead of a plain 0.
18071 Reported by Dick Streefland.
18072
cd5aafcf
AD
180732001-11-02 Akim Demaille <akim@epita.fr>
18074
18075 * tests/regression.at (Mixing %token styles): New test.
18076
037ca2f1
AD
180772001-11-02 Akim Demaille <akim@epita.fr>
18078
18079 * src/reader.c (parse_thong_decl): Formatting changes.
18080 (token_translations_init): New, extracted from...
18081 (packsymbols): Here.
18082 Adjust.
18083
270a173c
AD
180842001-11-01 Akim Demaille <akim@epita.fr>
18085
18086 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
18087 Check that `9foo.y' produces correct cpp guards.
18088 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
18089 guards.
18090 Reported by Wwp.
18091
561f9a30
AD
180922001-11-01 Akim Demaille <akim@epita.fr>
18093
18094 * tests/regression.at (Invalid input: 2): New.
18095 * src/lex.c (unlexed_token_buffer): New.
18096 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
18097 too.
18098 Reported by Wwp.
18099
f987e9d2
AD
181002001-11-01 Akim Demaille <akim@epita.fr>
18101
18102 * tests/calc.at: Catch up with 1.30.
18103 * configure.in: Bump to 1.49a.
18104 Adjust to newer Autotest.
18105
0846f581
PB
181062001-10-19 Pascal Bart <pascal.bart@epita.fr>
18107
18108 * src/conflicts.c: Move global variables rrc_total and src_total ...
18109 (print_conflicts): here.
18110 * src/output.c (output): Free global variable user_toknums.
18111 * src/lex.c (token_obstack): Become static.
18112
3c1a79b3
AD
181132001-10-18 Akim Demaille <akim@epita.fr>
18114
18115 * tests/atlocal.in (GCC): Add.
18116 * tests/calc.at: s/m4_match/m4_bmatch/.
18117 s/m4_patsubst/m4_bpatsubst/.
18118 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
18119 * configure.in: AC_SUBST(GCC).
18120
5d52e7d0
MA
181212001-10-14 Marc Autret <autret_m@epita.fr>
18122
18123 * src/options.c (create_long_option_table): Fix.
18124
631aa1d3
AD
181252001-10-10 Akim Demaille <akim@epita.fr>
18126
18127 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
18128
f6ec6d13
AD
181292001-10-04 Akim Demaille <akim@epita.fr>
18130
18131 * src/reader.c (parse_union_decl): Push the caracters in
18132 union_obstack, not attrs_obstack.
18133
342b8b6e
AD
181342001-10-04 Akim Demaille <akim@epita.fr>
18135
18136 Merge in the branch 1.29.
18137
18138 * src/reader.c (packsymbols): Use a temporary obstack for
18139 `%%tokendef', since output_stack is already used elsewhere.
18140
18141 2001-10-02 Akim Demaille <akim@epita.fr>
18142
18143 Bump 1.29d.
18144
18145 2001-10-02 Akim Demaille <akim@epita.fr>
18146
18147 Version 1.29c.
18148
18149 2001-10-02 Akim Demaille <akim@epita.fr>
18150
18151 * tests/regression.at (Invalid CPP headers): New.
18152 From Alexander Belopolsky.
18153 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
18154
18155 2001-10-02 Akim Demaille <akim@epita.fr>
18156
18157 * tests/regression.at (Invalid input): New.
18158 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
18159 Reported by Shura.
18160
18161 2001-10-02 Akim Demaille <akim@epita.fr>
18162
18163 * tests/calc.at: Now that --debug works, the tests must be adjusted.
18164
18165 2001-10-02 Akim Demaille <akim@epita.fr>
18166
18167 * src/output.c (output_parser): Assert `skeleton'.
18168 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
18169 systems.
18170 From Shura.
18171
18172 2001-10-01 Marc Autret <autret_m@epita.fr>
18173
18174 * src/lex.h: Echo modifications.
18175 * src/lex.c (unlex): Parameter is now token_t.
18176 From Hans Aberg.
18177
18178 2001-10-01 Marc Autret <autret_m@epita.fr>
18179
18180 * src/main.c: Include lex.h.
18181 From Hans Aberg.
18182
18183 2001-09-29 Akim Demaille <akim@epita.fr>
18184
18185 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
18186
18187 2001-09-28 Akim Demaille <akim@epita.fr>
18188
18189 * tests/testsuite.at: Update to newer Autotest.
18190 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
18191
18192 2001-09-27 Akim Demaille <akim@epita.fr>
18193
18194 Position independent wrapper.
18195
18196 * tests/bison: Remove.
18197 * tests/bison.in: New.
18198 * configure.in: Adjust.
18199
18200 2001-09-27 Paul Eggert <eggert@twinsun.com>
18201
18202 Port quotearg fixes from tar 1.13.24.
18203
18204 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
18205 tm to be declared.
18206 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
18207 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
18208
18209 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
18210 * m4/mbrtowc.m4: New file.
18211 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
18212 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
18213
18214 2001-09-27 Akim Demaille <akim@epita.fr>
18215
18216 Bump to 1.29c.
18217
18218 2001-09-27 Akim Demaille <akim@epita.fr>
18219
18220 Version 1.29b.
18221
18222 2001-09-25 Akim Demaille <akim@epita.fr>
18223
18224 * src/system.h: Include `xalloc.h'.
18225 Remove it from the C files.
18226 * src/files.c (output_files): Free the obstacks.
18227 * src/lex.c (init_lex): Rename as...
18228 (lex_init): this.
18229 (lex_free): New.
18230 * src/main.c (main): Use it.
18231
18232 2001-09-24 Marc Autret <autret_m@epita.fr>
18233
18234 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
18235 to output informations in fout (FILE*).
18236 (open_graph, close_graph): Likewise.
18237 (output_graph, output_edge, output_node): Likewise.
18238 * src/vcg.h: Update function prototypes.
18239 * src/print_graph.c (print_graph): Open output graph file.
18240 (print_actions): Adjust.
18241 * src/files.h: Remove extern declaration.
18242 * src/files.c: Remove graph_obstack declaration.
18243 (open_files): Remove graph_obstack initialization.
18244 (output_files): Remove graph_obstack saving.
18245
18246 2001-09-24 Marc Autret <autret_m@epita.fr>
18247
18248 * src/files.c (compute_output_file_names): Fix.
18249
18250 2001-09-24 Marc Autret <autret_m@epita.fr>,
18251 Akim Demaille <akim@epita.fr>
18252
18253 * src/reader.c (reader): Remove call to free_symtab ().
18254 * src/main.c (main): Call it here.
18255 Include symtab.h.
18256 * src/conflicts.c (initialize_conflicts): Rename as...
18257 (solve_conflicts): this.
18258 * src/print.c (print_core, print_actions, print_state)
18259 (print_grammar): Dump to a file instead a `output_obstack'.
18260 (print_results): Dump `output_obstack', and then proceed with the
18261 FILE *.
18262 * src/files.c (compute_output_file_names, close_files): New.
18263 (output_files): Adjust.
18264 * src/main.c (main): Adjust.
18265
18266 2001-09-23 Marc Autret <autret_m@epita.fr>
18267
18268 * src/files.c (compute_header_macro): Computes header macro name
18269 from spec_defines_file when given.
18270
18271 2001-09-23 Marc Autret <autret_m@epita.fr>
18272
18273 * src/files.c (output_files): Add default extensions.
18274
18275 2001-09-22 Akim Demaille <akim@epita.fr>
18276
18277 * src/conflicts.c (finalize_conflicts): Rename as...
18278 (free_conflicts): this.
18279
18280 2001-09-22 Akim Demaille <akim@epita.fr>
18281
18282 * src/gram.c (gram_free): Rename back as...
18283 (dummy): this.
18284 (output_token_translations): Free `token_translations'.
18285 * src/symtab.c (free_symtab): Free the tag field.
18286
18287 2001-09-22 Akim Demaille <akim@epita.fr>
18288
18289 Remove `translations' as it is always set to true.
18290
18291 * src/gram.h: Adjust.
18292 * src/reader.c (packsymbols, parse_token_decl): Adjust
18293 * src/print.c (print_grammar): Adjust.
18294 * src/output.c (output_token_translations): Adjust.
18295 * src/lex.c (lex): Adjust.
18296 * src/gram.c: Be sure the set pointers to NULL.
18297 (dummy): Rename as...
18298 (gram_free): this.
18299
18300 2001-09-22 Akim Demaille <akim@epita.fr>
18301
18302 * configure.in: Invoke AM_LIB_DMALLOC.
18303 * src/system.h: Use dmalloc.
18304 * src/LR0.c: Be sure to have pointers initialized to NULL.
18305 (allocate_itemsets): Allocate kernel_items only if needed.
18306
18307 2001-09-22 Akim Demaille <akim@epita.fr>
18308
18309 * configure.in: Bump to 1.29b.
18310 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
18311 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
18312 need xmalloc.c in calc.y.
18313 From Pascal Bart.
18314
18315 2001-09-21 Akim Demaille <akim@epita.fr>
18316
18317 Version 1.29a.
18318 * Makefile.maint, config/config.guess, config/config.sub,
18319 * config/missing: Update from masters.
18320 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
18321 upon package.m4.
18322 * configure.in (ALL_LINGUAS): Add `tr'.
18323
18324 2001-09-21 Akim Demaille <akim@epita.fr>
18325
18326 * tests/Makefile.am (package.m4): Move to...
18327 ($(srcdir)/$(TESTSUITE)): here.
18328
18329 2001-09-20 Akim Demaille <akim@epita.fr>
18330
18331 * src/complain.c: No longer try to be standalone: use system.h.
18332 Don't assume __STDC__ is defined to 1. Just test if it is defined.
18333 * src/complain.h: Likewise.
18334 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
18335 Remove the unused variable `n'.
18336 From Albert Chin-A-Young.
18337
18338 2001-09-18 Marc Autret <autret_m@epita.fr>
18339
18340 * doc/bison.1: Update.
18341 * doc/bison.texinfo (Bison Options): Update --defines and --graph
18342 descriptions.
18343 (Option Cross Key): Update.
18344 Add --graph.
18345
18346 2001-09-18 Marc Autret <autret_m@epita.fr>
18347
18348 * tests/regression.at: New test (comment in %union).
18349
18350 2001-09-18 Marc Autret <autret_m@epita.fr>
18351
18352 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
18353 do that.
18354 Reported by Keith Browne.
18355
18356 2001-09-18 Marc Autret <autret_m@epita.fr>
18357
18358 * tests/output.at: Add tests for --defines and --graph.
18359
18360 2001-09-18 Marc Autret <autret_m@epita.fr>
18361
18362 * tests/output.at: Removes tests of %{header,src}_extension features.
18363
18364 2001-09-18 Akim Demaille <akim@epita.fr>
18365
18366 * tests/Makefile.am (package.m4): New.
18367 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
18368 (_AT_CHECK_CALC_ERROR): Likewise.
18369 Factor the `, ' part of verbose error messages.
18370
18371 2001-09-18 Marc Autret <autret_m@epita.fr>
18372
18373 * src/getargs.c (longopts): Declare --defines and --graph as options
18374 with optional arguments.
18375 * src/files.h: Add extern declarations.
18376 * src/files.c (spec_graph_file, spec_defines_file): New.
18377 (output_files): Update.
18378 Remove CPP-outed code.
18379
18380 2001-09-18 Marc Autret <autret_m@epita.fr>
18381
18382 Turn off %{source,header}_extension feature.
18383
18384 * src/files.c (compute_exts_from_gf): Update.
18385 (compute_exts_from_src): Update.
18386 (output_files): CPP-out useless code.
18387 * src/files.h: Remove {header,source}_extension extern declarations.
18388 * src/reader.c (parse_dquoted_param): CPP-out.
18389 (parse_header_extension_decl): Remove.
18390 (parse_source_extension_decl): Remove.
18391 (read_declarations): Remove cases tok_{hdrext,srcext}.
18392 * src/lex.c (percent_table): Remove {header,source}_extension entries.
18393 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
18394
18395 2001-09-10 Akim Demaille <akim@epita.fr>
18396
18397 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
18398 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
18399 (AT_CHECK_OUTPUT): this.
18400 Merely check ls' exit status, its output is useless.
18401
18402 2001-09-10 Akim Demaille <akim@epita.fr>
18403
18404 * tests/calc.at: Use m4_match.
18405 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
18406
18407 2001-09-10 Marc Autret <autret_m@epita.fr>,
18408 Akim Demaille <akim@epita.fr>
18409
18410 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
18411 enum color_e.
18412 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
18413 to `normal'.
18414 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
18415 * src/lex.h: Adjust prototype.
18416 (token_t): Add `tok_undef'.
18417 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
18418 (parse_percent_token): Now returns token_t.
18419 Add default statement in switch.
18420 (lex): Separate `c' as an input variable, from the token_t result
18421 part.
18422 (unlexed): Is a token_t.
18423
18424 2001-09-10 Akim Demaille <akim@epita.fr>
18425
18426 * configure.in: Bump to 1.29a.
18427
18428 2001-09-07 Akim Demaille <akim@epita.fr>
18429
18430 Version 1.29.
18431
18432 2001-08-30 Akim Demaille <akim@epita.fr>
18433
18434 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
18435 * m4/atconfig.m4: Remove.
18436 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
18437 * tests/bison: New.
18438 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
18439 m4_if, m4_patsubst, and m4_regexp.
18440 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
18441 `input' file instead of echo.
18442
18443 2001-08-29 Akim Demaille <akim@epita.fr>
18444
18445 Bump to 1.28e.
18446
18447 2001-08-29 Akim Demaille <akim@epita.fr>
18448
18449 Version 1.28d.
18450
18451 2001-08-29 Paul Eggert <eggert@twinsun.com>
18452
18453 * src/bison.simple (yyparse): Don't take the address of an
18454 item before the start of an array, as that doesn't conform to
18455 the C Standard.
18456
18457 2001-08-29 Robert Anisko <anisko_r@epita.fr>
18458
18459 * doc/bison.texinfo (Location Tracking Calc): New node.
18460
18461 2001-08-29 Paul Eggert <eggert@twinsun.com>
18462
18463 * src/output.c (output): Do not define const, as this now
18464 causes more problems than it cures.
18465
18466 2001-08-29 Akim Demaille <akim@epita.fr>
18467
18468 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
18469 the nodes.
18470 Be sure to tag the `detailmenu'.
18471
18472 2001-08-29 Akim Demaille <akim@epita.fr>
18473
18474 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
18475 download in a tmp dir.
18476
18477 2001-08-28 Marc Autret <autret_m@epita.fr>
18478
18479 * config/depcomp: New file.
18480
18481 2001-08-28 Marc Autret <autret_m@epita.fr>
18482
18483 * doc/bison.1 (mandoc): Adjust.
18484 From Juan Manuel Guerrero.
18485
18486 2001-08-28 Marc Autret <autret_m@epita.fr>
18487
18488 * src/print_graph.c (print_state): Fix.
18489
18490 2001-08-27 Marc Autret <autret_m@epita.fr>
18491
18492 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
18493 char * members.
18494 Echo modifications to the functions prototypes.
18495 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
18496
18497 2001-08-27 Marc Autret <autret_m@epita.fr>
18498
18499 * src/vcg.c: Include `xalloc.h'.
18500 (add_colorentry): New.
18501 (add_classname): New.
18502 (add_infoname): New.
18503 * src/vcg.h: Add new prototypes.
18504
18505 2001-08-27 Akim Demaille <akim@epita.fr>
18506
18507 * Makefile.maint: Sync. again with CVS Autoconf.
18508
18509 2001-08-27 Akim Demaille <akim@epita.fr>
18510
18511 * Makefile.maint: Formatting changes.
18512 (po-update, cvs-update, update): New targets.
18513 (AMTAR): Remove.
18514
18515 2001-08-27 Akim Demaille <akim@epita.fr>
18516
18517 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18518 * Makefile.maint: Sync. with CVS Autoconf.
18519
18520 2001-08-27 Marc Autret <autret_m@epita.fr>
18521
18522 * src/vcg.h (struct infoname_s): New.
18523 (struct colorentry_s): New.
18524 (graph_s): New fields {vertical,horizontal}_order in structure.
18525 Add `infoname' field.
18526 Add `colorentry' field;
18527 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
18528 (G_HORIZONTAL_ORDER): New.
18529 (G_INFONAME): New.
18530 (G_COLORENTRY): New.
18531 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
18532 Add output of `infoname'.
18533 Add output of `colorentry'.
18534
18535 2001-08-27 Marc Autret <autret_m@epita.fr>
18536
18537 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
18538 This one shadowed a global parameter.
18539
18540 2001-08-24 Marc Autret <autret_m@epita.fr>
18541
18542 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
18543 instead of `unsigned'.
18544 (print_state): Do not call obstack_object_size () in obstack_grow ()
18545 to avoid macro variables shadowing.
18546
18547 2001-08-23 Marc Autret <autret_m@epita.fr>
18548
18549 * src/lex.c (percent_table): Typo: s/naem/name/.
18550 Add graph option.
18551 Normalize new options declarations.
18552
18553 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
18554
18555 * tests/suite.at: Exercise %header_extension and %source_extension.
18556
18557 2001-08-16 Marc Autret <autret_m@epita.fr>
18558
18559 * src/reader.c (parse_dquoted_param): New.
18560 (parse_header_extension_decl): Use it.
18561 (parse_source_extension_decl): Likewise.
18562
18563 2001-08-16 Marc Autret <autret_m@epita.fr>
18564
18565 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
18566 (get_xxxx_str): Use assert () instead of complain ().
18567 Remove return invokations in default cases.
18568 (get_decision_str): Modify default behaviour. Remove second argument.
18569 Echo modifications on calls.
18570 (output_graph): Fix.
18571
18572 2001-08-16 Marc Autret <autret_m@epita.fr>
18573
18574 * src/getargs.c (usage): Update with ``-g, --graph''.
18575
18576 2001-08-16 Marc Autret <autret_m@epita.fr>
18577
18578 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
18579 (Option Cross Key): Likewise.
18580 * doc/bison.1: Update.
18581
1c8c2190
PB
185822001-09-25 Pascal Bart <pascal.bart@epita.fr>
18583
18584 * src/output.c (output_master_parser): Don't finish action_obstack.
18585 (output_parser): Don't care about the muscle action, here.
18586 (prepare): Copy the action_obstack in the action muscle.
18587 (output): Free action_obstack.
18588
180d45ba
PB
185892001-09-23 Pascal Bart <pascal.bart@epita.fr>
18590
18591 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
18592 will contain `%union' declaration.
18593 (parse_union_decl): Delete #line directive output.
18594 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
18595 informations about %union.
18596 (parse_union_decl): Copy the union_obstack in the muscle stype.
18597 * src/bison.simple: Add new #line directive.
18598 Add typdef %%stype YYSTYPE.
18599
c51d1a19
PB
186002001-09-23 Pascal Bart <pascal.bart@epita.fr>
18601
18602 * src/bison.simple: Add new `#line' directive.
18603
6f9344da
PB
186042001-09-22 Pascal Bart <pascal.bart@epita.fr>
18605
18606 * src/bison.simple: New `#line' directive.
18607 * src/output.c (output_parser): Support new dynamic muscle input_line.
18608
652def80
MA
186092001-09-22 Marc Autret <autret_m@epita.fr>
18610
18611 * src/output.c (output_master_parser): New.
18612 (output_parser): Be more re-entrant.
18613
25b222fa
MA
186142001-09-21 Marc Autret <autret_m@epita.fr>
18615
18616 * src/reader.c (copy_definition, parse_union_decl): Update and use
18617 `linef' muscle.
18618 (copy_action): Likewise.
18619 Use obstack_1grow ().
18620 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
18621
6bc35ae5
MA
186222001-09-21 Marc Autret <autret_m@epita.fr>
18623
18624 * src/options.c (option_table): Adjust.
18625 * src/lex.c (parse_percent_token): Fix.
18626
c0629aa1
PB
186272001-09-20 Pascal Bart <pascal.bart@epita.fr>
18628
18629 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 18630
82b6d266
PB
186312001-09-20 Pascal Bart <pascal.bart@epita.fr>
18632
18633 * src/lex.c (parse_percent_token): Change type of variable `tx', which
18634 is now an option_table_struct*.
18635 (option_strcmp): New function option_strcmp.
18636 (parse_percent_token): Call option_strcmp.
18637 * src/getargs.c (xalloc.h, options.h): Include it.
18638 (getargs): Call create_long_option_table.
18639 (getargs): Free longopts at the end of the function.
18640 (shortopts): Move in options.c.
18641 * src/options.c (create_long_option_table): New function. Convert
18642 information from option_table to option structure.
18643 * src/reader.c (options.h): Include it.
18644
18645 * src/Makefile.am: Adjust.
18646 * src/options.c (option_table): Create from longopts and percent_table.
18647 * src/getargs.c (longopts): Delete.
18648 * src/lex.c (struct percent_table_struct): Delete.
18649 (percent_table): Delete.
18650 (options.h): Include it.
18651 * src/options.c: Create.
18652 * src/options.h: Create.
18653 Declare enum opt_access_e.
18654 Define struct option_table_struct.
18655
75f5aaea
MA
186562001-09-20 Marc Autret <autret_m@epita.fr>
18657
18658 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
18659 sections of Bison.
18660
f508cb0a
PB
186612001-09-19 Pascal Bart <pascal.bart@epita.fr>
18662
18663 * src/bison.simple: s/%%filename/%%skeleton.
18664 * src/muscle_tab.c (getargs.h): Include it.
18665 (muscle_init): Insert new muscle skeleton.
18666
13105fc1
PB
186672001-09-18 Pascal Bart <pascal.bart@epita.fr>
18668
18669 * src/output.c (output_parser): Delete unused variable actions_dumped.
18670
b0c4483e
PB
186712001-09-07 Pascal Bart <pascal.bart@epita.fr>
18672
18673 * src/output.c (output): Delete call to reader_output_yylsp.
18674 * src/reader.c (reader): Likewise.
ba0fe3c7 18675 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 18676
11d82f03
MA
186772001-09-02 Marc Autret <autret_m@epita.fr>
18678
18679 * src/reader.c: Include muscle_tab.h.
18680 (parse_union_decl): Update.
18681 (parse_macro_decl): Rename parse_muscle_decl.
18682 Update to use renamed functions and variable.
18683 (read_declarations, copy_action, read_additionnal_code, : Updated
18684 with correct variables and functions names.
18685 (packsymbols, reader): Likewise.
342b8b6e 18686
11d82f03 18687 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 18688
11d82f03
MA
18689 * src/output.c: Include muscle_tab.h
18690 In all functions using macro_insert, change by using muscle_insert ().
18691 (macro_obstack): Rename muscle_obstack.
18692 Echo modifications in the whole file.
18693 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
18694 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
18695 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
18696
18697 * src/muscle_tab.h: Update double inclusion macros.
18698 (macro_entry_s): Rename muscle_entry_s.
18699 Update prototypes.
342b8b6e 18700
11d82f03
MA
18701 * src/muscle_tab.c: Include muscle_tab.h.
18702 Rename macro_tabble to muscle_table.
18703 (mhash1, mhash2, mcmp): Use muscle_entry.
18704 (macro_init): Rename muscle_init. Update.
18705 (macro_insert): Rename muscle_insert. Update.
18706 (macro_find): Rename muscle_find. Update.
18707
18708 * src/main.c: Include muscle_tab.h.
18709 (main): Call muscle_init ().
18710 * src/Makefile.am (bison_SOURCES): Echo modifications.
18711
93a37297
MA
187122001-09-02 Marc Autret <autret_m@epita.fr>
18713
f753cd62 18714 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 18715
f753cd62
MA
18716 * src/muscle_tab.c, src/muscle_tab.h: Add files.
18717
187182001-09-02 Marc Autret <autret_m@epita.fr>
18719
18720 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 18721
682d48cd
PB
187222001-09-01 Pascal Bart <pascal.bart@epita.fr>
18723
342b8b6e 18724 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
18725 filename.
18726
087c8fda
MA
187272001-09-01 Marc Autret <autret_m@epita.fr>
18728
18729 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
18730 to an explicit value to activate the feature. We do it here.
18731
dda680cb
PB
187322001-08-31 Pascal Bart <pascal.bart@epita.fr>
18733
18734 * src/output.c (prepare): Delete the `filename' muscule insertion.
18735 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
18736 (parse_union_decl): Likewise.
18737 * src/macrotab.c (macro_init): Initialize filename by infile.
18738
9e644e64
MA
187392001-08-31 Marc Autret <autret_m@epita.fr>
18740
18741 * src/bison.simple (YYLSP_NEEDED): New definition.
18742 * src/output.c (prepare): Add macro insertion of `locations_flag'
18743
17da6427
PB
187442001-08-31 Pascal Bart <pascal.bart@epita.fr>
18745
18746 * src/output.c (prepare): Delete insertion of previous muscles,
18747 and insert the `prefix' muscles.
18748 * src/macrotab.c (macro_init): Likewise.
18749 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 18750 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
18751 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
18752 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 18753 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
18754 name_prefix.
18755
e8cb70b9
PB
187562001-08-31 Pascal Bart <pascal.bart@epita.fr>
18757
18758 * src/main.c (main): Standardize.
18759 * src/output.c (output_table_data, output_parser): Likewise.
18760 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
18761
63c2d5de
MA
187622001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
18763
342b8b6e 18764 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
18765 %%epilogue.
18766 * src/output.c (output): Rename %%declarations to %%prologue.
18767 * src/bison.simple: Echo modifications.
342b8b6e 18768
d8cb5183
MA
187692001-08-31 Marc Autret <autret_m@epita.fr>
18770
18771 * src/reader.c (readgram): CleanUp.
18772 (output_token_defines): Likewise.
18773 (packsymbols): Likewise.
18774 (reader): Likewise.
18775 * src/output.c (output): CPP-out useless code.
18776
6c686258
PB
187772001-08-31 Pascal Bart <pascal.bart@epita.fr>
18778
342b8b6e 18779 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
18780 output_trailers and output_headers.
18781 * src/output.h: Remove obsolete functions prototypes of output_headers
18782 and output_trailers.
18783
8f451ef7
PB
187842001-08-30 Pascal Bart <pascal.bart@epita.fr>
18785
18786 * src/main.c: Include macrotab.h.
342b8b6e 18787 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
18788 Adjust functions prototypes.
18789 * src/macrotab.c (macro_insert): Constify key and value.
18790 (macro_find): Constify key.
18791 (macro_insert): Include 'xalloc.h'
18792 (macro_insert): Use XMALLOC.
18793 (macro_find): Constify return value.
18794 * src/output.c (output_table_data): Rename table to table_data.
18795 (output_parser): Constify macro_key, macro_value.
18796
997b6fd0 187972001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
18798
18799 * src/reader.c (parse_skel_decl): New.
342b8b6e 18800 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
18801 * src/lex.h (token_t): New token `tok_skel'.
18802 * src/lex.c (percent_table): Add skeleton option entry.
18803 Standardize.
18804
ff48177d
MA
188052001-08-29 Marc Autret <autret_m@epita.fr>
18806
18807 * src/bison.simple: Add %%user_code directive at the end.
18808 * src/reader.c (read_additionnal_code): New.
18809 (reader): Use it.
18810 * src/output.c (output_program): Remove.
18811 (output): Update.
18812
b33160bf
MA
188132001-08-28 Marc Autret <autret_m@epita.fr>
18814
18815 * src/output.c (output_actions): Clean up.
4e5caae2 18816 (output_gram): CPP-out useless code.
b33160bf
MA
18817 * src/reader.c (reader): Clean up, CPP-out useless code.
18818
d1a2daf7
PB
188192001-08-28 Pascal Bart <pascal.bart@epita.fr>
18820
342b8b6e 18821 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 18822 directive.
d1a2daf7
PB
18823 * src/bison.simple: Add `%%definitions'.
18824
2b763dfe
MA
188252001-08-28 Marc Autret <autret_m@epita.fr>
18826
18827 * config/depcomp: New file.
18828
f1a87ef6
PE
188292001-08-27 Paul Eggert <eggert@twinsun.com>
18830
18831 * src/bison.simple (yyparse): Don't take the address of an
18832 item before the start of an array, as that doesn't conform to
18833 the C Standard.
18834
82e236e2
RA
188352001-08-27 Robert Anisko <robert.anisko@epita.fr>
18836
f1a87ef6 18837 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
18838 obstack. It was done too late here.
18839
18840 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
18841 completely wrong.
18842 (reader): Initialize the macro obstack here, since we need it to grow
18843 '%define' directives.
18844
18845 * src/reader.h: Declare the macro obstack as extern.
18846
b0cfa28a
RA
188472001-08-27 Robert Anisko <robert.anisko@epita.fr>
18848
18849 * src/output.c (output_parser): Fix. Store single '%' characters in
18850 the output obstack instead of throwing them away.
18851
6fc74234
AD
188522001-08-27 Akim Demaille <akim@epita.fr>
18853
18854 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18855
9c76d118
RA
188562001-08-25 Robert Anisko <robert.anisko@epita.fr>
18857
18858 * lib/Makefile.am: Adjust.
18859
a8289c62
RA
188602001-08-25 Robert Anisko <robert.anisko@epita.fr>
18861
18862 * src/bison.simple: Update and add '%%' directives.
18863
b6610515
RA
188642001-08-25 Robert Anisko <robert.anisko@epita.fr>
18865
18866 * src/reader.c (reader): Remove calls to 'output_headers' and
18867 'output_trailers'. Remove some C output.
18868 (readgram): Disable a piece of code that was writing a default
18869 definition for 'YYSTYPE'.
18870 (reader_output_yylsp): Remove.
18871 (packsymbols): Output token defintions to a macro.
18872 (copy_definition): Disable C output.
6fc74234 18873
b6610515
RA
18874 * src/reader.c (parse_macro_decl): New function used to parse macro
18875 declarations.
18876 (copy_string2): Put the body of copy_string into this new function.
18877 Add a parameter to let the caller choose whether he wants to copy the
18878 string delimiters or not.
18879 (copy_string): Be a simple call to copy_string2 with the last argument
18880 bound to true.
18881 (read_declarations): Add case for macro definition.
18882 (copy_identifier): New.
6fc74234 18883 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
18884 rather than lex.
18885
26f609ff
RA
188862001-08-25 Robert Anisko <robert.anisko@epita.fr>
18887
18888 * src/output.c (prepare): Add prefixed names.
18889 (output_parser): Output semantic actions.
18890 (output_parser): Fix bug on '%%line' directives.
6fc74234 18891
26f609ff
RA
18892 * src/output.c (output_headers): Remove. The C code printed by this
18893 function should now be in the skeletons.
18894 (output_trailers): Remove.
18895 (output): Disable call to 'reader_output_yylsp'.
18896 (output_rule_data): Do not output tables to the table obstack.
18897
18898 * src/output.c: Remove some C dedicated output.
18899 Improve the use of macro and output obstacks.
18900 (output_defines): Remove.
6fc74234 18901
26f609ff
RA
18902 * src/output.c (output_token_translations): Associate 'translate'
18903 table with a macro. No output to the table obstack.
18904 (output_gram): Same for 'rhs' and 'prhs'.
18905 (output_stos): Same for 'stos'.
18906 (output_rule_data): Same for 'r1' and 'r2'.
18907 (token_actions): Same for 'defact'.
18908 (goto_actions): Same for 'defgoto'.
18909 (output_base): Same for 'pact' and 'pgoto'.
18910 (output_table): Same for 'table'.
18911 (output_check): Same for 'check'.
6fc74234 18912
26f609ff
RA
18913 * src/output.c (output_table_data): New function.
18914 (output_short_table): Remove.
18915 (output_short_or_char_table): Remove.
6fc74234 18916
26f609ff
RA
18917 * src/output.c (output_parser): Replace most of the skeleton copy code
18918 with something new. Skeletons are now processed character by character
18919 rather than line by line, and Bison looks for '%%' macros. This is the
18920 first step in making Bison's output process (a lot) more flexible.
18921 (output_parser): Use the macro table.
18922
6f43b113
RA
189232001-08-25 Robert Anisko <robert.anisko@epita.fr>
18924
18925 * src/main.c (main): Initialize the macro table.
18926
dd3127cf
RA
189272001-08-25 Robert Anisko <robert.anisko@epita.fr>
18928
18929 * src/lex.c (percent_table): Add tok_define.
18930 * src/lex.h: Add tok_define.
18931
aa321494
RA
189322001-08-25 Robert Anisko <robert.anisko@epita.fr>
18933
18934 * src/macrotab.c: New file.
18935 * src/macrotab.h: New file.
18936 * src/Makefile.am: Update.
18937
68bd3b6b
RA
189382001-08-25 Robert Anisko <robert.anisko@epita.fr>
18939
18940 * lib/hash.c: New file.
18941 * lib/hash.h: New file.
18942 * lib/Makefile.am: Update.
18943
45f8dd1e
AD
189442001-08-15 Akim Demaille <akim@epita.fr>
18945
18946 Version 1.28c.
18947
40a64a7a 189482001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
18949
18950 * src/reader.c (readgram): Indent output macro YYSTYPE.
18951 (packsymbols): Likewise.
18952 (output_token_defines): Likewise.
18953 * src/files.c: Standardize.
18954 (compute_header_macro): New.
18955 (defines_obstack_save): New. Use compute_header_macro.
18956 (output_files): Update. Use defines_obstack_save.
18957
f9a8293a
AD
189582001-08-15 Akim Demaille <akim@epita.fr>
18959
18960 * doc/bison.texinfo (Table of Symbols): Document
18961 YYSTACK_USE_ALLOCA.
18962
150ca7a7
AD
189632001-08-15 Akim Demaille <akim@epita.fr>
18964
18965 * missing: Update from CVS Automake.
18966 * config/config.guess, config/config.sub, config/texinfo.tex:
18967 Update from gnu.org.
18968
69b5cec4
AD
189692001-08-15 Akim Demaille <akim@epita.fr>
18970
18971 * Makefile.maint: Sync with CVS Autoconf.
18972
f2b5126e
PB
189732001-08-14 Pascal Bart <pascal.bart@epita.fr>
18974
69b5cec4 18975 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
18976 `fdl.texi'.
18977 * doc/fdl.texi: Add to package.
18978
4ecbf796
MA
189792001-08-14 Marc Autret <autret_m@epita.fr>
18980
18981 Turn on %{source,header}_extension features.
18982
69b5cec4 18983 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
18984 source_extension.
18985 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 18986 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
18987 between options.
18988
95fb5662
MA
189892001-08-14 Marc Autret <autret_m@epita.fr>
18990
18991 * src/files.c (compute_base_names): Add extensions computing when
18992 `--file-prefix' used.
18993 Standardize function calls.
18994
78d09da9
MA
189952001-08-13 Marc Autret <autret_m@epita.fr>
18996
69b5cec4 18997 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
18998 defining it (defined but null disables alloca).
18999
5a009f2c
MA
190002001-08-13 Marc Autret <autret_m@epita.fr>
19001
19002 * src/bison.simple (_yy_memcpy): CPP reformat.
19003
1e41465a
PB
190042001-08-13 Pascal Bart <pascal.bart@epita.fr>
19005
19006 * tests/atconfig.in (CPPFLAGS): Fix.
19007
c67a198d
PB
190082001-08-10 Pascal Bart <pascal.bart@epita.fr>
19009
79282c6c 19010 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
19011 `gpl.texi'.
19012 * doc/gpl.texi: Add to package.
19013
09a6de7e
MA
190142001-08-10 Marc Autret <autret_m@epita.fr>
19015
19016 * src/print_graph.h: Fix.
19017 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
19018
b77b9ee0
AD
190192001-08-10 Akim Demaille <akim@epita.fr>
19020
19021 * src/system.h: Provide default declarations for stpcpy, strndup,
19022 and strnlen.
19023
3e259915
MA
190242001-08-10 Robert Anisko <anisko_r@epita.fr>
19025
19026 * doc/bison.texinfo (Locations): Update @$ stuff.
19027
ca96bc2d
MA
190282001-08-09 Robert Anisko <anisko_r@epita.fr>
19029
19030 * src/bison.simple (YYLLOC_DEFAULT): Update.
19031 (yyparse): Adjust.
19032
fdc6758b
MA
190332001-08-08 Marc Autret <autret_m@epita.fr>
19034
b77b9ee0 19035 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
19036 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
19037 Reported by Fabrice Bauzac.
957d4dbf 19038
600cad3b
MA
190392001-08-08 Marc Autret <autret_m@epita.fr>
19040
19041 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
19042 * src/vcg.c (output_node): Fix.
19043 * src/vcg.h: Cleanup.
19044 * src/print_graph.c: Add comments.
b77b9ee0 19045 (node_output_size): New global variable. Simplify the formatting of
600cad3b 19046 the VCG graph output.
b77b9ee0 19047 (print_actions): Unused code is now used. It notifies the final state
600cad3b 19048 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 19049 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
19050 blue.
19051 Get the current node name and node_obstack by argument.
19052 (node_obstack): New variable.
19053 (print_state): Manage node_obstack.
19054 (print_core): Use node_obstack given by argument.
19055 A node is not only computed here but in print_actions also.
19056 (print_graph): CPP out useless code instead of commenting it.
19057
976e528f
AD
190582001-08-07 Pascal Bart <pascal.bart@epita.fr>
19059
19060 * tests/atconfig.in (CPPFLAGS): Fix.
19061
20e8e5ca
AD
190622001-08-07 Akim Demaille <akim@epita.fr>
19063
19064 * src/print_graph.c (quote): New.
19065 (print_core): Use it.
19066
957d4dbf 190672001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 19068
3e3da797
AD
19069 * src/vcg.c (complain.h): Include it.
19070 Unepitaize `return' invocations.
c4b66126 19071 [NDEBUG] (main): Remove.
79282c6c 19072 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
19073 * src/files.c (open_files): Initialize graph_obstack.
19074 * src/print_graph.c (print_actions): CPP out useless code.
19075 (print_core): Don't output the last `\n' in labels.
19076 Use `quote'.
19077 * src/files.c (output_files): Output the VCG file.
19078 * src/main.c (main): Invoke print_graph ();
3e3da797 19079
957d4dbf 190802001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
19081
19082 Automaton VCG graph output.
19083 Using option ``-g'' or long option ``--graph'', you can generate
19084 a gram_filename.vcg file containing a VCG description of the LALR (1)
19085 automaton of your grammar.
19086
19087 * src/main.c: Call to print_graph() function.
19088 * src/getargs.h: Update.
19089 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
19090 (graph_flag): New flag.
19091 (longopts): Update.
19092 (getargs): Add case `g'.
19093 * src/files.c (graph_obstack): New obstack struct.
19094 (open_files): Initialize new obstack.
19095 (output_files): Saves graph_obstack if required.
19096 * src/files.h (graph_obstack): New extern declaration.
19097 * src/Makefile.am: Add new source files.
19098
927c1557 190992001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
19100
19101 * src/print_graph.c, src/print_graph.h (graph): New.
19102 * src/vcg.h: New file.
19103 * src/vcg.c: New file, VCG graph handling.
19104
7333d403
AD
191052001-08-06 Marc Autret <autret_m@epita.fr>
19106
19107 Add of %source_extension and %header_extension which specify
19108 the source or/and the header output file extension.
19109
19110 * src/files.c (compute_base_names): Remove initialisation of
19111 src_extension and header_extension.
19112 (compute_exts_from_gf): Update.
19113 (compute_exts_from_src): Update.
19114 (output_files): Update.
19115 * src/reader.c (parse_header_extension_decl): New.
19116 (parse_source_extension_decl): New.
19117 (read_declarations): New case statements for the new tokens.
19118 * src/lex.c (percent_table): Add entries for %source_extension
19119 and %header_extension.
19120 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
19121
84163231
AD
191222001-08-06 Marc Autret <autret_m@epita.fr>
19123
19124 * configure.in: Bump to 1.28c.
19125 * doc/bison.texinfo: Texinfo thingies.
19126
8303fc42
AD
191272001-08-04 Pascal Bart <pascal.bart@epita.fr>
19128
19129 * tests/atconfig.in (CPPFLAGS): Add.
19130 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
19131
70a84437
AD
191322001-08-03 Akim Demaille <akim@epita.fr>
19133
19134 Version 1.28b.
19135
2ce10144
AD
191362001-08-03 Akim Demaille <akim@epita.fr>
19137
19138 * tests/Makefile.am (check-local): Ship testsuite.
19139 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
19140 Include `string.h'.
19141
1e3e4bc1
AD
191422001-08-03 Akim Demaille <akim@epita.fr>
19143
19144 * configure.in: Try using -Wformat when compiling.
19145
42b45b7f
AD
191462001-08-03 Akim Demaille <akim@epita.fr>
19147
19148 * configure.in: Bump to 1.28b.
19149
8f13fe33
AD
191502001-08-03 Akim Demaille <akim@epita.fr>
19151
19152 * src/complain.c: Adjust strerror_r portability issues.
19153
b37ba92c
AD
191542001-08-03 Akim Demaille <akim@epita.fr>
19155
19156 Version 1.28a.
19157
b0ce6046
AD
191582001-08-03 Akim Demaille <akim@epita.fr>
19159
19160 * src/getargs.c, src/getarg.h (skeleton)): Constify.
19161 * src/lex.c (literalchar): Avoid name clashes on `buf'.
19162 * src/getargs.c: Include complain.h.
19163 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
19164 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
19165
d01c415b
AD
191662001-08-03 Akim Demaille <akim@epita.fr>
19167
19168 * src/reader.c (readgram): Display hidden chars in error messages.
19169
459dd1a6
AD
191702001-08-03 Akim Demaille <akim@epita.fr>
19171
19172 Update to gettext 0.10.39.
19173
53b74c0c
AD
191742001-08-03 Akim Demaille <akim@epita.fr>
19175
19176 * lib/strspn.c: New.
19177
234a3be3
AD
191782001-08-01 Marc Autret <autret_m@epita.fr>
19179
19180 * doc/bison.texinfo: Update.
19181 * doc/bison.1 (mandoc): Update.
19182 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
19183 * src/files.c: Support output files extensions computing.
19184 (src_extension): New static variable.
19185 (header_extension): New static variable.
19186 (tr): New function.
19187 (get_extension_index): New function, gets the index of an extension
19188 filename in a string.
19189 (compute_exts_from_gf): New function, computes extensions from the
19190 grammar file extension.
19191 (compute_exts_from_src): New functions, computes extensions from the
19192 C source file extension, file given by ``-o'' option.
19193 (compute_base_names): Update.
19194 (output_files): Update.
19195
847bf1f5
AD
191962001-08-01 Robert Anisko <anisko_r@epita.fr>
19197
d995fee7 19198 * doc/bison.texi: Document @$.
847bf1f5
AD
19199 (Locations): New section.
19200
d074a105
AD
192012001-07-18 Akim Demaille <akim@epita.fr>
19202
19203 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
19204 * config/prev-version.txt, config/move-if-change: New.
19205 * Makefile.am: Adjust.
19206
3419715d
AD
192072001-07-08 Pascal Bart <pascal.bart@epita.fr>
19208
19209 * src/bison.simple (yyparse): Suppress warning `comparaison
19210 between signed and unsigned'.
19211
62ab6972
AD
192122001-07-05 Pascal Bart <pascal.bart@epita.fr>
19213
19214 * src/getargs.h (raw_flag): Remove.
19215 * src/getargs.c: Die on `-r'/`--raw'.
19216 * src/lex.c (parse_percent_token): Die on `%raw'.
19217 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
19218 * tests/calc.at: Suppress test with option `--raw'.
19219
1e24cc5b
AD
192202001-07-14 Akim Demaille <akim@epita.fr>
19221
19222 * config/: New.
19223 * configure.in: Require Autoconf 2.50.
19224 Update to gettext 0.10.38.
19225
32dfccf8
AD
192262001-03-16 Akim Demaille <akim@epita.fr>
19227
19228 * doc/bison.texinfo: ANSIfy the examples.
19229
cd5bd6ac
AD
192302001-03-16 Akim Demaille <akim@epita.fr>
19231
19232 * getargs.c (skeleton): New variable.
19233 (longopts): --skeleton is a new option.
19234 (shortopts, getargs): -S is a new option.
19235 * getargs.h: Declare skeleton.
19236 * output.c (output_parser): Use it.
19237
5141b016
AD
192382001-03-16 Akim Demaille <akim@epita.fr>
19239
19240 * m4/strerror_r.m4: New.
19241 * m4/error.m4: Run AC_FUNC_STRERROR_R.
19242 * lib/error.h, lib/error.c: Update.
19243
447992b9
AD
192442001-03-16 Akim Demaille <akim@epita.fr>
19245
19246 * src/getargs.c (longopts): Clean up.
19247
274d42ce
AD
192482001-02-21 Akim Demaille <akim@epita.fr>
19249
19250 * src/reader.c (gensym): `gensym_count' is your own.
19251 Use a static buf to create the symbol name, as token_buffer is no
19252 longer a buffer.
19253
22c821f3
AD
192542001-02-08 Akim Demaille <akim@epita.fr>
19255
19256 * src/conflicts.c (conflict_report): Be sure not to append to res
19257 between two calls, which could happen if both first sprintf were
19258 skipped, but not the first cp += strlen.
19259
18569462
AD
192602001-02-08 Akim Demaille <akim@epita.fr>
19261
19262 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
19263 New, from fileutils 4.0.37.
19264 * configure.in: Require Autoconf 2.49c. I took some time before
19265 making this decision. This is the only way out for portability
19266 issues in Bison, it would mean way too much duplicate effort to
19267 import in Bison features implemented in 2.49c since 2.13.
19268 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
19269
0d8f3c8a
AD
192702001-02-02 Akim Demaille <akim@epita.fr>
19271
19272 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 19273 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 19274
f17bcd1f
AD
192752001-01-19 Akim Demaille <akim@epita.fr>
19276
19277 Get rid of the ad hoc handling of token_buffer in the scanner: use
19278 the obstacks.
19279
19280 * src/lex.c (token_obstack): New.
19281 (init_lex): Initialize it. No longer call...
19282 (grow_token_buffer): this. Remove it.
19283 Adjust all the places which used it to use the obstack.
19284
511e79b3
AD
192852001-01-19 Akim Demaille <akim@epita.fr>
19286
19287 * src/lex.h: Rename all the tokens:
19288 s/\bENDFILE\b/tok_eof/g;
19289 s/\bIDENTIFIER\b/tok_identifier/g;
19290 etc.
19291 Let them be enums, not #define, to ease debugging.
19292 Adjust all the code.
19293
0d6508ef
AD
192942001-01-18 Akim Demaille <akim@epita.fr>
19295
19296 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
19297 * src/lex.c (maxtoken, grow_token_buffer): Static.
19298
6deb4447
AD
192992001-01-18 Akim Demaille <akim@epita.fr>
19300
19301 Since we now use obstacks, more % directives can be enabled.
19302
19303 * src/lex.c (percent_table): Also accept `%yacc',
19304 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
19305 `%debug'.
19306 Handle the actions for `%semantic_parser' and `%pure_parser' here,
19307 instead of returning a token.
19308 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
19309 * src/reader.c (read_declarations): Adjust.
19310 * src/files.c (open_files): Don't call `compute_base_names', don't
19311 compute `attrsfile' since they depend upon data which might be
19312 *in* the input file now.
19313 (output_files): Do it here.
19314 * src/output.c (output_headers): Document the fact that this patch
19315 introduces a guaranteed SEGV for semantic parsers.
19316 * doc/bison.texinfo: Document them.
19317 * tests/suite.at: Exercise these %options.
19318
ff4423cc
AD
193192000-12-20 Akim Demaille <akim@epita.fr>
19320
19321 Also handle the output file (--verbose) with obstacks.
19322
19323 * files.c (foutput): Remove.
19324 (output_obstack): New.
19325 Adjust all dependencies.
19326 * src/conflicts.c: Return a string.
19327 * src/system.h (obstack_grow_string): Rename as...
19328 (obstack_sgrow): this. Be ready to work with non literals.
19329 (obstack_fgrow4): New.
19330
956dba3a
AD
193312000-12-20 Akim Demaille <akim@epita.fr>
19332
19333 * src/files.c (open_files): Fix the computation of short_base_name
19334 in the case of `-o foo.tab.c'.
19335
337bab46
AD
193362000-12-20 Akim Demaille <akim@epita.fr>
19337
19338 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
19339 (copy_dollar): Now that everything uses obstacks, get rid of the
19340 FILE * parameters.
19341
5d3214b8
AD
193422000-12-20 Akim Demaille <akim@epita.fr>
19343
19344 * src/files.c (open_files): Actually the `.output' file is based
19345 on the short_base_name, not base_name.
19346 * tests/suite.at (Checking output file names): Adjust.
19347
29092a57
AD
193482000-12-20 Akim Demaille <akim@epita.fr>
19349
19350 * src/bison.s1: Remove, we now use directly...
19351 * src/bison.simple: this.
19352 * src/Makefile.am: Use pkgdata instead of data.
19353
ea5607fd
AD
193542000-12-20 Akim Demaille <akim@epita.fr>
19355
19356 * src/files.c (guard_obstack): New.
19357 (open_files): Initialize it.
19358 (output_files): Dump it...
19359 * src/files.h: Export it.
19360 * src/reader.c (copy_guard): Use it.
19361
27110317
AD
193622000-12-19 Akim Demaille <akim@epita.fr>
19363
19364 * src/files.c (outfile, defsfile, actfile): Removed as global
19365 vars.
19366 (open_files): Don't compute them.
19367 (output_files): Adjust.
19368 (base_name, short_base_name): Be global.
19369 Adjust dependencies.
19370
19c50364
AD
193712000-12-19 Akim Demaille <akim@epita.fr>
19372
19373 * src/files.c (strsuffix): New.
19374 (stringappend): Be just like strcat but allocate.
19375 (base_names): Eve out from open_files.
19376 Try to simplify the rather hairy computation of base_name and
19377 short_base_name.
19378 (open_files): Use it.
19379 * tests/suite.at (Checking output file names): New test.
19380
573c1d9f
AD
193812000-12-19 Akim Demaille <akim@epita.fr>
19382
19383 * src/system.h (obstack_grow_literal_string): Rename as...
19384 (obstack_grow_string): this.
19385 * src/output.c (output_parser): Recognize `%% actions' instead of
19386 `$'.
19387 * src/bison.s1: s/$/%% actions/.
19388 * src/bison.hairy: Likewise.
19389
ef7ddedd
AD
193902000-12-19 Akim Demaille <akim@epita.fr>
19391
19392 * src/output.c (output_parser): Compute the `#line' lines when
19393 there are.
19394 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
19395 Suggested by Hans Aberg.
19396
ff61dabd
AD
193972000-12-19 Akim Demaille <akim@epita.fr>
19398
19399 Let the handling of the skeleton files be local to the procedures
19400 that use it.
19401
19402 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
19403 longer static.
19404 (fparser, open_extra_files): Remove.
19405 (open_files, output_files): Don't take care of fparser.
19406 * src/files.h: Adjust.
19407 * src/output.c (output_parser): Open and close the file to the
19408 skeleton.
19409 * src/reader.c (read_declarations): When %semantic_parser, open
19410 fguard.
19411
55b96341
AD
194122000-12-19 Akim Demaille <akim@epita.fr>
19413
19414 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
19415 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
19416
358c15b7
AD
194172000-12-19 Akim Demaille <akim@epita.fr>
19418
19419 * src/files.c (open_files): Yipee! We no longer need all the code
19420 looking for `/tmp' since we have no tmp file.
19421
7de3329e
AD
194222000-12-19 Akim Demaille <akim@epita.fr>
19423
19424 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
19425 New macros.
19426 * src/files.c (open_files): Less dependency on MSDOS etc.
19427
3abcd459
AD
194282000-12-14 Akim Demaille <akim@epita.fr>
19429
19430 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
19431 Provide a default definition.
19432 Use it when executing the default @ action.
19433 * src/reader.c (reader_output_yylsp): No longer include
19434 `timestamp' and `text' in the default YYLTYPE.
19435
2a91a95e
AD
194362000-12-12 Akim Demaille <akim@epita.fr>
19437
19438 * src/reader.c (copy_definition, parse_union_decl, copy_action)
19439 (copy_guard): Quote the file names.
19440 Reported by Laurent Mascherpa.
19441
14d3eb9b
AD
194422000-12-12 Akim Demaille <akim@epita.fr>
19443
19444 * src/output.c (output_headers, output_program, output): Be sure
19445 to escape special characters when outputting filenames.
19446 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
19447 (output_headers): Don't depend on them, Use ACTSTR.
19448
d7045ec6
AD
194492000-11-17 Akim Demaille <akim@epita.fr>
19450
19451 * lib/obstack.h: Formatting changes.
19452 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
19453 prevents type checking.
19454 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
19455 cast the value to (void *): assigning a `foo *' to a `void *'
19456 variable is valid.
19457 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
19458 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
19459 append characters.
19460
6fd54b73
AD
194612000-11-17 Akim Demaille <akim@epita.fr>
19462
19463 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
19464 as...
19465 (suite.m4, regression.m4, calc.m4): these.
19466 * tests/atgeneral.m4: Update from CVS Autoconf.
19467
4c50eae6
AD
194682000-11-17 Akim Demaille <akim@epita.fr>
19469
19470 * tests/regression.m4 (%union and --defines): New test,
19471 demonstrating a current bug in the obstack implementation.
19472
a35f64ea
AD
194732000-11-17 Akim Demaille <akim@epita.fr>
19474
19475 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
19476 macros.
19477 Use them to declare the variables which are global or local to
19478 `yyparse'.
19479
7de23534
AD
194802000-11-17 Akim Demaille <akim@epita.fr>
19481
19482 * acconfig.h: Remove, no longer used.
19483
aa7815f5
AD
194842000-11-07 Akim Demaille <akim@epita.fr>
19485
19486 * src: s/Copyright (C)/Copyright/g.
19487
5af1f549
AD
194882000-11-07 Akim Demaille <akim@epita.fr>
19489
19490 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
19491 defining.
19492 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
19493
553e2b22
AD
194942000-11-07 Akim Demaille <akim@epita.fr>
19495
19496 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
19497 Merge in a single CPP if/else.
19498
8a4f41d6
AD
194992000-11-07 Akim Demaille <akim@epita.fr>
19500
19501 * src/output.c (output): Remove useless variables.
19502 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
19503 argument `data' for consistency with the prototypes.
19504 Qualify it `const'.
19505 (obstack_copy, obstack_copy0): Rename the second argument as
19506 `address' for consistency. Qualify it `const'.
19507 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
19508 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
19509 `const' their input argument (`data' or `address').
19510 Adjust the corresponding macros to include `const' in casts.
19511
095a3fb5
AD
195122000-11-03 Akim Demaille <akim@epita.fr>
19513
19514 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
19515 s/PFILE1/BISON_HAIRY/.
19516 Adjust dependencies.
19517
d1cdce7c
AD
195182000-11-03 Akim Demaille <akim@epita.fr>
19519
090c5ebf 19520 For some reason, this was not applied.
d1cdce7c
AD
19521
19522 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
19523 `unlink': it's no longer used.
19524
9311529b
AD
195252000-11-03 Akim Demaille <akim@epita.fr>
19526
19527 * src/files.c (skeleton_find): New function, eved out of...
19528 (open_files, open_extra_files): here.
19529
d8880f69
AD
195302000-11-03 Akim Demaille <akim@epita.fr>
19531
19532 Don't use `atexit'.
19533
19534 * src/files.c (obstack_save): New function.
19535 (done): Rename as...
19536 (output_files): this.
19537 Use `obstack_save'.
19538 * src/main.c (main): Don't use `atexit' to register `done', since
19539 it no longer has to remove tmp files, just call `output_files'
19540 when there are no errors.
19541
0dbb648e
AD
195422000-11-02 Akim Demaille <akim@epita.fr>
19543
19544 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
19545 `unlink': it's no longer used.
19546 * src/files.h: Formatting changes.
19547
896fe5c1
AD
195482000-11-02 Akim Demaille <akim@epita.fr>
19549
19550 Remove the last uses of mktemp and unlink/delete.
19551
19552 * src/files.c (fdefines, ftable): Removed.
19553 (defines_ostack, table_obstack): New.
19554 Adjust dependencies of the former into uses of the latter.
19555 * src/output.c (output_short_or_char_table, output_short_table):
19556 Convert to using obstacks.
19557 * src/reader.c (copy_comment2): Accept one FILE * and two
19558 obstacks.
19559 (output_token_defines, reader_output_yylsp): Use obstacks.
19560 * src/system.h (obstack_fgrow3): New.
1f65350a 19561 * po/POTFILES.in: Adjust.
896fe5c1 19562
dd60faec
AD
195632000-11-01 Akim Demaille <akim@epita.fr>
19564
19565 Change each use of `fattrs' into a use of `attrs_obstack'.
19566
19567 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
19568 * src/files.c (fattrs): Remove.
19569 (attrs_obstack): New.
19570 Adjust all dependencies.
19571 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
19572
8c7ebe49
AD
195732000-11-01 Akim Demaille <akim@epita.fr>
19574
19575 Introduce obstacks.
19576 Change each use of `faction' into a use of `action_obstack'.
19577
19578 * lib/obstack.h, lib/obstack.c: New files.
19579 * src/files.c (faction): Remove.
19580 (action_obstack): New.
19581 Adjust all dependencies.
19582
77aee789
AD
195832000-10-20 Akim Demaille <akim@epita.fr>
19584
19585 * lib/quote.h (PARAMS): New macro. Use it.
19586
43591cec
AD
195872000-10-16 Akim Demaille <akim@epita.fr>
19588
19589 * src/output.c (output_short_or_char_table): New function.
19590 (output_short_table, output_token_translations): Use it.
19591 (goto_actions): Use output_short_table.
19592
1e9798d5
AD
195932000-10-16 Akim Demaille <akim@epita.fr>
19594
19595 * src/symtab.c (bucket_new): New function.
19596 (getsym): Use it.
19597
19598 * src/output.c (output_short_table): New argument to display the
19599 comment associated with the table.
19600 Adjust dependencies.
19601 (output_gram): Use it.
19602 (output_rule_data): Nicer output layout for YYTNAME.
19603
f282676b
AD
196042000-10-16 Akim Demaille <akim@epita.fr>
19605
19606 * src/lex.c (read_typename): New function.
19607 (lex): Use it.
19608 * src/reader.c (copy_dollar): Likewise.
19609
550a72a3
AD
196102000-10-16 Akim Demaille <akim@epita.fr>
19611
19612 * src/reader.c (copy_comment2): Expect the input stream to be on
19613 the `/' which is suspected to open a comment, instead of being
19614 called after `//' or `/*' was read.
19615 (copy_comment, copy_definition, parse_union_decl, copy_action)
19616 (copy_guard): Adjust.
19617
131e2fef
AD
196182000-10-16 Akim Demaille <akim@epita.fr>
19619
19620 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
19621 `read_signed_integer'.
19622
79282c5a
AD
196232000-10-16 Akim Demaille <akim@epita.fr>
19624
19625 * src/reader.c (copy_dollar): New function.
19626 (copy_guard, copy_action): Use it.
19627
ff4a34be
AD
196282000-10-16 Akim Demaille <akim@epita.fr>
19629
19630 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
19631 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
19632 New files, from Fileutils 4.0.27.
19633 * src/main.c (printable_version): Remove.
19634 * src/lex.c, src/reader.c: Use `quote'.
19635
196362000-10-04 Akim Demaille <akim@epita.fr>
19637
19638 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
19639
14ded682
AD
196402000-10-04 Akim Demaille <akim@epita.fr>
19641
19642 * doc/bison.texinfo: Various typos spotted by Neil Booth.
19643
8e03724b
AD
196442000-10-04 Akim Demaille <akim@epita.fr>
19645
19646 When a literal string is used to define two different tokens,
19647 `bison -v' segfaults.
19648 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
19649
19650 * tests/regression.m4: New file.
19651 Include the core of the sample provided by Piotr Gackiewicz.
19652 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
19653 properly.
19654
a9e64249
AD
196552000-10-04 Akim Demaille <akim@epita.fr>
19656
19657 * src/reader.c (parse_expect_decl): Keep `count' within the size
19658 of `buffer'.
19659 From Neil Booth.
19660
da9abf43
AD
196612000-10-02 Paul Eggert <eggert@twinsun.com>
19662
19663 * bison.s1 (yyparse): Assign the default value
19664 unconditionally, to avoid a GCC warning and make the parser a
19665 tad smaller.
19666
c33638bb
AD
196672000-10-02 Akim Demaille <akim@epita.fr>
19668
19669 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
19670 options.
19671
444c570a
AD
196722000-10-02 Akim Demaille <akim@epita.fr>
19673
19674 * src/derives.c, src/print.c, src/reduce.c: To ease the
19675 translation, move some `\n' out of the translated strings.
19676
89cab50d
AD
196772000-10-02 Akim Demaille <akim@epita.fr>
19678
19679 The location tracking mechanism is precious for parse error
19680 messages. Nevertheless, it is enabled only when `@n' is used in
19681 the grammar, which is a different issue (you can use it in error
19682 message, but not in the grammar per se). Therefore, there should
19683 be another means to enable it.
19684
19685 * src/getargs.c (getargs): Support `--locations'.
19686 (usage): Report it.
19687 * src/getargs.h (locationsflag): Export it.
19688 * src/lex.c (percent_table): Support `%locations'.
19689 * src/reader.c (yylsp_needed): Remove this variable, now replaced
19690 with `locationsflag'.
19691 * doc/bison.texinfo: Document `--locations' and `%locations'.
19692 Sort the options.
19693 * tests/calc.m4: Test it.
19694
19695 For regularity of the names, replace each
19696 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
19697 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
19698 In addition replace each `flag' with `_flag'.
19699
d6c2cba0
AD
197002000-10-02 Akim Demaille <akim@epita.fr>
19701
19702 Also test parse error messages, including with YYERROR_VERBOSE.
19703
19704 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
19705 associative).
19706 Use it to check the computations.
19707 Use it to check `nonassoc' is honored.
19708 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
19709 `--yyerror-verbose'.
19710 (_AT_CHECK_CALC): Adjust to this option.
19711 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
19712
5a35a6cb
AD
197132000-10-02 Akim Demaille <akim@epita.fr>
19714
19715 Test also `--verbose', `--defines' and `--name-prefix'. Testing
19716 the latter demonstrates a flaw in the handling of non debugging
19717 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
19718 was used in order to simplify:
19719
19720 #if YYDEBUG
19721 if (yydebug)
19722 {
19723 ...
19724 }
19725 #endif
19726
19727 into
19728
19729 if (yydebug)
19730 {
19731 ...
19732 }
19733
19734 unfortunately this leads to a CPP conflict when
19735 `--name-prefix=foo' is used since it produces `#define yydebug
19736 foodebug'.
19737
19738 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
19739 (YYDPRINTF): New macro.
19740 Spread its use.
19741 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
19742 the bison options.
19743 Also test `--verbose', `--defines' and `--name-prefix'.
19744
71da9eea
AD
197452000-10-02 Akim Demaille <akim@epita.fr>
19746
19747 Improve the readability of the produced parsers.
19748
19749 * src/bison.s1: Formatting changes.
19750 Improve the comment related to the `$' mark.
19751 (yydefault): Don't fall through to `yyresume': `goto' there.
19752 * src/output.c (output_parser): When the `$' is met, skip the end
19753 of its line.
19754 New variable, `number_of_dollar_signs', to check there's exactly
19755 one `$' in the parser skeleton.
19756
95e36146
AD
197572000-10-02 Akim Demaille <akim@epita.fr>
19758
19759 * lib/xstrdup.c: New file, from the fileutils.
19760 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
19761 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
19762 instead of strlen + xmalloc + strcpy.
19763 * src/symtab.c (copys): Remove, use xstrdup instead.
19764
d7020c20
AD
197652000-10-02 Akim Demaille <akim@epita.fr>
19766
19767 * src/gram.h (associativity): New enum type which replaces the
19768 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
19769 `right_assoc', `left_assoc' and `non_assoc'.
19770 Adjust all dependencies.
19771 * src/reader.c: Formatting changes.
19772 (LTYPESTR): Don't define it, use it as a literal in
19773 `reader_output_yylsp'.
19774 * src/symtab.h (symbol_class): New enum type which replaces the
19775 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
19776 `sunknown', `stoken and `snterm'.
19777
1916f98e
AD
197782000-10-02 Akim Demaille <akim@epita.fr>
19779
19780 * src/getargs.c (fixed_outfiles): Rename as...
19781 (yaccflag): for consistency and accuracy.
19782 Adjust dependencies.
19783
d7913476
AD
197842000-10-02 Akim Demaille <akim@epita.fr>
19785
19786 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
19787 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
19788 difficult and introduced a lot of core dump. It turns out that
19789 Bison used an implementation of `xmalloc' based on `calloc', and
19790 at various places it does depend upon the initialization to 0. I
19791 have not tried to isolate the pertinent places, and all the former
19792 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
19793 someone should address this issue.
19794
19795 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
19796 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
19797 files.
19798 Adjust dependencies.
19799 * src/warshall.h: New file.
19800 Propagate.
19801
340ef489
AD
198022000-10-02 Akim Demaille <akim@epita.fr>
19803
19804 Various anti-`extern in *.c' changes.
19805
19806 * src/system.h: Include `assert.h'.
19807
b2ca4022
AD
198082000-10-02 Akim Demaille <akim@epita.fr>
19809
19810 * src/state.h (nstates, final_state, first_state, first_shift)
19811 (first_reduction): Move their exportation from here...
19812 * src/LR0.h: to here.
19813 Adjust dependencies.
19814 * src/getargs.c (statisticsflag): New variable.
19815 Add support for `--statistics'.
19816 Adjust dependencies.
19817
19818 Remove a lot of now useless `extern' statements in most files.
19819
403b315b
AD
198202000-10-02 Akim Demaille <akim@epita.fr>
19821
19822 * src/LR0.h: New file.
19823 Propagate its use.
19824
07a58c13
AD
198252000-10-02 Akim Demaille <akim@epita.fr>
19826
19827 * src/print.h: New file.
19828 Propagate its use.
19829 * src/print.c: Formatting and ordering changes.
19830 (verbose, terse): Replace with...
19831 (print_results): this new function.
19832 Adjust dependencies.
19833
0619caf0
AD
198342000-10-02 Akim Demaille <akim@epita.fr>
19835
19836 * src/conflicts.c (conflict_report): New function.
19837 (conflict_log, verbose_conflict_log): Replace with...
19838 (print_conflicts): this function.
19839 Adjust dependencies.
19840 * src/conflicts.h: New file.
19841 Propagate its inclusion.
19842
3519ec76
AD
198432000-10-02 Akim Demaille <akim@epita.fr>
19844
19845 * src/nullable.h: New file.
19846 Propagate its inclusion.
19847 * src/nullable.c: Formatting changes.
19848
015acc48
AD
198492000-10-02 Akim Demaille <akim@epita.fr>
19850
19851 * src/reduce.h: New file.
19852 Propagate its inclusion.
19853 * src/reduce.c: Topological sort and other formatting changes.
19854 (bool, TRUE, FALSE): Move their definition to...
19855 * src/system.h: here.
19856
8963a27b
AD
198572000-10-02 Akim Demaille <akim@epita.fr>
19858
19859 * src/files.c: Formatting changes.
19860 (tryopen, tryclose, openfiles): Rename as...
19861 (xfopen, xfclose, open_files): this.
19862 (stringappend): static.
19863 * src/files.h: Complete the list of exported symbols.
19864 Propagate its use.
19865
a70083a3
AD
198662000-10-02 Akim Demaille <akim@epita.fr>
19867
19868 * src/reader.h: New file.
19869 Propagate its use instead of tedious list of `extern' and
19870 prototypes.
19871 * src/reader.c: Formatting changes, topological sort,
19872 s/register//.
19873
abadc117
AD
198742000-10-02 Akim Demaille <akim@epita.fr>
19875
19876 * src/lex.h: Prototype `lex.c' exported functions.
19877 * src/reader.c: Adjust.
19878 * src/lex.c: Formatting changes.
19879 (safegetc): Rename as...
19880 (xgetc): this.
19881
720d742f
AD
198822000-10-02 Akim Demaille <akim@epita.fr>
19883
19884 * src/lalr.h: New file.
19885 Propagate its inclusion instead of prototypes and `extern'.
19886 * src/lalr.c: Formatting changes, topological sorting etc.
19887
f2acea59
AD
198882000-10-02 Akim Demaille <akim@epita.fr>
19889
19890 * src/output.c (token_actions): Introduce a temporary array,
19891 YYDEFACT, that makes it possible for this function to use
19892 output_short_table.
19893
d019d655
AD
198942000-10-02 Akim Demaille <akim@epita.fr>
19895
19896 `user_toknums' is output as a `short[]' in `output.c', while it is
19897 defined as a `int[]' in `reader.c'. For consistency with the
19898 other output tables, `user_toknums' is now defined as a table of
19899 shorts.
19900
19901 * src/reader.c (user_toknums): Be a short table instead of an int
19902 table.
19903 Adjust dependencies.
19904
19905 Factor the short table outputs.
19906
19907 * src/output.c (output_short_table): New function.
19908 * src/output.c (output_gram, output_stos, output_rule_data)
19909 (output_base, output_table, output_check): Use it.
19910
6c89f1c1
AD
199112000-10-02 Akim Demaille <akim@epita.fr>
19912
19913 * src/output.c (output): Topological sort of the functions, in
19914 order to get rid of the `static' prototypes.
19915 No longer use `register'.
19916 * src/output.h: New file.
19917 Propagate its inclusion in files explicitly prototyping functions
19918 from output.c.
19919
d9efd181
AD
199202000-09-21 Akim Demaille <akim@epita.fr>
19921
19922 * src/atgeneral.m4: Update from Autoconf.
19923
c29240e7 199242000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
19925
19926 * src/closure.h: New file.
19927 * src/closure.c: Formatting changes, topological sort over the
19928 functions, use of closure.h.
19929 (initialize_closure, finalize_closure): Rename as...
19930 (new_closure, free_closure): these. Adjust dependencies.
19931 * src/LR0.c: Formatting changes, topological sort, use of
19932 cloture.h.
19933 (initialize_states): Rename as...
19934 (new_states): this.
19935 * src/Makefile.am (noinst_HEADERS): Adjust.
19936
499daa50
AD
199372000-09-20 Akim Demaille <akim@epita.fr>
19938
19939 * src/acconfig.h: Don't protect config.h against multiple
19940 inclusion.
19941 Don't define PARAMS.
19942 * src/system.h: Define PARAMS.
19943 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
19944 purpose of config.h. system.h must not try to fix wrong
19945 definitions in config.h.
19946
cc84fd5d
AD
199472000-09-20 Akim Demaille <akim@epita.fr>
19948
19949 * src/derives.h: New file.
19950 * src/main.c, src/derives.h: Use it.
19951 Formatting changes.
19952 * src/Makefile.am (noinst_HEADERS): Adjust.
19953
db5b3a89
AD
199542000-09-20 Akim Demaille <akim@epita.fr>
19955
19956 * tests/atgeneral.m4: Update from Autoconf.
19957 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
19958 (AT_CHECK_CALC): New macros.
19959 Use these macros to test bison with options `', `--raw',
19960 `--debug', `--yacc', `--yacc --debug'.
19961
ceed8467
AD
199622000-09-19 Akim Demaille <akim@epita.fr>
19963
19964 * src/output.c: Formatting changes.
19965 * src/machine.h: Remove, leaving its contents in...
19966 * src/system.h: here.
19967 Include stdio.h.
19968 Adjust all dependencies on stdio.h and machine.h.
19969 * src/getargs.h: New file.
19970 Let all `extern' declarations about getargs.c be replaced with
19971 inclusion of `getargs.h'.
19972 * src/Makefile.am (noinst_HEADERS): Adjust.
19973
19974 * tests/calc.m4 (yyin): Be initialized in main, not on the global
19975 scope.
19976 (yyerror): Returns void, not int.
19977 * doc/bison.texinfo: Formatting changes.
19978
05a1d24b
AD
199792000-09-19 Akim Demaille <akim@epita.fr>
19980
19981 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
19982 portable.
19983
cbd25751
AD
199842000-09-18 Akim Demaille <akim@epita.fr>
19985
19986 * configure.in: Append WARNING_CFLAGS to CFLAGS.
19987 * src/Makefile.am (INCLUDES): Don't.
19988 Be ready to fetch headers in lib/.
19989
13863333
AD
199902000-09-18 Akim Demaille <akim@epita.fr>
19991
19992 * doc/bison.texinfo: Update the copyright.
19993 ANSIfy and GNUify the examples.
19994 Remove the old menu.
19995
0d533154
AD
199962000-09-18 Akim Demaille <akim@epita.fr>
19997
19998 First set of tests: use the `calc' example from the documentation.
19999
20000 * src/bison.s1 (yyparse): Condition the code using `yytname' which
20001 is defined only when YYDEBUG is.
20002 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
20003 * src/files.c (tryopen, tryclose): Formatting changes.
20004 Move to the top and be static.
20005 * src/reader.c (read_signed_integer): Likewise.
20006 * tests/calc.m4: New file.
20007 * Makefile.am, suite.m4: Adjust.
20008 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
20009
e79137ac
AD
200102000-09-18 Akim Demaille <akim@epita.fr>
20011
20012 Add support for an Autotest test suite for Bison.
20013
20014 * m4/m4.m4, m4/atconfig.m4: New files.
20015 * m4/Makefile.am (EXTRA_DIST): Adjust.
20016 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
20017 files.
20018 * src/getargs.c: Display a more standard --version message.
20019 * src/reader.c (reader): Formatting changes.
20020 No longer depend upon VERSION_STRING.
20021 * configure.in: No longer use `dnl'.
20022 Set up the test suite and the new directory `tests/.
20023 (VERSION_STRING): Remove.
20024
27821bff
AD
200252000-04-14 Akim Demaille <akim@epita.fr>
20026
20027 * src/reader.c (copy_comment2): New function, same as former
20028 `copy_comment', but outputs into two FILE *.
20029 (copy_comment): Use it.
20030 (parse_union_decl): Use it.
20031 (get_type, parse_start_decl): Use the same `invalid' message.
20032 (parse_start_decl, parse_union_decl): Use the same `multiple'
20033 message.
20034 (parse_union_decl, copy_guard, copy_action): Use the same
20035 `unmatched' message.
20036 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
20037
cfe5fbc0
AD
200382000-03-31 Akim Demaille <akim@epita.fr>
20039
20040 * src/files.c (tryopen, tryclose): Move to the top.
20041 Be static.
20042
cb7db13e
AD
200432000-03-31 Akim Demaille <akim@epita.fr>
20044
20045 * src/main.c (main): Don't call `done', exit does it.
20046
a0f6b076
AD
200472000-03-31 Akim Demaille <akim@epita.fr>
20048
36281465
AD
20049 * allocate.c: s/return (foo)/return foo/.
20050 * lalr.c: Likewise.
20051 * LR0.c: Likewise.
20052 * output.c: Likewise.
20053 * reader.c: Likewise.
20054 * symtab.c: Likewise.
20055 * vmsgetargs.c: Likewise.
20056
200572000-03-31 Akim Demaille <akim@epita.fr>
20058
20059 Clean up the error reporting functions.
a0f6b076
AD
20060
20061 * src/report.c: New file.
20062 * src/report.h: Likewise.
20063 * src/Makefile.am: Adjust.
20064 * m4/error.m4: New file.
20065 * m4/Makefile.am: Adjust.
20066 * configure.in (jm_PREREQ_ERROR): Call it.
20067 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
20068 Remove.
20069 (fatal, fatals): Remove. All callers use complain.c::fatal.
20070 (warn, warni, warns, warnss, warnss): Remove. All callers use
20071 complain.c::complain.
20072 (toomany): Remove, use fatal instead.
20073 * src/files.c (done): No argument, use complain_message_count.
20074 * src/main.c (main): Register `done' to `atexit'.
20075
20076 * src/getargs.c (usage): More `fputs', less `fprintf'.
20077
18539825
AD
200782000-03-28 Akim Demaille <akim@epita.fr>
20079
20080 * lib/: New directory.
20081 * Makefile.am (SUBDIRS): Adjust.
20082 * configure.in: Adjust.
20083 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
20084 useless.
20085 * src/alloca.c: Moved to lib/.
20086 * src/getopt.c: Likewise.
20087 * src/getopt1.c: Likewise.
20088 * src/getopt.h: Likewise.
20089 * src/ansi2knr.c: Likewise.
20090 * src/ansi2knr.1: Likewise.
20091 * src/Makefile.am: Adjust.
20092 * lib/Makefile.am: New file.
20093
9f306f2a
AD
200942000-03-28 Akim Demaille <akim@epita.fr>
20095
20096 * src/getargs.c (usage): Refresh the help message.
20097
0ba347b6
AD
200982000-03-17 Akim Demaille <akim@epita.fr>
20099
20100 * src/getopt1.c: Updated from textutils 2.0e
20101 * src/getopt.c: Likewise.
20102 * src/getopt.h: Likewise.
20103
dbe7f271
AD
201042000-03-17 Akim Demaille <akim@epita.fr>
20105
20106 * src/Makefile.am (bison.simple): Fix the awk program: quote only
20107 the file name, not the whole `#line LINE FILE'.
20108
75bbe78d
AD
201092000-03-17 Akim Demaille <akim@epita.fr>
20110
20111 On syntax errors, report the token on which we choked.
20112
aa5fd0ee
AD
20113 * src/bison.s1 (yyparse): In the label yyerrlab, when
20114 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 20115
7b306f52
AD
201162000-03-17 Akim Demaille <akim@epita.fr>
20117
aa5fd0ee 20118 * src/reader.c (copy_at): New function.
7b306f52
AD
20119 (copy_guard): Use it.
20120 (copy_action): Use it.
20121
e87b5700
AD
201222000-03-17 Akim Demaille <akim@epita.fr>
20123
20124 Be kind to translators, save some useless translations.
20125
aa5fd0ee 20126 * src/main.c (banner): New function.
e87b5700
AD
20127 (fatal_banner): Use it.
20128 (warn_banner): Use it.
20129
ae3c3164
AD
201302000-03-17 Akim Demaille <akim@epita.fr>
20131
aa5fd0ee
AD
20132 * src/reader.c (copy_definition): Use copy_string and
20133 copy_comment. Removed now unused `match', `ended',
20134 `cplus_comment'.
ae3c3164
AD
20135 (copy_comment, copy_string): Moved, to be visible from
20136 copy_definition.
20137
4dc58e7c
AD
201382000-03-17 Akim Demaille <akim@epita.fr>
20139
aa5fd0ee
AD
20140 * src/reader.c (copy_string): Declare `static inline'. No
20141 problems with inline, since it is checked by configure.
4dc58e7c
AD
20142 (copy_comment): Likewise.
20143
0a6384c4
AD
201442000-03-17 Akim Demaille <akim@epita.fr>
20145
aa5fd0ee 20146 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 20147
3cef001a
AD
201482000-03-17 Akim Demaille <akim@epita.fr>
20149
aa5fd0ee 20150 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
20151 (copy_action): Use it. Removed now unused `match', `ended',
20152 `cplus_comment'.
20153 (copy_guard): Likewise.
20154
ca36d2ef
AD
201552000-03-17 Akim Demaille <akim@epita.fr>
20156
aa5fd0ee 20157 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
20158 (copy_action): Use it.
20159 (copy_guard): Likewise.
20160
6666f98f
AD
201612000-03-17 Akim Demaille <akim@epita.fr>
20162
20163 Change the handling of @s so that they behave exactly like $s.
20164 There is now a pseudo variable @$ (readble and writable), location
20165 of the lhs of the rule (by default ranging from the location of
20166 the first symbol of the rhs, to the location of the last symbol,
20167 or, if the rhs is empty, YYLLOC).
20168
20169 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
20170 yyval.
20171 (yyparse): When providing a default semantic action, provide a
20172 default location action.
20173 (after the $): No longer change `*YYLSP', just stack YYLOC the
20174 same way you stack YYVAL.
20175 * src/reader.c (read_declarations): Use warns.
20176 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
20177 (copy_action, case '@'): Likewise.
20178 Use a standard error message, to save useless work from
20179 translators.
20180
41aca2e0
AD
201812000-03-17 Akim Demaille <akim@epita.fr>
20182
aa5fd0ee
AD
20183 * src/bison.s1: Formatting and cosmetics changes.
20184 * src/reader.c: Likewise.
41aca2e0
AD
20185 Update the Copyright notice.
20186
dc08c1d5
AD
201872000-03-17 Akim Demaille <akim@epita.fr>
20188
aa5fd0ee
AD
20189 * src/bison.s1 (#line): All set to `#line' only, since the
20190 Makefile now handles them.
dc08c1d5 20191
9ee3c97b
AD
201922000-03-16 Akim Demaille <akim@epita.fr>
20193
20194 * src/output.c (output_rule_data): Output the documentation of
20195 some of the tables.
20196 (Copyright notice): Update.
20197 Formatting changes.
20198
0de741ca
AD
201992000-03-16 Akim Demaille <akim@epita.fr>
20200
20201 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
20202 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
20203 One `#if YYDEBUG' remains, since it uses variables which are
20204 defined only if `YYDEBUG != 0'.
20205
bb10be54
AD
202062000-03-16 Akim Demaille <akim@epita.fr>
20207
20208 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
20209 and related variables so that the similarities are highlighted.
20210
b07b484a
AD
202112000-03-16 Akim Demaille <akim@epita.fr>
20212
20213 * src/bison.s1: Properly indent CPP directives.
20214
361f60b3
AD
202152000-03-16 Akim Demaille <akim@epita.fr>
20216
20217 * src/bison.s1: Properly indent the `alloca' CPP section.
20218
8c44d3ec
AD
202192000-03-16 Akim Demaille <akim@epita.fr>
20220
20221 Do not hard code values of directories in `configure.in'.
20222 Update the `configure' tool chain.
20223
20224 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
20225 src/makefile.am.
20226 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
20227 (AC_OUTPUT): Add m4/Makefile.
20228 Bump to bison 1.28a, 1.29 has never been released.
20229 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
20230 handled via src/Makefile.am.
20231 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
20232 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
20233 autoheader.
20234 * Makefile.am (SUBDIRS): Add m4.
20235 (ACLOCAL_AM_FLAGS): New variable.
20236 (AUTOMAKE_OPTIONS): Add check-news.
20237 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
20238 the proper line number and file name.
20239 (DEFS): Propagate the location of bison library files and of the
20240 locale files.
20241 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
20242 builddir.
20243 * acinclude.m4: Remove, replaced by the directory m4.
20244 * m4/Makefile.am (EXTRA_DIST): New variable.
20245 * m4/gettext.m4: New file, from the fileutils.
20246 * m4/lcmessage.m4: Likewise
20247 * m4/progtest.m4: Likewise.
20248 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
20249
f95997e7
AD
202502000-03-10 Akim Demaille <akim@epita.fr>
20251
20252 * src/closure.c:
20253 Formatting changes of various comments.
20254 Respect the GNU coding standards at various places.
20255 Don't use `_()' when no translation is needed.
20256
202571999-12-13 Jesse Thilo <jthilo@gnu.org>
20258
20259 * src/files.c:
20260 OS/2 honors TMPDIR environment variable.
20261
202621999-12-13 Jesse Thilo <jthilo@gnu.org>
20263
20264 * doc/bison.texinfo: Tweaked spelling and grammar.
20265 Updated ISBN.
20266 Removed reference to price of printed copy.
20267 Mention BISON_SIMPLE and BISON_HAIRY.
20268
202691999-12-13 Jesse Thilo <jthilo@gnu.org>
20270
20271 * configure.in, NEWS:
20272 Bison 1.29 released.
20273
202741999-10-27 Jesse Thilo <jthilo@gnu.org>
20275
20276 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
20277 Added reference card.
20278
202791999-07-26 Jesse Thilo <jthilo@gnu.org>
20280
20281 * po/ru.po: Added Russian translation.
20282
202831999-07-26 Jesse Thilo <jthilo@gnu.org>
20284
20285 * configure.in: Added Russian translation.
20286
202871999-07-06 Jesse Thilo <jthilo@gnu.org>
20288
20289 * configure.in, NEWS, README:
20290 Released version 1.28.
20291
202921999-06-14 Jesse Thilo <jthilo@gnu.org>
20293
20294 * src/system.h:
20295 Squashed redefinition warning on some systems.
20296
20297 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
20298 Have configure build version string instead of relying on ANSI string
20299 concatentation.
20300
203011999-06-14 Jesse Thilo <jthilo@gnu.org>
20302
20303 * po/POTFILES.in: Got rid of version.c.
20304
203051999-06-14 Jesse Thilo <jthilo@gnu.org>
20306
20307 * acconfig.h, configure.in:
20308 Have configure build version string instead of relying on ANSI string
20309 concatentation.
20310
203111999-06-08 Jesse Thilo <jthilo@gnu.org>
20312
20313 * doc/bison.1:
20314 Dropped mention of `+' for long-named options.
20315
203161999-05-30 Jesse Thilo <jthilo@gnu.org>
20317
20318 * src/files.c: Added <unistd.h> for unlink().
20319
20320 * src/Makefile.am, src/system.h:
20321 I18n fixes.
20322
203231999-05-30 Jesse Thilo <jthilo@gnu.org>
20324
20325 * README: Added a FAQ list.
20326
20327 * configure.in, acconfig.h:
20328 I18n fixes.
20329
203301999-05-30 Jesse Thilo <jthilo@gnu.org>
20331
20332 * doc/FAQ, doc/Makefile.am:
20333 Added a FAQ list.
20334
203351999-05-19 Jesse Thilo <jthilo@gnu.org>
20336
20337 * src/alloc.h, src/symtab.h, src/version.c:
20338 Protected inclusion of "config.h" with HAVE_CONFIG_H.
20339
203401999-04-18 Jesse Thilo <jthilo@gnu.org>
20341
20342 * src/.cvsignore, src/Makefile.am:
20343 Reorganized: sources in `src', documentation in `doc'.
20344
20345 * src/lex.c (literalchar):
20346 fixed the code for escaping double quotes (thanks
20347 Jonathan Czisny.)
20348
203491999-04-18 Jesse Thilo <jthilo@gnu.org>
20350
20351 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
20352 Adjusted paths to reflect directory reorganization.
20353
203541999-04-18 Jesse Thilo <jthilo@gnu.org>
20355
20356 * doc/.cvsignore, doc/Makefile.am:
20357 Reorganized: sources in `src', documentation in `doc'.
20358
203591999-04-18 Jesse Thilo <jthilo@gnu.org>
20360
20361 * configure.in:
20362 Updated AC_INIT file to reflect directory reorganization.
20363
20364 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
20365 Reorganized: sources in `src', documentation in `doc'.
20366
203671999-04-13 Jesse Thilo <jthilo@gnu.org>
20368
20369 * src/allocate.c:
20370 Don't declare calloc() and realloc() if not necessary.
20371
203721999-04-13 Jesse Thilo <jthilo@gnu.org>
20373
20374 * configure.in, acconfig.h, acinclude.m4:
20375 Don't declare calloc() and realloc() if not necessary.
20376
203771999-03-23 Jesse Thilo <jthilo@gnu.org>
20378
20379 * po/.cvsignore: Added i18n support.
20380
203811999-03-23 Jesse Thilo <jthilo@gnu.org>
20382
20383 * acconfig.h, configure.in, Makefile.am:
20384 Added i18n support.
20385
203861999-03-22 Jesse Thilo <jthilo@gnu.org>
20387
20388 * src/bison.s1: Fixed #line numbers.
20389
203901999-03-15 Jesse Thilo <jthilo@gnu.org>
20391
20392 * po/es.po, po/fr.po, po/nl.po, po/de.po:
20393 Added PO files from Translation Project.
20394
203951999-03-03 Jesse Thilo <jthilo@gnu.org>
20396
20397 * Makefile.am:
20398 Added support for non-ANSI compilers (ansi2knr).
20399
204001999-02-16 Jesse Thilo <jthilo@gnu.org>
20401
20402 * configure.in: Bumped version number to 1.27.
20403
20404 * Makefile.am:
20405 Added `bison.simple' to list of files removed by `make distclean'.
20406
204071999-02-12 Jesse Thilo <jthilo@gnu.org>
20408
20409 * src/files.c, src/files.h:
20410 Defined locations of parser files in config.h instead of Makefile.
20411
204121999-02-12 Jesse Thilo <jthilo@gnu.org>
20413
20414 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
20415 Defined locations of parser files in config.h instead of Makefile.
20416
204171999-02-09 Jesse Thilo <jthilo@gnu.org>
20418
20419 * Makefile.am:
20420 Removed inappropriate use of $< macro.
20421
204221999-02-05 Jesse Thilo <jthilo@gnu.org>
20423
20424 * po/Makefile.in.in, po/POTFILES.in:
20425 Add `po' directory skeleton.
20426
204271999-01-27 Jesse Thilo <jthilo@gnu.org>
20428
20429 * README: Document help-bison list.
20430
20431 * configure.in: Add check for mkstemp().
20432
204331999-01-20 Jesse Thilo <jthilo@gnu.org>
20434
20435 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
20436 Hush a few compiler warnings.
20437
20438 * src/files.c:
20439 Add tryclose(), which verifies that fclose was successful.
20440 Hush a couple of compiler warnings.
20441
204421999-01-20 Jesse Thilo <jthilo@gnu.org>
20443
20444 * Makefile.am, OChangeLog:
20445 ChangeLog is now automatically generated. Include the old version as
20446 OChangeLog.
20447
204481999-01-14 Jesse Thilo <jthilo@gnu.org>
20449
20450 * 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:
20451 Update FSF address.
20452
204531999-01-14 Jesse Thilo <jthilo@gnu.org>
20454
20455 * doc/bison.texinfo: Fix formatting glitch.
20456
20457 * doc/bison.texinfo: Update FSF address.
20458
204591999-01-14 Jesse Thilo <jthilo@gnu.org>
20460
20461 * acconfig.h: Update FSF address.
20462
204631999-01-08 Jesse Thilo <jthilo@gnu.org>
20464
20465 * src/system.h:
20466 Don't define PACKAGE here, since config.h defines it.
20467
204681998-12-30 Jesse Thilo <jthilo@gnu.org>
20469
20470 * src/reader.c: Update copyright date.
20471
20472 * src/main.c:
20473 Ditch sprintf to statically-sized buffers in fatal/warn functions in
20474 favor of output directly to stderr (avoids buffer overruns).
20475
20476 * src/reader.c: Some checks for premature EOF.
20477
20478 * 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:
20479 Use prototypes if the compiler understands them.
20480
20481 * src/files.c: Honor TMPDIR on Unix hosts.
20482 Use prototypes if the compiler understands them.
20483
20484 * src/reader.c:
20485 Fix a couple of buffer overrun bugs.
20486 Use prototypes if the compiler understands them.
20487
20488 * src/system.h: Include unistd.h and ctype.h.
20489 Use #ifdef instead of #if for NLS symbols.
20490
204911998-12-30 Jesse Thilo <jthilo@gnu.org>
20492
20493 * doc/bison.texinfo:
20494 Delete comment "consider using @set for edition number, etc..." since
20495 we now are doing so.
20496
204971998-12-30 Jesse Thilo <jthilo@gnu.org>
20498
20499 * configure.in:
20500 Use prototypes if the compiler understands them.
20501
20502 * NEWS: Document 1.26 highlights.
20503
20504 * Makefile.am: Require Automake 1.3 or later.
20505
20506 * acconfig.h:
20507 Use prototypes if the compiler understands them.
20508
205091998-12-29 Jesse Thilo <jthilo@gnu.org>
20510
20511 * src/version.c:
20512 Use VERSION symbol from automake for version number.
20513
205141998-12-29 Jesse Thilo <jthilo@gnu.org>
20515
20516 * acconfig.h, configure.in, version.cin:
20517 Use VERSION symbol from automake for version number.
20518
205191998-11-28 Jesse Thilo <jthilo@gnu.org>
20520
20521 * Makefile.am:
20522 Distribute original version of simple parser (bison.s1), not built
20523 version (bison.simple).
20524
205251998-11-28 Jesse Thilo <jthilo@gnu.org>
20526
20527 * doc/bison.texinfo: Add info dir entry.
20528
20529 * doc/bison.texinfo:
20530 Let automake put version number into documentation.
20531
205321998-11-26 Jesse Thilo <jthilo@gnu.org>
20533
20534 * src/bison.cld, src/build.com, src/vmshlp.mar:
20535 Add non-RCS files from /gd/gnu/bison.
20536
205371998-11-26 Jesse Thilo <jthilo@gnu.org>
20538
20539 * doc/bison.1:
20540 Document the BISON_HAIRY and BISON_SIMPLE variables.
20541
205421998-11-25 Jesse Thilo <jthilo@gnu.org>
20543
20544 * src/version.c: Build version.c automatically.
20545
20546 * src/reader.c:
20547 Fix token numbering (used to start at 258, not 257).
20548
20549 * src/system.h: Include config.h.
20550
20551 * src/getargs.c: Update bug report address.
20552
20553 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
20554 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
20555
205561998-11-25 Jesse Thilo <jthilo@gnu.org>
20557
20558 * Makefile.am:
20559 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
20560
20561 * configure.in, version.cin:
20562 Build version.c automatically.
20563
20564 * AUTHORS: Add AUTHORS file.
20565
20566 * README: Update bug report address.
20567
20568 * bison.simple:
20569 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
20570
20571 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
20572 Add automake stuff.
20573
205741998-11-25 Jesse Thilo <jthilo@gnu.org>
20575
20576 * doc/bison.texinfo: Clean up some formatting.
20577
205781998-05-05 Richard Stallman <rms@gnu.org>
20579
20580 * doc/bison.texinfo:
20581 Explain better why to make a pure parser.
20582
205831998-01-05 Richard Stallman <rms@gnu.org>
20584
20585 * src/files.c (openfiles):
20586 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
20587 find a temporary directory, if possible. Do not unlink files while
20588 they are open.
20589
205901997-08-25 Richard Stallman <rms@gnu.org>
20591
20592 * src/reader.c (stack_offset;):
20593 Change some warni to warns.
20594
20595 * src/lex.c (literalchar): Use warns, not warni.
20596
205971997-06-28 Richard Stallman <rms@gnu.org>
20598
20599 * src/bison.s1: Add a Bison version comment.
20600
20601 * src/main.c (fatal, warn, berror):
20602 Use program_name.
20603
206041997-06-28 Richard Stallman <rms@gnu.org>
20605
20606 * Makefile.in (bison_version): New variable.
20607 (dist): Use that variable.
20608 (bison.s1): Substitute the Bison version into bison.simple.
20609
20610 * bison.simple: Add a Bison version comment.
20611
206121997-06-18 Richard Stallman <rms@gnu.org>
20613
20614 * src/main.c (fatal, warn, berror):
20615 Make error messages standard.
20616 (toomany): Improve error message text.
20617
20618 * 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:
20619 new.h renamed to alloc.h.
20620
206211997-06-18 Richard Stallman <rms@gnu.org>
20622
20623 * Makefile.in: new.h renamed to alloc.h.
20624
206251997-05-24 Richard Stallman <rms@gnu.org>
20626
20627 * src/lex.c (literalchar):
20628 Fix the code for escaping \, " and '.
20629
20630 (lex): Avoid trouble when there are many chars
20631 to discard in a char literal with just several chars in it.
20632
206331997-05-17 Richard Stallman <rms@gnu.org>
20634
20635 * src/bison.s1:
20636 Use malloc, if using alloca is troublesome.
20637 (YYSTACK_USE_ALLOCA): New flag macro.
20638 Define it for some systems and compilers.
20639 (YYSTACK_ALLOC): New macro.
20640 (yyparse): Use YYSTACK_ALLOC to allocate stack.
20641 If it was malloc'd, free it.
20642
206431997-05-17 Richard Stallman <rms@gnu.org>
20644
20645 * bison.simple:
20646 Use malloc, if using alloca is troublesome.
20647 (YYSTACK_USE_ALLOCA): New flag macro.
20648 Define it for some systems and compilers.
20649 (YYSTACK_ALLOC): New macro.
20650 (yyparse): Use YYSTACK_ALLOC to allocate stack.
20651 If it was malloc'd, free it.
20652
206531997-04-23 Richard Stallman <rms@gnu.org>
20654
20655 * src/bison.s1:
20656 (alloca) [__hpux]: Always define as __builtin_alloca.
20657
206581997-04-23 Richard Stallman <rms@gnu.org>
20659
20660 * bison.simple:
20661 (alloca) [__hpux]: Always define as __builtin_alloca.
20662
206631997-04-22 Richard Stallman <rms@gnu.org>
20664
20665 * src/bison.s1:
20666 [__hpux]: Include alloca.h (right for HPUX 10)
20667 instead of declaring alloca (right for HPUX 9).
20668
20669 * src/bison.s1 (__yy_memcpy):
20670 Declare arg `count' as unsigned int.
20671 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
20672
206731997-04-22 Richard Stallman <rms@gnu.org>
20674
20675 * bison.simple:
20676 [__hpux]: Include alloca.h (right for HPUX 10)
20677 instead of declaring alloca (right for HPUX 9).
20678
20679 * bison.simple (__yy_memcpy):
20680 Declare arg `count' as unsigned int.
20681 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
20682
206831997-01-03 Richard Stallman <rms@gnu.org>
20684
20685 * src/allocate.c: [__STDC__ or _MSC_VER]:
20686 Declare calloc and realloc to return void *.
20687
206881997-01-02 Richard Stallman <rms@gnu.org>
20689
20690 * src/system.h:
20691 [_MSC_VER]: Include stdlib.h and process.h.
20692 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
20693
20694 * src/main.c (main): Return FAILURE as a value.
20695 (printable_version): Declare arg as int, not char.
20696
206971997-01-02 Richard Stallman <rms@gnu.org>
20698
20699 * Makefile.in (dist):
20700 Explicitly check for symlinks, and copy them.
20701
207021996-12-19 Richard Stallman <rms@gnu.org>
20703
20704 * src/files.c:
20705 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
20706
207071996-12-18 Paul Eggert <eggert@gnu.org>
20708
20709 * src/bison.s1 (yyparse):
20710 If __GNUC__ and YYPARSE_PARAM are both defined,
20711 declare yyparse to have a void * argument.
20712
207131996-12-18 Paul Eggert <eggert@gnu.org>
20714
20715 * bison.simple (yyparse):
20716 If __GNUC__ and YYPARSE_PARAM are both defined,
20717 declare yyparse to have a void * argument.
20718
207191996-12-17 Richard Stallman <rms@gnu.org>
20720
20721 * src/reduce.c (nbits): Add some casts.
20722
207231996-08-12 Richard Stallman <rms@gnu.org>
20724
20725 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
20726
207271996-08-12 Richard Stallman <rms@gnu.org>
20728
20729 * bison.simple: Test _MSDOS as well as _MSDOS_.
20730
207311996-07-31 Richard Stallman <rms@gnu.org>
20732
20733 * src/bison.s1:
20734 [__sun && __i386]: Include alloca.h.
20735
207361996-07-31 Richard Stallman <rms@gnu.org>
20737
20738 * bison.simple:
20739 [__sun && __i386]: Include alloca.h.
20740
207411996-07-30 Richard Stallman <rms@gnu.org>
20742
20743 * src/bison.s1: Comment change.
20744
20745 * src/bison.s1: Test _MSDOS_, not MSDOS.
20746
207471996-07-30 Richard Stallman <rms@gnu.org>
20748
20749 * bison.simple: Comment change.
20750
20751 * bison.simple: Test _MSDOS_, not MSDOS.
20752
207531996-06-01 Richard Stallman <rms@gnu.org>
20754
20755 * 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:
20756 Insert `_' macro around many string constants.
20757
20758 * src/main.c:
20759 Insert `_' macro around many string constants.
20760
20761 (main): Call setlocale, bindtextdomain and textdomain.
20762
20763 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
20764 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
20765 [ENABLE_NLS]: Include libintl.h.
20766 [ENABLE_NLS] (gettext): Define.
20767 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
20768 (N_, PACKAGE, LOCALEDIR): New macros.
20769
207701996-06-01 Richard Stallman <rms@gnu.org>
20771
20772 * POTFILES.in: New file.
20773
20774 * Makefile.in (allocate.o):
20775 Define target explicitly.
20776
20777 * Makefile.in (CFLAGS): Set to @CFLAGS@.
20778 (LDFLAGS): Set to @LDFLAGS@.
20779 (configure): Run autoconf only if preceding `cd' succeeds.
20780 (bison.s1): Redirect output to temporary file then move the
20781 temporary to the target, rather than redirecting directly to bison.s1.
20782 (clean): Remove config.status and config.log.
20783 (distclean): Don't remove config.status here.
20784
207851996-05-12 Richard Stallman <rms@gnu.org>
20786
20787 * src/bison.s1:
20788 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20789
207901996-05-12 Richard Stallman <rms@gnu.org>
20791
20792 * bison.simple:
20793 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20794
207951996-05-11 Richard Stallman <rms@gnu.org>
20796
20797 * src/bison.s1 (__yy_memcpy):
20798 Really reorder the args, as was supposedly done on Feb 14 1995.
20799 (yyparse): Calls changed accordingly.
20800
208011996-05-11 Richard Stallman <rms@gnu.org>
20802
20803 * Makefile.in (dist): Don't use $(srcdir).
20804
20805 * bison.simple (__yy_memcpy):
20806 Really reorder the args, as was supposedly done on Feb 14 1995.
20807 (yyparse): Calls changed accordingly.
20808
208091996-01-27 Richard Stallman <rms@gnu.org>
20810
20811 * src/output.c (output_rule_data):
20812 Test YYERROR_VERBOSE in the conditional
20813 around the definition of ttyname.
20814
208151995-12-29 Richard Stallman <rms@gnu.org>
20816
20817 * src/bison.s1:
20818 Fix line numbers in #line commands.
20819
208201995-12-29 Richard Stallman <rms@gnu.org>
20821
20822 * bison.simple:
20823 Fix line numbers in #line commands.
20824
208251995-12-27 Richard Stallman <rms@gnu.org>
20826
20827 * src/bison.s1 (YYPARSE_PARAM_DECL):
20828 In C++, make it always null.
20829 (YYPARSE_PARAM_ARG): New macro.
20830 (yyparse): Use YYPARSE_PARAM_ARG.
20831
208321995-12-27 Richard Stallman <rms@gnu.org>
20833
20834 * bison.simple (YYPARSE_PARAM_DECL):
20835 In C++, make it always null.
20836 (YYPARSE_PARAM_ARG): New macro.
20837 (yyparse): Use YYPARSE_PARAM_ARG.
20838
208391995-11-29 Richard Stallman <rms@gnu.org>
20840
20841 * doc/bison.texinfo:
20842 Describe literal string tokens, %raw, %no_lines, %token_table.
20843
208441995-11-29 Daniel Hagerty <hag@gnu.org>
20845
20846 * doc/bison.texinfo: Fixed update date
20847
208481995-10-16 Richard Stallman <rms@gnu.org>
20849
20850 * src/version.c: Version 1.25.
20851
208521995-10-16 Richard Stallman <rms@gnu.org>
20853
20854 * NEWS: *** empty log message ***
20855
208561995-10-16 Richard Stallman <rms@gnu.org>
20857
20858 * doc/bison.1, doc/bison.rnh:
20859 Add new options.
20860
208611995-10-15 Richard Stallman <rms@gnu.org>
20862
20863 * src/vmsgetargs.c, src/getargs.c:
20864 Added -n, -k, and -raw switches.
20865 (noparserflag, toknumflag, rawtoknumflag): New variables.
20866
20867 * src/symtab.h (SALIAS):
20868 New #define for adding aliases to %token.
20869 (struct bucket): Added `alias' field.
20870
20871 * src/reduce.c (reduce_grammar):
20872 Revise error message.
20873 (print_notices): Remove final `.' from error message.
20874
20875 * src/reader.c (reader_output_yylsp):
20876 New function.
20877 (readgram): Use `#if 0' around code that accepted %command
20878 inside grammar rules: The documentation doesn't allow it,
20879 and it will fail since the %command processors scan for the next %.
20880 (parse_token_decl): Extended the %token
20881 declaration to allow a multi-character symbol as an alias.
20882 (parse_thong_decl): New function.
20883 (read_declarations): Added %thong declarations.
20884 (read_declarations): Handle NOOP to deal with allowing
20885 % declarations as another means to specify the flags.
20886 (readgram): Allow %prec prior to semantics embedded in a rule.
20887 (skip_to_char, read_declarations, copy_definition)
20888 (parse_token_decl, parse_start_decl, parse_type_decl)
20889 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
20890 (get_type_name, copy_guard, copy_action, readgram)
20891 (get_type, packsymbols): Revised most error messages.
20892 Changed `fatal' to `warnxxx' to avoid aborting for error.
20893 Revised and use multiple warnxxx functions to avoid using VARARGS1.
20894 (read_declarations): Improve the error message for
20895 an invalid character. Do not abort.
20896 (read_declarations, copy_guard, copy_action): Use
20897 printable_version to avoid unprintable characters in printed output.
20898 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
20899 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
20900 Allow the type of a non-terminal can be given
20901 more than once, as long as all specifications give the same type.
20902
20903 * src/output.c:
20904 (output_headers, output_trailers, output, output_gram)
20905 (output_rule_data): Implement noparserflag variable.
20906 Implement toknumflag variable.
20907 (output): Call reader_output_yylsp to output LTYPESTR.
20908
20909 * src/main.c (main):
20910 If reader sees an error, don't process the grammar.
20911 (fatals): Updated to not use VARARGS1.
20912 (printable_version, int_to_string, warn, warni, warns, warnss)
20913 (warnsss): New error reporting functions. Avoid abort for error.
20914
20915 * src/lex.h:
20916 Added THONG and NOOP for alias processing.
20917 Added SETOPT for the new code that allows setting options with %flags.
20918
20919 * src/lex.c:
20920 Include getopt.h. Add some extern decls.
20921 (safegetc): New function to deal with EOF gracefully.
20922 (literalchar); new function to deal with reading \ escapes.
20923 (lex): Use literalchar.
20924 (lex): Implemented "..." tokens.
20925 (literalchar, lex, parse_percent_token): Made tokenbuffer
20926 always contain the token. This includes growing the token
20927 buffer while reading an integer.
20928 (parse_percent_token): Replaced if-else statement with percent_table.
20929 (parse_percent_token): Added % declarations as another
20930 way to specify the flags -n, -l, and -r. Also added hooks for
20931 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
20932 major changes to files.c.
20933 (lex) Retain in the incoming stream a character following
20934 an incorrect '/'.
20935 (skip_white_space, lex): Revised most error messages
20936 and changed fatal to warn to avoid aborting.
20937 (percent_table): Added %thong declarations.
20938
20939 * src/gram.h: Comment changes.
20940
20941 * src/files.c (openfiles, open_extra_files, done):
20942 Add faction flag
20943 and actfile file. Handle noparserflag. Both for -n switch.
20944
20945 * src/conflicts.c (resolve_sr_conflict):
20946 Remove use of alloca.
20947
209481995-06-01 Jim Meyering <meyering@gnu.org>
20949
20950 * doc/bison.texinfo: *** empty log message ***
20951
209521995-05-06 Richard Stallman <rms@gnu.org>
20953
20954 * src/bison.s1: Comment change.
20955
209561995-05-06 Richard Stallman <rms@gnu.org>
20957
20958 * bison.simple: Comment change.
20959
209601995-05-03 Richard Stallman <rms@gnu.org>
20961
20962 * src/version.c: Version now 1.24.
20963
20964 * src/bison.s1: Change distribution terms.
20965
20966 * src/version.c: Version now 1.23.
20967
209681995-05-03 Richard Stallman <rms@gnu.org>
20969
20970 * doc/bison.texinfo:
20971 Rewrite "Conditions for Using Bison".
20972 Update version to 1.24.
20973
209741995-05-03 Richard Stallman <rms@gnu.org>
20975
20976 * bison.simple: Change distribution terms.
20977
209781995-02-23 Richard Stallman <rms@gnu.org>
20979
20980 * src/files.c: Test __VMS_POSIX as well as VMS.
20981
209821995-02-14 Jim Meyering <meyering@gnu.org>
20983
20984 * src/bison.s1 (__yy_memcpy):
20985 Renamed from __yy_bcopy to avoid
20986 confusion. Reverse FROM and TO arguments to be consistent with
20987 those of memcpy.
20988
209891995-02-14 Jim Meyering <meyering@gnu.org>
20990
20991 * bison.simple (__yy_memcpy):
20992 Renamed from __yy_bcopy to avoid
20993 confusion. Reverse FROM and TO arguments to be consistent with
20994 those of memcpy.
20995
209961994-11-10 David J. MacKenzie <djm@gnu.org>
20997
20998 * NEWS: reformat
20999
21000 * NEWS: New file.
21001
21002 * Makefile.in (DISTFILES): Include NEWS.
21003
21004 * Makefile.in (DISTFILES):
21005 Include install-sh, not install.sh.
21006
21007 * configure.in: Update to Autoconf v2 macro names.
21008
210091994-10-05 David J. MacKenzie <djm@gnu.org>
21010
21011 * Makefile.in: fix typo
21012
21013 * Makefile.in (prefix, exec_prefix):
21014 Let configure set them.
21015
210161994-09-28 David J. MacKenzie <djm@gnu.org>
21017
21018 * Makefile.in: Set datadir to $(prefix)/share.
21019
210201994-09-15 Richard Stallman <rms@gnu.org>
21021
21022 * src/bison.s1:
21023 Update copyright notice and GPL version.
21024
210251994-09-15 Richard Stallman <rms@gnu.org>
21026
21027 * bison.simple:
21028 Update copyright notice and GPL version.
21029
210301994-07-12 Richard Stallman <rms@gnu.org>
21031
21032 * src/reduce.c, src/reader.c:
21033 entered into RCS
21034
210351994-05-05 David J. MacKenzie <djm@gnu.org>
21036
21037 * Makefile.in: entered into RCS
21038
210391994-03-26 Richard Stallman <rms@gnu.org>
21040
21041 * src/bison.s1: entered into RCS
21042
210431994-03-26 Richard Stallman <rms@gnu.org>
21044
21045 * bison.simple: entered into RCS
21046
210471994-03-25 Richard Stallman <rms@gnu.org>
21048
21049 * src/main.c: entered into RCS
21050
210511994-03-24 Richard Stallman <rms@gnu.org>
21052
21053 * src/conflicts.c: entered into RCS
21054
210551994-01-02 Richard Stallman <rms@gnu.org>
21056
21057 * Makefile.in: *** empty log message ***
21058
210591993-11-21 Richard Stallman <rms@gnu.org>
21060
21061 * src/bison.s1: *** empty log message ***
21062
210631993-11-21 Richard Stallman <rms@gnu.org>
21064
21065 * doc/bison.texinfo: entered into RCS
21066
21067 * doc/bison.texinfo: *** empty log message ***
21068
210691993-11-21 Richard Stallman <rms@gnu.org>
21070
21071 * bison.simple: *** empty log message ***
21072
210731993-10-25 David J. MacKenzie <djm@gnu.org>
21074
21075 * doc/bison.texinfo: *** empty log message ***
21076
210771993-10-19 Richard Stallman <rms@gnu.org>
21078
21079 * src/bison.s1: *** empty log message ***
21080
210811993-10-19 Richard Stallman <rms@gnu.org>
21082
21083 * bison.simple: *** empty log message ***
21084
210851993-10-14 Richard Stallman <rms@gnu.org>
21086
21087 * src/bison.s1: *** empty log message ***
21088
210891993-10-14 Richard Stallman <rms@gnu.org>
21090
21091 * bison.simple: *** empty log message ***
21092
210931993-09-14 David J. MacKenzie <djm@gnu.org>
21094
21095 * doc/bison.texinfo: *** empty log message ***
21096
210971993-09-13 Noah Friedman <friedman@gnu.org>
21098
21099 * Makefile.in: *** empty log message ***
21100
211011993-09-10 Richard Stallman <rms@gnu.org>
21102
21103 * src/conflicts.c: *** empty log message ***
21104
21105 * src/system.h: entered into RCS
21106
211071993-09-10 Richard Stallman <rms@gnu.org>
21108
21109 * doc/bison.1: entered into RCS
21110
211111993-09-06 Noah Friedman <friedman@gnu.org>
21112
21113 * src/version.c: entered into RCS
21114
211151993-09-06 Noah Friedman <friedman@gnu.org>
21116
21117 * Makefile.in: *** empty log message ***
21118
211191993-07-30 David J. MacKenzie <djm@gnu.org>
21120
21121 * Makefile.in: *** empty log message ***
21122
211231993-07-24 Richard Stallman <rms@gnu.org>
21124
21125 * src/bison.s1: *** empty log message ***
21126
211271993-07-24 Richard Stallman <rms@gnu.org>
21128
21129 * bison.simple: *** empty log message ***
21130
211311993-07-08 David J. MacKenzie <djm@gnu.org>
21132
21133 * Makefile.in: *** empty log message ***
21134
211351993-07-04 Richard Stallman <rms@gnu.org>
21136
21137 * src/bison.s1: *** empty log message ***
21138
211391993-07-04 Richard Stallman <rms@gnu.org>
21140
21141 * bison.simple: *** empty log message ***
21142
211431993-06-26 David J. MacKenzie <djm@gnu.org>
21144
21145 * src/getargs.c: entered into RCS
21146
211471993-06-26 David J. MacKenzie <djm@gnu.org>
21148
21149 * doc/bison.texinfo: *** empty log message ***
21150
21151 * doc/bison.1: New file.
21152
211531993-06-25 Richard Stallman <rms@gnu.org>
21154
21155 * src/getargs.c: New file.
21156
211571993-06-16 Richard Stallman <rms@gnu.org>
21158
21159 * src/bison.s1: *** empty log message ***
21160
211611993-06-16 Richard Stallman <rms@gnu.org>
21162
21163 * bison.simple: *** empty log message ***
21164
211651993-06-03 Richard Stallman <rms@gnu.org>
21166
21167 * src/bison.s1: New file.
21168
211691993-06-03 Richard Stallman <rms@gnu.org>
21170
21171 * doc/bison.texinfo: *** empty log message ***
21172
211731993-06-03 Richard Stallman <rms@gnu.org>
21174
21175 * bison.simple: New file.
21176
211771993-05-19 Richard Stallman <rms@gnu.org>
21178
21179 * doc/bison.texinfo: New file.
21180
211811993-05-07 Noah Friedman <friedman@gnu.org>
21182
21183 * Makefile.in: *** empty log message ***
21184
211851993-04-28 Noah Friedman <friedman@gnu.org>
21186
21187 * src/reader.c: *** empty log message ***
21188
211891993-04-23 Noah Friedman <friedman@gnu.org>
21190
21191 * src/alloc.h: entered into RCS
21192
211931993-04-20 David J. MacKenzie <djm@gnu.org>
21194
21195 * src/version.c: *** empty log message ***
21196
21197 * src/files.c, src/allocate.c:
21198 entered into RCS
21199
21200 * src/reader.c: *** empty log message ***
21201
21202 * src/lex.c: entered into RCS
21203
21204 * src/conflicts.c: New file.
21205
21206 * src/symtab.c: entered into RCS
21207
21208 * src/alloc.h: New file.
21209
21210 * src/LR0.c: entered into RCS
21211
212121993-04-18 Noah Friedman <friedman@gnu.org>
21213
21214 * src/reader.c: New file.
21215
21216 * src/version.c: *** empty log message ***
21217
212181993-04-18 Noah Friedman <friedman@gnu.org>
21219
21220 * Makefile.in: *** empty log message ***
21221
212221993-04-17 Noah Friedman <friedman@gnu.org>
21223
21224 * Makefile.in: *** empty log message ***
21225
212261993-04-15 Richard Stallman <rms@gnu.org>
21227
21228 * src/main.c, src/files.c:
21229 New file.
21230
212311993-04-15 Noah Friedman <friedman@gnu.org>
21232
21233 * configure.in: entered into RCS
21234
21235 * configure.in: *** empty log message ***
21236
21237 * configure.in: New file.
21238
212391993-04-14 Richard Stallman <rms@gnu.org>
21240
21241 * Makefile.in: New file.
21242
212431993-04-13 Richard Stallman <rms@gnu.org>
21244
21245 * src/version.c: New file.
21246
212471993-03-25 Richard Stallman <rms@gnu.org>
21248
21249 * src/output.c: entered into RCS
21250
212511992-09-25 Richard Stallman <rms@gnu.org>
21252
21253 * configure.bat: entered into RCS
21254
212551992-06-22 Richard Stallman <rms@gnu.org>
21256
21257 * src/vmsgetargs.c: entered into RCS
21258
212591992-06-22 Richard Stallman <rms@gnu.org>
21260
21261 * doc/bison.rnh: entered into RCS
21262
212631992-04-20 David J. MacKenzie <djm@gnu.org>
21264
21265 * README: entered into RCS
21266
212671992-01-22 Richard Stallman <rms@gnu.org>
21268
21269 * src/machine.h: entered into RCS
21270
212711991-12-21 Richard Stallman <rms@gnu.org>
21272
21273 * src/lalr.c, src/closure.c:
21274 entered into RCS
21275
212761991-12-20 Richard Stallman <rms@gnu.org>
21277
21278 * src/state.h: entered into RCS
21279
212801991-12-18 Richard Stallman <rms@gnu.org>
21281
21282 * src/print.c, src/nullable.c, src/derives.c:
21283 entered into RCS
21284
212851991-11-03 David J. MacKenzie <djm@gnu.org>
21286
21287 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
21288 entered into RCS
21289
212901988-09-09 Richard Stallman <rms@gnu.org>
21291
21292 * src/bison.hairy: entered into RCS
21293
212941987-12-16 Richard Stallman <rms@gnu.org>
21295
21296 * REFERENCES: entered into RCS
dc546b0f 21297
f294a2c2 21298
04098407 21299 -----
f294a2c2 21300
04098407 21301 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
f490771b
JD
21302 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
21303 2007, 2008, 2009 Free Software Foundation, Inc.
f294a2c2 21304
04098407
PE
21305 Copying and distribution of this file, with or without
21306 modification, are permitted provided the copyright notice and this
21307 notice are preserved.